efficient-storefront-blocks 0.125.3 → 0.125.5
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 +41 -0
- package/dist/chunks/{CustomHtmlCodeWindow-VRZ524JP.js → CustomHtmlCodeWindow-HSZVKXL4.js} +1 -1
- package/dist/chunks/{EditorPreviewCheckout-OMVFLWD5.js → EditorPreviewCheckout-3ZX2DIIL.js} +1 -1
- package/dist/chunks/SiteEditorProvider-6X2YHTVA.js +1 -0
- package/dist/chunks/{chunk-PULBLZRR.js → chunk-4WRJWM6K.js} +1 -1
- package/dist/chunks/{chunk-TXL5UDD5.js → chunk-5SWY36EZ.js} +1 -1
- package/dist/chunks/{chunk-FNCEZSDY.js → chunk-ACYEMD5J.js} +1 -1
- package/dist/chunks/chunk-B3U6XXDZ.js +337 -0
- package/dist/chunks/chunk-GATK7RJE.js +7 -0
- package/dist/chunks/chunk-HKL2EKLO.js +96 -0
- package/dist/chunks/{chunk-TVMCJUOE.js → chunk-RGLTNGJH.js} +1 -1
- package/dist/chunks/{fitment-data-C2NHZBPR.js → fitment-data-CFDAFXJB.js} +1 -1
- package/dist/chunks/{section-css-style-BECHWIDU.js → section-css-style-TKWJ7WU2.js} +1 -1
- package/dist/editor/lib/document/blocks/commerce/AccountBlock/fields.js +1 -1
- package/dist/editor/lib/document/blocks/commerce/CartBlock/fields.js +1 -1
- package/dist/editor/lib/document/blocks/commerce/CountrySwitchBlock/fields.js +1 -1
- package/dist/editor/lib/document/blocks/commerce/SearchBlock/fields.js +1 -1
- package/dist/editor/lib/document/blocks/commerce/ThemeSwitchBlock/fields.js +1 -1
- package/dist/editor/lib/document/blocks/service/ContactRouting/fields.js +1 -1
- package/dist/editor/lib/document/blocks/service/Form/fields.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/index.js +67 -30
- package/dist/render/built-with.json +1 -1
- package/dist/render/components/AppointmentBooking.js +1 -1
- package/dist/render/components/CollectionCard.js +1 -1
- package/dist/render/components/Collections.js +1 -1
- package/dist/render/components/ContactRouting.d.ts +3 -1
- package/dist/render/components/ContactRouting.js +1 -1
- package/dist/render/components/Events.js +1 -1
- package/dist/render/components/FitmentTable.js +1 -1
- package/dist/render/components/FooterMenu.js +1 -1
- package/dist/render/components/FooterSection.js +1 -1
- package/dist/render/components/FormBlock.d.ts +9 -2
- package/dist/render/components/FormBlock.js +1 -1
- package/dist/render/components/GalleryGrid.js +3 -3
- package/dist/render/components/GalleryItem.js +1 -1
- package/dist/render/components/GalleryShowcase.js +1 -1
- package/dist/render/components/HeaderToolBlocks.d.ts +11 -5
- package/dist/render/components/HeaderToolBlocks.js +1 -1
- package/dist/render/components/HeaderTools.d.ts +1 -0
- package/dist/render/components/HeaderTools.js +1 -1
- package/dist/render/components/PhoneMenuAccount.d.ts +6 -0
- package/dist/render/components/PhoneMenuAccount.js +1 -0
- package/dist/render/components/PhoneSheet.js +1 -1
- package/dist/render/components/ProductGridSection.js +1 -1
- package/dist/render/components/ProductHeroPanel.js +1 -1
- package/dist/render/components/ReviewForm.js +1 -1
- package/dist/render/components/SectionBand.js +1 -1
- package/dist/render/components/SectionGroupBody.js +1 -1
- package/dist/render/components/SectionNotice.js +1 -1
- package/dist/render/components/ThanksCard.d.ts +9 -0
- package/dist/render/components/ThanksCard.js +1 -0
- package/dist/render/components/pdp-dynamic/DynamicGalleryGrid.js +1 -1
- package/dist/render/lib/content/thanks-slot.d.ts +12 -0
- package/dist/render/lib/content/thanks-slot.js +1 -0
- package/dist/render/lib/document/blocks/commerce/AccountBlock/render.js +1 -1
- package/dist/render/lib/document/blocks/commerce/CartBlock/render.js +1 -1
- package/dist/render/lib/document/blocks/commerce/CountrySwitchBlock/render.js +1 -1
- package/dist/render/lib/document/blocks/commerce/SearchBlock/render.js +1 -1
- package/dist/render/lib/document/blocks/commerce/ThemeSwitchBlock/render.js +1 -1
- package/dist/render/lib/document/blocks/service/ContactRouting/meta.d.ts +4 -0
- package/dist/render/lib/document/blocks/service/ContactRouting/meta.js +1 -1
- package/dist/render/lib/document/blocks/service/ContactRouting/render.js +1 -1
- package/dist/render/lib/document/blocks/service/Form/meta.d.ts +6 -0
- package/dist/render/lib/document/blocks/service/Form/meta.js +1 -1
- package/dist/render/lib/document/blocks/service/Form/render.js +1 -1
- package/dist/render/lib/document/card-templates.js +1 -1
- package/dist/routine-index.json +1 -1
- package/dist/value-index.json +1 -1
- package/dist/words.d.ts +2 -0
- package/dist/words.js +2 -2
- package/package.json +2 -2
- package/dist/chunks/SiteEditorProvider-OBXLJM7I.js +0 -1
- package/dist/chunks/chunk-4KN3VTQU.js +0 -7
- package/dist/chunks/chunk-6ABZ7XWF.js +0 -96
- package/dist/chunks/chunk-J6SPMJBT.js +0 -337
- /package/dist/chunks/{chunk-7UJXVH57.js → chunk-3DCSW3PN.js} +0 -0
- /package/dist/chunks/{chunk-EZ5QLDA5.js → chunk-5NGS7VFJ.js} +0 -0
- /package/dist/chunks/{chunk-FNCEZSDY.js.LEGAL.txt → chunk-ACYEMD5J.js.LEGAL.txt} +0 -0
- /package/dist/chunks/{chunk-UV27QVUD.js → chunk-AEBQM5LZ.js} +0 -0
- /package/dist/chunks/{chunk-J6SPMJBT.js.LEGAL.txt → chunk-B3U6XXDZ.js.LEGAL.txt} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,jsxs as i}from"react/jsx-runtime";import{BookingFormProvider as
|
|
1
|
+
"use client";import{jsx as e,jsxs as i}from"react/jsx-runtime";import{BookingFormProvider as A,useBookingForm as C}from"./booking/BookingFormState.js";import{useBookingPreview as _}from"efficient-web-builder/render/lib/document/booking-preview";import{say as o}from"efficient-web-builder/format/lib/editor-words";import{BookingChoose as D,BookingConfirmed as I,BookingDetails as L,BookingHead as P}from"./booking/BookingRegions.js";import{HideTaker as u}from"efficient-web-builder/render/components/ViewHideRoot";import j from"./SectionBand.js";import{siteSideRoom as z}from"efficient-web-builder/format/lib/content/page-width";import{useSideSpaceOnce as F}from"efficient-web-builder/render/components/SideSpaceOnce";function T(t={}){const n=_();return e(A,{editing:t.editing,previewConfirmation:!!t.nodeId&&n===t.nodeId,children:e($,{...t})})}const x="mx-auto max-w-[var(--sf-site-width,1600px)] px-[min(24px,var(--sf-site-gutter,40px))] py-16 view-wide:px-[var(--sf-site-gutter,40px)] view-wide:py-[88px]",c="grid gap-8 min-[960px]:grid-cols-[minmax(0,1fr)_minmax(360px,0.8fr)] min-[960px]:gap-12";function $({eyebrow:t,heading:n,intro:v,buttonLabel:b,successMessage:S,boxes:r,inBoxes:h=!1,omitHead:l=!1,nodeId:k="AppointmentBooking",serviceTemplate:B,timeTemplate:N}){const a=F()?`${x} ${z("box").onceFrame}`:x,{fieldPrefix:E,editing:w,services:d,currency:M,serviceId:R,setServiceId:O,requiresPayment:q,date:G,earliestDate:H,setDate:J,setDateTouched:K,availability:Q,loadingSlots:U,noSlotsMessage:V,selectedStart:W,setSelectedStart:X,customerTimezone:Y,name:Z,setName:ee,email:te,setEmail:ie,phone:oe,setPhone:ne,notes:re,setNotes:ae,confirmation:p,submitting:se,error:me,canSubmit:ce,handleSubmit:f,sample:y}=C(),s=y?e("p",{className:"mb-6 font-mono text-[12px] uppercase tracking-[0.2em] text-fg-dim",role:"status",children:o("Example form — add an active service in {place}.",{place:o("Storefront → Booking Services")})}):null,m=d===void 0?e("p",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-fg-dim",children:"Loading appointments…"}):d?.length===0?e("p",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-fg-dim",role:"status",children:w?o("Add an active service in {place}.",{place:o("Storefront → Booking Services")}):"Appointments are not available right now."}):null;if(h&&r&&!l)return e(u,{as:"section",className:"relative z-[2] border-t border-line bg-surface",children:i("div",{className:a,children:[s,p?e(r,{className:`${c} items-start`}):i("form",{onSubmit:f,children:[e(r,{className:`${c} items-start`}),m]})]})});const g=p?e(I,{successMessage:S}):m||i("form",{onSubmit:f,className:c,children:[e(D,{owner:{id:k,type:"AppointmentBooking",serviceTemplate:B,timeTemplate:N}}),e(L,{buttonLabel:b})]});return l?i(j,{className:"relative z-[2] border-t border-line bg-surface",column:a,children:[s,g]}):e(u,{as:"section",className:"relative z-[2] border-t border-line bg-surface",children:i("div",{className:a,children:[s,e(P,{eyebrow:t,heading:n,intro:v}),g]})})}export{$ as AppointmentBookingBody,T as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,jsxs as m}from"react/jsx-runtime";import{createContext as
|
|
1
|
+
"use client";import{jsx as e,jsxs as m}from"react/jsx-runtime";import{createContext as T,useContext as v}from"react";import b from"next/link";import L from"efficient-web-builder/render/components/Placeholder";import{COLLECTION_HOVER_ZOOM_CLASS as k,COLLECTION_WASH_CLASS as I}from"../lib/content/collection-card-look.js";import{SIZE_STEP_OF_ROLE as $}from"efficient-web-builder/format/lib/fonts";import{COLLECTION_CARD_REGIONS as R,COLLECTION_CARD_TEXT_SIZE as i}from"efficient-web-builder/format/lib/sections/collection-card-text-regions";import{TEXT_REGION_ATTR as A,regionStyle as D,textRegionPartKey as H}from"efficient-web-builder/format/lib/sections/text-regions";import{renderGold as d,renderHeadline as P,splitParagraphs as j}from"efficient-web-builder/render/components/goldPhrases";import{absolutizeApiUrl as z}from"efficient-web-builder/render/lib/media";import{useTakeViewHide as G,withViewHide as w}from"efficient-web-builder/render/components/ViewHideRoot";import{CardTemplateRows as U}from"efficient-web-builder/render/components/CardRowContext";import{BOX_HOLDS_NO_GUTTER_CLASS as V,SIDE_ONCE_HOLDS_CLASS as X}from"efficient-web-builder/format/lib/content/page-width";import{useSideSpaceOnce as Z}from"efficient-web-builder/render/components/SideSpaceOnce";function B(n){return z(n)??void 0}const F=T({}),le=3;function K({tag:n,name:t,desc:l,href:p,imageSrc:f,imageLabel:_,price:x}){const h=Z(),{showPrice:O,cardStyle:C,partStyles:y,editing:N,ownerId:S,Template:g}=v(F),E=C==="bordered"?" border border-line":C==="shadow"?" shadow-[0_8px_30px_rgba(0,0,0,0.12)]":"",u=B(f),r=G();if(g){const o={key:typeof t=="string"&&t?t:f??"card",name:typeof t=="string"?t:"",desc:l??"",image:u??"",tag:n??"",href:p||"#"};return r.scope(e("div",{className:w(`block w-full min-w-0 ${V}${h?` ${X}`:""}`,r.className),...r.attrs,children:e(U,{ownerId:S??"Collections",ownerType:"Collections",Template:g,rows:[o],fallback:null,children:c=>c})}))}const a=o=>N?{[A]:o}:{},s=o=>D(y?.[H(o)]?.role,R[o],$);return r.scope(m(b,{href:p||"#",className:w(`sf-card group relative block w-full min-w-0 overflow-hidden bg-surface-2${E}`,r.className),...r.attrs,children:[e("div",{className:`relative z-0 aspect-[4/5] transition-transform duration-700 [transition-timing-function:cubic-bezier(.2,.6,.2,1)] ${k}`,children:e(L,{label:_||"collection.jpg",src:u})}),e("div",{className:`pointer-events-none absolute inset-0 z-[1] ${I} max-view-wide:hidden`,style:{transition:"none"}}),m("div",{className:"absolute inset-x-8 bottom-8 z-[2] flex flex-col gap-3 text-overlay-fg max-view-wide:relative max-view-wide:inset-auto max-view-wide:p-6 max-view-wide:gap-3 max-view-wide:text-fg",children:[n&&e("span",{...a("tag"),style:s("tag"),className:`font-mono ${i.tag} uppercase tracking-[0.25em] opacity-70`,children:d(n)}),t&&e("h3",{...a("name"),style:s("name"),className:`font-heading2 ${i.name} font-medium leading-none tracking-[-0.03em] ${i.namePhone}`,children:typeof t=="string"?P(t,!1):t}),l&&j(l).map((o,c)=>e("p",{...a("body"),style:s("body"),className:`max-w-[420px] ${i.body} leading-[1.5] opacity-80`,children:d(o)},c)),O&&x&&e("span",{...a("price"),style:s("price"),className:`font-mono ${i.price} tracking-[0.05em] text-accent`,children:d(x)}),m("span",{...a("link"),style:s("link"),className:`mt-2 inline-flex items-center gap-3 font-mono ${i.link} uppercase tracking-[0.2em]`,children:["Explore",e("span",{className:"transition-transform group-hover:translate-x-[3px]","aria-hidden":!0,children:"→"})]})]})]}))}export{le as COLLECTION_CARD_SEED_COUNT,F as CollectionCardStyleContext,K as default,B as resolveCategoryImage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{Fragment as u,jsx as e,jsxs as
|
|
1
|
+
"use client";import{Fragment as u,jsx as e,jsxs as t}from"react/jsx-runtime";import{useScopeClass as N}from"../lib/use-scope-class.js";import T from"efficient-web-builder/render/components/SectionHeader";import{SectionTextParts as w}from"efficient-web-builder/render/lib/document/editing-bridges";import{CollectionCardStyleContext as $}from"./CollectionCard.js";import{fillRowCss as S}from"../lib/sections/fill-row.js";import{renderHeadline as A}from"efficient-web-builder/render/components/goldPhrases";import{CONTENT_CAP_GUTTER as c}from"../lib/sections/content-cap-gutter.js";import{FRAME_ROOM_DESKTOP_BOTTOM as F,FRAME_ROOM_DESKTOP_Y as P,FRAME_ROOM_NO_TOP as v,FRAME_ROOM_NO_TOP_PHONE as y,FRAME_ROOM_PHONE_BOTTOM as H,FRAME_ROOM_PHONE_Y as j}from"../lib/sections/band-padding.js";import{withSideOnce as B}from"efficient-web-builder/format/lib/content/page-width";import{useSideSpaceOnce as I}from"efficient-web-builder/render/components/SideSpaceOnce";function b({editing:s,nodeId:r,children:i}){return!s||!r?e(u,{children:i}):e(w,{nodeId:r,sectionType:"Collections",children:i})}const L=`${c} ${P} max-view-wide:px-[min(20px,var(--sf-site-gutter,40px))] ${j}`,k=`${c} ${v} ${F} max-view-wide:px-[min(20px,var(--sf-site-gutter,40px))] ${y} ${H}`,D=`${c} max-view-wide:px-[min(20px,var(--sf-site-gutter,40px))]`,K={2:"grid-cols-2",3:"grid-cols-3",4:"grid-cols-4",5:"grid-cols-5"};function U({eyebrow:s,heading:r,columns:i,showPrice:x,cardStyle:M,layout:g,limit:n,cards:l,template:a,omitHead:d=!1,nodeId:m,partStyles:E,editing:O=!1}={}){const C=I(),o=N("cg"),R=typeof n=="number"&&n>0,h=g==="list"?"grid-cols-1":i===void 0?"grid-cols-3":K[Math.min(5,Math.max(2,Math.round(i)))]??"grid-cols-3",f=`${o} grid ${h} gap-4 max-view-wide:grid-cols-1 max-view-wide:gap-3`,p=S(o,f,{limit:n}),_=Number(a?.blockCount??0)>0;return t("section",{className:B(d?_?D:k:L,C),children:[d?null:e(T,{num:s!==void 0?s:"01 / Collections",accentNum:!0,title:r!==void 0?A(r,!1):t(u,{children:["Three ranges,",e("br",{}),"one standard."]}),link:{text:"View all",href:"/wheels"}}),l&&e(b,{editing:O,nodeId:m,children:t($.Provider,{value:{showPrice:x,cardStyle:M,partStyles:E,editing:O,ownerId:m,Template:_?a:void 0},children:[R&&e("style",{children:`.${o} > *:nth-child(n+${n+1}){display:none}`}),p&&e("style",{children:p}),e(l,{className:f,minEmptyHeight:260})]})})]})}export{U as default};
|
|
@@ -36,6 +36,7 @@ export interface ContactRoutingProps {
|
|
|
36
36
|
formSlug?: string;
|
|
37
37
|
form?: Form | null;
|
|
38
38
|
editing?: boolean;
|
|
39
|
+
showSent?: unknown;
|
|
39
40
|
initialActiveId?: string;
|
|
40
41
|
onActiveChange?: (id: string) => void;
|
|
41
42
|
reasonExtras?: (activeId: string) => ReactNode;
|
|
@@ -47,6 +48,7 @@ export interface ContactRoutingTemplates {
|
|
|
47
48
|
topic?: SlotComponent;
|
|
48
49
|
reason?: SlotComponent;
|
|
49
50
|
channel?: SlotComponent;
|
|
51
|
+
thanks?: SlotComponent;
|
|
50
52
|
pressTitles?: {
|
|
51
53
|
topic?: readonly CardPressTitle[];
|
|
52
54
|
reason?: readonly CardPressTitle[];
|
|
@@ -54,5 +56,5 @@ export interface ContactRoutingTemplates {
|
|
|
54
56
|
};
|
|
55
57
|
}
|
|
56
58
|
export declare const fieldClass: string;
|
|
57
|
-
export default function ContactRouting({ routingNumber, routingTagline, groups, formNumber, formHeading, metaLines, showOther, otherLabel, otherNoteTitle, otherNoteBody, buttonText, consent, channels, formSlug, form: injectedForm, editing, initialActiveId, onActiveChange, reasonExtras, omitHead, templates, }: ContactRoutingProps): import("react").JSX.Element;
|
|
59
|
+
export default function ContactRouting({ routingNumber, routingTagline, groups, formNumber, formHeading, metaLines, showOther, otherLabel, otherNoteTitle, otherNoteBody, buttonText, consent, channels, formSlug, form: injectedForm, editing, showSent, initialActiveId, onActiveChange, reasonExtras, omitHead, templates, }: ContactRoutingProps): import("react").JSX.Element;
|
|
58
60
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as n,jsxs as u,Fragment as ce}from"react/jsx-runtime";import pe from"./SectionBand.js";import{HideTaker as me,usePeekViewHide as ue,useTakeViewHide as fe,withViewHide as be}from"efficient-web-builder/render/components/ViewHideRoot";import{useEffect as L,useState as J}from"react";import{useRootIsDark as xe}from"efficient-shell/theme";import{OTHER_REASON_ID as k}from"efficient-web-builder/format/lib/content/contact";import{FormFieldInput as he,FormHoneypot as ge,successMessageFor as ye,useBoundForm as ve,useFormSubmission as we}from"./formSubmission.js";import ke from"efficient-web-builder/render/components/SectionEyebrow";import{InsideSiteColumn as R,useSectionEdge as Ce}from"efficient-web-builder/render/components/SiteGutterFrame";import{sectionEdgeBandAttrs as Ne}from"efficient-web-builder/render/lib/content/section-edge";import Te,{FieldCaption as Se}from"./WebFormField.js";import{scrollBehavior as Ie}from"efficient-web-builder/render/components/useReducedMotion";import{renderChrome as $e,renderGold as T,renderHeadline as Fe,splitParagraphs as Re}from"efficient-web-builder/render/components/goldPhrases";import{say as S}from"efficient-web-builder/format/lib/editor-words";import{phoneHref as _e}from"efficient-web-builder/format/lib/links/phone-href";import{PART_ROW_ATTR as Oe,encodePartRow as Ee}from"efficient-web-builder/render/lib/document/text-parts";import{CardTemplateRows as _}from"efficient-web-builder/render/components/CardRowContext";import{cardRow as O}from"efficient-web-builder/format/lib/content/card-template";import{CONTACT_CHANNEL_SLOT as K,CONTACT_REASON_SLOT as Ae,CONTACT_TOPIC_SLOT as ze}from"../lib/content/contact-card-seed.js";import{groundCell as He}from"./card-ground-cell.js";const f={bodySmall:"text-[length:var(--size-body,14px)]",body:"text-[length:var(--size-body,15px)]",bodyLarge:"text-[length:var(--size-body,18px)]",labelSmall:"text-[length:var(--size-label,12px)]",labelLarge:"text-[length:var(--size-label,13px)]",labelXl:"text-[length:var(--size-label,14px)]"},j={label:"Label",value:"Value",sub:"Sub line"};function Le(a,s){return a.map((t,r)=>s?{...t,at:r,label:t.label||S(j.label),value:t.value||S(j.value),sub:t.sub||S(j.sub)}:{...t,at:r}).filter(t=>!t.hidden)}function Q(a,s){return s?{[Oe]:Ee("channels",a.at)}:{}}function Y(a){if(a.href)return a.href;const s=(a.value??"").trim();if(s.includes("@"))return`mailto:${s}`;if(/^\+?[\d\s().-]{6,}$/.test(s))return _e(s)}function je(a){const s=[],t=new Map;for(const r of a){if(!r.groupId){s.push(r);continue}const d=r.value.trim().toLowerCase(),b=t.get(d);if(b)b.label=`${b.label} · ${r.label}`;else{const g={...r};t.set(d,g),s.push(g)}}return s}function Me(a,s,t){const r=d=>String(d??"").trim().toLowerCase();for(const d of a?.fields??[]){if(d.type!=="select"||!Array.isArray(d.options))continue;const b=d.options.map(String);if(!s.some(l=>b.some(c=>r(c)===r(l.title))))continue;const g=l=>r(l===k?t:s.find(c=>c.id===l)?.title);return{key:d.key,optionFor:l=>b.find(c=>r(c)===g(l)&&g(l)!==""),idFor:l=>{const c=s.find(N=>r(N.title)===r(l));return c?c.id:t&&r(l)===r(t)?k:void 0}}}return null}const ee=`border-b border-line bg-transparent py-4 font-display ${f.bodyLarge} tracking-[0.01em] text-fg outline-none transition-colors focus:border-accent`;function Pe({routingNumber:a,routingTagline:s,groups:t,formNumber:r,formHeading:d,metaLines:b,showOther:g=!0,otherLabel:l="Other",otherNoteTitle:c,otherNoteBody:N,buttonText:M,consent:P,channels:ne,formSlug:V,form:te,editing:x,initialActiveId:y,onActiveChange:q,reasonExtras:re,omitHead:I=!1,templates:p}){const C=[...t.map(e=>e.id),...g?[k]:[]],se=y&&C.includes(y)?y:C[0]??k,[v,$]=J(se);L(()=>{C.includes(v)||$(C[0]??k)},[C.join("|")]),L(()=>{y&&C.includes(y)&&$(y)},[y]);const w=ve(V,te),i=we({form:w,formSlug:V,editing:x}),m=Me(w,t,g?l:void 0),B=e=>{$(e),E(null);const o=m?.optionFor(e);m&&o!==void 0&&i.set(m.key,o),q?.(e)};L(()=>{if(!m||i.valueOf(m.key))return;const e=m.optionFor(v);e!==void 0&&i.set(m.key,e)},[m?.key]);const[X,E]=J(null),h=Le(ne??[],!!x),oe=e=>X!==null?!e.groupId&&e.value===X:e.groupId===v,ae=w===void 0,A=!!w||!!x,le=!xe({whenUnset:!0}),D=Ce(),F=I&&D?Ne(D):null,W=F?`${F.className} `:"",G=t.length>0||!!x,ie=e=>{B(e),typeof window<"u"&&window.matchMedia("(max-width: 1100px)").matches&&document.getElementById("contact-form")?.scrollIntoView({behavior:Ie(),block:"start"})},U=n("div",{className:"sf-card grid grid-cols-4 gap-[2px] border border-line bg-line max-view-desktop:grid-cols-2 max-[700px]:grid-cols-1",children:n(R,{children:n(_,{ownerId:p?.ownerId??"",ownerType:"ContactRouting",slot:ze,Template:p?.topic,rows:t.map(O),items:t,states:t.map(e=>({selected:v===e.id})),actions:x?void 0:t.map(e=>({press:()=>ie(e.id)})),pressTitles:p?.pressTitles?.topic,fallback:null,wrapCopy:He,children:e=>e})})}),z=[...t.map(e=>({id:e.id,title:e.title})),...g?[{id:k,title:l}]:[]],de=ue(),Z=fe();return u(ce,{children:[G&&(I?n(me,{as:"section",className:`${W}border-b border-line bg-surface pt-6 pb-[60px]`,style:F?.style,children:U}):u(pe,{className:"border-b border-line py-[60px]",style:le?void 0:{background:"var(--section-bg)"},children:[(a||s)&&u("div",{className:"mb-6 flex items-center gap-6 border-b border-line pb-6",children:[a&&n(ke,{text:a}),s&&n("span",{className:`font-display ${f.bodySmall} uppercase tracking-[0.04em] text-fg-dim`,children:T(s)})]}),U]})),(A||h.length>0)&&Z.scope(n("section",{id:"contact-form",className:be(`${W}${I?"bg-bg ":""}scroll-mt-[80px] border-b border-line py-20 max-view-desktop:py-[60px]`,de),style:F?.style,...G?{}:Z.attrs,children:u("div",{className:[I?"grid gap-20 max-view-desktop:grid-cols-1 max-view-desktop:gap-[60px]":"mx-auto grid max-w-[var(--sf-site-width,1600px)] gap-20 px-[var(--sf-site-gutter,40px)] max-view-desktop:grid-cols-1 max-view-desktop:gap-[60px] max-view-desktop:px-[min(24px,var(--sf-site-gutter,40px))]",A&&h.length>0?"grid-cols-[1.3fr_1fr]":"grid-cols-1"].join(" "),children:[A&&u("div",{children:[u("div",{className:"mb-8 flex items-end justify-between gap-6 border-b border-line pb-6",children:[u("div",{children:[r&&n("div",{className:`pb-2 font-mono ${f.labelLarge} uppercase tracking-[0.3em] text-accent`,children:T(r)}),d&&n("h2",{className:"font-heading2 text-[length:min(var(--size-headingMedium,clamp(36px,4vw,56px)),var(--sf-heading-max,9999px))] font-medium uppercase leading-none tracking-[-0.03em]",children:Fe(d,!0)})]}),!!(b&&b.length)&&n("div",{className:`text-right font-mono ${f.labelSmall} uppercase leading-[1.8] tracking-[0.22em] text-fg-dim max-[700px]:text-left`,children:b.map((e,o)=>n("div",{children:e},o))})]}),w?i.done?n("div",{className:`border border-accent bg-accent/[0.08] p-8 font-display ${f.body} leading-[1.6] text-fg-dim`,children:ye(w,"Thanks — we've received your message.")}):u("form",{className:"grid grid-cols-2 gap-5 max-[700px]:grid-cols-1",onSubmit:i.handleSubmit,children:[w.fields.map(e=>n(Te,{label:e.label,required:e.required,className:e.type==="textarea"||e.type==="checkbox"?"col-span-2 max-[700px]:col-span-1":void 0,children:n(he,{field:e,value:i.valueOf(e.key),onChange:o=>{i.set(e.key,o);const H=m&&e.key===m.key?m.idFor(o):void 0;H!==void 0&&($(H),E(null),q?.(H))},className:e.type==="textarea"?`${ee} min-h-[140px] resize-y leading-[1.5]`:e.type==="checkbox"?"size-4 self-start accent-accent":ee})},e.key)),u("div",{className:"col-span-2 flex flex-col gap-2 max-[700px]:col-span-1",children:[n(Se,{required:!0,children:"Reason"}),n("div",{className:"mt-1 flex flex-wrap gap-2",children:n(R,{children:n(_,{ownerId:p?.ownerId??"",ownerType:"ContactRouting",slot:Ae,Template:p?.reason,rows:z.map(e=>O({title:e.title})),states:z.map(e=>({selected:v===e.id})),actions:x?void 0:z.map(e=>({press:()=>B(e.id)})),pressTitles:p?.pressTitles?.reason,fallback:null,children:e=>e})})})]}),re?.(v),v===k&&(c||N)&&u("div",{className:"sf-card col-span-2 flex flex-col gap-2 border border-line bg-bg/40 p-5 max-[700px]:col-span-1",children:[c&&n("span",{className:`font-mono ${f.labelSmall} uppercase tracking-[0.24em] text-accent`,children:T(c)}),N&&Re(N).map((e,o)=>n("p",{className:`font-display ${f.body} leading-[1.55] text-fg-dim`,children:T(e)},o))]}),n(ge,{value:i.honeypot,onChange:i.setHoneypot}),i.error&&n("p",{role:"alert",className:`col-span-2 font-mono ${f.labelSmall} uppercase tracking-[0.18em] text-alert max-[700px]:col-span-1`,children:i.error}),u("div",{className:"col-span-2 mt-5 flex flex-wrap items-center justify-between gap-6 border-t border-line pt-6 max-[700px]:col-span-1 max-[700px]:flex-col max-[700px]:items-stretch",children:[P&&n("span",{className:`max-w-[380px] font-mono ${f.labelSmall} uppercase leading-[1.6] tracking-[0.18em] text-fg-dim`,children:T(P)}),n("button",{type:x?"button":"submit",disabled:i.submitting,className:`cursor-pointer bg-btn px-8 py-5 font-mono ${f.labelXl} uppercase tracking-[0.32em] text-btn-ink transition-colors hover:bg-fg disabled:cursor-wait disabled:opacity-60 max-[700px]:w-full`,children:i.submitting?"Sending…":M?$e(M):"Send Message →"})]})]}):n("p",{className:`font-mono ${f.labelSmall} uppercase tracking-[0.22em] text-fg-dim`,children:ae?S("Loading form…"):S("Choose a form in the inspector, under Message form — until then this column is hidden on the live page and no message can be sent.")})]}),h.length>0&&n("aside",{className:"flex flex-col gap-0 max-view-desktop:hidden",children:n(R,{children:n(_,{ownerId:p?.ownerId??"",ownerType:"ContactRouting",slot:K,Template:p?.channel,rows:h.map(e=>O({label:e.label,value:e.value,sub:e.sub??"",href:Y(e)??""})),items:h,states:h.map(e=>({selected:oe(e)})),copyAttrs:({index:e})=>Q(h[e],x),actions:x?void 0:h.map(e=>e.groupId?{press:()=>{},disabled:!0}:{press:()=>E(e.value)}),pressTitles:p?.pressTitles?.channel,fallback:null,children:e=>e})})}),h.length>0&&(()=>{const e=je(h);return n("div",{"data-contact-phone-list":!0,className:"hidden flex-col gap-0 max-view-desktop:flex",children:n(R,{children:n(_,{ownerId:p?.ownerId??"",ownerType:"ContactRouting",slot:K,Template:p?.channel,rows:e.map(o=>O({label:o.label,value:o.value,sub:o.sub??"",href:Y(o)??""})),items:e,copyAttrs:({index:o})=>Q(e[o],x),fallback:null,children:o=>o})})})})()]})}))]})}export{j as CHANNEL_HINTS,Y as channelHref,Pe as default,Le as drawnChannels,ee as fieldClass,je as mergeChannelsForPhone,Me as topicFieldOf};
|
|
1
|
+
"use client";import{jsx as n,jsxs as m,Fragment as ue}from"react/jsx-runtime";import fe from"./SectionBand.js";import{HideTaker as be,usePeekViewHide as xe,useTakeViewHide as he,withViewHide as ge}from"efficient-web-builder/render/components/ViewHideRoot";import{useEffect as L,useState as K}from"react";import{useRootIsDark as ye}from"efficient-shell/theme";import{OTHER_REASON_ID as k}from"efficient-web-builder/format/lib/content/contact";import{FormFieldInput as we,FormHoneypot as ve,successMessageFor as ke,useBoundForm as Ce,useFormSubmission as Te}from"./formSubmission.js";import Ne from"efficient-web-builder/render/components/SectionEyebrow";import{InsideSiteColumn as R,useSectionEdge as Se}from"efficient-web-builder/render/components/SiteGutterFrame";import{sectionEdgeBandAttrs as Ie}from"efficient-web-builder/render/lib/content/section-edge";import $e,{FieldCaption as Oe}from"./WebFormField.js";import{scrollBehavior as Re}from"efficient-web-builder/render/components/useReducedMotion";import{renderChrome as Fe,renderGold as N,renderHeadline as _e,splitParagraphs as Ee}from"efficient-web-builder/render/components/goldPhrases";import{say as S}from"efficient-web-builder/format/lib/editor-words";import{phoneHref as Ae}from"efficient-web-builder/format/lib/links/phone-href";import{PART_ROW_ATTR as ze,encodePartRow as He}from"efficient-web-builder/render/lib/document/text-parts";import{CardTemplateRows as F}from"efficient-web-builder/render/components/CardRowContext";import{cardRow as _}from"efficient-web-builder/format/lib/content/card-template";import{CONTACT_CHANNEL_SLOT as Q,CONTACT_REASON_SLOT as Le,CONTACT_TOPIC_SLOT as je}from"../lib/content/contact-card-seed.js";import{showsSentOnCanvas as Me}from"../lib/content/thanks-slot.js";import{ThanksCard as Pe}from"./ThanksCard.js";import{groundCell as Ve}from"./card-ground-cell.js";import{withSideOnce as qe}from"efficient-web-builder/format/lib/content/page-width";import{useSideSpaceOnce as Be}from"efficient-web-builder/render/components/SideSpaceOnce";const b={bodySmall:"text-[length:var(--size-body,14px)]",body:"text-[length:var(--size-body,15px)]",bodyLarge:"text-[length:var(--size-body,18px)]",labelSmall:"text-[length:var(--size-label,12px)]",labelLarge:"text-[length:var(--size-label,13px)]",labelXl:"text-[length:var(--size-label,14px)]"},j={label:"Label",value:"Value",sub:"Sub line"};function Xe(a,o){return a.map((t,r)=>o?{...t,at:r,label:t.label||S(j.label),value:t.value||S(j.value),sub:t.sub||S(j.sub)}:{...t,at:r}).filter(t=>!t.hidden)}function Y(a,o){return o?{[ze]:He("channels",a.at)}:{}}function ee(a){if(a.href)return a.href;const o=(a.value??"").trim();if(o.includes("@"))return`mailto:${o}`;if(/^\+?[\d\s().-]{6,}$/.test(o))return Ae(o)}function De(a){const o=[],t=new Map;for(const r of a){if(!r.groupId){o.push(r);continue}const c=r.value.trim().toLowerCase(),x=t.get(c);if(x)x.label=`${x.label} · ${r.label}`;else{const g={...r};t.set(c,g),o.push(g)}}return o}function We(a,o,t){const r=c=>String(c??"").trim().toLowerCase();for(const c of a?.fields??[]){if(c.type!=="select"||!Array.isArray(c.options))continue;const x=c.options.map(String);if(!o.some(l=>x.some(p=>r(p)===r(l.title))))continue;const g=l=>r(l===k?t:o.find(p=>p.id===l)?.title);return{key:c.key,optionFor:l=>x.find(p=>r(p)===g(l)&&g(l)!==""),idFor:l=>{const p=o.find(T=>r(T.title)===r(l));return p?p.id:t&&r(l)===r(t)?k:void 0}}}return null}const ne=`border-b border-line bg-transparent py-4 font-display ${b.bodyLarge} tracking-[0.01em] text-fg outline-none transition-colors focus:border-accent`;function Ge({routingNumber:a,routingTagline:o,groups:t,formNumber:r,formHeading:c,metaLines:x,showOther:g=!0,otherLabel:l="Other",otherNoteTitle:p,otherNoteBody:T,buttonText:M,consent:P,channels:te,formSlug:V,form:re,editing:u,showSent:oe,initialActiveId:w,onActiveChange:q,reasonExtras:se,omitHead:I=!1,templates:i}){const ae=Be(),C=[...t.map(e=>e.id),...g?[k]:[]],le=w&&C.includes(w)?w:C[0]??k,[v,$]=K(le);L(()=>{C.includes(v)||$(C[0]??k)},[C.join("|")]),L(()=>{w&&C.includes(w)&&$(w)},[w]);const y=Ce(V,re),d=Te({form:y,formSlug:V,editing:u}),B=y?n("div",{className:`border border-accent bg-accent/[0.08] p-8 font-display ${b.body} leading-[1.6] text-fg-dim`,children:ke(y,"Thanks — we've received your message.")}):null,f=We(y,t,g?l:void 0),X=e=>{$(e),E(null);const s=f?.optionFor(e);f&&s!==void 0&&d.set(f.key,s),q?.(e)};L(()=>{if(!f||d.valueOf(f.key))return;const e=f.optionFor(v);e!==void 0&&d.set(f.key,e)},[f?.key]);const[D,E]=K(null),h=Xe(te??[],!!u),ie=e=>D!==null?!e.groupId&&e.value===D:e.groupId===v,de=y===void 0,A=!!y||!!u,ce=!ye({whenUnset:!0}),W=Se(),O=I&&W?Ie(W):null,G=O?`${O.className} `:"",U=t.length>0||!!u,pe=e=>{X(e),typeof window<"u"&&window.matchMedia("(max-width: 1100px)").matches&&document.getElementById("contact-form")?.scrollIntoView({behavior:Re(),block:"start"})},Z=n("div",{className:"sf-card grid grid-cols-4 gap-[2px] border border-line bg-line max-view-desktop:grid-cols-2 max-[700px]:grid-cols-1",children:n(R,{children:n(F,{ownerId:i?.ownerId??"",ownerType:"ContactRouting",slot:je,Template:i?.topic,rows:t.map(_),items:t,states:t.map(e=>({selected:v===e.id})),actions:u?void 0:t.map(e=>({press:()=>pe(e.id)})),pressTitles:i?.pressTitles?.topic,fallback:null,wrapCopy:Ve,children:e=>e})})}),z=[...t.map(e=>({id:e.id,title:e.title})),...g?[{id:k,title:l}]:[]],me=xe(),J=he();return m(ue,{children:[U&&(I?n(be,{as:"section",className:`${G}border-b border-line bg-surface pt-6 pb-[60px]`,style:O?.style,children:Z}):m(fe,{className:"border-b border-line py-[60px]",style:ce?void 0:{background:"var(--section-bg)"},children:[(a||o)&&m("div",{className:"mb-6 flex items-center gap-6 border-b border-line pb-6",children:[a&&n(Ne,{text:a}),o&&n("span",{className:`font-display ${b.bodySmall} uppercase tracking-[0.04em] text-fg-dim`,children:N(o)})]}),Z]})),(A||h.length>0)&&J.scope(n("section",{id:"contact-form",className:ge(`${G}${I?"bg-bg ":""}scroll-mt-[80px] border-b border-line py-20 max-view-desktop:py-[60px]`,me),style:O?.style,...U?{}:J.attrs,children:m("div",{className:[I?"grid gap-20 max-view-desktop:grid-cols-1 max-view-desktop:gap-[60px]":qe("mx-auto grid max-w-[var(--sf-site-width,1600px)] gap-20 px-[var(--sf-site-gutter,40px)] max-view-desktop:grid-cols-1 max-view-desktop:gap-[60px] max-view-desktop:px-[min(24px,var(--sf-site-gutter,40px))]",ae),A&&h.length>0?"grid-cols-[1.3fr_1fr]":"grid-cols-1"].join(" "),children:[A&&m("div",{children:[m("div",{className:"mb-8 flex items-end justify-between gap-6 border-b border-line pb-6",children:[m("div",{children:[r&&n("div",{className:`pb-2 font-mono ${b.labelLarge} uppercase tracking-[0.3em] text-accent`,children:N(r)}),c&&n("h2",{className:"font-heading2 text-[length:min(var(--size-headingMedium,clamp(36px,4vw,56px)),var(--sf-heading-max,9999px))] font-medium uppercase leading-none tracking-[-0.03em]",children:_e(c,!0)})]}),!!(x&&x.length)&&n("div",{className:`text-right font-mono ${b.labelSmall} uppercase leading-[1.8] tracking-[0.22em] text-fg-dim max-[700px]:text-left`,children:x.map((e,s)=>n("div",{children:e},s))})]}),y?d.done||Me(oe,u)?n(Pe,{ownerId:i?.ownerId??"",ownerType:"ContactRouting",Template:i?.thanks,message:B,children:e=>m("div",{className:"flex flex-col gap-6",children:[B,e]})}):m("form",{className:"grid grid-cols-2 gap-5 max-[700px]:grid-cols-1",onSubmit:d.handleSubmit,children:[y.fields.map(e=>n($e,{label:e.label,required:e.required,className:e.type==="textarea"||e.type==="checkbox"?"col-span-2 max-[700px]:col-span-1":void 0,children:n(we,{field:e,value:d.valueOf(e.key),onChange:s=>{d.set(e.key,s);const H=f&&e.key===f.key?f.idFor(s):void 0;H!==void 0&&($(H),E(null),q?.(H))},className:e.type==="textarea"?`${ne} min-h-[140px] resize-y leading-[1.5]`:e.type==="checkbox"?"size-4 self-start accent-accent":ne})},e.key)),m("div",{className:"col-span-2 flex flex-col gap-2 max-[700px]:col-span-1",children:[n(Oe,{required:!0,children:"Reason"}),n("div",{className:"mt-1 flex flex-wrap gap-2",children:n(R,{children:n(F,{ownerId:i?.ownerId??"",ownerType:"ContactRouting",slot:Le,Template:i?.reason,rows:z.map(e=>_({title:e.title})),states:z.map(e=>({selected:v===e.id})),actions:u?void 0:z.map(e=>({press:()=>X(e.id)})),pressTitles:i?.pressTitles?.reason,fallback:null,children:e=>e})})})]}),se?.(v),v===k&&(p||T)&&m("div",{className:"sf-card col-span-2 flex flex-col gap-2 border border-line bg-bg/40 p-5 max-[700px]:col-span-1",children:[p&&n("span",{className:`font-mono ${b.labelSmall} uppercase tracking-[0.24em] text-accent`,children:N(p)}),T&&Ee(T).map((e,s)=>n("p",{className:`font-display ${b.body} leading-[1.55] text-fg-dim`,children:N(e)},s))]}),n(ve,{value:d.honeypot,onChange:d.setHoneypot}),d.error&&n("p",{role:"alert",className:`col-span-2 font-mono ${b.labelSmall} uppercase tracking-[0.18em] text-alert max-[700px]:col-span-1`,children:d.error}),m("div",{className:"col-span-2 mt-5 flex flex-wrap items-center justify-between gap-6 border-t border-line pt-6 max-[700px]:col-span-1 max-[700px]:flex-col max-[700px]:items-stretch",children:[P&&n("span",{className:`max-w-[380px] font-mono ${b.labelSmall} uppercase leading-[1.6] tracking-[0.18em] text-fg-dim`,children:N(P)}),n("button",{type:u?"button":"submit",disabled:d.submitting,className:`cursor-pointer bg-btn px-8 py-5 font-mono ${b.labelXl} uppercase tracking-[0.32em] text-btn-ink transition-colors hover:bg-fg disabled:cursor-wait disabled:opacity-60 max-[700px]:w-full`,children:d.submitting?"Sending…":M?Fe(M):"Send Message →"})]})]}):n("p",{className:`font-mono ${b.labelSmall} uppercase tracking-[0.22em] text-fg-dim`,children:de?S("Loading form…"):S("Choose a form in the inspector, under Message form — until then this column is hidden on the live page and no message can be sent.")})]}),h.length>0&&n("aside",{className:"flex flex-col gap-0 max-view-desktop:hidden",children:n(R,{children:n(F,{ownerId:i?.ownerId??"",ownerType:"ContactRouting",slot:Q,Template:i?.channel,rows:h.map(e=>_({label:e.label,value:e.value,sub:e.sub??"",href:ee(e)??""})),items:h,states:h.map(e=>({selected:ie(e)})),copyAttrs:({index:e})=>Y(h[e],u),actions:u?void 0:h.map(e=>e.groupId?{press:()=>{},disabled:!0}:{press:()=>E(e.value)}),pressTitles:i?.pressTitles?.channel,fallback:null,children:e=>e})})}),h.length>0&&(()=>{const e=De(h);return n("div",{"data-contact-phone-list":!0,className:"hidden flex-col gap-0 max-view-desktop:flex",children:n(R,{children:n(F,{ownerId:i?.ownerId??"",ownerType:"ContactRouting",slot:Q,Template:i?.channel,rows:e.map(s=>_({label:s.label,value:s.value,sub:s.sub??"",href:ee(s)??""})),items:e,copyAttrs:({index:s})=>Y(e[s],u),fallback:null,children:s=>s})})})})()]})}))]})}export{j as CHANNEL_HINTS,ee as channelHref,Ge as default,Xe as drawnChannels,ne as fieldClass,De as mergeChannelsForPhone,We as topicFieldOf};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as s,jsxs as c,Fragment as Ue}from"react/jsx-runtime";import{Children as ze,useContext as Ve,useState as de}from"react";import{servedWords as Ye}from"../lib/content/served-lists.js";import{TAB_PILLS as B}from"../lib/content/tab-strip.js";import{useScopeClass as je}from"../lib/use-scope-class.js";import{containerGapProps as Be}from"efficient-web-builder/format/lib/content/container-gap";import He from"efficient-web-builder/render/components/SectionHeader";import A from"efficient-web-builder/render/components/PostCard";import We from"efficient-web-builder/render/components/PostDate";import Ke from"efficient-web-builder/render/components/Placeholder";import{SiteLink as O}from"efficient-web-builder/render/lib/site-runtime";import{renderGold as T,renderHeadline as L}from"efficient-web-builder/render/components/goldPhrases";import{say as S}from"efficient-web-builder/format/lib/editor-words";import{cardImageShapeTokens as Ge}from"efficient-web-builder/format/lib/content/card-image-shape";import{SITE_COLUMN as H}from"efficient-web-builder/format/lib/content/page-width";import{fillRowCss as Je}from"../lib/sections/fill-row.js";import{FRAME_120 as fe,FRAME_ROOM_COUNT as Xe,SECTION_FRAME_INLINE as me,SECTION_FRAME_OWN_BOX as pe,framedBandPad as W,headIsEmpty as qe,withBandClasses as K}from"../lib/sections/band-padding.js";import{HideTaker as G,ViewHideContext as Qe,viewHideClaim as Ze}from"efficient-web-builder/render/components/ViewHideRoot";import{CardTemplateRows as et,useCardRow as tt}from"efficient-web-builder/render/components/CardRowContext";import{SECTION_FILL_CLASS as st}from"efficient-web-builder/format/lib/content/section-min-height";import{postPath as ue}from"efficient-web-builder/format/lib/links/page-link-rules";import{EVENTS_FEATURED_DARKEN as nt,EVENTS_FEATURED_DARKEN_STYLE as rt,EVENTS_FEATURED_PLACEMENT as at}from"../lib/content/events-featured-look.js";import{PostListStarts as ot}from"./PostListStartsProvider.js";import{useCurrentRecordOf as it}from"../lib/document/current-record.js";import{BLOG_POST_RECORD_TYPE as lt}from"../lib/content/article-body.js";import{EVENTS_DEFAULT_LIMIT as ct,EVENTS_LAYOUT_COUNT as ge,postCap as dt}from"../lib/content/post-list-continue.js";import{VIEW_TIERS as J}from"efficient-easel/screen/lib/content/view-tiers";import{hiddenKeyOf as ft}from"efficient-easel/screen/lib/content/view-hide";import{nodeHiddenEverywhere as mt,nodeViewHideWords as pt,viewHideClass as he}from"efficient-web-builder/format/lib/content/view-hide-class";const ut=4;function Cs(e){return Ye(e,ut)}function ws(e){if(!e||typeof e!="object"||Array.isArray(e))return;const n={};for(const[t,r]of Object.entries(e))if(t.trim()){if(typeof r=="string")r.trim()&&(n[t]=r.trim());else if(Array.isArray(r)){const o=r.filter(d=>typeof d=="string"&&!!d.trim()).map(d=>d.trim());o.length&&(n[t]=o)}}return Object.keys(n).length?n:void 0}function xe(e,n){const t=e.facets?.[n];return t===void 0?[]:typeof t=="string"?[t]:t}const gt=new Intl.Collator("en",{numeric:!0,sensitivity:"base"});function ht(e){const n=[],t=new Map;for(const r of e)for(const o of Object.keys(r.facets??{})){t.has(o)||(n.push(o),t.set(o,new Set));for(const d of xe(r,o))t.get(o).add(d)}return n.map(r=>({label:r,values:[...t.get(r)].sort(gt.compare)}))}function xt(e,n){return Object.entries(n).every(([t,r])=>r===""||xe(e,t).includes(r))}const ve="featured",Ne="tabs",be="portrait",y="spread",As=[{label:"Even grid",value:"even"},{label:"Featured first",value:ve},{label:"Tabs",value:Ne},{label:"Photo cards",value:be},{label:"Staggered spread",value:y},{label:"Count",value:ge}],vt=[be,y],Os="even",X={min:2,max:11,step:1,fallback:7,unit:"of 12"},Nt=at,bt=nt,Et=rt;function Tt(e){const n=typeof e=="number"?e:Number.parseFloat(String(e??"")),t=Number.isFinite(n)?Math.min(X.max,Math.max(X.min,Math.round(n))):X.fallback;return`${t}fr ${12-t}fr`}const Ee={1:"grid-cols-1",2:"grid-cols-2 max-view-wide:grid-cols-1",3:"grid-cols-3 max-view-wide:grid-cols-1",4:"grid-cols-4 max-view-desktop:grid-cols-2 max-view-wide:grid-cols-1"},yt={2:"grid-cols-2",3:"grid-cols-3 max-view-wide:grid-cols-2",4:"grid-cols-4 max-view-desktop:grid-cols-3 max-view-wide:grid-cols-2"},_t={2:"grid-cols-2 max-view-wide:grid-cols-1",3:"grid-cols-3 max-view-wide:grid-cols-1",4:"grid-cols-4 max-view-desktop:grid-cols-3 max-view-wide:grid-cols-1"};function Te(e,n){return{key:e.slug,title:e.title??"",excerpt:e.excerpt??"",cover:e.cover??"",meta:e.meta??"",dateLabel:e.dateLabel??"",href:e.href||(n?"#":ue(e.slug))}}function Ct(e,n){return{...Te(e,n),tags:(e.tags??[]).map(t=>({label:t}))}}const ye=new WeakMap,wt={className:"hidden"},At={className:st};function _e(e,n){const t=e.blockIds[0],r=e;function o(d){const u=tt(),N=n&&u?.index===0;return s(r,{...d,cell:h=>h===t===N?At:wt})}return Object.assign(o,{blockCount:1,blockIds:e.blockIds})}function Ot(e,n){const t=e;if(typeof t!="function"||(t.blockCount??0)<2||!Array.isArray(t.blockIds))return e;let r=ye.get(t);return r||(r={lead:_e(t,!0),rest:_e(t,!1)},ye.set(t,r)),n?r.lead:r.rest}const Lt="Find by name",St="Nobody by that name.",$t="Nobody matches.",kt="Any",Rt="No posts in this category yet.",It="All posts",Ft=ue("").replace(/\/$/,"");function Pt(e){return typeof e=="string"?e.trim():""}function Dt(){return c("div",{className:"flex min-h-[40vh] flex-col items-center justify-center gap-6 text-center font-mono text-[length:var(--size-label,14px)] uppercase text-fg-dim",children:[s("p",{role:"status",className:"tracking-[0.2em]",children:Rt}),c(O,{href:Ft,className:"inline-flex min-h-11 items-center tracking-[0.22em] hover:text-fg",children:[It," ",s("span",{className:"text-accent",children:"→"})]})]})}function Mt(e,n){const t=o=>o.normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLocaleLowerCase().trim(),r=t(n);return r===""||t(e).includes(r)}function Ce({typed:e,onType:n,wide:t=!1}){return c("label",{className:`flex max-w-[360px] flex-col gap-1.5${t?" w-full":""}`,children:[s("span",{className:"font-mono text-[length:var(--size-label,12px)] uppercase tracking-[0.18em] text-fg-dim",children:Lt}),s("input",{type:"search",value:e,onChange:r=>n(r.target.value),autoComplete:"off",className:"rounded-[var(--sf-button-radius,6px)] border border-line bg-bg px-4 py-2.5 text-[length:var(--size-body,15px)] text-fg outline-none focus:border-accent"})]})}function we({tags:e}){return s("ul",{"aria-label":"Details",className:"flex gap-1.5 overflow-hidden",children:e.map((n,t)=>s("li",{className:"shrink-0 rounded-[var(--sf-button-radius,4px)] border border-line px-2 py-0.5 text-[length:var(--size-label,12px)] text-fg-dim",children:n},`${n}-${t}`))})}function Ut({card:e,scaffold:n,lower:t=!1}){return c(O,{href:e.href||"#",className:`sf-card group relative isolate flex aspect-[3/4] overflow-hidden bg-surface${t?" min-[801px]:mt-16":""}`,"aria-disabled":n||void 0,tabIndex:n?-1:void 0,children:[s("div",{className:"absolute inset-0 transition-transform duration-700 group-hover:scale-[1.03] motion-reduce:transition-none motion-reduce:group-hover:scale-100",children:s(Ke,{label:`card-${e.slug}`,src:e.cover||void 0,sizes:"(max-width: 800px) 50vw, 25vw"})}),s("div",{"aria-hidden":!0,className:"absolute inset-0 z-0",style:{background:"linear-gradient(180deg, transparent 45%, color-mix(in srgb, var(--bg) 88%, transparent) 100%)"}}),e.meta&&s("span",{className:"absolute left-3 top-3 z-[1] rounded-[var(--sf-button-radius,999px)] bg-bg/85 px-2.5 py-1 font-mono text-[length:var(--size-label,11px)] uppercase tracking-[0.16em] text-accent",children:T(e.meta)}),c("div",{className:"relative z-[1] mt-auto flex w-full flex-col gap-1 p-4 max-view-wide:p-3",children:[s("h3",{className:"font-heading3 text-[length:var(--size-headingSmall,24px)] leading-[1.1] tracking-[-0.01em] text-fg",children:L(e.title,!1)}),(e.publishedAt||e.dateLabel)&&s("p",{className:"font-mono text-[length:var(--size-label,12px)] uppercase tracking-[0.16em] text-accent",children:e.publishedAt?s(We,{at:e.publishedAt}):T(e.dateLabel??"")}),e.tags&&e.tags.length>0&&s(we,{tags:e.tags}),e.excerpt&&s("p",{className:"line-clamp-2 text-[length:var(--size-body,14px)] leading-[1.45] text-fg-dim",children:T(e.excerpt)})]})]})}function zt({cards:e,scaffold:n}){return s("nav",{"aria-label":"Days",className:B.nav,children:s("ul",{className:B.list,children:e.map((t,r)=>{const o=!!t.meta;return s("li",{children:c(O,{href:t.href||"#","aria-current":o?"page":void 0,"aria-disabled":n||void 0,tabIndex:n?-1:void 0,className:B.tab(o),children:[s("span",{className:"font-heading3 text-[length:var(--size-body,15px)] leading-[1.2]",children:L(t.title,!1)}),t.excerpt&&s("span",{className:`font-mono text-[length:var(--size-label,11px)] uppercase tracking-[0.14em] ${o?"opacity-80":"text-fg-dim"}`,children:T(t.excerpt)})]})},`${t.slug}-${r}`)})})})}function Vt({count:e,words:n,href:t}){const r=c("span",{className:"inline-flex items-baseline gap-3",children:[s("span",{className:"font-heading text-[length:var(--size-headingLarge,64px)] leading-none text-accent",children:e}),n!==void 0&&s("span",{className:"font-mono text-[length:var(--size-label,13px)] uppercase tracking-[0.2em] text-fg",children:n})]});return t?s(O,{href:t,className:"inline-flex hover:opacity-85",children:r}):r}const q="[&>[data-sf-repeat]>*]:h-full [&>[data-sf-repeat]>*>*]:h-full",Yt="[&>[data-sf-repeat]]:h-full [&>[data-sf-repeat]>*]:h-full [&>[data-sf-repeat]>*>*]:h-full",jt=`relative z-[2] bg-bg ${Xe}`,Bt={top:32,bottom:32};function Ht(e){const{starts:n,posts:t}=Ve(ot),r=n[e.ownerId??""];if(!r)return s(Q,{...e,start:0});const o=t?.[e.ownerId??""]??e.posts,d=r.skipCurrentPost===!0,u=Wt(r);return u.length===1?s(Q,{...e,posts:o,start:u[0].start,skipCurrentPost:d}):s(Ue,{children:u.map(({start:N,views:h})=>{const b=Kt(h,e.viewHidden);return mt(Ae(b))?null:s(Qe.Provider,{value:Gt(b),children:s(Q,{...e,posts:o,start:N,skipCurrentPost:d})},N)})})}function Wt(e){const n=[];for(const t of J){const r=n.find(o=>o.start===e[t]);r?r.views.push(t):n.push({start:e[t],views:[t]})}return n}const Kt=(e,n)=>Object.fromEntries(J.map(t=>[t,!e.includes(t)||!!n?.[t]])),Ae=e=>Object.fromEntries(J.map(n=>[ft(n),e[n]])),Gt=e=>Ze(he(e),pt(Ae(e)),{sectionClassName:he(e,{atSectionLine:!0}),line:"section"});function Q({start:e,num:n,title:t,link:r,posts:o,servedCategory:d,columns:u,limit:N,showAll:h=!1,editing:b=!1,cardImage:Oe,gap:Le,gapPhone:Se,layout:g,featuredWidth:$e,listCover:ke=!0,featuredDarken:Re,omitHead:x=!1,sample:$,nameFilter:Ie=!1,pads:k,template:Z,ownerId:Fe="",skipCurrentPost:Pe=!1}){const[R,ee]=de(""),[te,De]=de({}),_=je("ev"),se=it(lt),ne=Pe&&se?(o??[]).filter(a=>a.slug!==se.key):o??[],re=e>0?ne.slice(e):ne,ae=h?re.length:dt({limit:N}),I=re.slice(0,ae),p=b&&I.length===0;if(I.length===0&&!b){if(!Pt(d))return null;const a=W(k,fe,{noTop:x,nonNegative:!0});return s(G,{as:"section",...a.attrs,className:K(x?pe:me,a),style:a.style,children:s("div",{className:H,children:s(Dt,{})})})}const oe=h?ct:ae,f=p?$?.length?$.slice(0,h?$.length:oe):Array.from({length:oe},(a,l)=>({slug:`placeholder-${l}`,title:S("Blog post title"),excerpt:S("A short summary of the post appears here."),cover:"",meta:S("Journal"),dateLabel:S("Date")})):I,i=Be("Events",Le,"both",Se),w=g===ve&&f.length>1,ie=Tt($e),F=g===Ne,P=g===ge,le=vt.includes(g??""),D=Ie&&!F&&!P&&!w,M=D?ht(f):[],E=D?f.filter(a=>Mt(a.title,R)&&xt(a,te)):f,C=P?W(k,Bt,{nonNegative:!0}):W(k,fe,{noTop:x,nonNegative:!0}),U=C.style,Me=!b&&qe(n,t,r?.text),z=(Z?.blockCount??0)>0?_t:yt,V=g===y?z[3]:z[Math.min(4,Math.max(2,u??3))]??z[3],Y=Ee[Math.min(4,Math.max(1,u??3))]??Ee[3],ce=F||w||g===y?"":Je(_,le?V:Y,{cards:E.length}),j=(a,l,m)=>s(et,{ownerId:Fe,ownerType:"Events",Template:Ot(Z,w),rows:a.map(v=>Te(v,p)),items:a.map(v=>Ct(v,p)),fallback:l,children:v=>m(ze.toArray(v))});return P?s(G,{as:"section",...C.attrs,className:K(jt,C),style:Object.keys(U).length?U:void 0,children:s("div",{className:H,children:s(Vt,{count:f.length,words:x||t===void 0?void 0:L(t,!1),href:x?void 0:r?.href})})}):s(G,{as:"section",...C.attrs,className:K(x?pe:me,C),style:{...Ge(Oe),...U},children:c("div",{className:H,children:[x||Me?null:s(He,{num:n!==void 0?T(n):void 0,title:t!==void 0?L(t,!1):void 0,link:r?{text:T(r.text),href:r.href}:void 0}),D&&c("div",{className:"mb-6 flex flex-col gap-2",children:[M.length===0?s(Ce,{typed:R,onType:ee}):c("div",{className:"flex flex-wrap items-end gap-3",children:[s(Ce,{typed:R,onType:ee,wide:!0}),M.map(({label:a,values:l})=>c("label",{className:"flex min-w-[140px] flex-col gap-1.5 max-view-wide:flex-1",children:[s("span",{className:"font-mono text-[length:var(--size-label,12px)] uppercase tracking-[0.18em] text-fg-dim",children:a}),c("select",{value:te[a]??"",onChange:m=>De(v=>({...v,[a]:m.target.value})),className:"rounded-[var(--sf-button-radius,6px)] border border-line bg-bg px-4 py-2.5 text-[length:var(--size-body,15px)] text-fg outline-none focus:border-accent",children:[s("option",{value:"",children:kt}),l.map(m=>s("option",{value:m,children:m},m))]})]},a))]}),E.length===0&&s("p",{role:"status",className:"text-[length:var(--size-body,14px)] text-fg-dim",children:M.length===0?St:$t})]}),ce&&s("style",{children:ce}),F?s(zt,{cards:f,scaffold:p}):le?j(E,s("div",{className:`${_} sf-card-grid grid${i.className} ${V}`,style:i.style,children:E.map((a,l)=>s(Ut,{card:a,scaffold:p,lower:g===y&&l%3===1},`${a.slug}-${l}`))}),a=>s("div",{className:`${_} sf-card-grid grid${i.className} ${V} ${q}`,style:i.style,children:g===y?a.map((l,m)=>s("div",{className:`${Yt}${m%3===1?" view-wide:mt-16":""}`,children:l},m)):a})):w?j(f,c("div",{className:`sf-card-grid grid grid-cols-[var(--sf-events-split)] max-view-wide:grid-cols-1${i.className}`,style:{...i.style,"--sf-events-split":ie},children:[s(A,{post:f[0],href:f[0].href,scaffold:p,layout:"cover",darken:Re??bt,darkenStyle:Et,placement:Nt},`${f[0].slug}-0`),s("div",{className:`grid auto-rows-min${i.className}`,style:i.style,children:f.slice(1).map((a,l)=>s(A,{post:a,href:a.href,scaffold:p,showCover:ke},`${a.slug}-${l+1}`))})]}),a=>c("div",{className:`sf-card-grid grid grid-cols-[var(--sf-events-split)] max-view-wide:grid-cols-1${i.className} ${q}`,style:{...i.style,"--sf-events-split":ie},children:[a[0],s("div",{className:`grid auto-rows-min${i.className}`,style:i.style,children:a.slice(1)})]})):j(E,s("div",{className:`${_} sf-card-grid grid${i.className} ${Y}`,style:i.style,children:E.map((a,l)=>a.tags&&a.tags.length>0?c("div",{className:"flex flex-col gap-2",children:[s(A,{post:a,href:a.href,scaffold:p}),s(we,{tags:a.tags})]},`${a.slug}-${l}`):s(A,{post:a,href:a.href,scaffold:p},`${a.slug}-${l}`))}),a=>s("div",{className:`${_} sf-card-grid grid${i.className} ${Y} ${q}`,style:i.style,children:a}))]})})}export{X as EVENTS_FEATURED_WIDTH,As as EVENTS_LAYOUTS,Os as EVENTS_LAYOUT_FALLBACK,ve as EVENTS_LAYOUT_FEATURED,be as EVENTS_LAYOUT_PORTRAIT,y as EVENTS_LAYOUT_SPREAD,Ne as EVENTS_LAYOUT_TABS,vt as EVENTS_PHOTO_LAYOUTS,ut as MAX_CARD_TAGS,Ht as default,ht as facetChoices,xt as matchesFacets,Mt as matchesName,ws as readFacets,Cs as readTags};
|
|
1
|
+
import{jsx as s,jsxs as c,Fragment as Ve}from"react/jsx-runtime";import{Children as Ye,useContext as je,useState as me}from"react";import{servedWords as Be}from"../lib/content/served-lists.js";import{TAB_PILLS as H}from"../lib/content/tab-strip.js";import{useScopeClass as He}from"../lib/use-scope-class.js";import{containerGapProps as We}from"efficient-web-builder/format/lib/content/container-gap";import Ke from"efficient-web-builder/render/components/SectionHeader";import A from"efficient-web-builder/render/components/PostCard";import Ge from"efficient-web-builder/render/components/PostDate";import Je from"efficient-web-builder/render/components/Placeholder";import{SiteLink as O}from"efficient-web-builder/render/lib/site-runtime";import{renderGold as T,renderHeadline as L}from"efficient-web-builder/render/components/goldPhrases";import{say as S}from"efficient-web-builder/format/lib/editor-words";import{cardImageShapeTokens as Xe}from"efficient-web-builder/format/lib/content/card-image-shape";import{SITE_COLUMN as W,withSideOnce as K}from"efficient-web-builder/format/lib/content/page-width";import{fillRowCss as qe}from"../lib/sections/fill-row.js";import{FRAME_120 as pe,FRAME_ROOM_COUNT as Qe,SECTION_FRAME_INLINE as ue,SECTION_FRAME_OWN_BOX as ge,framedBandPad as G,headIsEmpty as Ze,withBandClasses as J}from"../lib/sections/band-padding.js";import{HideTaker as X,ViewHideContext as et,viewHideClaim as tt}from"efficient-web-builder/render/components/ViewHideRoot";import{CardTemplateRows as st,useCardRow as nt}from"efficient-web-builder/render/components/CardRowContext";import{SECTION_FILL_CLASS as rt}from"efficient-web-builder/format/lib/content/section-min-height";import{postPath as he}from"efficient-web-builder/format/lib/links/page-link-rules";import{EVENTS_FEATURED_DARKEN as at,EVENTS_FEATURED_DARKEN_STYLE as ot,EVENTS_FEATURED_PLACEMENT as it}from"../lib/content/events-featured-look.js";import{PostListStarts as lt}from"./PostListStartsProvider.js";import{useCurrentRecordOf as ct}from"../lib/document/current-record.js";import{BLOG_POST_RECORD_TYPE as dt}from"../lib/content/article-body.js";import{EVENTS_DEFAULT_LIMIT as ft,EVENTS_LAYOUT_COUNT as xe,postCap as mt}from"../lib/content/post-list-continue.js";import{VIEW_TIERS as q}from"efficient-easel/screen/lib/content/view-tiers";import{hiddenKeyOf as pt}from"efficient-easel/screen/lib/content/view-hide";import{nodeHiddenEverywhere as ut,nodeViewHideWords as gt,viewHideClass as ve}from"efficient-web-builder/format/lib/content/view-hide-class";import{useSideSpaceOnce as ht}from"efficient-web-builder/render/components/SideSpaceOnce";const xt=4;function Ls(e){return Be(e,xt)}function Ss(e){if(!e||typeof e!="object"||Array.isArray(e))return;const n={};for(const[t,r]of Object.entries(e))if(t.trim()){if(typeof r=="string")r.trim()&&(n[t]=r.trim());else if(Array.isArray(r)){const o=r.filter(d=>typeof d=="string"&&!!d.trim()).map(d=>d.trim());o.length&&(n[t]=o)}}return Object.keys(n).length?n:void 0}function Ne(e,n){const t=e.facets?.[n];return t===void 0?[]:typeof t=="string"?[t]:t}const vt=new Intl.Collator("en",{numeric:!0,sensitivity:"base"});function Nt(e){const n=[],t=new Map;for(const r of e)for(const o of Object.keys(r.facets??{})){t.has(o)||(n.push(o),t.set(o,new Set));for(const d of Ne(r,o))t.get(o).add(d)}return n.map(r=>({label:r,values:[...t.get(r)].sort(vt.compare)}))}function bt(e,n){return Object.entries(n).every(([t,r])=>r===""||Ne(e,t).includes(r))}const be="featured",Ee="tabs",Te="portrait",y="spread",$s=[{label:"Even grid",value:"even"},{label:"Featured first",value:be},{label:"Tabs",value:Ee},{label:"Photo cards",value:Te},{label:"Staggered spread",value:y},{label:"Count",value:xe}],Et=[Te,y],ks="even",Q={min:2,max:11,step:1,fallback:7,unit:"of 12"},Tt=it,yt=at,_t=ot;function Ct(e){const n=typeof e=="number"?e:Number.parseFloat(String(e??"")),t=Number.isFinite(n)?Math.min(Q.max,Math.max(Q.min,Math.round(n))):Q.fallback;return`${t}fr ${12-t}fr`}const ye={1:"grid-cols-1",2:"grid-cols-2 max-view-wide:grid-cols-1",3:"grid-cols-3 max-view-wide:grid-cols-1",4:"grid-cols-4 max-view-desktop:grid-cols-2 max-view-wide:grid-cols-1"},wt={2:"grid-cols-2",3:"grid-cols-3 max-view-wide:grid-cols-2",4:"grid-cols-4 max-view-desktop:grid-cols-3 max-view-wide:grid-cols-2"},At={2:"grid-cols-2 max-view-wide:grid-cols-1",3:"grid-cols-3 max-view-wide:grid-cols-1",4:"grid-cols-4 max-view-desktop:grid-cols-3 max-view-wide:grid-cols-1"};function _e(e,n){return{key:e.slug,title:e.title??"",excerpt:e.excerpt??"",cover:e.cover??"",meta:e.meta??"",dateLabel:e.dateLabel??"",href:e.href||(n?"#":he(e.slug))}}function Ot(e,n){return{..._e(e,n),tags:(e.tags??[]).map(t=>({label:t}))}}const Ce=new WeakMap,Lt={className:"hidden"},St={className:rt};function we(e,n){const t=e.blockIds[0],r=e;function o(d){const u=nt(),N=n&&u?.index===0;return s(r,{...d,cell:h=>h===t===N?St:Lt})}return Object.assign(o,{blockCount:1,blockIds:e.blockIds})}function $t(e,n){const t=e;if(typeof t!="function"||(t.blockCount??0)<2||!Array.isArray(t.blockIds))return e;let r=Ce.get(t);return r||(r={lead:we(t,!0),rest:we(t,!1)},Ce.set(t,r)),n?r.lead:r.rest}const kt="Find by name",Rt="Nobody by that name.",It="Nobody matches.",Ft="Any",Pt="No posts in this category yet.",Dt="All posts",Mt=he("").replace(/\/$/,"");function Ut(e){return typeof e=="string"?e.trim():""}function zt(){return c("div",{className:"flex min-h-[40vh] flex-col items-center justify-center gap-6 text-center font-mono text-[length:var(--size-label,14px)] uppercase text-fg-dim",children:[s("p",{role:"status",className:"tracking-[0.2em]",children:Pt}),c(O,{href:Mt,className:"inline-flex min-h-11 items-center tracking-[0.22em] hover:text-fg",children:[Dt," ",s("span",{className:"text-accent",children:"→"})]})]})}function Vt(e,n){const t=o=>o.normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLocaleLowerCase().trim(),r=t(n);return r===""||t(e).includes(r)}function Ae({typed:e,onType:n,wide:t=!1}){return c("label",{className:`flex max-w-[360px] flex-col gap-1.5${t?" w-full":""}`,children:[s("span",{className:"font-mono text-[length:var(--size-label,12px)] uppercase tracking-[0.18em] text-fg-dim",children:kt}),s("input",{type:"search",value:e,onChange:r=>n(r.target.value),autoComplete:"off",className:"rounded-[var(--sf-button-radius,6px)] border border-line bg-bg px-4 py-2.5 text-[length:var(--size-body,15px)] text-fg outline-none focus:border-accent"})]})}function Oe({tags:e}){return s("ul",{"aria-label":"Details",className:"flex gap-1.5 overflow-hidden",children:e.map((n,t)=>s("li",{className:"shrink-0 rounded-[var(--sf-button-radius,4px)] border border-line px-2 py-0.5 text-[length:var(--size-label,12px)] text-fg-dim",children:n},`${n}-${t}`))})}function Yt({card:e,scaffold:n,lower:t=!1}){return c(O,{href:e.href||"#",className:`sf-card group relative isolate flex aspect-[3/4] overflow-hidden bg-surface${t?" min-[801px]:mt-16":""}`,"aria-disabled":n||void 0,tabIndex:n?-1:void 0,children:[s("div",{className:"absolute inset-0 transition-transform duration-700 group-hover:scale-[1.03] motion-reduce:transition-none motion-reduce:group-hover:scale-100",children:s(Je,{label:`card-${e.slug}`,src:e.cover||void 0,sizes:"(max-width: 800px) 50vw, 25vw"})}),s("div",{"aria-hidden":!0,className:"absolute inset-0 z-0",style:{background:"linear-gradient(180deg, transparent 45%, color-mix(in srgb, var(--bg) 88%, transparent) 100%)"}}),e.meta&&s("span",{className:"absolute left-3 top-3 z-[1] rounded-[var(--sf-button-radius,999px)] bg-bg/85 px-2.5 py-1 font-mono text-[length:var(--size-label,11px)] uppercase tracking-[0.16em] text-accent",children:T(e.meta)}),c("div",{className:"relative z-[1] mt-auto flex w-full flex-col gap-1 p-4 max-view-wide:p-3",children:[s("h3",{className:"font-heading3 text-[length:var(--size-headingSmall,24px)] leading-[1.1] tracking-[-0.01em] text-fg",children:L(e.title,!1)}),(e.publishedAt||e.dateLabel)&&s("p",{className:"font-mono text-[length:var(--size-label,12px)] uppercase tracking-[0.16em] text-accent",children:e.publishedAt?s(Ge,{at:e.publishedAt}):T(e.dateLabel??"")}),e.tags&&e.tags.length>0&&s(Oe,{tags:e.tags}),e.excerpt&&s("p",{className:"line-clamp-2 text-[length:var(--size-body,14px)] leading-[1.45] text-fg-dim",children:T(e.excerpt)})]})]})}function jt({cards:e,scaffold:n}){return s("nav",{"aria-label":"Days",className:H.nav,children:s("ul",{className:H.list,children:e.map((t,r)=>{const o=!!t.meta;return s("li",{children:c(O,{href:t.href||"#","aria-current":o?"page":void 0,"aria-disabled":n||void 0,tabIndex:n?-1:void 0,className:H.tab(o),children:[s("span",{className:"font-heading3 text-[length:var(--size-body,15px)] leading-[1.2]",children:L(t.title,!1)}),t.excerpt&&s("span",{className:`font-mono text-[length:var(--size-label,11px)] uppercase tracking-[0.14em] ${o?"opacity-80":"text-fg-dim"}`,children:T(t.excerpt)})]})},`${t.slug}-${r}`)})})})}function Bt({count:e,words:n,href:t}){const r=c("span",{className:"inline-flex items-baseline gap-3",children:[s("span",{className:"font-heading text-[length:var(--size-headingLarge,64px)] leading-none text-accent",children:e}),n!==void 0&&s("span",{className:"font-mono text-[length:var(--size-label,13px)] uppercase tracking-[0.2em] text-fg",children:n})]});return t?s(O,{href:t,className:"inline-flex hover:opacity-85",children:r}):r}const Z="[&>[data-sf-repeat]>*]:h-full [&>[data-sf-repeat]>*>*]:h-full",Ht="[&>[data-sf-repeat]]:h-full [&>[data-sf-repeat]>*]:h-full [&>[data-sf-repeat]>*>*]:h-full",Wt=`relative z-[2] bg-bg ${Qe}`,Kt={top:32,bottom:32};function Gt(e){const{starts:n,posts:t}=je(lt),r=n[e.ownerId??""];if(!r)return s(ee,{...e,start:0});const o=t?.[e.ownerId??""]??e.posts,d=r.skipCurrentPost===!0,u=Jt(r);return u.length===1?s(ee,{...e,posts:o,start:u[0].start,skipCurrentPost:d}):s(Ve,{children:u.map(({start:N,views:h})=>{const b=Xt(h,e.viewHidden);return ut(Le(b))?null:s(et.Provider,{value:qt(b),children:s(ee,{...e,posts:o,start:N,skipCurrentPost:d})},N)})})}function Jt(e){const n=[];for(const t of q){const r=n.find(o=>o.start===e[t]);r?r.views.push(t):n.push({start:e[t],views:[t]})}return n}const Xt=(e,n)=>Object.fromEntries(q.map(t=>[t,!e.includes(t)||!!n?.[t]])),Le=e=>Object.fromEntries(q.map(n=>[pt(n),e[n]])),qt=e=>tt(ve(e),gt(Le(e)),{sectionClassName:ve(e,{atSectionLine:!0}),line:"section"});function ee({start:e,num:n,title:t,link:r,posts:o,servedCategory:d,columns:u,limit:N,showAll:h=!1,editing:b=!1,cardImage:Se,gap:$e,gapPhone:ke,layout:g,featuredWidth:Re,listCover:Ie=!0,featuredDarken:Fe,omitHead:x=!1,sample:$,nameFilter:Pe=!1,pads:k,template:te,ownerId:De="",skipCurrentPost:Me=!1}){const R=ht(),[I,se]=me(""),[ne,Ue]=me({}),_=He("ev"),re=ct(dt),ae=Me&&re?(o??[]).filter(a=>a.slug!==re.key):o??[],oe=e>0?ae.slice(e):ae,ie=h?oe.length:mt({limit:N}),F=oe.slice(0,ie),p=b&&F.length===0;if(F.length===0&&!b){if(!Ut(d))return null;const a=G(k,pe,{noTop:x,nonNegative:!0});return s(X,{as:"section",...a.attrs,className:J(x?ge:ue,a),style:a.style,children:s("div",{className:K(W,R),children:s(zt,{})})})}const le=h?ft:ie,f=p?$?.length?$.slice(0,h?$.length:le):Array.from({length:le},(a,l)=>({slug:`placeholder-${l}`,title:S("Blog post title"),excerpt:S("A short summary of the post appears here."),cover:"",meta:S("Journal"),dateLabel:S("Date")})):F,i=We("Events",$e,"both",ke),w=g===be&&f.length>1,ce=Ct(Re),P=g===Ee,D=g===xe,de=Et.includes(g??""),M=Pe&&!P&&!D&&!w,U=M?Nt(f):[],E=M?f.filter(a=>Vt(a.title,I)&&bt(a,ne)):f,C=D?G(k,Kt,{nonNegative:!0}):G(k,pe,{noTop:x,nonNegative:!0}),z=C.style,ze=!b&&Ze(n,t,r?.text),V=(te?.blockCount??0)>0?At:wt,Y=g===y?V[3]:V[Math.min(4,Math.max(2,u??3))]??V[3],j=ye[Math.min(4,Math.max(1,u??3))]??ye[3],fe=P||w||g===y?"":qe(_,de?Y:j,{cards:E.length}),B=(a,l,m)=>s(st,{ownerId:De,ownerType:"Events",Template:$t(te,w),rows:a.map(v=>_e(v,p)),items:a.map(v=>Ot(v,p)),fallback:l,children:v=>m(Ye.toArray(v))});return D?s(X,{as:"section",...C.attrs,className:J(Wt,C),style:Object.keys(z).length?z:void 0,children:s("div",{className:K(W,R),children:s(Bt,{count:f.length,words:x||t===void 0?void 0:L(t,!1),href:x?void 0:r?.href})})}):s(X,{as:"section",...C.attrs,className:J(x?ge:ue,C),style:{...Xe(Se),...z},children:c("div",{className:K(W,R),children:[x||ze?null:s(Ke,{num:n!==void 0?T(n):void 0,title:t!==void 0?L(t,!1):void 0,link:r?{text:T(r.text),href:r.href}:void 0}),M&&c("div",{className:"mb-6 flex flex-col gap-2",children:[U.length===0?s(Ae,{typed:I,onType:se}):c("div",{className:"flex flex-wrap items-end gap-3",children:[s(Ae,{typed:I,onType:se,wide:!0}),U.map(({label:a,values:l})=>c("label",{className:"flex min-w-[140px] flex-col gap-1.5 max-view-wide:flex-1",children:[s("span",{className:"font-mono text-[length:var(--size-label,12px)] uppercase tracking-[0.18em] text-fg-dim",children:a}),c("select",{value:ne[a]??"",onChange:m=>Ue(v=>({...v,[a]:m.target.value})),className:"rounded-[var(--sf-button-radius,6px)] border border-line bg-bg px-4 py-2.5 text-[length:var(--size-body,15px)] text-fg outline-none focus:border-accent",children:[s("option",{value:"",children:Ft}),l.map(m=>s("option",{value:m,children:m},m))]})]},a))]}),E.length===0&&s("p",{role:"status",className:"text-[length:var(--size-body,14px)] text-fg-dim",children:U.length===0?Rt:It})]}),fe&&s("style",{children:fe}),P?s(jt,{cards:f,scaffold:p}):de?B(E,s("div",{className:`${_} sf-card-grid grid${i.className} ${Y}`,style:i.style,children:E.map((a,l)=>s(Yt,{card:a,scaffold:p,lower:g===y&&l%3===1},`${a.slug}-${l}`))}),a=>s("div",{className:`${_} sf-card-grid grid${i.className} ${Y} ${Z}`,style:i.style,children:g===y?a.map((l,m)=>s("div",{className:`${Ht}${m%3===1?" view-wide:mt-16":""}`,children:l},m)):a})):w?B(f,c("div",{className:`sf-card-grid grid grid-cols-[var(--sf-events-split)] max-view-wide:grid-cols-1${i.className}`,style:{...i.style,"--sf-events-split":ce},children:[s(A,{post:f[0],href:f[0].href,scaffold:p,layout:"cover",darken:Fe??yt,darkenStyle:_t,placement:Tt},`${f[0].slug}-0`),s("div",{className:`grid auto-rows-min${i.className}`,style:i.style,children:f.slice(1).map((a,l)=>s(A,{post:a,href:a.href,scaffold:p,showCover:Ie},`${a.slug}-${l+1}`))})]}),a=>c("div",{className:`sf-card-grid grid grid-cols-[var(--sf-events-split)] max-view-wide:grid-cols-1${i.className} ${Z}`,style:{...i.style,"--sf-events-split":ce},children:[a[0],s("div",{className:`grid auto-rows-min${i.className}`,style:i.style,children:a.slice(1)})]})):B(E,s("div",{className:`${_} sf-card-grid grid${i.className} ${j}`,style:i.style,children:E.map((a,l)=>a.tags&&a.tags.length>0?c("div",{className:"flex flex-col gap-2",children:[s(A,{post:a,href:a.href,scaffold:p}),s(Oe,{tags:a.tags})]},`${a.slug}-${l}`):s(A,{post:a,href:a.href,scaffold:p},`${a.slug}-${l}`))}),a=>s("div",{className:`${_} sf-card-grid grid${i.className} ${j} ${Z}`,style:i.style,children:a}))]})})}export{Q as EVENTS_FEATURED_WIDTH,$s as EVENTS_LAYOUTS,ks as EVENTS_LAYOUT_FALLBACK,be as EVENTS_LAYOUT_FEATURED,Te as EVENTS_LAYOUT_PORTRAIT,y as EVENTS_LAYOUT_SPREAD,Ee as EVENTS_LAYOUT_TABS,Et as EVENTS_PHOTO_LAYOUTS,xt as MAX_CARD_TAGS,Gt as default,Nt as facetChoices,bt as matchesFacets,Vt as matchesName,Ss as readFacets,Ls as readTags};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as t,jsxs as l,Fragment as
|
|
1
|
+
"use client";import{jsx as t,jsxs as l,Fragment as ae}from"react/jsx-runtime";import O from"./SectionBand.js";import{useEffect as ie,useState as z}from"react";import{CardTemplateRows as R}from"efficient-web-builder/render/components/CardRowContext";import{BOX_HOLDS_NO_GUTTER_CLASS as se,SIDE_ONCE_HOLDS_CLASS as ce}from"efficient-web-builder/format/lib/content/page-width";import{SPEC_TABLE_BAND as B}from"../lib/sections/spec-table-band.js";import{FITMENT_HEAD_TEMPLATE_SLOT as de,fitmentCardRow as me,fitmentHeadRow as pe}from"../lib/content/fitment-row-seed.js";import I from"efficient-web-builder/render/components/SectionHeader";import ue from"./SectionFootnote.js";import{renderGold as b,renderHeadline as H}from"efficient-web-builder/render/components/goldPhrases";import fe from"./fitment/FitmentRowFit.js";import{useVehicleFit as be}from"./fitment/useVehicleFit.js";import{fitmentRowAnswer as he}from"../lib/wheels/fitment-row-fit.js";import{fitmentColumns as xe,loadUnitFor as ge}from"../lib/wheels/fitment-columns.js";import{useActiveCountry as we}from"./CurrencyContext.js";import{NO_FIELD_ANSWERS as ve}from"../lib/content/field-usage.js";import{say as X}from"efficient-web-builder/format/lib/editor-words";import{useEnglish as Ne}from"./EnglishVariant.js";import{useSideSpaceOnce as Se}from"efficient-web-builder/render/components/SideSpaceOnce";const a={body:"text-[length:var(--size-body,12px)]",labelXs:"text-[length:var(--size-label,11px)]",labelSmall:"text-[length:var(--size-label,12px)]",labelLarge:"text-[length:var(--size-label,13px)]",labelXl:"text-[length:var(--size-label,14px)]"},ye="whitespace-nowrap border-b border-line px-4 py-4",D=`relative cursor-pointer border-2 px-4 py-2 font-mono ${a.labelSmall} font-semibold uppercase tracking-[0.18em] text-fg transition-colors`,j=B.inline,P=B.ownBox,G="-mx-1 overflow-x-auto",h={scroll:G,table:`min-w-[600px] ${se}`,head:"border-b border-line bg-surface",row:"group relative border-b border-line transition-colors hover:bg-surface"},W={background:"color-mix(in oklab, var(--accent) 14%, transparent)"},S=(i,s,c)=>s.map(x=>x.cell(i,c)).join("|");function Te({num:i,title:s,description:c,rows:x,showFilter:K=!0,tooltipDefaultOn:g=!0,footnote:M,footnoteLinkText:U,footnoteLinkHref:V,editing:y=!1,omitHead:f=!1,fieldUsage:Z=ve,template:q,headTemplate:J,nodeId:T}){const Q=Se(),_=x??[],r=xe(Z),k=Ne(),u=ge(we()),[w,E]=z(null),[o,$]=z(g);ie(()=>$(g),[g]);const Y=be({editing:y}),C=r.length===0;if(_.length===0||C)return y?l(O,{className:f?P:j,children:[f?null:t(I,{num:i!=null?b(i):void 0,title:s!=null?H(s,!1):void 0,description:c!=null?b(c):void 0,accent:!0}),t("p",{className:`border-t border-line py-6 font-mono ${a.labelLarge} uppercase tracking-[0.18em] text-fg-dim`,children:C?X("Every fitment column is hidden in Product Types — show one to draw this table."):X("No fitment data for this wheel — pick a wheel with fitment specs.")})]}):null;const A=new Set,v=_.filter(e=>{const n=S(e,r,u);return A.has(n)?!1:(A.add(n),!0)}),N=Array.from(new Set(v.map(e=>e.diameter))).sort((e,n)=>e-n),d=w!==null&&N.includes(w)?w:null,m=d===null?v:v.filter(e=>e.diameter===d),ee=K&&N.length>1,te=e=>{if(e===0)return!1;const n=m[e-1],p=m[e];return n.diameter!==p.diameter||n.width!==p.width},L=e=>o?t("span",{role:"tooltip",className:`pointer-events-none absolute top-1/2 right-0 z-20 hidden w-[520px] -translate-y-1/2 whitespace-normal bg-[var(--tooltip-bg)] px-3 py-2 text-right font-mono ${a.labelXs} normal-case tracking-[0.12em] text-fg shadow-lg group-hover:block max-view-tablet:!hidden`,children:t(fe,{answer:he(e,Y)})}):null,ne=(e,n)=>l("div",{className:h.row,children:[e,m[n.index]?L(m[n.index]):null]}),le=t("div",{className:G,children:l("table",{className:`w-full border-collapse font-mono ${a.labelXl} tracking-[0.06em] text-fg`,children:[t("thead",{children:t("tr",{children:r.map(({header:e},n)=>t("th",{className:`whitespace-nowrap border-b border-line bg-surface px-4 py-4 text-left ${a.body} font-normal uppercase tracking-[0.22em] text-fg-dim`,children:k(e)},n))})}),t("tbody",{children:m.map((e,n)=>t("tr",{className:`group transition-colors hover:[&>td]:bg-surface ${te(n)?"[&>td]:border-t [&>td]:border-line":""}`,children:r.map((p,re)=>{const F=re===r.length-1,oe=p.fieldKey==="diameter";return l("td",{className:`${F?"relative ":""}${ye}${oe?" text-accent":""}`,children:[p.cell(e,u),F?L(e):null]},p.fieldKey)})},S(e,r,u)))})]})});return l(O,{className:f?P:j,children:[f?null:t(I,{num:i!=null?b(i):void 0,title:s!=null?H(s,!1):void 0,description:c!=null?b(c):void 0,accent:!0}),l("div",{className:"mb-6 flex flex-wrap items-center gap-x-2 gap-y-3",children:[ee&&l(ae,{children:[t("span",{className:`mr-2 font-mono ${a.labelSmall} uppercase tracking-[0.24em] text-fg-dim max-view-tablet:mr-0 max-view-tablet:mb-1 max-view-tablet:w-full`,children:"Filter by size:"}),l("button",{type:"button",onClick:()=>E(null),className:`${D} ${d===null?"border-accent outline outline-1 outline-accent -outline-offset-1":"border-fg-dim/50 hover:border-accent"}`,style:d===null?W:void 0,children:[d===null&&t("span",{"aria-hidden":!0,className:"absolute inset-y-0 left-0 w-[3px] bg-accent"}),"All"]}),N.map(e=>{const n=e===d;return l("button",{type:"button",onClick:()=>E(n?null:e),className:`${D} ${n?"border-accent outline outline-1 outline-accent -outline-offset-1":"border-fg-dim/50 hover:border-accent"}`,style:n?W:void 0,children:[n&&t("span",{"aria-hidden":!0,className:"absolute inset-y-0 left-0 w-[3px] bg-accent"}),e,'"']},e)})]}),l("button",{type:"button",onClick:()=>$(e=>!e),"aria-pressed":o,"aria-label":o?"Hide vehicle tooltip":"Show vehicle tooltip",className:`ml-auto inline-flex items-center gap-3 font-mono ${a.labelSmall} uppercase tracking-[0.24em] text-fg-dim transition-colors hover:text-fg max-view-tablet:hidden`,children:[t("span",{children:"Vehicle tooltip"}),t("span",{className:`relative inline-flex h-5 w-9 shrink-0 items-center rounded-full border-2 transition-colors ${o?"border-accent":"border-fg-dim/50"}`,style:o?{background:"color-mix(in oklab, var(--accent) 30%, transparent)"}:void 0,"aria-hidden":!0,children:t("span",{className:`block h-3 w-3 rounded-full transition-transform ${o?"translate-x-[18px] bg-accent":"translate-x-[2px] bg-fg-dim"}`})}),t("span",{className:o?"text-accent":"text-fg-dim",children:o?"On":"Off"})]})]}),t(R,{ownerId:T??"",ownerType:"FitmentTable",Template:q,rows:m.map(e=>me(e,r,u,S(e,r,u))),wrapCopy:ne,fallback:le,children:e=>t("div",{className:h.scroll,children:l("div",{className:`${h.table}${Q?` ${ce}`:""}`,children:[t(R,{ownerId:T??"",ownerType:"FitmentTable",slot:de,Template:J,rows:[pe(r,k)],fallback:null,children:n=>t("div",{className:h.head,children:n})}),e]})})}),t(ue,{text:M,linkText:U,linkHref:V})]})}export{Te as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,Fragment as H,jsxs as p}from"react/jsx-runtime";import{createContext as fe,useCallback as we,useContext as be,useEffect as X,useRef as F,useState as P}from"react";import{createPortal as ge}from"react-dom";import{CloseIcon as xe,MenuIcon as Ne}from"efficient-shell/icons/efficient-glyphs";import Ee from"./PopupFrame.js";import{POPUP_LOOK_DEFAULTS as Z}from"efficient-web-builder/format/lib/popup/look";import{REPEAT_ATTRIBUTE as Ce,REPEAT_INDEX_ATTRIBUTE as Te}from"efficient-easel/draw";import{MenuPlaceContext as _e}from"./MenuLinkBlock.js";import{CardRowContext as ye,CardTemplateRows as Me}from"efficient-web-builder/render/components/CardRowContext";import{renderChrome as $}from"efficient-web-builder/render/components/goldPhrases";import{UTIL_WORDS as J}from"./HeaderTools.js";import{usePhoneMenuTools as ke}from"efficient-web-builder/render/components/PhoneMenuTools";import{useSearch as ve}from"./SearchContext.js";import{useModalDismiss as Le}from"./useModalDismiss.js";import{PhoneSheet as Oe}from"./PhoneSheet.js";import{usePreviewMenus as Re}from"./PreviewMenusContext.js";import{FOOTER_MENU_PLACEHOLDER_COUNT as Ae,FOOTER_MENU_PLACEHOLDER_HEADING as Se,FOOTER_MENU_PLACEHOLDER_HINT as Pe}from"../lib/content/menu-placeholder.js";import{say as O}from"efficient-web-builder/format/lib/editor-words";import{isMenuOrphaned as Ie}from"../lib/menu-source.js";import{legacyBlockAlignOf as Ue}from"efficient-web-builder/format/lib/content/block-align";import{MENU_PANEL_TINT_OPACITY_DEFAULT as De,MENU_PANEL_WIDTH_DEFAULT as He,MENU_STYLE_BUTTON as ee,MENU_STYLE_TABS as Fe,menuLinkInRange as $e,menuShowClasses as ne,resolveMenuLinkRange as Be}from"../lib/content/menu-row.js";import{MENU_ENTRY_SIZE_CLASS as te}from"../lib/content/menu-entry-type.js";import{TAB_CELLS as le,currentLinkIndex as Ye,marksCurrentLink as re}from"../lib/content/tab-strip.js";import{useAddressQuery as Qe}from"./wheels-plp/usePlpFiltersInUrl.js";import{useCurrentPagePath as We}from"efficient-web-builder/render/lib/site-runtime";import{HideTaker as M}from"efficient-web-builder/render/components/ViewHideRoot";import{blockParts as je}from"../lib/block-parts.js";import{MENU_BLOCK_TYPE as qe}from"../lib/document/document-nodes.js";const r=je(qe),ze=`flex list-none flex-col gap-3 ${te}`,G="mb-4 font-mono text-[13px] uppercase tracking-[0.2em] text-fg-dim",B="text-[12px] italic text-fg-dim/70",ae=(n,t)=>n&&t>0?"border-t border-line pt-3":"",Ge=n=>({label:n.label??"",url:n.href??"",served:n}),oe=n=>n.served?{...n.served,label:n.label??"",href:n.url??""}:{label:n.label??"",href:n.url??""},Ve=Array.from({length:Ae},()=>({label:"",href:""}));function I({owner:n,items:t,place:s,wrap:h,markCurrent:E=!1}){const C=t?t.map(oe):Ve,c=We(),w=be(ce),_=t&&E?Ye(t.map(g=>g.url??""),c,w):-1,b=_<0?null:{index:_,href:t[_].url??""};return e(_e.Provider,{value:t?b?{...s,current:b}:s:{...s,placeholder:!0},children:e(Me,{ownerId:n.id,ownerType:n.type,Template:n.template,rows:C,items:t??void 0,fallback:null,wrapCopy:h,children:g=>g})})}const Y=n=>(n.template?.blockCount??0)>0,Ke="Nothing to show yet: this menu's entries come from its Menu content.",ie="This menu draws no links: its card template is empty. Undo the delete, or delete this Menu and add it again.";function se({owner:n,items:t,label:s,editing:h,linkAlign:E,linkRange:C,markCurrent:c,menuStyle:w,menuStylePhone:_,panelLook:b}){const g=Ue(E),k=Be(C),R=!!k&&t!==null&&k.to!==void 0&&k.to<t.length,[u,A]=P(!1),v=F(null),x=ke(),{open:Q}=ve(),S=s||"Menu",d=we(()=>A(!1),[]),l=w===ee||_===ee,m=ne(w,_),[U,W]=P("sheet"),y=F(null),f=F(null),[N,D]=P(void 0),[L,me]=P(null),V=()=>{if(!u&&l){const i=v.current?.ownerDocument.defaultView;W(i?.matchMedia("(min-width: 720px)").matches?"side":"sheet");const a=y.current?.querySelector("span");if(a&&i){const o=i.getComputedStyle(a);D({fontFamily:o.fontFamily,fontSize:o.fontSize,letterSpacing:o.letterSpacing,textTransform:o.textTransform});const T=(y.current?.querySelector("svg")??y.current)?.getBoundingClientRect();me(T?{left:T.left,top:T.top,height:T.height}:null)}}A(i=>!i)};X(()=>{if(!u||!l)return;const a=v.current?.ownerDocument.defaultView?.matchMedia("(min-width: 720px)");if(!a)return;const o=()=>A(!1);return a.addEventListener("change",o),()=>a.removeEventListener("change",o)},[u,l]);const j=F(null);Le({active:u&&!(u&&l&&U==="side"),onDismiss:d,scopeRef:v,focusRef:j,trapRef:j});const ue=e(I,{owner:n,items:t,place:{place:"row"},markCurrent:c,wrap:(i,a)=>{const o=t!==null&&k&&!$e(k,a.index+1)?{"data-menu-out":""}:null;return e("li",{className:"",...o,...r("menu-item"),children:i})}}),q=(i,a,o)=>h?{[Ce]:`${i}:${o<0?"panel":"dropdown"}`,[Te]:`${o+1}.${a.index}`}:null,de=e(I,{owner:n,items:t,place:{place:"panel",onNavigate:d},markCurrent:c,wrap:(i,a)=>p(H,{children:[e("li",{className:"flex min-h-14 items-center border-b border-line",...q(n.id,a,-1),...r("menu-item"),children:i}),t===null?null:(a.item?.dropdown_items??[]).map((o,T)=>e(ye.Provider,{value:{...a,row:oe(o),item:o},children:e("li",{className:"flex min-h-12 items-center border-b border-line pl-5 text-[14px]",...q(n.id,a,T),...r("menu-item"),children:i})},T))]})}),pe=x&&(x.search||x.region||x.account||x.theme)?x:null;if(!h&&t!==null&&!Y(n)&&!pe)return null;const K=e(Oe,{role:"dialog",panelRef:j,name:S,entries:de,tools:x,withAccount:!l,editing:h,onClose:d,onSearch:Q,phoneOnly:!l,marker:l?"sheet":void 0,listStyle:l&&L?{paddingLeft:L.left,paddingRight:L.left}:void 0});let z=null;if(l){const i=v.current?.ownerDocument,a={...Z,placement:"left",height:"full",closeButton:"none",width:typeof b?.width=="number"?b.width:He,tintColor:typeof b?.tintColor=="string"?b.tintColor:Z.tintColor,tintOpacity:typeof b?.tintOpacity=="number"?b.tintOpacity:De},o=e(Ee,{look:a,drawer:{closeRef:f},open:!0,onClose:d,label:S,children:p("div",{"data-menu-panel":"side",className:"flex h-full flex-col overflow-y-auto text-fg",children:[e("div",{className:"flex min-h-[var(--sf-header-h,88px)] shrink-0 items-center px-8",style:L?{paddingLeft:L.left}:void 0,children:p("button",{ref:f,type:"button",onClick:d,className:"inline-flex h-11 items-center gap-2",style:N,children:[e(xe,{size:20,"aria-hidden":"true"}),e("span",{className:"whitespace-nowrap",children:J.close})]})}),e("ul",{className:"m-0 flex list-none flex-col px-8 pb-8",style:L?{paddingLeft:L.left}:void 0,...r("menu"),children:e(I,{owner:n,items:t,place:{place:"panel",onNavigate:d},markCurrent:c,wrap:(T,he)=>e("li",{className:"flex min-h-12 items-center",...q(n.id,he,-1),...r("menu-item"),children:T})})})]})});z=p(H,{children:[p("button",{ref:y,type:"button",className:`mono-eyebrow-ctl ${m.button} h-11 min-w-11 items-center gap-2 opacity-80 transition-opacity hover:opacity-100 max-view-tablet:-mx-3 max-view-tablet:min-w-0 max-view-tablet:px-3`,"aria-expanded":u,"aria-label":u?"Close the menu":"Open the menu",onClick:V,...r("menu-button"),children:[e(Ne,{size:20,"aria-hidden":"true"}),e("span",{className:"whitespace-nowrap max-view-tablet:hidden",children:J.menu})]}),u&&i?ge(U==="side"?o:K,i.body):null]})}else m.drawsButton&&(z=p(H,{children:[e("button",{type:"button",className:`${m.buttonHead} h-11 w-11 items-center justify-center${m.buttonTail}`,"aria-expanded":u,"aria-label":u?"Close the menu":"Open the menu",onClick:V,...r("menu-button"),children:e("svg",{width:"22",height:"22",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round","aria-hidden":"true",children:u?e("path",{d:"M6 6l12 12M18 6L6 18"}):e("path",{d:"M4 7h16M4 12h16M4 17h16"})})}),u?K:null]}));return p(M,{as:"nav",ref:v,"aria-label":S,"data-menu-row":"",...l?{"data-menu-show":"button"}:null,...!l&&g?{"data-menu-align":g}:null,...!l&&R?{"data-menu-part":"lead"}:null,className:"min-w-0",...r("menu-block"),children:[e("ul",{className:`m-0 ${m.listHead} list-none flex-wrap items-center gap-x-8 gap-y-2 p-0 font-mono ${te} uppercase tracking-[0.18em]${m.listTail}`,...r("menu"),children:ue}),z]})}function Xe({owner:n,items:t,label:s,editing:h,markCurrent:E,strip:C=""}){return!h&&(t===null||t.length===0||!Y(n))?null:e(M,{as:"nav","aria-label":s||"Menu","data-menu-tabs":"",className:C?`min-w-0 ${C}`:"min-w-0",...r("menu-block"),children:e("ul",{className:le.list,...r("menu"),children:e(I,{owner:n,items:t,place:{place:"tab"},markCurrent:E,wrap:(c,w)=>e("li",{className:le.item(w.index===0,h),...r("menu-item"),children:c})})})})}const ce=fe("");function Ze(n){const t=!n.editing&&re(n.layout,n.currentPage),s=Qe(n.pageQuery??"",t);return e(ce.Provider,{value:s,children:e(Je,{...n})})}function Je({owner:n,menu:t,served:s,heading:h,accordionMobile:E=!1,showDividers:C=!1,editing:c=!1,layout:w="column",linkAlign:_,linkRange:b,menuStyle:g,currentPage:k,menuStylePhone:R,menuPanelWidth:u,menuPanelTintColor:A,menuPanelTintOpacity:v}){const x=re(w,k),{live:Q,ready:S}=Re(),d=!s&&Ie({id:t?.id,handle:t?.handle,editing:c,ready:S,live:Q}),l=s?s.map(Ge):d?[]:t?.items??[],m=h||(s?"":t?.name)||"",[U,W]=P(!1);if(X(()=>{if(!E)return;const f=window.matchMedia("(max-width: 800px)"),N=()=>W(f.matches);return N(),f.addEventListener("change",N),()=>f.removeEventListener("change",N)},[E]),s&&l.length===0)return c?e(M,{as:"p",className:B,children:O(Ke)}):null;if(w==="row"&&c&&!d&&l.length>0&&!Y(n))return e(M,{as:"p",className:B,children:O(ie)});if(w==="row"&&g===Fe){const{strip:f}=ne(g,R),N=e(Xe,{owner:n,items:d?null:l,label:m,editing:c,markCurrent:x,strip:f});return f?p(H,{children:[N,e(se,{owner:n,items:d?null:l,label:m,editing:c,markCurrent:x,menuStyle:g,menuStylePhone:R})]}):N}if(w==="row")return e(se,{owner:n,items:d?null:l,label:m,editing:c,linkAlign:_,linkRange:b,markCurrent:x,menuStyle:g,menuStylePhone:R,panelLook:{width:u,tintColor:A,tintOpacity:v}});const y=f=>e("ul",{className:ze,...r("menu"),children:e(I,{owner:n,items:f,place:{place:"column"},wrap:(N,D)=>e("li",{className:f?ae(C,D.index):`text-fg ${ae(C,D.index)}`,...r("menu-item"),children:N})})});return d?p(M,{as:"div",className:"min-w-0",...r("menu-block"),children:[e("h4",{className:G,...r("heading"),children:h?$(h):O(Se)}),y(null),e("p",{className:`mt-3 ${B}`,children:O(Pe)})]}):l.length===0||!Y(n)?p(M,{as:"div",className:"min-w-0",...r("menu-block"),children:[m?e("h4",{className:G,...r("heading"),children:$(m)}):null,c?e("p",{className:B,children:l.length===0?O("This menu has no links yet — add them in {place}.",{place:O("Storefront → Menus")}):O(ie)}):null]}):E&&U?p(M,{as:"details",className:"min-w-0 border-b border-line",...r("menu-block"),children:[p("summary",{className:"flex cursor-pointer list-none items-center justify-between py-3 font-mono text-[13px] uppercase tracking-[0.2em] text-fg-dim",children:[$(m),e("span",{"aria-hidden":!0,children:"+"})]}),e("div",{className:"pb-3",children:y(l)})]}):p(M,{as:"div",className:"min-w-0",...r("menu-block"),children:[m?e("h4",{className:G,...r("heading"),children:$(m)}):null,y(l)]})}export{Ze as default};
|
|
1
|
+
"use client";import{jsx as e,Fragment as H,jsxs as p}from"react/jsx-runtime";import{createContext as we,useCallback as be,useContext as ge,useEffect as X,useRef as F,useState as P}from"react";import{createPortal as xe}from"react-dom";import{CloseIcon as Ne,MenuIcon as Ee}from"efficient-shell/icons/efficient-glyphs";import Ce from"./PopupFrame.js";import{POPUP_LOOK_DEFAULTS as Z}from"efficient-web-builder/format/lib/popup/look";import{REPEAT_ATTRIBUTE as Te,REPEAT_INDEX_ATTRIBUTE as _e}from"efficient-easel/draw";import{MenuPlaceContext as ye}from"./MenuLinkBlock.js";import{CardRowContext as Me,CardTemplateRows as ke}from"efficient-web-builder/render/components/CardRowContext";import{renderChrome as $}from"efficient-web-builder/render/components/goldPhrases";import{UTIL_WORDS as J}from"./HeaderTools.js";import{usePhoneMenuTools as ve}from"efficient-web-builder/render/components/PhoneMenuTools";import{useSearch as Le}from"./SearchContext.js";import{useModalDismiss as Oe}from"./useModalDismiss.js";import{PhoneSheet as Ae}from"./PhoneSheet.js";import{useAccountInPhoneMenu as Re}from"./PhoneMenuAccount.js";import{usePreviewMenus as Se}from"./PreviewMenusContext.js";import{FOOTER_MENU_PLACEHOLDER_COUNT as Pe,FOOTER_MENU_PLACEHOLDER_HEADING as Ie,FOOTER_MENU_PLACEHOLDER_HINT as Ue}from"../lib/content/menu-placeholder.js";import{say as O}from"efficient-web-builder/format/lib/editor-words";import{isMenuOrphaned as De}from"../lib/menu-source.js";import{legacyBlockAlignOf as He}from"efficient-web-builder/format/lib/content/block-align";import{MENU_PANEL_TINT_OPACITY_DEFAULT as Fe,MENU_PANEL_WIDTH_DEFAULT as $e,MENU_STYLE_BUTTON as ee,MENU_STYLE_TABS as Be,menuLinkInRange as Ye,menuShowClasses as ne,resolveMenuLinkRange as Qe}from"../lib/content/menu-row.js";import{MENU_ENTRY_SIZE_CLASS as te}from"../lib/content/menu-entry-type.js";import{TAB_CELLS as re,currentLinkIndex as We,marksCurrentLink as le}from"../lib/content/tab-strip.js";import{useAddressQuery as je}from"./wheels-plp/usePlpFiltersInUrl.js";import{useCurrentPagePath as qe}from"efficient-web-builder/render/lib/site-runtime";import{HideTaker as M}from"efficient-web-builder/render/components/ViewHideRoot";import{blockParts as ze}from"../lib/block-parts.js";import{MENU_BLOCK_TYPE as Ge}from"../lib/document/document-nodes.js";const l=ze(Ge),Ve=`flex list-none flex-col gap-3 ${te}`,G="mb-4 font-mono text-[13px] uppercase tracking-[0.2em] text-fg-dim",B="text-[12px] italic text-fg-dim/70",oe=(n,t)=>n&&t>0?"border-t border-line pt-3":"",Ke=n=>({label:n.label??"",url:n.href??"",served:n}),ae=n=>n.served?{...n.served,label:n.label??"",href:n.url??""}:{label:n.label??"",href:n.url??""},Xe=Array.from({length:Pe},()=>({label:"",href:""}));function I({owner:n,items:t,place:c,wrap:h,markCurrent:E=!1}){const C=t?t.map(ae):Xe,m=qe(),w=ge(ce),_=t&&E?We(t.map(g=>g.url??""),m,w):-1,b=_<0?null:{index:_,href:t[_].url??""};return e(ye.Provider,{value:t?b?{...c,current:b}:c:{...c,placeholder:!0},children:e(ke,{ownerId:n.id,ownerType:n.type,Template:n.template,rows:C,items:t??void 0,fallback:null,wrapCopy:h,children:g=>g})})}const Y=n=>(n.template?.blockCount??0)>0,Ze="Nothing to show yet: this menu's entries come from its Menu content.",ie="This menu draws no links: its card template is empty. Undo the delete, or delete this Menu and add it again.";function se({owner:n,items:t,label:c,editing:h,linkAlign:E,linkRange:C,markCurrent:m,menuStyle:w,menuStylePhone:_,panelLook:b}){const g=He(E),k=Qe(C),A=!!k&&t!==null&&k.to!==void 0&&k.to<t.length,[u,R]=P(!1),v=F(null),f=ve(),Q=Re(),{open:W}=Le(),N=c||"Menu",i=be(()=>R(!1),[]),r=w===ee||_===ee,y=ne(w,_),[U,S]=P("sheet"),d=F(null),x=F(null),[D,me]=P(void 0),[L,ue]=P(null),V=()=>{if(!u&&r){const s=v.current?.ownerDocument.defaultView;S(s?.matchMedia("(min-width: 720px)").matches?"side":"sheet");const o=d.current?.querySelector("span");if(o&&s){const a=s.getComputedStyle(o);me({fontFamily:a.fontFamily,fontSize:a.fontSize,letterSpacing:a.letterSpacing,textTransform:a.textTransform});const T=(d.current?.querySelector("svg")??d.current)?.getBoundingClientRect();ue(T?{left:T.left,top:T.top,height:T.height}:null)}}R(s=>!s)};X(()=>{if(!u||!r)return;const o=v.current?.ownerDocument.defaultView?.matchMedia("(min-width: 720px)");if(!o)return;const a=()=>R(!1);return o.addEventListener("change",a),()=>o.removeEventListener("change",a)},[u,r]);const j=F(null);Oe({active:u&&!(u&&r&&U==="side"),onDismiss:i,scopeRef:v,focusRef:j,trapRef:j});const de=e(I,{owner:n,items:t,place:{place:"row"},markCurrent:m,wrap:(s,o)=>{const a=t!==null&&k&&!Ye(k,o.index+1)?{"data-menu-out":""}:null;return e("li",{className:"",...a,...l("menu-item"),children:s})}}),q=(s,o,a)=>h?{[Te]:`${s}:${a<0?"panel":"dropdown"}`,[_e]:`${a+1}.${o.index}`}:null,pe=e(I,{owner:n,items:t,place:{place:"panel",onNavigate:i},markCurrent:m,wrap:(s,o)=>p(H,{children:[e("li",{className:"flex min-h-14 items-center border-b border-line",...q(n.id,o,-1),...l("menu-item"),children:s}),t===null?null:(o.item?.dropdown_items??[]).map((a,T)=>e(Me.Provider,{value:{...o,row:ae(a),item:a},children:e("li",{className:"flex min-h-12 items-center border-b border-line pl-5 text-[14px]",...q(n.id,o,T),...l("menu-item"),children:s})},T))]})}),he=f&&(f.search||f.cart||f.region||f.account||f.theme)?f:null;if(!h&&t!==null&&!Y(n)&&!he)return null;const K=e(Ae,{role:"dialog",panelRef:j,name:N,entries:pe,tools:f,withAccount:!r||Q,editing:h,onClose:i,onSearch:W,phoneOnly:!r,marker:r?"sheet":void 0,listStyle:r&&L?{paddingLeft:L.left,paddingRight:L.left}:void 0});let z=null;if(r){const s=v.current?.ownerDocument,o={...Z,placement:"left",height:"full",closeButton:"none",width:typeof b?.width=="number"?b.width:$e,tintColor:typeof b?.tintColor=="string"?b.tintColor:Z.tintColor,tintOpacity:typeof b?.tintOpacity=="number"?b.tintOpacity:Fe},a=e(Ce,{look:o,drawer:{closeRef:x},open:!0,onClose:i,label:N,children:p("div",{"data-menu-panel":"side",className:"flex h-full flex-col overflow-y-auto text-fg",children:[e("div",{className:"flex min-h-[var(--sf-header-h,88px)] shrink-0 items-center px-8",style:L?{paddingLeft:L.left}:void 0,children:p("button",{ref:x,type:"button",onClick:i,className:"inline-flex h-11 items-center gap-2",style:D,children:[e(Ne,{size:20,"aria-hidden":"true"}),e("span",{className:"whitespace-nowrap",children:J.close})]})}),e("ul",{className:"m-0 flex list-none flex-col px-8 pb-8",style:L?{paddingLeft:L.left}:void 0,...l("menu"),children:e(I,{owner:n,items:t,place:{place:"panel",onNavigate:i},markCurrent:m,wrap:(T,fe)=>e("li",{className:"flex min-h-12 items-center",...q(n.id,fe,-1),...l("menu-item"),children:T})})})]})});z=p(H,{children:[p("button",{ref:d,type:"button",className:`mono-eyebrow-ctl ${y.button} h-11 min-w-11 items-center gap-2 opacity-80 transition-opacity hover:opacity-100 max-view-tablet:-mx-3 max-view-tablet:min-w-0 max-view-tablet:px-3`,"aria-expanded":u,"aria-label":u?"Close the menu":"Open the menu",onClick:V,...l("menu-button"),children:[e(Ee,{size:20,"aria-hidden":"true"}),e("span",{className:"whitespace-nowrap max-view-tablet:hidden",children:J.menu})]}),u&&s?xe(U==="side"?a:K,s.body):null]})}else y.drawsButton&&(z=p(H,{children:[e("button",{type:"button",className:`${y.buttonHead} h-11 w-11 items-center justify-center${y.buttonTail}`,"aria-expanded":u,"aria-label":u?"Close the menu":"Open the menu",onClick:V,...l("menu-button"),children:e("svg",{width:"22",height:"22",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round","aria-hidden":"true",children:u?e("path",{d:"M6 6l12 12M18 6L6 18"}):e("path",{d:"M4 7h16M4 12h16M4 17h16"})})}),u?K:null]}));return p(M,{as:"nav",ref:v,"aria-label":N,"data-menu-row":"",...r?{"data-menu-show":"button"}:null,...!r&&g?{"data-menu-align":g}:null,...!r&&A?{"data-menu-part":"lead"}:null,className:"min-w-0",...l("menu-block"),children:[e("ul",{className:`m-0 ${y.listHead} list-none flex-wrap items-center gap-x-8 gap-y-2 p-0 font-mono ${te} uppercase tracking-[0.18em]${y.listTail}`,...l("menu"),children:de}),z]})}function Je({owner:n,items:t,label:c,editing:h,markCurrent:E,strip:C=""}){return!h&&(t===null||t.length===0||!Y(n))?null:e(M,{as:"nav","aria-label":c||"Menu","data-menu-tabs":"",className:C?`min-w-0 ${C}`:"min-w-0",...l("menu-block"),children:e("ul",{className:re.list,...l("menu"),children:e(I,{owner:n,items:t,place:{place:"tab"},markCurrent:E,wrap:(m,w)=>e("li",{className:re.item(w.index===0,h),...l("menu-item"),children:m})})})})}const ce=we("");function en(n){const t=!n.editing&&le(n.layout,n.currentPage),c=je(n.pageQuery??"",t);return e(ce.Provider,{value:c,children:e(nn,{...n})})}function nn({owner:n,menu:t,served:c,heading:h,accordionMobile:E=!1,showDividers:C=!1,editing:m=!1,layout:w="column",linkAlign:_,linkRange:b,menuStyle:g,currentPage:k,menuStylePhone:A,menuPanelWidth:u,menuPanelTintColor:R,menuPanelTintOpacity:v}){const f=le(w,k),{live:Q,ready:W}=Se(),N=!c&&De({id:t?.id,handle:t?.handle,editing:m,ready:W,live:Q}),i=c?c.map(Ke):N?[]:t?.items??[],r=h||(c?"":t?.name)||"",[y,U]=P(!1);if(X(()=>{if(!E)return;const d=window.matchMedia("(max-width: 800px)"),x=()=>U(d.matches);return x(),d.addEventListener("change",x),()=>d.removeEventListener("change",x)},[E]),c&&i.length===0)return m?e(M,{as:"p",className:B,children:O(Ze)}):null;if(w==="row"&&m&&!N&&i.length>0&&!Y(n))return e(M,{as:"p",className:B,children:O(ie)});if(w==="row"&&g===Be){const{strip:d}=ne(g,A),x=e(Je,{owner:n,items:N?null:i,label:r,editing:m,markCurrent:f,strip:d});return d?p(H,{children:[x,e(se,{owner:n,items:N?null:i,label:r,editing:m,markCurrent:f,menuStyle:g,menuStylePhone:A})]}):x}if(w==="row")return e(se,{owner:n,items:N?null:i,label:r,editing:m,linkAlign:_,linkRange:b,markCurrent:f,menuStyle:g,menuStylePhone:A,panelLook:{width:u,tintColor:R,tintOpacity:v}});const S=d=>e("ul",{className:Ve,...l("menu"),children:e(I,{owner:n,items:d,place:{place:"column"},wrap:(x,D)=>e("li",{className:d?oe(C,D.index):`text-fg ${oe(C,D.index)}`,...l("menu-item"),children:x})})});return N?p(M,{as:"div",className:"min-w-0",...l("menu-block"),children:[e("h4",{className:G,...l("heading"),children:h?$(h):O(Ie)}),S(null),e("p",{className:`mt-3 ${B}`,children:O(Ue)})]}):i.length===0||!Y(n)?p(M,{as:"div",className:"min-w-0",...l("menu-block"),children:[r?e("h4",{className:G,...l("heading"),children:$(r)}):null,m?e("p",{className:B,children:i.length===0?O("This menu has no links yet — add them in {place}.",{place:O("Storefront → Menus")}):O(ie)}):null]}):E&&y?p(M,{as:"details",className:"min-w-0 border-b border-line",...l("menu-block"),children:[p("summary",{className:"flex cursor-pointer list-none items-center justify-between py-3 font-mono text-[13px] uppercase tracking-[0.2em] text-fg-dim",children:[$(r),e("span",{"aria-hidden":!0,children:"+"})]}),e("div",{className:"pb-3",children:S(i)})]}):p(M,{as:"div",className:"min-w-0",...l("menu-block"),children:[r?e("h4",{className:G,...l("heading"),children:$(r)}):null,S(i)]})}export{en as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as m,jsxs as
|
|
1
|
+
"use client";import{jsx as m,jsxs as N}from"react/jsx-runtime";import{useContext as U,useEffect as q,useRef as K,useState as C}from"react";import{PublishedFooterContext as J}from"efficient-web-builder/render/components/PublishedFooterContext";import{usePreviewDevice as Q}from"efficient-easel/screen/components/PreviewDeviceContext";import V from"./LegalLine.js";import{LOGO_FILL_DEFAULT as X,LOGO_ROW_FILL_DEFAULT as Y,normalizeFooterColumns as Z}from"efficient-web-builder/format/lib/content/footer";import{viewTierForWidth as ee}from"efficient-easel/screen/lib/content/view-tiers";import{chromeWidthStyle as te,resolveChromeWidth as oe,withSideOnce as se}from"efficient-web-builder/format/lib/content/page-width";import{HideTaker as re}from"efficient-web-builder/render/components/ViewHideRoot";import{blockParts as ie}from"../lib/block-parts.js";import{useSideSpaceOnce as le}from"efficient-web-builder/render/components/SideSpaceOnce";const ce=ie("FooterSection"),n={1:"grid-cols-1",2:"grid-cols-2",3:"grid-cols-3",4:"grid-cols-4",5:"grid-cols-5",6:"grid-cols-6"},S={1:"view-tablet:grid-cols-1",2:"view-tablet:grid-cols-2",3:"view-tablet:grid-cols-3",4:"view-tablet:grid-cols-4",5:"view-tablet:grid-cols-5",6:"view-tablet:grid-cols-6"},_={1:"view-desktop:grid-cols-1",2:"view-desktop:grid-cols-2",3:"view-desktop:grid-cols-3",4:"view-desktop:grid-cols-4",5:"view-desktop:grid-cols-5",6:"view-desktop:grid-cols-6"};function ne({blocks:E,editing:e=!1,width:R,columns:j,logoFill:D,logoRowFill:y}){const M=le(),d=U(J),{desktop:o,tablet:s,mobile:r}=Z(j),{desktop:p,tablet:u,mobile:f}={...X,...D},{desktop:b,tablet:w,mobile:g}={...Y,...y},i=Q(),v=i==="desktop"?o:i==="tablet"?s:r,W=e?Object.hasOwn(n,v)?n[v]:void 0:`${Object.hasOwn(n,r)?n[r]:void 0} ${Object.hasOwn(S,s)?S[s]:void 0} ${Object.hasOwn(_,o)?_[o]:void 0}`,h=K(null),[$,A]=C(1),[P,z]=C(!1);if(q(()=>{if(!e&&!d)return;const l=h.current;if(!l)return;const O=()=>{const t=l.querySelector(".footer-block-grid");if(!t)return;const c=e?i:ee(window.innerWidth),T=c==="desktop"?b:c==="tablet"?w:g;z(T);const H=c==="desktop"?p:c==="tablet"?u:f,F=getComputedStyle(t).gridTemplateColumns.split(" ").filter(Boolean).length-1,I=Math.max(t.childElementCount-1,0);A(!T&&H&&F>=1?Math.max(Math.ceil(I/F),1):1)};let a;const k=()=>{clearTimeout(a),a=setTimeout(O,0)},G=[0,80,250,600].map(t=>setTimeout(O,t)),x=new MutationObserver(k);x.observe(l,{childList:!0,subtree:!0});const L=new ResizeObserver(k);return L.observe(l),()=>{clearTimeout(a),G.forEach(clearTimeout),x.disconnect(),L.disconnect()}},[o,s,r,e,d,i,p,u,f,b,w,g]),!e&&!d)return null;const B=te(oe(R))??void 0;return m(re,{as:"footer",ref:h,className:se(`${e?"sf-theme-surfaces text-fg ":""}border-t border-line bg-bg px-[var(--sf-site-gutter,40px)] pb-10 pt-20 max-view-wide:px-[min(20px,var(--sf-site-gutter,40px))] max-view-wide:pt-14`,M),style:{"--footer-logo-rows":$,"--footer-logo-col":P?"1 / -1":"1"},...ce("footer-block"),children:N("div",{style:B,children:[m(E,{className:`footer-block-grid mb-[60px] grid items-start gap-x-10 gap-y-12 ${W}`,minEmptyHeight:160}),m(V,{})]})})}export{ne as default};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type CSSProperties } from "react";
|
|
2
|
+
import type { SlotComponent } from "efficient-easel/blocks";
|
|
2
3
|
import { type Form, type FormAck } from "../lib/api/index.js";
|
|
3
4
|
export interface FormBlockProps {
|
|
4
5
|
formSlug?: string;
|
|
@@ -8,15 +9,18 @@ export interface FormBlockProps {
|
|
|
8
9
|
finePrint?: string;
|
|
9
10
|
form?: Form | null;
|
|
10
11
|
editing?: boolean;
|
|
12
|
+
nodeId?: string;
|
|
13
|
+
thanks?: SlotComponent;
|
|
14
|
+
showSent?: unknown;
|
|
11
15
|
buttonCorners?: unknown;
|
|
12
16
|
buttonCornerSides?: unknown;
|
|
13
17
|
buttonCornersUnit?: unknown;
|
|
14
18
|
}
|
|
15
|
-
export default function FormBlock({ formSlug, heading, intro, submitText, finePrint, form: injected, editing, buttonCorners, buttonCornerSides, buttonCornersUnit, }?: FormBlockProps): import("react").JSX.Element;
|
|
19
|
+
export default function FormBlock({ formSlug, heading, intro, submitText, finePrint, form: injected, editing, nodeId, thanks, showSent, buttonCorners, buttonCornerSides, buttonCornersUnit, }?: FormBlockProps): import("react").JSX.Element;
|
|
16
20
|
export declare function AccountOutcome({ account }: {
|
|
17
21
|
account: FormAck["account"];
|
|
18
22
|
}): import("react").JSX.Element | null;
|
|
19
|
-
export declare function FormBody({ form, formSlug, submitText, finePrint, editing, onSent, corners, }: {
|
|
23
|
+
export declare function FormBody({ form, formSlug, submitText, finePrint, editing, onSent, corners, nodeId, thanks, showSent, }: {
|
|
20
24
|
form: Form;
|
|
21
25
|
formSlug?: string;
|
|
22
26
|
submitText?: string;
|
|
@@ -27,4 +31,7 @@ export declare function FormBody({ form, formSlug, submitText, finePrint, editin
|
|
|
27
31
|
style: CSSProperties;
|
|
28
32
|
className: string;
|
|
29
33
|
} | null;
|
|
34
|
+
nodeId?: string;
|
|
35
|
+
thanks?: SlotComponent;
|
|
36
|
+
showSent?: unknown;
|
|
30
37
|
}): import("react").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as t,jsxs as
|
|
1
|
+
"use client";import{jsx as t,jsxs as m}from"react/jsx-runtime";import O from"next/link";import{useEffect as L}from"react";import{FormFieldInput as S,FormHoneypot as j,successMessageFor as I,useBoundForm as B,useFormSubmission as M}from"./formSubmission.js";import k from"./SectionNotice.js";import{ThanksCard as _}from"./ThanksCard.js";import{showsSentOnCanvas as q}from"../lib/content/thanks-slot.js";import{say as w}from"efficient-web-builder/format/lib/editor-words";import P from"./WebFormField.js";import{usePopupScope as W}from"./PopupHost.js";import{FIELD_INPUT_CLASS as F}from"../lib/field-input.js";import{cornerSidesShorthand as A,normalizeCornerSides as E}from"efficient-web-builder/format/lib/content/section-corners";import{cssLengthOf as H}from"efficient-web-builder/format/lib/content/css-length";import{withSideOnce as D}from"efficient-web-builder/format/lib/content/page-width";import{useSideSpaceOnce as U}from"efficient-web-builder/render/components/SideSpaceOnce";function Y({field:e,value:n,onChange:a,cornersClass:o=""}){const r={field:e,value:n,onChange:a};return e.type==="checkbox"?m("label",{className:"flex items-start gap-3",children:[t(S,{...r,className:"mt-1 size-4 accent-accent"}),m("span",{className:"font-mono text-[12px] font-semibold uppercase tracking-[0.16em] text-fg",children:[e.label,e.required?t("span",{className:"text-accent",children:" *"}):null]})]}):t(P,{label:e.label,required:e.required,children:t(S,{...r,className:(e.type==="textarea"?F+" resize-y":F)+o})})}function $(e,n,a){if(typeof e!="number"||!Number.isFinite(e))return null;const o=H(Math.max(0,e),a),r=E(n);return{style:{"--form-control-radius":r===null?o:A(o,r)},className:" [border-radius:var(--form-control-radius)]"}}function G({formSlug:e,heading:n,intro:a,submitText:o,finePrint:r,form:u,editing:i=!1,nodeId:d="",thanks:x,showSent:f,buttonCorners:h,buttonCornerSides:g,buttonCornersUnit:b}={}){const N=U(),s=B(e,u),l=W();if(s===void 0)return t(k,{size:"short",children:w("Loading form…")});if(s===null)return t(k,{size:"short",children:i?w("Choose a form in the inspector, under Form."):"This form is unavailable."});const p=(n??"").trim()||s.title;return t("section",{className:"relative z-[2] border-t border-line bg-surface",children:m("div",{className:D("mx-auto max-w-[var(--sf-site-width,1600px)] px-[var(--sf-site-gutter,40px)] py-[84px] max-[960px]:px-[min(24px,var(--sf-site-gutter,40px))]",N),children:[p&&t("h2",{className:"mb-4 font-heading2 text-[length:min(var(--size-headingMedium,44px),var(--sf-heading-max,9999px))] font-medium uppercase leading-none tracking-[-0.02em] text-fg max-view-wide:text-[length:min(var(--size-headingMedium,32px),var(--sf-heading-max,9999px))]",children:p}),(a??"").trim()&&t("p",{className:"mb-12 max-w-[640px] font-display text-[16px] leading-[1.6] text-fg-dim",children:a}),t(K,{form:s,formSlug:e,submitText:o,finePrint:r,editing:i,onSent:l?.markSent,nodeId:d,thanks:x,showSent:f,corners:$(h,g,b)})]})})}function J({account:e}){const n="font-mono text-[12px] uppercase tracking-[0.18em] text-fg-dim";switch(e?.status){case"approved":return m("p",{className:n,children:["Your account is ready."," ",t(O,{href:"/account",className:"underline",children:"Sign in"})]});case"pending":return t("p",{className:n,children:"We're reviewing your application and will email you once it's approved."});case"rejected":return t("p",{className:n,children:"We couldn't open an account from this application. Please contact the shop."});default:return null}}function K({form:e,formSlug:n,submitText:a,finePrint:o,editing:r=!1,onSent:u,corners:i=null,nodeId:d="",thanks:x,showSent:f}){const{valueOf:h,set:g,honeypot:b,setHoneypot:N,submitting:s,done:l,account:p,error:y,handleSubmit:C}=M({form:e,formSlug:n,editing:r});L(()=>{l&&u?.()},[l]);const T=(a??"").trim()||e.submitButtonText?.trim()||"Submit",v=c=>m("div",{role:"status",className:"flex max-w-[560px] flex-col gap-3",children:[t("p",{className:"font-serif text-[19px] italic leading-[1.6] text-fg-dim",children:I(e)}),c,t(J,{account:p})]});return l||q(f,r)?t(_,{ownerId:d,ownerType:"Form",Template:x,message:v(null),children:v}):m("form",{className:"flex max-w-[720px] flex-col gap-5",style:i?.style,onSubmit:C,children:[e.fields.map(c=>t(Y,{field:c,value:h(c.key),onChange:z=>g(c.key,z),cornersClass:i?.className},c.key)),t(j,{value:b,onChange:N}),y&&t("p",{role:"alert",className:"font-mono text-[12px] uppercase tracking-[0.18em] text-alert",children:y}),t("button",{type:r?"button":"submit",disabled:s,className:`cursor-pointer self-start bg-btn px-8 py-4 font-mono text-[14px] uppercase tracking-[0.32em] text-btn-ink transition-colors hover:bg-fg hover:text-bg disabled:cursor-wait disabled:opacity-60${i?.className??""}`,children:s?"Sending…":T}),e.consentText?.trim()&&t("span",{className:"font-mono text-[12px] uppercase tracking-[0.18em] text-fg-dim/70",children:e.consentText}),(o??"").trim()&&t("span",{className:"font-mono text-[12px] uppercase tracking-[0.18em] text-fg-dim/70",children:o})]})}export{J as AccountOutcome,K as FormBody,G as default};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
"use client";import{jsx as t,jsxs as
|
|
2
|
-
`),b=f(()=>
|
|
3
|
-
`):[]:c?.blockIds,[
|
|
1
|
+
"use client";import{jsx as t,jsxs as ae}from"react/jsx-runtime";import{useCallback as E,useMemo as f,useState as R}from"react";import{usePathname as ie}from"next/navigation";import{containerGapProps as de}from"efficient-web-builder/format/lib/content/container-gap";import ce from"efficient-web-builder/render/components/Btn";import me,{GALLERY_GRID_ATTR as pe,GalleryLinksContext as fe,GalleryTilesContext as ge}from"./GalleryItem.js";import{useShopperGallery as ue}from"./catalog/ShopperScope.js";import{galleryShownIds as ye,galleryToolbarIdle as he,WALL_PLACED_CELL as we,WALL_PLACED_CSS as Se,wallSpanAt as Le}from"../lib/sections/gallery-toolbar.js";import{useSiteSells as xe}from"./SiteRecordContext.js";import{SharedPartKinds as ve}from"efficient-web-builder/render/components/PublishedPartStylesContext";import{renderHeadline as Ne}from"efficient-web-builder/render/components/goldPhrases";import Ce from"efficient-web-builder/render/components/SectionHeader";import{FRAME_120 as Ge,framedBandPad as _e,headIsEmpty as Pe,withBandClasses as ke}from"../lib/sections/band-padding.js";import{galleryFrame as be,galleryTemplate as Ae}from"../lib/sections/gallery-frame.js";import{SITE_COLUMN as Ie,withSideOnce as Oe}from"efficient-web-builder/format/lib/content/page-width";import{resolveGridColumns as Te,resolveGridMobileColumns as Ee}from"efficient-web-builder/format/lib/content/grid-span";import{galleryLayoutClass as Re,galleryLayoutCss as Me,resolveGalleryLayout as je}from"efficient-web-builder/format/lib/content/gallery-layout";import{HideTaker as Be}from"efficient-web-builder/render/components/ViewHideRoot";import{useSideSpaceOnce as $e}from"efficient-web-builder/render/components/SideSpaceOnce";function De({items:c,template:M,nodeId:j,sourced:a,num:v,title:h,linkText:N,linkHref:B,galleryHref:g="/gallery",submitHref:$="/contact",previewHover:D,display:z,displayPhone:F,styleOwner:W,layout:K,layoutPhone:U,columns:u,columnsMobile:V,gap:Y,gapPhone:q,omitHead:w=!1,pads:H,editing:C=!1}){const J=$e(),Q=ie(),X=xe(),Z=g!==Q&&(X||g!=="/gallery"),S={layout:K,layoutPhone:U},m=je(S),ee=!m&&u!=null&&u!=="",i=de("GalleryB",Y,"both",q),G=m?{className:`sf-card-grid sf-gallery-zone ${Re(S)} grid${i.className}`,style:i.style}:ee?{className:`sf-card-grid sf-grid-zone grid${i.className}`,style:{...i.style,"--sf-grid-cols":String(Te(u)),"--sf-grid-cols-phone":String(Ee(V,u))}}:{className:`sf-card-grid grid grid-cols-4${i.className} max-[1500px]:grid-cols-3 max-view-wide:grid-cols-1`,style:i.style},_=N?{text:N,href:B||"#"}:void 0,le=h?Ne(h,!1):void 0,[P,se]=R({}),k=E((e,s)=>{se(l=>{const o=l[e.id];if(s){if(!o)return l;const{[e.id]:ze,...oe}=l;return oe}return o&&o.tag===e.tag&&o.name===e.name?l:{...l,[e.id]:e}})},[]),y=a?.map(e=>e.tile.id).join(`
|
|
2
|
+
`),b=f(()=>y!==void 0?y?y.split(`
|
|
3
|
+
`):[]:c?.blockIds,[y,c?.blockIds]),d=f(()=>(b??[]).map(e=>P[e]).filter(e=>!!e),[b,P]),{ref:te,toolbar:p}=ue(d),A=p!==null&&!he(p,d),n=f(()=>A&&p?ye(d,p):null,[A,p,d]),r=f(()=>n??d.map(e=>e.id),[n,d]),[I,ne]=R(null),O=E((e,s)=>{const l=r.indexOf(e);l<0||r.length<2||ne({id:r[(l+s+r.length)%r.length],at:s>0?"first":"last"})},[r]),re=f(()=>{const e=new Map((n??[]).map((s,l)=>[s,l]));return{report:k,positionOf:s=>{const l=n?e.get(s):void 0;return l===void 0?null:{index:l+1,total:n.length}},walkCount:r.length,walk:O,opening:I}},[k,n,r.length,O,I]),L=n?e=>{const s=n.indexOf(e);if(s<0)return{style:{display:"none"}};if(!m)return{style:{order:s}};const l=Le(m,s,n.length);return{className:we,style:{order:s,"--sf-wall-c":l.col,"--sf-wall-r":l.row,"--sf-wall-cp":l.colPhone,"--sf-wall-rp":l.rowPhone}}}:void 0,x=_e(H,Ge,{noTop:w,nonNegative:!0}),T=Ae(M,!a);return t(Be,{as:"section",ref:te,...x.attrs,className:ke(be(w,!!T),x),style:x.style,children:ae("div",{className:Oe(Ie,J),children:[w||!C&&Pe(v,h,_?.text)?null:t(Ce,{num:v,title:le,link:_}),m&&t("style",{dangerouslySetInnerHTML:{__html:Me(S)+(n?Se:"")}}),(c||a)&&t(fe.Provider,{value:{galleryHref:g,submitHref:$,previewHover:D,display:z,displayPhone:F,styleOwner:W,wordsAtRest:!!a,ownerId:j,Template:T},children:t(ge.Provider,{value:re,children:t(ve,{children:t("div",{[pe]:"",style:{display:"contents"},children:a?t("div",{...G,children:a.map(({tile:e,...s})=>{const l=t(me,{...s,tile:e,editing:C},e.id),o=L?.(e.id);return o?t("div",{className:o.className,style:o.style,children:l},e.id):l})}):c?t(c,{...G,minEmptyHeight:320,...L?{cell:L}:{}}):null})})})}),Z&&t("div",{className:"mt-12 flex flex-col items-center gap-3",children:t(ce,{href:g,variant:"ghost",children:"See Gallery"})})]})})}export{De as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as r,jsxs as n,Fragment as x}from"react/jsx-runtime";import{createContext as V,useCallback as
|
|
1
|
+
"use client";import{jsx as r,jsxs as n,Fragment as x}from"react/jsx-runtime";import{createContext as V,useCallback as ae,useContext as X,useEffect as q,useRef as se,useState as I}from"react";import P from"next/link";import{slugify as ie}from"efficient-shell/format";import{CardTemplateRows as ce}from"efficient-web-builder/render/components/CardRowContext";import{BOX_HOLDS_NO_GUTTER_CLASS as pe,SIDE_ONCE_HOLDS_CLASS as de}from"efficient-web-builder/format/lib/content/page-width";import me,{galleryTileNumber as fe}from"./GalleryCard.js";import he,{LightboxClose as xe,LIGHTBOX_CLOSE_TINT as ue}from"./Lightbox.js";import{useSiteSells as ge}from"./SiteRecordContext.js";import{renderGold as f,renderHeadline as Z}from"efficient-web-builder/render/components/goldPhrases";import{sizedImage as be}from"efficient-web-builder/format/lib/sized-image";import{useBrowserLayoutEffect as ve}from"efficient-shell/hooks";import{HideTaker as J}from"efficient-web-builder/render/components/ViewHideRoot";import{useSideSpaceOnce as we}from"efficient-web-builder/render/components/SideSpaceOnce";const ye="(max-width: 1100px) 100vw, min(59vw, 1050px)",ke=V({}),Ue=[{id:"tag",label:"Tag"},{id:"eyebrow",label:"Eyebrow"},{id:"title",label:"Title"},{id:"meta",label:"Meta"},{id:"number",label:"Card number"}],Ne=V(null),Se="data-gallery-grid",z="data-gallery-tile";function Le(t,o){const[a,i]=I(null);return q(()=>{const c=t.current,s=c?.closest(`[${Se}]`);if(!c||!s)return;const w=()=>{const k=Array.from(s.querySelectorAll(`[${z}]`)),N=k.indexOf(c),u=N>=0?{index:N+1,total:k.length}:null;i(g=>g?.index===u?.index&&g?.total===u?.total?g:u)};if(w(),!o)return;const y=new MutationObserver(w);return y.observe(s,{childList:!0,subtree:!0}),()=>y.disconnect()},[t,o]),a}const Ve={process:"Category",eyebrow:"Subtitle",name:"Item name",meta:"Detail"},_e=()=>({image:"",href:"#",process:"",eyebrow:"",name:"",meta:""}),Xe=Array.from({length:6},_e);function Ce(t){const o=(t.photos??[]).map(s=>s?.src).filter(s=>!!s),a=t.image||o[0]||"",i=[a,...o].filter(s=>!!s),c=ie(t.name)||"gallery-item";return{car:t.eyebrow??"",wheel:t.name??"",process:t.process??"",finish:t.meta??"",imageLabel:`${c}.jpg`,detailLabel:`${c}-detail.jpg`,imageSrc:a||void 0,detailSrc:o[0]||a||void 0,photos:i,href:t.href}}function Te({editing:t=!1,previewHover:o,ratio:a,captionPlace:i,tile:c,...s}){const w=we(),{galleryHref:y="/gallery",submitHref:k="/contact",previewHover:N,display:u,displayPhone:g,styleOwner:ee,photosOnly:te=!1,wordsAtRest:re=!1,Template:A,ownerId:oe}=X(ke),e=Ce(s),b=ge()&&!te,H=!b&&!Oe(e),p=e.photos??(e.imageSrc?[e.imageSrc]:[]),$=se(null),j=ae(l=>{$.current=l},[]),ne=Le($,t),h=X(Ne),S=h?.report,d=c?.id,G=c?.tag??"",R=c?.name??"";ve(()=>{if(!S||!d)return;const l={id:d,tag:G,name:R};return S(l),()=>S(l,!0)},[S,d,G,R]);const v=(d?h?.positionOf(d):null)??ne,B=t&&(!!o||!!N),[le,m]=I(!1),[L,C]=I(0),M=!!d&&!!h&&h.walkCount>1,D=l=>{const E=L+l;if(M&&(E<0||E>=p.length)){m(!1),h.walk(d,l);return}C((E+p.length)%p.length)},Y=()=>D(-1),W=()=>D(1),T=p.length>1||M,_=h?.opening;q(()=>{!_||_.id!==d||(C(_.at==="last"?Math.max(0,p.length-1):0),m(!0))},[_,d]);const O=p[L]??e.imageSrc??"",F=p.slice(1),U=A?r("div",{className:`block w-full min-w-0 ${pe}${w?` ${de}`:""}`,children:r(ce,{ownerId:oe??"GalleryB",ownerType:"GalleryB",Template:A,rows:[{key:d??e.imageSrc??"tile",image:e.imageSrc??"",tag:e.process,number:v?fe(v.index,v.total):"",eyebrow:e.car,name:e.wheel,meta:e.finish,href:e.href??""}],items:[{hoverMedia:F.length?{photos:[{finish:"",items:F.map(l=>({url:l,kind:"image"}))}]}:null}],previewHover:B,fallback:null,children:l=>l})}):r(me,{build:e,forceHover:B,alwaysShowOverlay:re,index:v?.index,total:v?.total,ratio:a,captionPlace:i,display:u,displayPhone:g,styleOwner:ee,editing:t});return n(x,{children:[t?r(J,{as:"div",ref:j,[z]:"",className:"block w-full text-left",children:U}):r(J,{as:"button",ref:j,[z]:"",type:"button","aria-label":b?`Open ${e.car||"build"} on ${e.wheel||"wheel"}`:Q(e),onClick:()=>{C(0),m(!0)},className:"block w-full cursor-pointer text-left focus:outline-none focus-visible:outline focus-visible:outline-2 focus-visible:outline-accent focus-visible:outline-offset-2",children:U}),r(he,{open:le,onClose:()=>m(!1),label:b?`${e.car} on ${e.wheel}`:Q(e),onPrev:T?Y:void 0,onNext:T?W:void 0,className:"flex items-center justify-center p-6 max-[700px]:p-3",children:n("div",{onClick:l=>l.stopPropagation(),className:`relative grid w-[min(1800px,100%)] max-h-[calc(100vh-48px)] ${H?"grid-cols-1":"grid-cols-[1.4fr_1fr]"} overflow-hidden border border-line bg-bg max-view-desktop:grid-cols-1 max-view-desktop:overflow-auto`,style:{boxShadow:"0 60px 120px -20px color-mix(in srgb, var(--sf-shadow-color, #141416) 70%, transparent)"},children:[r(xe,{label:"Close popup",className:"absolute right-[24px] top-[24px] z-[5] flex h-[56px] w-[56px] items-center justify-center border border-line font-mono text-[length:var(--size-label,21px)] text-fg-dim transition-colors hover:border-accent hover:text-fg",style:{background:ue},children:"✕"}),n("div",{className:"relative flex min-h-[690px] items-center justify-center overflow-hidden bg-surface-2 max-view-desktop:min-h-[450px]",children:[O&&r("img",{...be(O,{fallbackWidth:1280}),sizes:ye,alt:`${(b?e.car:e.wheel||e.car)||"Photo"} — ${L+1} of ${p.length}`,className:"block h-full max-h-[88vh] w-full object-cover"},O),T&&n(x,{children:[r("button",{type:"button","aria-label":"Previous photo",onClick:Y,className:"absolute left-4 top-1/2 flex h-16 w-16 -translate-y-1/2 cursor-pointer items-center justify-center border border-fg-dim/40 bg-overlay-scrim/40 font-mono text-[length:var(--size-label,24px)] text-fg-dim transition-colors hover:border-accent hover:text-accent",children:"◁"}),r("button",{type:"button","aria-label":"Next photo",onClick:W,className:"absolute right-4 top-1/2 flex h-16 w-16 -translate-y-1/2 cursor-pointer items-center justify-center border border-fg-dim/40 bg-overlay-scrim/40 font-mono text-[length:var(--size-label,24px)] text-fg-dim transition-colors hover:border-accent hover:text-accent",children:"▷"}),p.length>1&&n("span",{className:"absolute bottom-4 left-1/2 -translate-x-1/2 border border-fg-dim/30 bg-overlay-scrim/50 px-4 py-1.5 font-mono text-[length:var(--size-label,15px)] uppercase tracking-[0.22em] text-fg-dim backdrop-blur-[4px]",children:[L+1," / ",p.length]})]})]}),b?n("div",{className:"flex flex-col gap-[30px] px-[60px] py-[72px] max-view-desktop:px-9 max-view-desktop:py-[54px]",children:[e.process&&r("span",{className:"font-mono text-[length:var(--size-label,15px)] uppercase tracking-[0.3em] text-accent",children:f(e.process)}),e.wheel&&r("h2",{className:"font-heading2 text-[length:min(var(--size-headingMedium,clamp(42px,4.5vw,60px)),var(--sf-heading-max,9999px))] font-medium uppercase leading-[0.95] tracking-[-0.025em]",children:Z(e.wheel,!1)}),e.car&&n("div",{className:"font-heading3 text-[length:var(--size-headingSmall,27px)] leading-[1.4] text-fg",children:["on ",r("em",{className:"font-serif font-normal italic text-accent tracking-[-0.01em]",children:f(e.car,!0)})]}),n("dl",{className:"mt-3 grid grid-cols-[auto_1fr] gap-x-7 gap-y-[18px] border-y border-line py-[30px] font-mono text-[length:var(--size-label,15px)] uppercase tracking-[0.22em]",children:[e.wheel&&n(x,{children:[r("dt",{className:"text-fg-dim",children:"Wheel"}),r("dd",{className:"text-fg",children:f(e.wheel)})]}),e.process&&n(x,{children:[r("dt",{className:"text-fg-dim",children:"Process"}),r("dd",{className:"text-fg",children:f(e.process)})]}),e.finish&&n(x,{children:[r("dt",{className:"text-fg-dim",children:"Finish"}),r("dd",{className:"text-fg",children:f(e.finish)})]}),e.car&&n(x,{children:[r("dt",{className:"text-fg-dim",children:"Vehicle"}),r("dd",{className:"text-fg",children:f(e.car)})]})]}),n("div",{className:"mt-auto flex flex-col gap-3.5 pt-6",children:[n(P,{href:e.href||"/wheels",onClick:()=>m(!1),className:"group flex items-center justify-between gap-6 border border-btn bg-btn px-9 py-6 font-mono text-[length:var(--size-label,16px)] uppercase tracking-[0.3em] text-btn-ink transition-colors hover:border-fg hover:bg-fg",children:[r("span",{children:"View product"}),r("span",{className:"transition-transform group-hover:translate-x-[6px]",children:"→"})]}),n(P,{href:y,onClick:()=>m(!1),className:"flex items-center justify-between gap-6 border border-line px-9 py-6 font-mono text-[length:var(--size-label,16px)] uppercase tracking-[0.3em] text-fg transition-colors hover:border-accent hover:text-accent",children:[r("span",{children:"See more builds"}),r("span",{children:"→"})]}),n(P,{href:k,onClick:()=>m(!1),className:"flex items-center justify-between gap-6 border border-line px-9 py-6 font-mono text-[length:var(--size-label,16px)] uppercase tracking-[0.3em] text-fg transition-colors hover:border-accent hover:text-accent",children:[r("span",{children:"Submit your build"}),r("span",{children:"→"})]})]})]}):!H&&r(Ee,{build:e})]})})]})}function K(t){return[t.process,t.car,t.finish].filter((o,a,i)=>!!o&&o!==t.wheel&&i.indexOf(o)===a)}function Oe(t){return!!t.wheel||K(t).length>0}function Q(t){const o=t.wheel||t.car;return o?`Open photo of ${o}`:"Open photo"}function Ee({build:t}){const o=t.wheel,a=K(t);return n("div",{className:"flex flex-col gap-[24px] px-[60px] py-[72px] max-view-desktop:px-9 max-view-desktop:py-[54px]",children:[o&&r("h2",{className:"font-heading2 text-[length:min(var(--size-headingMedium,clamp(42px,4.5vw,60px)),var(--sf-heading-max,9999px))] font-medium uppercase leading-[0.95] tracking-[-0.025em]",children:Z(o,!1)}),a.map(i=>r("p",{className:"text-[length:var(--size-body,18px)] leading-[1.5] text-fg",children:f(i)},i))]})}export{Se as GALLERY_GRID_ATTR,Ve as GALLERY_ITEM_HINTS,Xe as GALLERY_ITEM_SEEDS,z as GALLERY_TILE_ATTR,Ue as GALLERY_TILE_PARTS,ke as GalleryLinksContext,Ne as GalleryTilesContext,Te as default};
|