@riverbankcms/sdk 0.159.0 → 0.161.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -4
- package/dist/_dts/{BlocksIslandsHydrator-Cj1i1Yhh.d.ts → BlocksIslandsHydrator-Bx4kLiTA.d.ts} +1 -1
- package/dist/_dts/{Page-Cgzbv22M.d.ts → Page-Dm7_P13o.d.ts} +217 -8
- package/dist/_dts/{SdkPreviewMode-BC_FGc6b.d.ts → SdkPreviewMode-D7HdWWwF.d.ts} +55 -127
- package/dist/_dts/{auth-contract-FPg0-2MC.d.ts → auth-contract-CgJ5nMaH.d.ts} +2 -0
- package/dist/_dts/{client-BOK-YHVJ.d.ts → client-Ep0jI9eE.d.ts} +1 -1
- package/dist/_dts/{content-types-CsrYWxq_.d.ts → content-types-BgAzCrBc.d.ts} +18 -18
- package/dist/_dts/{contracts-ClgMD-9g.d.ts → contracts-DUiOnj9e.d.ts} +10 -6
- package/dist/_dts/{footerPageOutline-C_IDuELl.d.ts → footerPageOutline-B-uXamTG.d.ts} +6 -6
- package/dist/_dts/{generatePageMetadata-B7bhYSWx.d.ts → generatePageMetadata-BDkZYEcS.d.ts} +2 -2
- package/dist/_dts/index-BQDBQvdu.d.ts +13 -0
- package/dist/_dts/index-BVkP8f70.d.ts +66 -0
- package/dist/_dts/{index-Dt3XSGzY.d.ts → index-CF6Cjs7b.d.ts} +2 -2
- package/dist/_dts/{index-Ci1PEk82.d.ts → index-CSsfq6KG.d.ts} +3 -17
- package/dist/_dts/{index-BZ4fb2zz.d.ts → index-D_8uz4OP.d.ts} +3 -3
- package/dist/_dts/{index-CcaG6O13.d.ts → index-DvKQA6AZ.d.ts} +4 -4
- package/dist/_dts/{index-DMOfW1A7.d.ts → index-KPrWM0KF.d.ts} +2 -2
- package/dist/_dts/{index-DzUdUaJ-.d.ts → index-ylivB7Jj.d.ts} +2 -2
- package/dist/_dts/{loadContent-C1JI2pG0.d.ts → loadContent-DTjKOO-T.d.ts} +19 -10
- package/dist/_dts/{resolvePageContent-BtRUtrJa.d.ts → resolvePageContent-C1vA5c5w.d.ts} +2 -2
- package/dist/_dts/{constants-DkcKHMX-.d.ts → runtime-BY8DQBbT.d.ts} +10 -16
- package/dist/_dts/{hosted-booking-appearance-ChGCQYdQ.d.ts → schema-BHu0PYWl.d.ts} +25911 -23567
- package/dist/_dts/sdk/src/bookings/index.d.ts +2 -2
- package/dist/_dts/sdk/src/client/types.d.ts +2 -2
- package/dist/_dts/sdk/src/client.d.ts +13 -7
- package/dist/_dts/sdk/src/config/index.d.ts +6 -6
- package/dist/_dts/sdk/src/config/template-validation.d.ts +1 -1
- package/dist/_dts/sdk/src/config/validation.d.ts +1 -1
- package/dist/_dts/sdk/src/index.d.ts +8 -8
- package/dist/_dts/sdk/src/manifest/index.d.ts +6 -6
- package/dist/_dts/sdk/src/metadata/index.d.ts +1 -1
- package/dist/_dts/sdk/src/navigation/index.d.ts +2 -2
- package/dist/_dts/sdk/src/next/index.d.ts +7 -7
- package/dist/_dts/sdk/src/next/middleware.d.ts +2 -2
- package/dist/_dts/sdk/src/page-converter/index.d.ts +10 -28
- package/dist/_dts/sdk/src/portal/client.d.ts +1 -1
- package/dist/_dts/sdk/src/prebuild/index.d.ts +1 -1
- package/dist/_dts/sdk/src/preview-next/before-render.d.ts +2 -2
- package/dist/_dts/sdk/src/preview-next/client/index.d.ts +2 -2
- package/dist/_dts/sdk/src/preview-next/client/runtime.d.ts +1 -1
- package/dist/_dts/sdk/src/preview-next/keep-alive.d.ts +1 -1
- package/dist/_dts/sdk/src/preview-next/session.d.ts +2 -2
- package/dist/_dts/sdk/src/rendering/client.d.ts +2 -2
- package/dist/_dts/sdk/src/rendering/index.d.ts +6 -6
- package/dist/_dts/sdk/src/rendering/islands/client.d.ts +1 -1
- package/dist/_dts/sdk/src/rendering/server.d.ts +2 -2
- package/dist/_dts/sdk/src/routing/index.d.ts +5 -5
- package/dist/_dts/sdk/src/server.d.ts +5 -5
- package/dist/_dts/sdk/src/theme/index.d.ts +1 -1
- package/dist/_dts/{session-Ba2CsnK5.d.ts → session-C_gtSFyZ.d.ts} +2 -1
- package/dist/_dts/{navigation-BnV_hOZy.d.ts → types-BR1Yboa9.d.ts} +15530 -16017
- package/dist/_dts/{types-CMFIZGUI.d.ts → types-CJXTCF_F.d.ts} +10 -13
- package/dist/_dts/{types-CI9dYWJ8.d.ts → types-D02ngcUH.d.ts} +4 -2
- package/dist/_dts/{types--oWXIfyz.d.ts → types-ZGUiHpDE.d.ts} +7 -7
- package/dist/_dts/{validation-Ct-GL0eA.d.ts → validation-BaV565gb.d.ts} +4 -4
- package/dist/client/{BlocksIslandsHydrator-DKS8Ba30.mjs → BlocksIslandsHydrator-DTExCJsb.mjs} +22 -21
- package/dist/client/{BookingMailingListNote-Cg9v6d7Y.mjs → BookingMailingListNote-BDpxmn1p.mjs} +2 -2
- package/dist/client/{CalendarNavigationChevron-BoVCTUXy.mjs → CalendarNavigationChevron-PeCiL82X.mjs} +6 -6
- package/dist/client/{CheckboxChoice-BF9eCNno.mjs → CheckboxChoice-DWexRLf6.mjs} +1 -1
- package/dist/client/{DemoBookingPortalAccess-BxRVCJG3.mjs → DemoBookingPortalAccess-3zmIqakW.mjs} +6 -6
- package/dist/client/{DemoPortalSignInLink-DHxYgkT6.mjs → DemoPortalSignInLink-GHi-8BW5.mjs} +1 -1
- package/dist/client/{EventCalendar.client-BI-kvwXf.mjs → EventCalendar.client-BxQLY5cX.mjs} +10 -9
- package/dist/client/{EventCombined.client-DIvnoN5l.mjs → EventCombined.client-B5bmQ03b.mjs} +8 -8
- package/dist/client/{EventEmbeddedCheckoutStep-B3XUyNY9.mjs → EventEmbeddedCheckoutStep-CgMZ9TeU.mjs} +1 -1
- package/dist/client/{EventItem-BRMtEaa6.mjs → EventItem-BEx-qiDE.mjs} +11 -6
- package/dist/client/{EventListWeekNavigation-B8DzAUDa.mjs → EventListWeekNavigation-CyH5tA6Y.mjs} +1 -1
- package/dist/client/{EventListing.client-Bo4qzQi0.mjs → EventListing.client-D3uySdGP.mjs} +3 -3
- package/dist/client/{EventListing.view-D2vemnCx.mjs → EventListing.view-9RFrBejr.mjs} +31 -15
- package/dist/client/{EventRegistrationPayment-e5XWtygG.mjs → EventRegistrationPayment-CG2tQx8K.mjs} +92 -99
- package/dist/client/LocationMapActions-Wsr83Q7q.mjs +268 -0
- package/dist/client/{Page-Dqpv9Ggi.mjs → Page-Bf2nPACI.mjs} +2673 -2290
- package/dist/client/{StepIndicator-BrvKa_8H.mjs → StepIndicator-CZweb1vs.mjs} +3 -3
- package/dist/client/{TabBarFragment-DvzIV75f.mjs → TabBarFragment-Bkgz67gt.mjs} +1 -1
- package/dist/client/ThemedButton-CnyL3s1A.mjs +2243 -0
- package/dist/client/{accordion-ByLpb4Dz.mjs → accordion-TcimLLRQ.mjs} +1 -1
- package/dist/client/{booking-form.client-BLndwxpx.mjs → booking-form.client-q-RpJ4aF.mjs} +13 -13
- package/dist/client/{bookingForm-CTxTEgHX.mjs → bookingForm-DjGfk3Wj.mjs} +4 -4
- package/dist/client/bookings.mjs +6 -6
- package/dist/client/{carousel-C8ef0vnT.mjs → carousel-CGAk6j0m.mjs} +2 -2
- package/dist/client/{carousel.client-BJGoJVtg.mjs → carousel.client-ArlGmYWV.mjs} +1 -1
- package/dist/client/{cart-BpH6jkUO.mjs → cart-D_h3rAZ2.mjs} +3 -3
- package/dist/client/{cart.client-DV78Td13.mjs → cart.client-DHOxZbJ7.mjs} +1 -1
- package/dist/client/{checkout-BJVb2RpL.mjs → checkout-tC-3CzuM.mjs} +3 -3
- package/dist/client/{checkout.client-CqGPXPSm.mjs → checkout.client-DsBb2Pkm.mjs} +1 -1
- package/dist/client/client.mjs +28 -15
- package/dist/client/{context-BRgBWthI.mjs → context-9ZfMb6GA.mjs} +1 -1
- package/dist/client/{cta-D8ucLsvX.mjs → cta-D-ZqL7-e.mjs} +2 -1
- package/dist/client/{dateFormatting-LeKNQ-iX.mjs → dateFormatting-BCwLqYpW.mjs} +1 -1
- package/dist/client/{demoPortalMagicLink-CjstiFPh.mjs → demoPortalMagicLink-BxkSS9fx.mjs} +1 -1
- package/dist/client/{enhanceHeaderSection-BaQJyI9x.mjs → enhanceHeaderSection-xg6to91E.mjs} +3 -3
- package/dist/client/{event-details.client-CYNQYOsP.mjs → event-details.client-C670TgRd.mjs} +2 -17
- package/dist/client/{event-registration.client-DDqSpN36.mjs → event-registration.client-C6GApWTB.mjs} +17 -17
- package/dist/client/{eventCalendar-3vQtuC9X.mjs → eventCalendar-CWc0dg9i.mjs} +4 -4
- package/dist/client/{eventCombined-CEJFMjqV.mjs → eventCombined-D4DbOrvQ.mjs} +4 -4
- package/dist/client/{eventDetails-nGh47jef.mjs → eventDetails-C2DfmbC0.mjs} +2 -2
- package/dist/client/{eventListing-BL3Ptb83.mjs → eventListing-C_yXmHyz.mjs} +4 -4
- package/dist/client/{eventRegistration-DDSO6KB2.mjs → eventRegistration-DJuaCB-O.mjs} +4 -4
- package/dist/client/{form-DjNLfy2Z.mjs → form-QZhtdFHA.mjs} +3 -3
- package/dist/client/{form.client-Cj0By6ot.mjs → form.client-CgvPACwG.mjs} +5 -5
- package/dist/client/{form.parts-DyA9C5Hy.mjs → form.parts-2uI0-5N-.mjs} +3 -3
- package/dist/client/{formatDate-CZo0MPTA.mjs → formatDate-Danr0Nk4.mjs} +1 -1
- package/dist/client/gifting/client.mjs +3 -3
- package/dist/client/{headerSection-JjSq6Mzp.mjs → headerSection-DJdlLdvZ.mjs} +2 -2
- package/dist/client/{mediaAssets-BOj-Co0B.mjs → mediaAssets-BvjcAZpS.mjs} +1 -1
- package/dist/client/mediaContext-jPeJ2PmJ.mjs +10801 -0
- package/dist/client/{newsletter-form.client-C2EgEBP1.mjs → newsletter-form.client-Cbepz2KU.mjs} +8 -8
- package/dist/client/{newsletter-form.parts-CaldoFmi.mjs → newsletter-form.parts-DN8oMCQ0.mjs} +2 -2
- package/dist/client/{newsletterForm-hm7L17LM.mjs → newsletterForm-wjLtW-wq.mjs} +3 -3
- package/dist/client/{noop-M8FTSgm2.mjs → noop-B7H6gCbj.mjs} +306 -5
- package/dist/client/portal/client.mjs +4560 -115
- package/dist/client/{product-detail.client-y86uwzEI.mjs → product-detail.client-CYTR165c.mjs} +1 -1
- package/dist/client/{product-list.client-_JBndYZT.mjs → product-list.client-B4vTvag8.mjs} +1 -1
- package/dist/client/{productDetail-D-9fb2cW.mjs → productDetail-k8LEMSWn.mjs} +3 -3
- package/dist/client/{productList-BSRlnwBW.mjs → productList-DEo8Bqoe.mjs} +3 -3
- package/dist/client/{propsDecoder-DhbGL302.mjs → propsDecoder-G0j0HXBO.mjs} +3 -28
- package/dist/client/{registry.server-BaX0hxf5.mjs → registry.server-BTmSXE3D.mjs} +1154 -997
- package/dist/client/rendering/client.mjs +28 -28
- package/dist/client/rendering/islands.mjs +1 -1
- package/dist/client/rendering.mjs +57 -32
- package/dist/client/{richText-coerce-Cny2Ukb6.mjs → richText-coerce-B19taoH6.mjs} +1 -1
- package/dist/client/{routeIslandApiConfig-96er7pIx.mjs → routeIslandApiConfig-Chu5BHra.mjs} +1 -1
- package/dist/client/{ThemedButton-DVBC_pS9.mjs → schema-C-m8XHuW.mjs} +1123 -2362
- package/dist/client/{shop-CnIJfdZA.mjs → shop-RGWa43H7.mjs} +3 -3
- package/dist/client/{shop-commerce-CsLwzq5O.mjs → shop-commerce-TJYCBO_H.mjs} +12 -12
- package/dist/client/{shop-commerce-store--O8GRBwr.mjs → shop-commerce-store-CjCcUB_o.mjs} +1 -1
- package/dist/client/{shop.client-BcaJ-acA.mjs → shop.client-tsKfZw1W.mjs} +15 -15
- package/dist/client/{shop.interactive-BxL_bshW.mjs → shop.interactive-CVqLAU53.mjs} +370 -189
- package/dist/client/{shopShared-VZjPOfCX.mjs → shopShared-C3lHMz_R.mjs} +2 -2
- package/dist/client/{src-7cXhT0G_.mjs → src-VIsPY-kw.mjs} +6 -1
- package/dist/client/timetableModel-V2ifvGGy.mjs +1100 -0
- package/dist/client/{useAvailableSlots-pTXuY3jV.mjs → useAvailableSlots-D1X69-pN.mjs} +4 -4
- package/dist/client/{useBookingNowIso-D14J-EhJ.mjs → useBookingNowIso-Ch30jino.mjs} +1 -1
- package/dist/client/{useDiscountApply-o5sIVZ2u.mjs → useDiscountApply-Bwzr1RjV.mjs} +3 -3
- package/dist/client/{useDiscountCodeUi-DJhFP_rg.mjs → useDiscountCodeUi-BimJbFC7.mjs} +1 -1
- package/dist/client/{useEventPagination-DMmNf2FP.mjs → useEventPagination-CLAS0upd.mjs} +12 -24
- package/dist/client/uuid-BETKW8rS.mjs +12 -0
- package/dist/client/{view-BgPql2yH2.mjs → view-BUh4LnLS.mjs} +4 -4
- package/dist/client/{view-D1R3Lk05.mjs → view-Dj_FZHmg.mjs} +19 -15
- package/dist/client/wizardSteps-BkZc-hKH.mjs +6598 -0
- package/dist/preview-next/before-render.mjs +5 -4
- package/dist/preview-next/chrome.css +2 -0
- package/dist/preview-next/client/{EventEmbeddedCheckoutStep-BFlBqSu4.mjs → EventEmbeddedCheckoutStep-CwerMfzn.mjs} +2 -1
- package/dist/preview-next/client/LocationPickerEnvironment-QtSG2Bl-.mjs +138 -0
- package/dist/preview-next/client/MapLibreEditMap-B-rohNcG.mjs +488 -0
- package/dist/preview-next/client/{PreviewEditorSidebar-DADCj_ET.mjs → PreviewEditorSidebar-Dvq-RW9-.mjs} +1328 -171
- package/dist/preview-next/client/{PreviewEditorUI-La40Dmmh.mjs → PreviewEditorUI-BdFjS39R.mjs} +53 -79
- package/dist/preview-next/client/{SdkPreviewModeRuntime-406Hw9zY.mjs → SdkPreviewModeRuntime-BEfHln1E.mjs} +1249 -2551
- package/dist/preview-next/client/{SdkPreviewModeRuntime-CWN44I_B.mjs → SdkPreviewModeRuntime-CjkGh1IG.mjs} +1 -1
- package/dist/preview-next/client/{SiteChromeCustomizeContext-BdwEZoo9.mjs → SiteChromeCustomizeContext-CDbxk_qZ.mjs} +117481 -162497
- package/dist/preview-next/client/{ThemedButton-BEOPss9H.mjs → ThemedButton-b14Bv03E.mjs} +1253 -403
- package/dist/preview-next/client/lucide-react-CA9cpo0P.mjs +51984 -0
- package/dist/preview-next/client/maplibre-gl-DykfOYYn.mjs +34208 -0
- package/dist/preview-next/client/{previewChromeSurface-BVUKIYG0.mjs → previewChromeSurface-Dd1_mNIg.mjs} +3 -8
- package/dist/preview-next/client/result-BjJUoxUF.mjs +16 -0
- package/dist/preview-next/client/rolldown-runtime-CE6sIgz8.mjs +34 -0
- package/dist/preview-next/client/runtime.mjs +3 -3
- package/dist/preview-next/client/{sdk-runtime-Cy9AKPy5.mjs → sdk-runtime-B-CXyGVb.mjs} +1 -1
- package/dist/preview-next/client/siteStyleAccess-Kqk0j0dE.mjs +5812 -0
- package/dist/preview-next/client/{spinner-Bhpzz2vO.mjs → spinner-CGxS8Ns-.mjs} +2 -1
- package/dist/preview-next/{constants-D8Ya7bO4.mjs → constants-Bf-vqdKH.mjs} +2 -1
- package/dist/preview-next/editor-base.css +64 -2
- package/dist/preview-next/editor-chrome.css +85 -0
- package/dist/preview-next/keepAlive.mjs +2 -2
- package/dist/preview-next/middleware.mjs +7 -3
- package/dist/preview-next/{route-contract-DM22uOXM.mjs → route-contract-hLg-yjQN.mjs} +190 -116
- package/dist/preview-next/{session-BgkrPqu0.mjs → session-P1R_ajT7.mjs} +12 -2
- package/dist/preview-next/session.mjs +1 -1
- package/dist/server/{Block.shared-DB6fb1pR.mjs → Block.shared-CeTd2saO.mjs} +6 -6
- package/dist/server/{bindings-z2daXp-2.mjs → bindings-C5YpKuKt.mjs} +3 -2
- package/dist/server/{client-Cv-osXoU.mjs → client-Cv26lZQ4.mjs} +14 -10
- package/dist/server/config-template-validation.mjs +50 -10
- package/dist/server/config-validation.mjs +1 -1
- package/dist/server/config.mjs +2 -2
- package/dist/server/{siteChromeOverlayClearance-BangtD8A.mjs → effectiveNavLinkStyle-CGvGr3yD.mjs} +572 -1078
- package/dist/server/index.mjs +3 -3
- package/dist/server/{loadContent-BNMDYCm8.mjs → loadContent-C8a0b-cC.mjs} +40 -21
- package/dist/server/loadPage--DXBwI8V.mjs +2 -0
- package/dist/server/{loadPage-CjA_F_AF.mjs → loadPage-BW7dklu3.mjs} +9 -5
- package/dist/server/manifest.mjs +1 -1
- package/dist/server/next.mjs +9 -9
- package/dist/server/{overrideResolution-CGodrtqi.mjs → overrideResolution-tIuqmJB3.mjs} +1 -1
- package/dist/server/{overrides-DxRC724a.mjs → overrides-D1fiPOKF.mjs} +1158 -754
- package/dist/server/page-converter.mjs +8 -10
- package/dist/server/{prebuild-C6bhjRKT.mjs → prebuild--fO0E2tr.mjs} +1 -1
- package/dist/server/prebuild.mjs +1 -1
- package/dist/server/{prefetchBlockData-DZ5Fq_-r.mjs → prefetchBlockData-CqJnokWJ.mjs} +968 -968
- package/dist/server/{publicProducts-C3meXS2o.mjs → publicProducts-CvvZ4JIe.mjs} +207 -132
- package/dist/server/{blocks-BaG8Qpaa.mjs → registry-BVfCqaCq.mjs} +2853 -2799
- package/dist/server/rendering/server.mjs +4 -4
- package/dist/server/rendering.mjs +8 -8
- package/dist/server/{resolveBlockData-CbGDakvp.mjs → resolveBlockData-DPNvhXEz.mjs} +6 -3
- package/dist/server/routing.mjs +1 -1
- package/dist/server/{schema-Bs735S27.mjs → schema-CD4peO7m.mjs} +2441 -1401
- package/dist/server/server.mjs +3 -3
- package/dist/server/site-styles-H-EvTJiW.mjs +787 -0
- package/dist/server/siteChromeOverlayClearance-DNC2k1U0.mjs +750 -0
- package/dist/server/{src-B935_bzN.mjs → src-ILxc6pid.mjs} +427 -190
- package/dist/server/theme-bridge.mjs +1 -1
- package/dist/server/theme.mjs +1 -1
- package/dist/server/{themeAdmission-DK2YBNqy.mjs → themeAdmission-BNHIXiUj.mjs} +117 -26
- package/dist/server/{three-pass-converter-CmmchOFC.mjs → three-pass-converter-Chnb1XD-.mjs} +2 -58
- package/dist/server/{validation-BtHE2S_D.mjs → validation-B1ieVemg.mjs} +22 -63
- package/dist/server/{version-CNCdL6id.mjs → version-BQK44wFg.mjs} +1 -1
- package/dist/styles/index.css +235 -0
- package/package.json +8 -3
- package/dist/_dts/index-CXsnaCGe.d.ts +0 -10
- package/dist/_dts/index-cnymEAZY.d.ts +0 -1
- package/dist/client/LeafletStaticMap-dlapZ6mi.mjs +0 -135
- package/dist/client/location-map.client-DRN1JePj.mjs +0 -28
- package/dist/client/location-map.view-CuCvQdvp.mjs +0 -282
- package/dist/client/locationMap-B9srHHzZ.mjs +0 -15
- package/dist/client/mediaContext-DThoeEBU.mjs +0 -136
- package/dist/client/renderableMediaAssetAdmission-DGjBr_e-.mjs +0 -152
- package/dist/client/timetableModel-D09jPdue.mjs +0 -480
- package/dist/client/wizardSteps-C0TsNqJc.mjs +0 -17049
- package/dist/preview-next/client/siteStyleAccess-CFMmoMZb.mjs +0 -1326
- package/dist/server/loadPage-jade28Xh.mjs +0 -2
- package/dist/server/media-CcHwZkdJ.mjs +0 -243
|
@@ -0,0 +1,1100 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { d as formatDateKey, f as getDayOfWeek, i as buildTimetableModel$1, v as isToday } from "./src-1PJxc8KO.mjs";
|
|
3
|
+
import { j as parseThemeButtonVariantId, jn as textColorStyle } from "./schema-C-m8XHuW.mjs";
|
|
4
|
+
import { C as clsx, i as ThemedButtonLink, n as ThemedAuthoredButton, r as ThemedButton } from "./ThemedButton-CnyL3s1A.mjs";
|
|
5
|
+
import { c as assertNever } from "./src-VIsPY-kw.mjs";
|
|
6
|
+
import { An as isEventFull, Kt as RichText, Mr as listItemPresentation, On as getEventAvailabilityStatus, Pr as listLookSlot, _n as formatEventTimeRange, bn as resolveEventTimeZone, cn as eventDateOptions, fn as formatEventClockLabel, vn as formatTime, wn as formatEventRemainingPlaces, xr as resolveDateRuntimeContext, yn as groupEventsByDate } from "./wizardSteps-BkZc-hKH.mjs";
|
|
7
|
+
import { At as toScheduledBookingDateTime, Tt as parseLocalScheduleTime, bt as formatBookingCompactEnglishTime, lt as formatDate, wt as parseBookingLocalDate } from "./noop-B7H6gCbj.mjs";
|
|
8
|
+
import { i as readableMapDrawing, n as AdmittedMapDrawingSvg, t as LocationMapActions } from "./LocationMapActions-Wsr83Q7q.mjs";
|
|
9
|
+
import { n as resolveEventLinkProps } from "./cta-D-ZqL7-e.mjs";
|
|
10
|
+
import { a as buildMonthDay, t as CalendarNavigationChevron } from "./CalendarNavigationChevron-PeCiL82X.mjs";
|
|
11
|
+
import { i as formatEventTeacherLine, r as EventItem } from "./EventItem-BEx-qiDE.mjs";
|
|
12
|
+
import { t as coerceRichTextDoc } from "./richText-coerce-B19taoH6.mjs";
|
|
13
|
+
import "react";
|
|
14
|
+
import { z } from "zod";
|
|
15
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
16
|
+
//#region ../core/src/opening-hours.ts
|
|
17
|
+
const openingHoursWeekdayLabels = {
|
|
18
|
+
monday: "Monday",
|
|
19
|
+
tuesday: "Tuesday",
|
|
20
|
+
wednesday: "Wednesday",
|
|
21
|
+
thursday: "Thursday",
|
|
22
|
+
friday: "Friday",
|
|
23
|
+
saturday: "Saturday",
|
|
24
|
+
sunday: "Sunday"
|
|
25
|
+
};
|
|
26
|
+
function formatOpeningHoursTime(value) {
|
|
27
|
+
const time = parseLocalScheduleTime(value);
|
|
28
|
+
return formatBookingCompactEnglishTime(toScheduledBookingDateTime({
|
|
29
|
+
startsAt: new Date(Date.UTC(2e3, 0, 1, time.hour, time.minute)).toISOString(),
|
|
30
|
+
timeZone: "UTC",
|
|
31
|
+
locale: "en-GB"
|
|
32
|
+
}));
|
|
33
|
+
}
|
|
34
|
+
function formatDayHours(day) {
|
|
35
|
+
return day.kind === "closed" ? "Closed" : day.intervals.map((interval) => `${formatOpeningHoursTime(interval.opensAt)} to ${formatOpeningHoursTime(interval.closesAt)}`).join(", ");
|
|
36
|
+
}
|
|
37
|
+
function weekdayRangeLabel(weekdays) {
|
|
38
|
+
const first = weekdays[0];
|
|
39
|
+
const last = weekdays[weekdays.length - 1];
|
|
40
|
+
if (!first || !last) return "";
|
|
41
|
+
return first === last ? openingHoursWeekdayLabels[first] : `${openingHoursWeekdayLabels[first]} to ${openingHoursWeekdayLabels[last]}`;
|
|
42
|
+
}
|
|
43
|
+
/** Monday-first table rows; only adjacent days with identical ranges are grouped. */
|
|
44
|
+
function formatOpeningHoursRows(hours) {
|
|
45
|
+
return (hours?.days ?? []).reduce((rows, day) => {
|
|
46
|
+
const text = formatDayHours(day);
|
|
47
|
+
const previous = rows[rows.length - 1];
|
|
48
|
+
const weekdays = previous?.kind === day.kind && previous.hours === text ? [...previous.weekdays, day.weekday] : [day.weekday];
|
|
49
|
+
const row = {
|
|
50
|
+
kind: day.kind,
|
|
51
|
+
weekdays,
|
|
52
|
+
label: weekdayRangeLabel(weekdays),
|
|
53
|
+
hours: text
|
|
54
|
+
};
|
|
55
|
+
return weekdays.length > 1 ? [...rows.slice(0, -1), row] : [...rows, row];
|
|
56
|
+
}, []);
|
|
57
|
+
}
|
|
58
|
+
const inlineTextMarkSchema = z.discriminatedUnion("kind", [
|
|
59
|
+
z.object({ kind: z.literal("strong") }),
|
|
60
|
+
z.object({ kind: z.literal("emphasis") }),
|
|
61
|
+
z.object({
|
|
62
|
+
kind: z.literal("accent"),
|
|
63
|
+
tone: z.enum([
|
|
64
|
+
"accent",
|
|
65
|
+
"brand",
|
|
66
|
+
"contrast"
|
|
67
|
+
])
|
|
68
|
+
}),
|
|
69
|
+
z.object({
|
|
70
|
+
kind: z.literal("highlight"),
|
|
71
|
+
tone: z.enum([
|
|
72
|
+
"soft",
|
|
73
|
+
"accent",
|
|
74
|
+
"brand"
|
|
75
|
+
])
|
|
76
|
+
})
|
|
77
|
+
]);
|
|
78
|
+
const inlineTextRunSchema = z.object({
|
|
79
|
+
text: z.string(),
|
|
80
|
+
marks: z.array(inlineTextMarkSchema).optional()
|
|
81
|
+
});
|
|
82
|
+
z.array(inlineTextRunSchema);
|
|
83
|
+
const MARK_ORDER = {
|
|
84
|
+
strong: 0,
|
|
85
|
+
emphasis: 1,
|
|
86
|
+
accent: 2,
|
|
87
|
+
highlight: 3
|
|
88
|
+
};
|
|
89
|
+
function plainTextToInlineText(value) {
|
|
90
|
+
return normalizeInlineText(value.length > 0 ? [{ text: value }] : []);
|
|
91
|
+
}
|
|
92
|
+
function inlineTextToPlainText(value) {
|
|
93
|
+
return value.map((run) => run.text).join("");
|
|
94
|
+
}
|
|
95
|
+
function isInlineTextEmpty(value) {
|
|
96
|
+
return inlineTextToPlainText(value).trim().length === 0;
|
|
97
|
+
}
|
|
98
|
+
function coerceInlineTextWithFallback(value, fallbackPlainText) {
|
|
99
|
+
const parsed = parseInlineTextFromUnknown(value);
|
|
100
|
+
if (parsed.ok && !isInlineTextEmpty(parsed.value)) return parsed.value;
|
|
101
|
+
if (fallbackPlainText && fallbackPlainText.length > 0) return plainTextToInlineText(fallbackPlainText);
|
|
102
|
+
return parsed.ok ? parsed.value : [];
|
|
103
|
+
}
|
|
104
|
+
function parseInlineTextFromUnknown(value) {
|
|
105
|
+
if (!Array.isArray(value)) return {
|
|
106
|
+
ok: false,
|
|
107
|
+
error: { kind: "not-array" }
|
|
108
|
+
};
|
|
109
|
+
const runs = [];
|
|
110
|
+
for (let index = 0; index < value.length; index += 1) {
|
|
111
|
+
const parsed = inlineTextRunSchema.safeParse(value[index]);
|
|
112
|
+
if (!parsed.success) return {
|
|
113
|
+
ok: false,
|
|
114
|
+
error: {
|
|
115
|
+
kind: "invalid-run",
|
|
116
|
+
index
|
|
117
|
+
}
|
|
118
|
+
};
|
|
119
|
+
runs.push(parsed.data);
|
|
120
|
+
}
|
|
121
|
+
return {
|
|
122
|
+
ok: true,
|
|
123
|
+
value: normalizeInlineText(runs)
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
function normalizeInlineText(value) {
|
|
127
|
+
const normalized = [];
|
|
128
|
+
for (const run of value) {
|
|
129
|
+
if (run.text.length === 0) continue;
|
|
130
|
+
const marks = normalizeInlineTextMarks(run.marks ?? []);
|
|
131
|
+
const nextRun = marks.length > 0 ? {
|
|
132
|
+
text: run.text,
|
|
133
|
+
marks
|
|
134
|
+
} : { text: run.text };
|
|
135
|
+
const previous = normalized[normalized.length - 1];
|
|
136
|
+
if (previous && inlineTextMarksEqual(previous.marks ?? [], nextRun.marks ?? [])) {
|
|
137
|
+
normalized[normalized.length - 1] = previous.marks && previous.marks.length > 0 ? {
|
|
138
|
+
text: previous.text + nextRun.text,
|
|
139
|
+
marks: previous.marks
|
|
140
|
+
} : { text: previous.text + nextRun.text };
|
|
141
|
+
continue;
|
|
142
|
+
}
|
|
143
|
+
normalized.push(nextRun);
|
|
144
|
+
}
|
|
145
|
+
return normalized;
|
|
146
|
+
}
|
|
147
|
+
function normalizeInlineTextMarks(marks) {
|
|
148
|
+
let strong = null;
|
|
149
|
+
let emphasis = null;
|
|
150
|
+
let accent = null;
|
|
151
|
+
let highlight = null;
|
|
152
|
+
for (const mark of marks) switch (mark.kind) {
|
|
153
|
+
case "strong":
|
|
154
|
+
strong = { kind: "strong" };
|
|
155
|
+
break;
|
|
156
|
+
case "emphasis":
|
|
157
|
+
emphasis = { kind: "emphasis" };
|
|
158
|
+
break;
|
|
159
|
+
case "accent":
|
|
160
|
+
accent = {
|
|
161
|
+
kind: "accent",
|
|
162
|
+
tone: mark.tone
|
|
163
|
+
};
|
|
164
|
+
break;
|
|
165
|
+
case "highlight":
|
|
166
|
+
highlight = {
|
|
167
|
+
kind: "highlight",
|
|
168
|
+
tone: mark.tone
|
|
169
|
+
};
|
|
170
|
+
break;
|
|
171
|
+
}
|
|
172
|
+
return [
|
|
173
|
+
strong,
|
|
174
|
+
emphasis,
|
|
175
|
+
accent,
|
|
176
|
+
highlight
|
|
177
|
+
].filter((mark) => mark !== null).sort((left, right) => MARK_ORDER[left.kind] - MARK_ORDER[right.kind]);
|
|
178
|
+
}
|
|
179
|
+
function inlineTextMarksEqual(left, right) {
|
|
180
|
+
const normalizedLeft = normalizeInlineTextMarks(left);
|
|
181
|
+
const normalizedRight = normalizeInlineTextMarks(right);
|
|
182
|
+
if (normalizedLeft.length !== normalizedRight.length) return false;
|
|
183
|
+
return normalizedLeft.every((mark, index) => inlineTextMarkEqual(mark, normalizedRight[index]));
|
|
184
|
+
}
|
|
185
|
+
function inlineTextMarkEqual(left, right) {
|
|
186
|
+
if (!right || left.kind !== right.kind) return false;
|
|
187
|
+
switch (left.kind) {
|
|
188
|
+
case "strong":
|
|
189
|
+
case "emphasis": return true;
|
|
190
|
+
case "accent": return right.kind === "accent" && left.tone === right.tone;
|
|
191
|
+
case "highlight": return right.kind === "highlight" && left.tone === right.tone;
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
//#endregion
|
|
195
|
+
//#region ../path-utils/src/index.ts
|
|
196
|
+
const PATH_SEPARATOR_REGEX = /\./g;
|
|
197
|
+
const BRACKET_ACCESS_REGEX = /\[([^\]]+)\]/g;
|
|
198
|
+
/**
|
|
199
|
+
* Segments that would traverse or mutate the prototype chain.
|
|
200
|
+
*
|
|
201
|
+
* `setAtPath` creates nested objects along the path, so allowing these
|
|
202
|
+
* segments is a prototype-pollution vector. They are rejected everywhere a
|
|
203
|
+
* path is parsed (string or pre-parsed array form) — fail closed.
|
|
204
|
+
*/
|
|
205
|
+
const UNSAFE_PATH_SEGMENTS = /* @__PURE__ */ new Set([
|
|
206
|
+
"__proto__",
|
|
207
|
+
"constructor",
|
|
208
|
+
"prototype"
|
|
209
|
+
]);
|
|
210
|
+
var UnsafePathSegmentError = class extends Error {
|
|
211
|
+
constructor(segment) {
|
|
212
|
+
super(`Unsafe path segment: "${segment}"`);
|
|
213
|
+
this.name = "UnsafePathSegmentError";
|
|
214
|
+
this.segment = segment;
|
|
215
|
+
}
|
|
216
|
+
};
|
|
217
|
+
function assertSafePathSegments(segments) {
|
|
218
|
+
for (const segment of segments) if (typeof segment === "string" && UNSAFE_PATH_SEGMENTS.has(segment)) throw new UnsafePathSegmentError(segment);
|
|
219
|
+
}
|
|
220
|
+
function isRecord(value) {
|
|
221
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
222
|
+
}
|
|
223
|
+
function isPathContainer(value) {
|
|
224
|
+
return Array.isArray(value) || isRecord(value);
|
|
225
|
+
}
|
|
226
|
+
function getContainerValue(container, segment) {
|
|
227
|
+
if (typeof segment === "number") return Array.isArray(container) ? container[segment] : void 0;
|
|
228
|
+
if (segment in container) return Reflect.get(container, segment);
|
|
229
|
+
}
|
|
230
|
+
function parsePath(path) {
|
|
231
|
+
if (Array.isArray(path)) {
|
|
232
|
+
assertSafePathSegments(path);
|
|
233
|
+
return path;
|
|
234
|
+
}
|
|
235
|
+
const segments = [];
|
|
236
|
+
const parts = path.split(PATH_SEPARATOR_REGEX);
|
|
237
|
+
for (const raw of parts) {
|
|
238
|
+
if (!raw) continue;
|
|
239
|
+
const baseMatch = raw.match(/^[^\[]+/);
|
|
240
|
+
if (baseMatch !== null) {
|
|
241
|
+
const base = baseMatch[1] ?? baseMatch[0];
|
|
242
|
+
if (/^\d+$/.test(base)) segments.push(Number(base));
|
|
243
|
+
else segments.push(base);
|
|
244
|
+
}
|
|
245
|
+
const bracketMatches = raw.matchAll(BRACKET_ACCESS_REGEX);
|
|
246
|
+
for (const match of bracketMatches) {
|
|
247
|
+
const token = match[1] ?? "";
|
|
248
|
+
if (token.startsWith("\"") || token.startsWith("'")) segments.push(token.slice(1, -1));
|
|
249
|
+
else if (/^\d+$/.test(token)) segments.push(Number(token));
|
|
250
|
+
else segments.push(token);
|
|
251
|
+
}
|
|
252
|
+
if (baseMatch === null && !raw.includes("[")) segments.push(raw);
|
|
253
|
+
}
|
|
254
|
+
assertSafePathSegments(segments);
|
|
255
|
+
return segments;
|
|
256
|
+
}
|
|
257
|
+
function getAtPath(source, path) {
|
|
258
|
+
return parsePath(path).reduce((current, segment) => {
|
|
259
|
+
if (current === void 0 || current === null) return void 0;
|
|
260
|
+
if (!isPathContainer(current)) return void 0;
|
|
261
|
+
return getContainerValue(current, segment);
|
|
262
|
+
}, source);
|
|
263
|
+
}
|
|
264
|
+
//#endregion
|
|
265
|
+
//#region ../blocks/src/primitives/content/components/Text.tsx
|
|
266
|
+
function Text({ as: Comp = "span", children, className = "", path, style, "data-slot": dataSlot, "data-surface": dataSurface, maxLength: _maxLength }) {
|
|
267
|
+
return /* @__PURE__ */ jsx(Comp, {
|
|
268
|
+
"data-slot": dataSlot,
|
|
269
|
+
"data-surface": dataSurface,
|
|
270
|
+
style: dataSlot === void 0 ? void 0 : style,
|
|
271
|
+
className,
|
|
272
|
+
...path ? { "data-builder-text": path } : void 0,
|
|
273
|
+
children
|
|
274
|
+
});
|
|
275
|
+
}
|
|
276
|
+
//#endregion
|
|
277
|
+
//#region ../blocks/src/system/runtime/nodes/renderInlineText.tsx
|
|
278
|
+
function renderInlineText(value) {
|
|
279
|
+
return value.map((run, index) => renderRun(run, index));
|
|
280
|
+
}
|
|
281
|
+
function renderRun(run, key) {
|
|
282
|
+
return (run.marks ?? []).reduceRight((child, mark, index) => renderMark(mark, `${String(key)}-${index}`, child), run.text);
|
|
283
|
+
}
|
|
284
|
+
function renderMark(mark, key, child) {
|
|
285
|
+
switch (mark.kind) {
|
|
286
|
+
case "strong": return /* @__PURE__ */ jsx("strong", { children: child }, key);
|
|
287
|
+
case "emphasis": return /* @__PURE__ */ jsx("em", { children: child }, key);
|
|
288
|
+
case "accent": return /* @__PURE__ */ jsx("span", {
|
|
289
|
+
className: `rb-inline-text-accent rb-inline-text-accent-${mark.tone}`,
|
|
290
|
+
children: child
|
|
291
|
+
}, key);
|
|
292
|
+
case "highlight": return /* @__PURE__ */ jsx("span", {
|
|
293
|
+
className: `rb-inline-text-highlight rb-inline-text-highlight-${mark.tone}`,
|
|
294
|
+
children: child
|
|
295
|
+
}, key);
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
//#endregion
|
|
299
|
+
//#region ../blocks/src/system/runtime/nodes/location-map.view.tsx
|
|
300
|
+
function OpeningHoursTable({ hours, lookLayout }) {
|
|
301
|
+
if (!hours) return null;
|
|
302
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
303
|
+
className: "rb-location-map-hours",
|
|
304
|
+
"data-slot": lookLayout ? "schedule" : void 0,
|
|
305
|
+
children: [/* @__PURE__ */ jsxs("table", { children: [/* @__PURE__ */ jsx("caption", { children: "Opening hours" }), /* @__PURE__ */ jsx("tbody", { children: formatOpeningHoursRows(hours).map((row) => /* @__PURE__ */ jsxs("tr", {
|
|
306
|
+
"data-slot": lookLayout ? "row" : void 0,
|
|
307
|
+
"data-closed": row.kind === "closed" ? true : void 0,
|
|
308
|
+
children: [/* @__PURE__ */ jsx("th", {
|
|
309
|
+
scope: "row",
|
|
310
|
+
"data-slot": lookLayout ? "fact-label" : void 0,
|
|
311
|
+
children: row.label
|
|
312
|
+
}), /* @__PURE__ */ jsx("td", {
|
|
313
|
+
"data-slot": lookLayout ? "fact-value" : void 0,
|
|
314
|
+
children: row.hours
|
|
315
|
+
})]
|
|
316
|
+
}, row.label)) })] }), hours.note ? /* @__PURE__ */ jsx("p", { children: hours.note }) : null]
|
|
317
|
+
});
|
|
318
|
+
}
|
|
319
|
+
function LocationMapView(props) {
|
|
320
|
+
const { addressText, location } = props;
|
|
321
|
+
const hours = props.showOpeningHours === false ? null : props.openingHours ?? null;
|
|
322
|
+
if (![
|
|
323
|
+
location,
|
|
324
|
+
addressText,
|
|
325
|
+
hours
|
|
326
|
+
].some(Boolean)) return /* @__PURE__ */ jsx("p", {
|
|
327
|
+
className: "rb-caption",
|
|
328
|
+
style: textColorStyle("mutedText"),
|
|
329
|
+
children: props.unresolvedMessage ?? "Location details coming soon."
|
|
330
|
+
});
|
|
331
|
+
return /* @__PURE__ */ jsx(LocationMapDetails, {
|
|
332
|
+
...props,
|
|
333
|
+
openingHours: hours
|
|
334
|
+
});
|
|
335
|
+
}
|
|
336
|
+
/** The entrance-photo Look leaves the drawing out; Look layouts treat the authored height as a minimum. */
|
|
337
|
+
function LocationMapDrawing(props) {
|
|
338
|
+
return /* @__PURE__ */ jsx(AdmittedMapDrawingSvg, {
|
|
339
|
+
drawing: props.drawing,
|
|
340
|
+
wider: props.wider,
|
|
341
|
+
label: props.addressText ?? void 0,
|
|
342
|
+
height: props.heightPx,
|
|
343
|
+
heightAs: props.lookLayout ? "minimum" : "fixed"
|
|
344
|
+
});
|
|
345
|
+
}
|
|
346
|
+
/**
|
|
347
|
+
* `data-map="none"` marks details shown without a drawing (none yet, or the entrance photo
|
|
348
|
+
* takes its place), so map Looks lay the details out on their own instead of beside an empty space.
|
|
349
|
+
*/
|
|
350
|
+
function LocationMapDetails(props) {
|
|
351
|
+
const drawing = props.showMap === false ? null : readableMapDrawing(props.drawing);
|
|
352
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
353
|
+
className: "rb-location-map",
|
|
354
|
+
"data-map": drawing ? "drawing" : "none",
|
|
355
|
+
children: [drawing ? /* @__PURE__ */ jsx(LocationMapDrawing, {
|
|
356
|
+
...props,
|
|
357
|
+
drawing
|
|
358
|
+
}) : null, /* @__PURE__ */ jsxs("div", {
|
|
359
|
+
className: "rb-location-map-details",
|
|
360
|
+
...props.detailsSlot,
|
|
361
|
+
children: [/* @__PURE__ */ jsx(LocationMapPlace, { ...props }), /* @__PURE__ */ jsx(OpeningHoursTable, {
|
|
362
|
+
lookLayout: props.lookLayout,
|
|
363
|
+
hours: props.openingHours ?? null
|
|
364
|
+
})]
|
|
365
|
+
})]
|
|
366
|
+
});
|
|
367
|
+
}
|
|
368
|
+
/** Address, door note and the directions actions. */
|
|
369
|
+
function LocationMapPlace(props) {
|
|
370
|
+
const address = props.showAddressText && props.addressText ? props.addressText : null;
|
|
371
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
372
|
+
className: "rb-location-map-place",
|
|
373
|
+
"data-slot": props.lookLayout ? "copy" : void 0,
|
|
374
|
+
children: [
|
|
375
|
+
address ? /* @__PURE__ */ jsx("p", {
|
|
376
|
+
className: "rb-location-map-address",
|
|
377
|
+
"data-slot": props.lookLayout ? "headline" : void 0,
|
|
378
|
+
children: address
|
|
379
|
+
}) : null,
|
|
380
|
+
props.doorNote ? /* @__PURE__ */ jsx("p", {
|
|
381
|
+
className: "rb-location-map-door",
|
|
382
|
+
children: props.doorNote
|
|
383
|
+
}) : null,
|
|
384
|
+
props.showDirections ? /* @__PURE__ */ jsx(LocationMapActions, {
|
|
385
|
+
layout: "block",
|
|
386
|
+
location: props.location,
|
|
387
|
+
addressText: props.addressText,
|
|
388
|
+
directionsLabel: props.directionsLabel,
|
|
389
|
+
googleMapsLabel: props.googleMapsLabel
|
|
390
|
+
}) : null
|
|
391
|
+
]
|
|
392
|
+
});
|
|
393
|
+
}
|
|
394
|
+
//#endregion
|
|
395
|
+
//#region ../blocks/src/system/runtime/nodes/basic.tsx
|
|
396
|
+
const TextNode = ({ value, children, blockContent, inlineTextFallbackPath, ...rest }) => {
|
|
397
|
+
const inlineText = parseInlineTextFromUnknown(value);
|
|
398
|
+
if (inlineText.ok && !isInlineTextEmpty(inlineText.value)) return /* @__PURE__ */ jsx(Text, {
|
|
399
|
+
...rest,
|
|
400
|
+
children: renderInlineText(inlineText.value)
|
|
401
|
+
});
|
|
402
|
+
const fallbackValue = inlineTextFallbackPath ? readStringPath(blockContent, inlineTextFallbackPath) : null;
|
|
403
|
+
return /* @__PURE__ */ jsx(Text, {
|
|
404
|
+
...rest,
|
|
405
|
+
children: fallbackValue ?? textNodeContent(value) ?? children
|
|
406
|
+
});
|
|
407
|
+
};
|
|
408
|
+
function textNodeContent(value) {
|
|
409
|
+
if (value === null || value === void 0) return null;
|
|
410
|
+
if (typeof value === "string" || typeof value === "number") return value;
|
|
411
|
+
return null;
|
|
412
|
+
}
|
|
413
|
+
function readStringPath(source, path) {
|
|
414
|
+
const value = getAtPath(source, path);
|
|
415
|
+
return typeof value === "string" ? value : null;
|
|
416
|
+
}
|
|
417
|
+
const RichTextNode = ({ value, blockKind, ...rest }) => {
|
|
418
|
+
return /* @__PURE__ */ jsx(RichText, {
|
|
419
|
+
doc: coerceRichTextDoc(value, `block-runtime:${blockKind ?? "unknown"}:${rest.path ?? "richText"}`) ?? void 0,
|
|
420
|
+
...rest
|
|
421
|
+
});
|
|
422
|
+
};
|
|
423
|
+
function isMissingRequiredLink(linkRequired, resolvedHref) {
|
|
424
|
+
return linkRequired && resolvedHref.length === 0;
|
|
425
|
+
}
|
|
426
|
+
function authoredButtonDecision(props) {
|
|
427
|
+
const content = props.value ?? props.children;
|
|
428
|
+
if (!content) return { kind: "empty" };
|
|
429
|
+
const href = typeof props.href === "string" ? props.href.trim() : "";
|
|
430
|
+
if (isMissingRequiredLink(props.linkRequired ?? false, href)) return { kind: "missing-link" };
|
|
431
|
+
const variant = parseThemeButtonVariantId(props.variantId ?? "primary");
|
|
432
|
+
if (props.variantId && !variant) return { kind: "invalid-variant" };
|
|
433
|
+
return {
|
|
434
|
+
kind: "ready",
|
|
435
|
+
content,
|
|
436
|
+
href,
|
|
437
|
+
variant
|
|
438
|
+
};
|
|
439
|
+
}
|
|
440
|
+
const ButtonNode = (props) => {
|
|
441
|
+
const decision = authoredButtonDecision(props);
|
|
442
|
+
switch (decision.kind) {
|
|
443
|
+
case "empty":
|
|
444
|
+
console.warn("[ButtonNode] No content to render - value and children are both empty");
|
|
445
|
+
return null;
|
|
446
|
+
case "missing-link":
|
|
447
|
+
console.warn("[ButtonNode] Missing href for link-required button");
|
|
448
|
+
return null;
|
|
449
|
+
case "invalid-variant":
|
|
450
|
+
console.error("[ButtonNode] Invalid button variant", { variantId: props.variantId });
|
|
451
|
+
return null;
|
|
452
|
+
case "ready": return /* @__PURE__ */ jsx(AuthoredButtonContent, {
|
|
453
|
+
props,
|
|
454
|
+
decision
|
|
455
|
+
});
|
|
456
|
+
}
|
|
457
|
+
};
|
|
458
|
+
function AuthoredButtonContent({ props, decision }) {
|
|
459
|
+
if (props.actionStyle === "link" && decision.href && !props.disabled) return /* @__PURE__ */ jsx("a", {
|
|
460
|
+
href: decision.href,
|
|
461
|
+
target: props.target,
|
|
462
|
+
rel: props.rel,
|
|
463
|
+
onClick: props.onClick,
|
|
464
|
+
className: `rb-item-text-link btn-${props.size ?? "md"}`,
|
|
465
|
+
"aria-label": props["aria-label"],
|
|
466
|
+
"data-testid": props["data-testid"],
|
|
467
|
+
children: decision.content
|
|
468
|
+
});
|
|
469
|
+
return /* @__PURE__ */ jsx(ThemedAuthoredButton, {
|
|
470
|
+
label: decision.content,
|
|
471
|
+
href: decision.href || void 0,
|
|
472
|
+
target: props.target,
|
|
473
|
+
rel: props.rel,
|
|
474
|
+
variant: decision.variant,
|
|
475
|
+
size: props.size ?? "md",
|
|
476
|
+
disabled: props.disabled,
|
|
477
|
+
type: props.type ?? "button",
|
|
478
|
+
trailingIcon: props.trailingIcon,
|
|
479
|
+
onClick: props.onClick,
|
|
480
|
+
extraClassName: props.className,
|
|
481
|
+
ariaLabel: props["aria-label"],
|
|
482
|
+
dataTestId: props["data-testid"]
|
|
483
|
+
});
|
|
484
|
+
}
|
|
485
|
+
const LinkNode = ({ href, children, className, target, rel, linkRequired = false, ...rest }) => {
|
|
486
|
+
if (!children) return null;
|
|
487
|
+
const resolvedHref = typeof href === "string" ? href.trim() : "";
|
|
488
|
+
if (resolvedHref.length === 0) {
|
|
489
|
+
if (linkRequired && true) console.warn("[LinkNode] Missing href for link-required link");
|
|
490
|
+
if (linkRequired) return null;
|
|
491
|
+
return /* @__PURE__ */ jsx("span", {
|
|
492
|
+
className,
|
|
493
|
+
...rest,
|
|
494
|
+
children
|
|
495
|
+
});
|
|
496
|
+
}
|
|
497
|
+
return /* @__PURE__ */ jsx("a", {
|
|
498
|
+
href: resolvedHref,
|
|
499
|
+
className,
|
|
500
|
+
target,
|
|
501
|
+
rel,
|
|
502
|
+
...rest,
|
|
503
|
+
children
|
|
504
|
+
});
|
|
505
|
+
};
|
|
506
|
+
//#endregion
|
|
507
|
+
//#region ../blocks/src/system/runtime/nodes/events/RecurringSchedule.tsx
|
|
508
|
+
function destinationHref(destination) {
|
|
509
|
+
return destination.kind === "external" ? destination.url : destination.path;
|
|
510
|
+
}
|
|
511
|
+
function bookingLinkProps(booking) {
|
|
512
|
+
return booking.destination.kind === "external" ? {
|
|
513
|
+
href: destinationHref(booking.destination),
|
|
514
|
+
target: "_blank",
|
|
515
|
+
rel: "noopener noreferrer"
|
|
516
|
+
} : { href: destinationHref(booking.destination) };
|
|
517
|
+
}
|
|
518
|
+
function bookingActionContent(input) {
|
|
519
|
+
switch (input.booking.kind) {
|
|
520
|
+
case "available": return /* @__PURE__ */ jsx(ButtonNode, {
|
|
521
|
+
...bookingLinkProps(input.booking),
|
|
522
|
+
"aria-label": input.accessibleName,
|
|
523
|
+
className: "recurring-schedule-book",
|
|
524
|
+
linkRequired: true,
|
|
525
|
+
variantId: input.buttonVariant,
|
|
526
|
+
size: "sm",
|
|
527
|
+
children: input.buttonText
|
|
528
|
+
});
|
|
529
|
+
case "unavailable": return null;
|
|
530
|
+
default: return assertNever(input.booking);
|
|
531
|
+
}
|
|
532
|
+
}
|
|
533
|
+
function RecurringSchedule({ dateContext = resolveDateRuntimeContext(void 0), schedule, buttonText = "Book", buttonVariant = "primary", showVenue = true, emptyMessage = "Regular schedule details will be added shortly." }) {
|
|
534
|
+
const projection = schedule ?? {
|
|
535
|
+
items: [],
|
|
536
|
+
diagnostics: []
|
|
537
|
+
};
|
|
538
|
+
if (projection.items.length === 0) return /* @__PURE__ */ jsx("p", {
|
|
539
|
+
className: "recurring-schedule-empty",
|
|
540
|
+
"data-diagnostic-count": projection.diagnostics.length,
|
|
541
|
+
children: emptyMessage
|
|
542
|
+
});
|
|
543
|
+
return /* @__PURE__ */ jsx("div", {
|
|
544
|
+
className: "recurring-schedule",
|
|
545
|
+
"data-diagnostic-count": projection.diagnostics.length,
|
|
546
|
+
role: "list",
|
|
547
|
+
children: projection.items.map((item) => /* @__PURE__ */ jsx(RecurringScheduleRow, {
|
|
548
|
+
item,
|
|
549
|
+
locale: dateContext.locale,
|
|
550
|
+
buttonText: buttonText ?? "Book",
|
|
551
|
+
buttonVariant: buttonVariant ?? "primary",
|
|
552
|
+
showVenue: showVenue ?? true
|
|
553
|
+
}, item.seriesId))
|
|
554
|
+
});
|
|
555
|
+
}
|
|
556
|
+
function RecurringScheduleRow({ item, locale, buttonText, buttonVariant, showVenue }) {
|
|
557
|
+
const startLabel = formatEventClockLabel(item.cadence.startTime, locale);
|
|
558
|
+
const endLabel = formatEventClockLabel(item.cadence.endTime, locale);
|
|
559
|
+
const weekdays = item.cadence.weekdays?.join(", ") ?? item.cadence.weekday;
|
|
560
|
+
const description = `${item.title}, ${weekdays} at ${startLabel}`;
|
|
561
|
+
return /* @__PURE__ */ jsxs("article", {
|
|
562
|
+
className: "recurring-schedule-row",
|
|
563
|
+
role: "listitem",
|
|
564
|
+
"aria-label": description,
|
|
565
|
+
children: [
|
|
566
|
+
/* @__PURE__ */ jsx("p", {
|
|
567
|
+
className: "recurring-schedule-day",
|
|
568
|
+
children: weekdays
|
|
569
|
+
}),
|
|
570
|
+
/* @__PURE__ */ jsxs("p", {
|
|
571
|
+
className: "recurring-schedule-time",
|
|
572
|
+
children: [
|
|
573
|
+
/* @__PURE__ */ jsx("time", {
|
|
574
|
+
dateTime: item.cadence.startTime,
|
|
575
|
+
children: startLabel
|
|
576
|
+
}),
|
|
577
|
+
/* @__PURE__ */ jsx("span", {
|
|
578
|
+
"aria-hidden": "true",
|
|
579
|
+
children: "–"
|
|
580
|
+
}),
|
|
581
|
+
/* @__PURE__ */ jsx("time", {
|
|
582
|
+
dateTime: item.cadence.endTime,
|
|
583
|
+
children: endLabel
|
|
584
|
+
})
|
|
585
|
+
]
|
|
586
|
+
}),
|
|
587
|
+
/* @__PURE__ */ jsxs("div", {
|
|
588
|
+
className: "recurring-schedule-details",
|
|
589
|
+
children: [/* @__PURE__ */ jsx("p", {
|
|
590
|
+
className: "recurring-schedule-title",
|
|
591
|
+
children: item.title
|
|
592
|
+
}), showVenue && item.venueName ? /* @__PURE__ */ jsx("p", {
|
|
593
|
+
className: "recurring-schedule-venue",
|
|
594
|
+
children: item.venueName
|
|
595
|
+
}) : null]
|
|
596
|
+
}),
|
|
597
|
+
/* @__PURE__ */ jsx("div", {
|
|
598
|
+
className: "recurring-schedule-action",
|
|
599
|
+
children: bookingActionContent({
|
|
600
|
+
booking: item.booking,
|
|
601
|
+
buttonVariant,
|
|
602
|
+
buttonText,
|
|
603
|
+
accessibleName: `${buttonText} ${description}`
|
|
604
|
+
})
|
|
605
|
+
})
|
|
606
|
+
]
|
|
607
|
+
});
|
|
608
|
+
}
|
|
609
|
+
//#endregion
|
|
610
|
+
//#region ../blocks/src/system/runtime/nodes/events/shared/CalendarRecurringWeek.tsx
|
|
611
|
+
/** Week mode keeps the series projection and booking destinations from issue 1586. */
|
|
612
|
+
function CalendarRecurringWeek({ display }) {
|
|
613
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
614
|
+
className: "event-calendar event-calendar--recurring-week",
|
|
615
|
+
children: [display.seeAllUrl ? /* @__PURE__ */ jsx(ThemedButtonLink, {
|
|
616
|
+
href: display.seeAllUrl,
|
|
617
|
+
variant: display.seeAllButtonVariant,
|
|
618
|
+
size: "md",
|
|
619
|
+
label: display.loadMoreText ?? "See all classes"
|
|
620
|
+
}) : null, /* @__PURE__ */ jsx(RecurringSchedule, {
|
|
621
|
+
schedule: display.schedule,
|
|
622
|
+
dateContext: display.dateContext,
|
|
623
|
+
buttonText: display.buttonText,
|
|
624
|
+
buttonVariant: display.buttonVariant,
|
|
625
|
+
showVenue: display.showVenue,
|
|
626
|
+
emptyMessage: display.emptyMessage
|
|
627
|
+
})]
|
|
628
|
+
});
|
|
629
|
+
}
|
|
630
|
+
//#endregion
|
|
631
|
+
//#region ../blocks/src/system/runtime/nodes/events/shared/MonthLookView.tsx
|
|
632
|
+
function MonthEvent({ event, timeZone, locale }) {
|
|
633
|
+
return /* @__PURE__ */ jsxs("a", {
|
|
634
|
+
...resolveEventLinkProps(event),
|
|
635
|
+
"data-slot": "item",
|
|
636
|
+
children: [
|
|
637
|
+
/* @__PURE__ */ jsx("span", {
|
|
638
|
+
"data-slot": "time",
|
|
639
|
+
children: formatTime(event.startsAt, {
|
|
640
|
+
...eventDateOptions({
|
|
641
|
+
...event,
|
|
642
|
+
timeZone
|
|
643
|
+
}),
|
|
644
|
+
locale
|
|
645
|
+
})
|
|
646
|
+
}),
|
|
647
|
+
" ",
|
|
648
|
+
/* @__PURE__ */ jsx("span", {
|
|
649
|
+
"data-slot": "what",
|
|
650
|
+
children: event.title
|
|
651
|
+
})
|
|
652
|
+
]
|
|
653
|
+
});
|
|
654
|
+
}
|
|
655
|
+
function dateLabel(key, timeZone, date = "short") {
|
|
656
|
+
return formatDate({
|
|
657
|
+
kind: "civil",
|
|
658
|
+
value: parseBookingLocalDate(key)
|
|
659
|
+
}, eventDateOptions({
|
|
660
|
+
siteTimeZone: timeZone,
|
|
661
|
+
timeZone
|
|
662
|
+
}), {
|
|
663
|
+
date,
|
|
664
|
+
weekday: "long"
|
|
665
|
+
});
|
|
666
|
+
}
|
|
667
|
+
function MonthDay(props) {
|
|
668
|
+
const { day, selection } = props;
|
|
669
|
+
const { controls } = selection;
|
|
670
|
+
const selected = day.dateKey === selection.selectedDay;
|
|
671
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
672
|
+
"data-slot": "date",
|
|
673
|
+
"data-current": String(selected),
|
|
674
|
+
"data-today": String(day.isToday),
|
|
675
|
+
"data-other-month": String(!day.isCurrentMonth),
|
|
676
|
+
children: [selection.arrangement === "month-day" ? /* @__PURE__ */ jsx("button", {
|
|
677
|
+
type: "button",
|
|
678
|
+
"data-slot": "control",
|
|
679
|
+
"aria-label": `Show events on ${dateLabel(day.dateKey, selection.timeZone, "long")}`,
|
|
680
|
+
"aria-pressed": selected,
|
|
681
|
+
onClick: controls ? () => controls.selectDay(day.dateKey) : void 0,
|
|
682
|
+
children: day.date.day
|
|
683
|
+
}) : /* @__PURE__ */ jsx("span", {
|
|
684
|
+
"data-slot": "date-label",
|
|
685
|
+
children: day.date.day
|
|
686
|
+
}), selection.arrangement === "month-grid" ? /* @__PURE__ */ jsxs(Fragment, { children: [day.visibleEntries.map(({ event, timeZone }) => /* @__PURE__ */ jsx(MonthEvent, {
|
|
687
|
+
event,
|
|
688
|
+
timeZone,
|
|
689
|
+
locale: eventDateOptions({ siteTimeZone: selection.timeZone }).locale
|
|
690
|
+
}, event.occurrenceId ?? event.id)), day.moreCount > 0 ? /* @__PURE__ */ jsxs("button", {
|
|
691
|
+
type: "button",
|
|
692
|
+
className: "event-calendar-more",
|
|
693
|
+
"data-slot": "more",
|
|
694
|
+
onClick: controls ? () => controls.openDay(day.date, day.entries.map(({ event }) => event)) : void 0,
|
|
695
|
+
children: [
|
|
696
|
+
"+",
|
|
697
|
+
day.moreCount,
|
|
698
|
+
" more"
|
|
699
|
+
]
|
|
700
|
+
}) : null] }) : /* @__PURE__ */ jsx(MonthDayMarks, { count: day.entries.length })]
|
|
701
|
+
});
|
|
702
|
+
}
|
|
703
|
+
/** Both Looks and the legacy month grid consume the same per-day model. */
|
|
704
|
+
function MonthLookView(props) {
|
|
705
|
+
const days = props.days.map((date) => buildMonthDay({
|
|
706
|
+
date,
|
|
707
|
+
events: props.eventsByDate.get(formatDateKey(date)) ?? [],
|
|
708
|
+
viewDate: props.viewDate,
|
|
709
|
+
today: props.today,
|
|
710
|
+
calendarTimeZone: props.timeZone
|
|
711
|
+
}));
|
|
712
|
+
const selected = days.find((day) => day.dateKey === props.selectedDay);
|
|
713
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
714
|
+
"data-slot": "frame",
|
|
715
|
+
"data-arrangement": props.arrangement,
|
|
716
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
717
|
+
"data-slot": "grid",
|
|
718
|
+
children: [props.dayNames.map((name) => /* @__PURE__ */ jsx("span", {
|
|
719
|
+
"data-slot": "group-label",
|
|
720
|
+
children: name
|
|
721
|
+
}, name)), days.map((day) => /* @__PURE__ */ jsx(MonthDay, {
|
|
722
|
+
day,
|
|
723
|
+
selection: props
|
|
724
|
+
}, day.dateKey))]
|
|
725
|
+
}), props.arrangement === "month-day" ? /* @__PURE__ */ jsxs("section", {
|
|
726
|
+
...listLookSlot(props, "panel"),
|
|
727
|
+
"aria-live": "polite",
|
|
728
|
+
children: [/* @__PURE__ */ jsx("h3", {
|
|
729
|
+
"data-slot": "panel-heading",
|
|
730
|
+
children: dateLabel(props.selectedDay, props.timeZone)
|
|
731
|
+
}), /* @__PURE__ */ jsx("div", {
|
|
732
|
+
...listLookSlot(props, "list"),
|
|
733
|
+
children: selected?.entries.length ? selected.entries.map(({ event }, index, entries) => /* @__PURE__ */ jsx(EventItem, {
|
|
734
|
+
...listItemPresentation(props, index, entries.length),
|
|
735
|
+
event,
|
|
736
|
+
arrangement: "month-day"
|
|
737
|
+
}, event.occurrenceId ?? event.id)) : /* @__PURE__ */ jsx("p", {
|
|
738
|
+
"data-slot": "intro",
|
|
739
|
+
children: props.emptyMessage
|
|
740
|
+
})
|
|
741
|
+
})]
|
|
742
|
+
}) : null]
|
|
743
|
+
});
|
|
744
|
+
}
|
|
745
|
+
function MonthDayMarks({ count }) {
|
|
746
|
+
if (count === 0) return null;
|
|
747
|
+
return /* @__PURE__ */ jsx("span", {
|
|
748
|
+
"data-slot": "item-meta",
|
|
749
|
+
role: "img",
|
|
750
|
+
"aria-label": `${count} ${count === 1 ? "event" : "events"}`,
|
|
751
|
+
children: Array.from({ length: Math.min(count, 3) }, (_, index) => /* @__PURE__ */ jsx("span", {
|
|
752
|
+
"data-slot": "mark",
|
|
753
|
+
"aria-hidden": "true"
|
|
754
|
+
}, index))
|
|
755
|
+
});
|
|
756
|
+
}
|
|
757
|
+
//#endregion
|
|
758
|
+
//#region ../blocks/src/system/runtime/nodes/events/shared/WeekBoardView.tsx
|
|
759
|
+
function buildWeekBoardNavigationState(viewport, today) {
|
|
760
|
+
return {
|
|
761
|
+
rangeLabel: viewport.title,
|
|
762
|
+
isCurrentWeek: viewport.days.some((day) => isToday(day, today))
|
|
763
|
+
};
|
|
764
|
+
}
|
|
765
|
+
function buildWeekBoardViewProps(display, days, navigation, events = display.events) {
|
|
766
|
+
return {
|
|
767
|
+
days,
|
|
768
|
+
events: [...events],
|
|
769
|
+
navigation,
|
|
770
|
+
showCapacity: display.showCapacity,
|
|
771
|
+
emptyMessage: display.emptyMessage,
|
|
772
|
+
title: display.boardTitle,
|
|
773
|
+
footerNote: display.footerNote,
|
|
774
|
+
ctaLabel: display.loadMoreText ?? display.buttonText,
|
|
775
|
+
ctaHref: display.seeAllUrl,
|
|
776
|
+
buttonVariant: display.buttonVariant,
|
|
777
|
+
elevated: display.elevated,
|
|
778
|
+
banded: display.banded,
|
|
779
|
+
calendarTimeZone: display.calendarTimeZone,
|
|
780
|
+
today: display.today
|
|
781
|
+
};
|
|
782
|
+
}
|
|
783
|
+
const SHORT_DAY_NAMES = [
|
|
784
|
+
"Sun",
|
|
785
|
+
"Mon",
|
|
786
|
+
"Tue",
|
|
787
|
+
"Wed",
|
|
788
|
+
"Thu",
|
|
789
|
+
"Fri",
|
|
790
|
+
"Sat"
|
|
791
|
+
];
|
|
792
|
+
const LEGEND_ITEMS = [
|
|
793
|
+
{
|
|
794
|
+
status: "available",
|
|
795
|
+
label: "Places available"
|
|
796
|
+
},
|
|
797
|
+
{
|
|
798
|
+
status: "filling",
|
|
799
|
+
label: "Filling up"
|
|
800
|
+
},
|
|
801
|
+
{
|
|
802
|
+
status: "waitlist",
|
|
803
|
+
label: "Waitlist"
|
|
804
|
+
}
|
|
805
|
+
];
|
|
806
|
+
/**
|
|
807
|
+
* Format an event's start–end as a compact range, merging the shared meridiem.
|
|
808
|
+
* "6:00 PM" + "7:00 PM" -> "6:00 – 7:00 PM"; "9:30 AM" + "10:15 AM" -> "9:30 – 10:15 AM".
|
|
809
|
+
*/
|
|
810
|
+
function formatCompactTimeRange(event, calendarTimeZone) {
|
|
811
|
+
return formatEventTimeRange(event, eventDateOptions({
|
|
812
|
+
...event,
|
|
813
|
+
timeZone: resolveEventTimeZone(event, calendarTimeZone)
|
|
814
|
+
}));
|
|
815
|
+
}
|
|
816
|
+
const WeekBoardCard = ({ event, showCapacity, calendarTimeZone }) => {
|
|
817
|
+
const linkProps = resolveEventLinkProps(event);
|
|
818
|
+
const { status, label } = getEventAvailabilityStatus(event);
|
|
819
|
+
const pill = showCapacity ? label : null;
|
|
820
|
+
return /* @__PURE__ */ jsxs("a", {
|
|
821
|
+
...linkProps,
|
|
822
|
+
className: "event-week-board-card",
|
|
823
|
+
"data-status": status,
|
|
824
|
+
children: [
|
|
825
|
+
/* @__PURE__ */ jsx("span", {
|
|
826
|
+
className: "event-week-board-card-title",
|
|
827
|
+
children: event.title
|
|
828
|
+
}),
|
|
829
|
+
/* @__PURE__ */ jsx("span", {
|
|
830
|
+
className: "event-week-board-card-time",
|
|
831
|
+
children: formatCompactTimeRange(event, calendarTimeZone)
|
|
832
|
+
}),
|
|
833
|
+
pill ? /* @__PURE__ */ jsx("span", {
|
|
834
|
+
className: "event-week-board-card-pill",
|
|
835
|
+
"data-status": status,
|
|
836
|
+
children: pill
|
|
837
|
+
}) : null
|
|
838
|
+
]
|
|
839
|
+
});
|
|
840
|
+
};
|
|
841
|
+
const WeekBoardNavigationControls = ({ navigation, buttonVariant }) => {
|
|
842
|
+
const handlers = navigation.kind === "interactive" ? navigation : {
|
|
843
|
+
onPrevious: void 0,
|
|
844
|
+
onNext: void 0,
|
|
845
|
+
onToday: void 0
|
|
846
|
+
};
|
|
847
|
+
const isLoading = navigation.kind === "interactive" && navigation.loadState.kind === "loading";
|
|
848
|
+
return /* @__PURE__ */ jsxs("nav", {
|
|
849
|
+
className: "event-week-board-navigation",
|
|
850
|
+
"aria-label": "Choose week",
|
|
851
|
+
children: [
|
|
852
|
+
/* @__PURE__ */ jsx("button", {
|
|
853
|
+
type: "button",
|
|
854
|
+
className: "event-week-board-nav-button",
|
|
855
|
+
"aria-label": "Previous week",
|
|
856
|
+
onClick: handlers.onPrevious,
|
|
857
|
+
children: /* @__PURE__ */ jsx(CalendarNavigationChevron, { direction: "previous" })
|
|
858
|
+
}),
|
|
859
|
+
/* @__PURE__ */ jsxs("h3", {
|
|
860
|
+
className: "event-week-board-range",
|
|
861
|
+
"aria-live": "polite",
|
|
862
|
+
children: [navigation.rangeLabel, isLoading ? /* @__PURE__ */ jsx("span", {
|
|
863
|
+
className: "event-week-board-loading",
|
|
864
|
+
children: " Loading…"
|
|
865
|
+
}) : null]
|
|
866
|
+
}),
|
|
867
|
+
/* @__PURE__ */ jsx("button", {
|
|
868
|
+
type: "button",
|
|
869
|
+
className: "event-week-board-nav-button",
|
|
870
|
+
"aria-label": "Next week",
|
|
871
|
+
onClick: handlers.onNext,
|
|
872
|
+
children: /* @__PURE__ */ jsx(CalendarNavigationChevron, { direction: "next" })
|
|
873
|
+
}),
|
|
874
|
+
/* @__PURE__ */ jsx(ThemedButton, {
|
|
875
|
+
type: "button",
|
|
876
|
+
variant: buttonVariant,
|
|
877
|
+
size: "sm",
|
|
878
|
+
label: "Today",
|
|
879
|
+
disabled: navigation.isCurrentWeek,
|
|
880
|
+
onClick: handlers.onToday
|
|
881
|
+
})
|
|
882
|
+
]
|
|
883
|
+
});
|
|
884
|
+
};
|
|
885
|
+
const WeekBoardLegend = () => /* @__PURE__ */ jsx("div", {
|
|
886
|
+
className: "event-week-board-legend",
|
|
887
|
+
"aria-hidden": "true",
|
|
888
|
+
children: LEGEND_ITEMS.map((item) => /* @__PURE__ */ jsxs("span", {
|
|
889
|
+
className: "event-week-board-legend-item",
|
|
890
|
+
children: [/* @__PURE__ */ jsx("i", {
|
|
891
|
+
className: "event-week-board-legend-dot",
|
|
892
|
+
"data-status": item.status
|
|
893
|
+
}), item.label]
|
|
894
|
+
}, item.status))
|
|
895
|
+
});
|
|
896
|
+
const WeekBoardLoadError = ({ navigation, buttonVariant }) => {
|
|
897
|
+
if (navigation.kind !== "interactive" || navigation.loadState.kind !== "error") return null;
|
|
898
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
899
|
+
className: "event-week-board-error",
|
|
900
|
+
role: "status",
|
|
901
|
+
children: [/* @__PURE__ */ jsx("p", { children: "Failed to load events" }), /* @__PURE__ */ jsx(ThemedButton, {
|
|
902
|
+
type: "button",
|
|
903
|
+
variant: buttonVariant,
|
|
904
|
+
size: "sm",
|
|
905
|
+
label: "Try again",
|
|
906
|
+
onClick: navigation.loadState.onRetry
|
|
907
|
+
})]
|
|
908
|
+
});
|
|
909
|
+
};
|
|
910
|
+
const WeekBoardGrid = ({ days, eventsByDate, showCapacity, calendarTimeZone, today: currentDate }) => /* @__PURE__ */ jsx("div", {
|
|
911
|
+
className: "event-week-board-grid",
|
|
912
|
+
children: days.map((date) => {
|
|
913
|
+
const dateKey = formatDateKey(date);
|
|
914
|
+
const dayEvents = eventsByDate.get(dateKey) ?? [];
|
|
915
|
+
const today = isToday(date, currentDate);
|
|
916
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
917
|
+
className: clsx("event-week-board-day", dayEvents.length === 0 && "event-week-board-day--empty", today && "event-week-board-day--today"),
|
|
918
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
919
|
+
className: "event-week-board-day-head",
|
|
920
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
921
|
+
className: "event-week-board-day-abbr",
|
|
922
|
+
children: SHORT_DAY_NAMES[getDayOfWeek(date)]
|
|
923
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
924
|
+
className: "event-week-board-day-num",
|
|
925
|
+
children: date.day
|
|
926
|
+
})]
|
|
927
|
+
}), /* @__PURE__ */ jsx("div", {
|
|
928
|
+
className: "event-week-board-day-body",
|
|
929
|
+
children: dayEvents.map((event) => /* @__PURE__ */ jsx(WeekBoardCard, {
|
|
930
|
+
event,
|
|
931
|
+
showCapacity,
|
|
932
|
+
calendarTimeZone
|
|
933
|
+
}, event.occurrenceId || event.id))
|
|
934
|
+
})]
|
|
935
|
+
}, dateKey);
|
|
936
|
+
})
|
|
937
|
+
});
|
|
938
|
+
const WeekBoardFooter = ({ note, ctaHref, ctaLabel, buttonVariant }) => {
|
|
939
|
+
if (note === null && ctaHref === null) return null;
|
|
940
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
941
|
+
className: "event-week-board-foot",
|
|
942
|
+
children: [note === null ? null : /* @__PURE__ */ jsx("p", {
|
|
943
|
+
className: "event-week-board-foot-note",
|
|
944
|
+
children: note
|
|
945
|
+
}), ctaHref === null ? null : /* @__PURE__ */ jsx(ThemedButtonLink, {
|
|
946
|
+
variant: buttonVariant,
|
|
947
|
+
size: "sm",
|
|
948
|
+
href: ctaHref,
|
|
949
|
+
label: ctaLabel
|
|
950
|
+
})]
|
|
951
|
+
});
|
|
952
|
+
};
|
|
953
|
+
/**
|
|
954
|
+
* WeekBoardView
|
|
955
|
+
*
|
|
956
|
+
* Compact "class day-board": day columns side by side (one card per class per
|
|
957
|
+
* day), a legend of the three availability states, and a footer CTA. Collapses
|
|
958
|
+
* to a stacked list on mobile. Repurposes the week-grouped agenda data as a
|
|
959
|
+
* board rather than an hour-positioned timetable grid.
|
|
960
|
+
*/
|
|
961
|
+
const WeekBoardView = ({ days, events, navigation, showCapacity, emptyMessage = "No classes scheduled this week", title, footerNote, ctaLabel = "Reserve a place", ctaHref = null, buttonVariant = "outline", elevated = false, banded = false, calendarTimeZone, today }) => {
|
|
962
|
+
const eventsByDate = groupEventsByDate(events, calendarTimeZone);
|
|
963
|
+
const hasAnyEvents = days.some((date) => (eventsByDate.get(formatDateKey(date)) ?? []).length > 0);
|
|
964
|
+
const hasTitle = typeof title === "string" && title.length > 0;
|
|
965
|
+
const hasFooterNote = typeof footerNote === "string" && footerNote.length > 0;
|
|
966
|
+
const footerNoteText = hasAnyEvents ? hasFooterNote ? footerNote : null : emptyMessage;
|
|
967
|
+
const resolvedCtaHref = typeof ctaHref === "string" && ctaHref.length > 0 ? ctaHref : null;
|
|
968
|
+
return /* @__PURE__ */ jsx("div", {
|
|
969
|
+
className: "event-calendar event-calendar--week-board",
|
|
970
|
+
"data-block": "event-calendar",
|
|
971
|
+
...banded ? { "data-banded": "" } : {},
|
|
972
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
973
|
+
className: "event-week-board",
|
|
974
|
+
style: { "--event-week-board-cols": String(days.length) },
|
|
975
|
+
...elevated ? { "data-elevated": "" } : {},
|
|
976
|
+
children: [
|
|
977
|
+
/* @__PURE__ */ jsxs("div", {
|
|
978
|
+
className: "event-week-board-top",
|
|
979
|
+
children: [
|
|
980
|
+
hasTitle ? /* @__PURE__ */ jsx("span", {
|
|
981
|
+
className: "event-week-board-title",
|
|
982
|
+
children: title
|
|
983
|
+
}) : null,
|
|
984
|
+
/* @__PURE__ */ jsx(WeekBoardNavigationControls, {
|
|
985
|
+
navigation,
|
|
986
|
+
buttonVariant
|
|
987
|
+
}),
|
|
988
|
+
/* @__PURE__ */ jsx(WeekBoardLegend, {})
|
|
989
|
+
]
|
|
990
|
+
}),
|
|
991
|
+
/* @__PURE__ */ jsx(WeekBoardLoadError, {
|
|
992
|
+
navigation,
|
|
993
|
+
buttonVariant
|
|
994
|
+
}),
|
|
995
|
+
/* @__PURE__ */ jsx(WeekBoardGrid, {
|
|
996
|
+
days,
|
|
997
|
+
eventsByDate,
|
|
998
|
+
showCapacity,
|
|
999
|
+
calendarTimeZone,
|
|
1000
|
+
today
|
|
1001
|
+
}),
|
|
1002
|
+
/* @__PURE__ */ jsx(WeekBoardFooter, {
|
|
1003
|
+
note: footerNoteText,
|
|
1004
|
+
ctaHref: resolvedCtaHref,
|
|
1005
|
+
ctaLabel,
|
|
1006
|
+
buttonVariant
|
|
1007
|
+
})
|
|
1008
|
+
]
|
|
1009
|
+
})
|
|
1010
|
+
});
|
|
1011
|
+
};
|
|
1012
|
+
//#endregion
|
|
1013
|
+
//#region ../blocks/src/system/runtime/nodes/events/shared/timetableModel.ts
|
|
1014
|
+
/**
|
|
1015
|
+
* Event-domain adapter over @riverbankcms/calendar.
|
|
1016
|
+
*
|
|
1017
|
+
* Wraps the generic timetable model with PublicEvent-shaped accessors and
|
|
1018
|
+
* domain-side cell content (timeLabel, teacherLine, capacityLabel, isFull,
|
|
1019
|
+
* categoryColor with theme fallback). Renderers (WeekTimetableView,
|
|
1020
|
+
* EventCalendar.server) consume this shape.
|
|
1021
|
+
*/
|
|
1022
|
+
/** Theme-default border colour for events without a category-supplied colour. */
|
|
1023
|
+
const DEFAULT_EVENT_CELL_COLOR = "rgb(var(--tb-accent))";
|
|
1024
|
+
function buildTimetableModel(input) {
|
|
1025
|
+
const calendarTimeZone = input.calendarTimeZone;
|
|
1026
|
+
const generic = buildTimetableModel$1({
|
|
1027
|
+
items: input.events,
|
|
1028
|
+
viewDate: input.viewDate,
|
|
1029
|
+
startOfWeek: input.startOfWeek,
|
|
1030
|
+
today: input.today,
|
|
1031
|
+
getId: (event) => event.id,
|
|
1032
|
+
getStartsAt: (event) => event.startsAt,
|
|
1033
|
+
getEndsAt: (event) => event.endsAt,
|
|
1034
|
+
getTimeZone: (event) => resolveEventTimeZone(event, calendarTimeZone),
|
|
1035
|
+
getColor: (event) => event.eventCategory?.color ?? null,
|
|
1036
|
+
getOrderKey: (event) => `${event.title}\u0000${event.id}`
|
|
1037
|
+
});
|
|
1038
|
+
return {
|
|
1039
|
+
hourTicks: [...generic.hourTicks],
|
|
1040
|
+
startHour: generic.startHour,
|
|
1041
|
+
endHour: generic.endHour,
|
|
1042
|
+
rangeMinutes: generic.rangeMinutes,
|
|
1043
|
+
hasEvents: generic.hasItems,
|
|
1044
|
+
days: generic.days.map((day) => ({
|
|
1045
|
+
date: day.date,
|
|
1046
|
+
dateKey: day.dateKey,
|
|
1047
|
+
label: formatDayLabel(day.date, calendarTimeZone, {
|
|
1048
|
+
date: "short",
|
|
1049
|
+
weekday: "long",
|
|
1050
|
+
year: "omit"
|
|
1051
|
+
}),
|
|
1052
|
+
shortLabel: formatDayLabel(day.date, calendarTimeZone, {
|
|
1053
|
+
date: "omit",
|
|
1054
|
+
day: "numeric",
|
|
1055
|
+
weekday: "short",
|
|
1056
|
+
year: "omit"
|
|
1057
|
+
}),
|
|
1058
|
+
isToday: day.isToday,
|
|
1059
|
+
events: day.cells.map((cell) => toEventCell(cell, calendarTimeZone))
|
|
1060
|
+
}))
|
|
1061
|
+
};
|
|
1062
|
+
}
|
|
1063
|
+
function toEventCell(cell, calendarTimeZone) {
|
|
1064
|
+
const event = cell.item;
|
|
1065
|
+
const capacity = formatTimetableCapacity(event);
|
|
1066
|
+
return {
|
|
1067
|
+
event,
|
|
1068
|
+
startsAtMinutes: cell.startsAtMinutes,
|
|
1069
|
+
endsAtMinutes: cell.endsAtMinutes,
|
|
1070
|
+
topPercent: cell.topPercent,
|
|
1071
|
+
heightPercent: cell.heightPercent,
|
|
1072
|
+
laneIndex: cell.laneIndex,
|
|
1073
|
+
laneCount: cell.laneCount,
|
|
1074
|
+
categoryColor: cell.color ?? DEFAULT_EVENT_CELL_COLOR,
|
|
1075
|
+
timeLabel: formatEventTimeRange(event, eventDateOptions({
|
|
1076
|
+
...event,
|
|
1077
|
+
timeZone: resolveEventTimeZone(event, calendarTimeZone)
|
|
1078
|
+
})),
|
|
1079
|
+
teacherLine: formatEventTeacherLine(event),
|
|
1080
|
+
capacityLabel: capacity.label,
|
|
1081
|
+
isFull: capacity.isFull
|
|
1082
|
+
};
|
|
1083
|
+
}
|
|
1084
|
+
function formatTimetableCapacity(event) {
|
|
1085
|
+
return {
|
|
1086
|
+
label: formatEventRemainingPlaces(event, { compact: true }),
|
|
1087
|
+
isFull: isEventFull(event)
|
|
1088
|
+
};
|
|
1089
|
+
}
|
|
1090
|
+
function formatDayLabel(date, timeZone, options) {
|
|
1091
|
+
return formatDate({
|
|
1092
|
+
kind: "civil",
|
|
1093
|
+
value: date
|
|
1094
|
+
}, eventDateOptions({
|
|
1095
|
+
siteTimeZone: timeZone,
|
|
1096
|
+
timeZone
|
|
1097
|
+
}), options);
|
|
1098
|
+
}
|
|
1099
|
+
//#endregion
|
|
1100
|
+
export { plainTextToInlineText as _, MonthLookView as a, ButtonNode as c, TextNode as d, LocationMapView as f, parseInlineTextFromUnknown as g, inlineTextToPlainText as h, buildWeekBoardViewProps as i, LinkNode as l, coerceInlineTextWithFallback as m, WeekBoardView as n, CalendarRecurringWeek as o, Text as p, buildWeekBoardNavigationState as r, RecurringSchedule as s, buildTimetableModel as t, RichTextNode as u };
|