@riverbankcms/sdk 0.152.0 → 0.154.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.
Files changed (303) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/dist/{EventEmbeddedCheckoutStep-DVQXWFm6.mjs → EventEmbeddedCheckoutStep-ba9npQtb.mjs} +1 -1
  3. package/dist/{PreviewEditorSidebar-Dr4NJi3Q.mjs → PreviewEditorSidebar-C7FiaxlF.mjs} +194 -22
  4. package/dist/{PreviewEditorUI-DSZXQbyh.mjs → PreviewEditorUI-DFst50q1.mjs} +20 -44
  5. package/dist/{SdkPreviewModeRuntime-Dl4GyMc3.mjs → SdkPreviewModeRuntime-BUNV_YHZ.mjs} +266 -143
  6. package/dist/{SiteChromeCustomizeContext-DgBe-FlM.mjs → SiteChromeCustomizeContext-DEj7qppF.mjs} +5340 -4329
  7. package/dist/{ThemedButton-B8ViBnLK.mjs → ThemedButton-C8kzu0hY.mjs} +610 -116
  8. package/dist/_dts/ai/src/contracts/proposals.d.ts +416 -182
  9. package/dist/_dts/ai/src/contracts/siteStyleProposalSchemas.d.ts +3270 -8214
  10. package/dist/_dts/api/src/billing.d.ts +2 -0
  11. package/dist/_dts/api/src/billingEndpointDefinitions.d.ts +78 -0
  12. package/dist/_dts/api/src/bookingAdjustments.d.ts +3 -2
  13. package/dist/_dts/api/src/bookingOperations.d.ts +7 -2
  14. package/dist/_dts/api/src/bookingPeople.d.ts +19 -0
  15. package/dist/_dts/api/src/bookingPeopleEndpointDefinitions.d.ts +8 -0
  16. package/dist/_dts/api/src/bookingRecords.d.ts +4 -106
  17. package/dist/_dts/api/src/bookings.d.ts +2 -3
  18. package/dist/_dts/api/src/communications.d.ts +19 -5
  19. package/dist/_dts/api/src/contentRuntime.d.ts +1 -0
  20. package/dist/_dts/api/src/endpoints.d.ts +88 -43
  21. package/dist/_dts/api/src/index.d.ts +4 -2
  22. package/dist/_dts/api/src/indexCoreTypes.d.ts +1 -0
  23. package/dist/_dts/api/src/indexExtendedTypes.d.ts +1 -1
  24. package/dist/_dts/api/src/moneyPayments.d.ts +116 -0
  25. package/dist/_dts/api/src/onboarding/surfaceData.d.ts +2 -0
  26. package/dist/_dts/api/src/sdk-event-upsert.d.ts +2 -2
  27. package/dist/_dts/api/src/sdkThemeWire.d.ts +348 -1537
  28. package/dist/_dts/api/src/shared-contracts.d.ts +10 -0
  29. package/dist/_dts/api/src/siteInfrastructure.d.ts +2 -1
  30. package/dist/_dts/api/src/sitePlatformEndpoints.d.ts +18 -0
  31. package/dist/_dts/api/src/siteRuntimeEndpoints.d.ts +17 -16
  32. package/dist/_dts/api/src/siteSettings.d.ts +1 -0
  33. package/dist/_dts/api/src/stripeConnectSetup.d.ts +90 -0
  34. package/dist/_dts/api/src/teamMembers.d.ts +2 -27
  35. package/dist/_dts/api/src/types.d.ts +11 -31
  36. package/dist/_dts/api/src/wholeSeriesRuns.d.ts +2 -4
  37. package/dist/_dts/block-form/src/widgets/RepeaterField/components/layoutGridDomain.d.ts +3 -13
  38. package/dist/_dts/blocks/src/client/site-chrome.d.ts +1 -1
  39. package/dist/_dts/blocks/src/contracts/index.d.ts +1 -0
  40. package/dist/_dts/blocks/src/contracts/proof-block-islands.d.ts +8 -96
  41. package/dist/_dts/blocks/src/index.d.ts +1 -0
  42. package/dist/_dts/blocks/src/lib/media.d.ts +1 -0
  43. package/dist/_dts/blocks/src/lib/picsum.d.ts +2 -2
  44. package/dist/_dts/blocks/src/pageRendererContracts.d.ts +2 -1
  45. package/dist/_dts/blocks/src/primitives/content/components/RichText.d.ts +1 -1
  46. package/dist/_dts/blocks/src/primitives/content/primitives.d.ts +4 -1
  47. package/dist/_dts/blocks/src/primitives/layout/Section.d.ts +1 -0
  48. package/dist/_dts/blocks/src/system/blocks/events/event-calendar.d.ts +1 -1
  49. package/dist/_dts/blocks/src/system/blocks/events/eventSelectionFields.d.ts +2 -2
  50. package/dist/_dts/blocks/src/system/blocks/events/shared/fields.d.ts +0 -4
  51. package/dist/_dts/blocks/src/system/blocks/events/shared/index.d.ts +0 -1
  52. package/dist/_dts/blocks/src/system/blocks/events/shared/schemas.d.ts +276 -884
  53. package/dist/_dts/blocks/src/system/blocks/events/shared/types.d.ts +2 -2
  54. package/dist/_dts/blocks/src/system/blocks/form.d.ts +10 -0
  55. package/dist/_dts/blocks/src/system/blocks/image-gallery/fields.d.ts +1 -0
  56. package/dist/_dts/blocks/src/system/blocks/image-gallery.d.ts +6 -1
  57. package/dist/_dts/blocks/src/system/blocks/location-map.d.ts +2 -2
  58. package/dist/_dts/blocks/src/system/blocks/media-text.d.ts +92 -90
  59. package/dist/_dts/blocks/src/system/blocks/newsletter-signup.d.ts +12 -0
  60. package/dist/_dts/blocks/src/system/blocks/shared/teamMembers.d.ts +4 -7
  61. package/dist/_dts/blocks/src/system/blocks/site-footer-runtime-layout.d.ts +23 -0
  62. package/dist/_dts/blocks/src/system/blocks/site-footer-runtime-profile.d.ts +20 -0
  63. package/dist/_dts/blocks/src/system/blocks/site-footer-runtime.d.ts +17 -16
  64. package/dist/_dts/blocks/src/system/blocks/site-footer.d.ts +1 -1
  65. package/dist/_dts/blocks/src/system/blocks/team-members.d.ts +2 -2
  66. package/dist/_dts/blocks/src/system/customize/backgrounds.d.ts +6 -6
  67. package/dist/_dts/blocks/src/system/customize/facets.d.ts +75 -9
  68. package/dist/_dts/blocks/src/system/fields/backgroundContent.d.ts +377 -1
  69. package/dist/_dts/blocks/src/system/helpers/backgroundMedia.d.ts +6 -2
  70. package/dist/_dts/blocks/src/system/helpers/resolveBackground.d.ts +3 -3
  71. package/dist/_dts/blocks/src/system/layout/repeaterGrid.d.ts +12 -5
  72. package/dist/_dts/blocks/src/system/manifest/fieldValidation/index.d.ts +3 -3
  73. package/dist/_dts/blocks/src/system/manifest/schema.d.ts +48 -48
  74. package/dist/_dts/blocks/src/system/manifest/validation.d.ts +2 -0
  75. package/dist/_dts/blocks/src/system/node/fragments/index.d.ts +1 -0
  76. package/dist/_dts/blocks/src/system/node/fragments/lookSlot.d.ts +1 -1
  77. package/dist/_dts/blocks/src/system/node/fragments/responsiveTwoColumn.d.ts +3 -1
  78. package/dist/_dts/blocks/src/system/node/fragments/sectionHead.d.ts +15 -0
  79. package/dist/_dts/blocks/src/system/runtime/components/registry.client.d.ts +18 -198
  80. package/dist/_dts/blocks/src/system/runtime/components/runtime-backed-blocks.d.ts +9 -99
  81. package/dist/_dts/blocks/src/system/runtime/hooks/useBookingFlowController.d.ts +1 -1
  82. package/dist/_dts/blocks/src/system/runtime/hooks/useHeadlessBookingFlow.d.ts +2 -0
  83. package/dist/_dts/blocks/src/system/runtime/lookSurfaces.d.ts +18 -6
  84. package/dist/_dts/blocks/src/system/runtime/nodes/ImageResolveContext.d.ts +1 -1
  85. package/dist/_dts/blocks/src/system/runtime/nodes/appointment-services.d.ts +50 -202
  86. package/dist/_dts/blocks/src/system/runtime/nodes/basic.d.ts +2 -1
  87. package/dist/_dts/blocks/src/system/runtime/nodes/booking-form.headless.state.d.ts +28 -1
  88. package/dist/_dts/blocks/src/system/runtime/nodes/event-details/lookPresentation.d.ts +12 -6
  89. package/dist/_dts/blocks/src/system/runtime/nodes/event-details/presentation.d.ts +1 -1
  90. package/dist/_dts/blocks/src/system/runtime/nodes/events/domain/dates.d.ts +1 -1
  91. package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/CardListItem.d.ts +1 -1
  92. package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/eventCollectionContract.d.ts +289 -885
  93. package/dist/_dts/blocks/src/system/runtime/nodes/file-download.d.ts +3 -2
  94. package/dist/_dts/blocks/src/system/runtime/nodes/form.fields.d.ts +5 -2
  95. package/dist/_dts/blocks/src/system/runtime/nodes/form.interactive.d.ts +11 -79
  96. package/dist/_dts/blocks/src/system/runtime/nodes/form.parts.d.ts +7 -0
  97. package/dist/_dts/blocks/src/system/runtime/nodes/form.server.d.ts +2 -13
  98. package/dist/_dts/blocks/src/system/runtime/nodes/media.d.ts +22 -90
  99. package/dist/_dts/blocks/src/system/runtime/nodes/mediaContext.d.ts +69 -0
  100. package/dist/_dts/blocks/src/system/runtime/nodes/newsletter-form.interactive.d.ts +8 -72
  101. package/dist/_dts/blocks/src/system/runtime/nodes/newsletter-form.parts.d.ts +6 -6
  102. package/dist/_dts/blocks/src/system/runtime/nodes/newsletter-form.types.d.ts +3 -2
  103. package/dist/_dts/blocks/src/system/runtime/nodes/shared/contract-schemas.d.ts +2 -2
  104. package/dist/_dts/blocks/src/system/transforms/registry/_utils/surfaceForegroundStyles.d.ts +3 -0
  105. package/dist/_dts/blocks/src/system/transforms/registry/footerArrangement.d.ts +6 -0
  106. package/dist/_dts/blocks/src/system/transforms/registry/index.d.ts +1 -0
  107. package/dist/_dts/blocks/src/system/transforms/registry/layout.d.ts +0 -11
  108. package/dist/_dts/blocks/src/system/transforms/registry/links.d.ts +3 -3
  109. package/dist/_dts/blocks/src/system/transforms/typed.d.ts +1 -10
  110. package/dist/_dts/commerce/src/purchase/orderConfirmationPlanning.d.ts +1 -0
  111. package/dist/_dts/content-editor/src/FooterComposerOverview.d.ts +5 -2
  112. package/dist/_dts/content-editor/src/FooterComposerPanel.d.ts +1 -1
  113. package/dist/_dts/content-editor/src/FooterNavigationLayoutControl.d.ts +6 -3
  114. package/dist/_dts/content-editor/src/controller/editorLeaseParticipation.d.ts +1 -1
  115. package/dist/_dts/content-editor/src/footerComposer.d.ts +2 -1
  116. package/dist/_dts/content-editor/src/footerComposerPanelTypes.d.ts +3 -1
  117. package/dist/_dts/content-editor/src/footerNavigationLayoutState.d.ts +56 -0
  118. package/dist/_dts/content-editor/src/footerPreviewRuntime.d.ts +2 -1
  119. package/dist/_dts/content-editor/src/useFooterComposerState.d.ts +3 -4
  120. package/dist/_dts/content-editor/src/useFooterNavigationLayout.d.ts +11 -8
  121. package/dist/_dts/content-model/src/content-types/schema.d.ts +3 -3
  122. package/dist/_dts/core/src/booking-refunds.d.ts +2 -0
  123. package/dist/_dts/core/src/date-display.d.ts +85 -0
  124. package/dist/_dts/core/src/date-time-formatter.d.ts +2 -0
  125. package/dist/_dts/core/src/footer-arrangement.d.ts +8 -1
  126. package/dist/_dts/core/src/footer-composition-types.d.ts +6 -1
  127. package/dist/_dts/core/src/footer-composition.d.ts +1 -1
  128. package/dist/_dts/core/src/footer-navigation-layout.d.ts +3 -0
  129. package/dist/_dts/core/src/index.d.ts +2 -0
  130. package/dist/_dts/core/src/mailing-list-runtime.d.ts +2 -2
  131. package/dist/_dts/core/src/mailing-list-setup-parser.d.ts +9 -1
  132. package/dist/_dts/core/src/mailing-list-setup.d.ts +12 -1
  133. package/dist/_dts/core/src/mailing-list-submission.d.ts +7 -2
  134. package/dist/_dts/core/src/mailing-list-targeting.d.ts +9 -1
  135. package/dist/_dts/core/src/public-profile.d.ts +3 -1
  136. package/dist/_dts/core/src/scheduled-date-time.d.ts +69 -0
  137. package/dist/_dts/db/src/generated/supabase/database.types.d.ts +105 -13
  138. package/dist/_dts/db/src/schemas/forms.d.ts +16 -16
  139. package/dist/_dts/editor-blocks/src/index.d.ts +1 -0
  140. package/dist/_dts/editor-blocks/src/media/MediaField.d.ts +2 -2
  141. package/dist/_dts/editor-blocks/src/media/admitEditorMediaField.d.ts +4 -0
  142. package/dist/_dts/editor-blocks/src/widgets/mailing-list-targeting/targetingState.d.ts +2 -2
  143. package/dist/_dts/media-core/src/assetsInUseSummary.d.ts +6 -0
  144. package/dist/_dts/media-core/src/contentMediaAudit.d.ts +3 -2
  145. package/dist/_dts/media-core/src/index.d.ts +4 -0
  146. package/dist/_dts/media-core/src/media.d.ts +406 -0
  147. package/dist/_dts/media-core/src/mediaIdentifierSchema.d.ts +3 -0
  148. package/dist/_dts/media-core/src/mediaKinds.d.ts +2 -0
  149. package/dist/_dts/media-core/src/mediaUsageProjection.d.ts +13 -1
  150. package/dist/_dts/media-core/src/mediaWriteNormalizer.d.ts +2 -6
  151. package/dist/_dts/media-core/src/portableMediaReferences.d.ts +8 -21
  152. package/dist/_dts/media-core/src/renderableMediaAsset.d.ts +28 -14
  153. package/dist/_dts/media-core/src/renderableMediaAssetAdmission.d.ts +15 -0
  154. package/dist/_dts/media-editor/src/CropDialog.d.ts +6 -3
  155. package/dist/_dts/media-editor/src/MediaEditor.d.ts +2 -1
  156. package/dist/_dts/media-editor/src/MediaPreview.d.ts +3 -3
  157. package/dist/_dts/media-editor/src/cropEditorSource.d.ts +5 -7
  158. package/dist/_dts/media-editor/src/editorMediaState.d.ts +29 -0
  159. package/dist/_dts/media-editor/src/mediaSelection.d.ts +1 -2
  160. package/dist/_dts/media-editor/src/runtimeMediaAssetState.d.ts +4 -5
  161. package/dist/_dts/media-editor/src/types.d.ts +1 -1
  162. package/dist/_dts/media-editor/src/utils.d.ts +0 -1
  163. package/dist/_dts/media-react/src/components/cropChangePolicy.d.ts +4 -1
  164. package/dist/_dts/media-react/src/components/cropGeometry.d.ts +1 -0
  165. package/dist/_dts/media-react/src/components/useImageCropperController.d.ts +1 -0
  166. package/dist/_dts/preview-next/src/client/blocks/ArrangementBlockToolbar.d.ts +2 -1
  167. package/dist/_dts/preview-next/src/client/blocks/BlockBackgroundChooser.d.ts +2 -1
  168. package/dist/_dts/preview-next/src/client/blocks/previewCustomizeSelectedMedia.d.ts +11 -12
  169. package/dist/_dts/preview-next/src/client/preview/PreviewShell.d.ts +1 -0
  170. package/dist/_dts/preview-next/src/client/preview/PreviewShellLayout.d.ts +1 -0
  171. package/dist/_dts/preview-next/src/client/preview/SiteChromeCustomizeContext.d.ts +4 -1
  172. package/dist/_dts/preview-next/src/client/preview/siteChromeSavePlan.d.ts +27 -5
  173. package/dist/_dts/preview-next/src/client/preview/siteStylePreviewPlanner.d.ts +2 -0
  174. package/dist/_dts/preview-next/src/client/preview/useConfirmedPreferenceRecord.d.ts +12 -0
  175. package/dist/_dts/preview-next/src/client/preview/usePersistedFooterPreferences.d.ts +26 -0
  176. package/dist/_dts/preview-next/src/client/preview/usePersistedHeaderPreferences.d.ts +40 -2
  177. package/dist/_dts/sdk/src/config/validation.d.ts +3 -3
  178. package/dist/_dts/sdk/src/contracts/content.d.ts +2 -45
  179. package/dist/_dts/sdk/src/contracts/index.d.ts +1 -1
  180. package/dist/_dts/sdk/src/contracts/rendering.d.ts +3 -3
  181. package/dist/_dts/sdk/src/contracts/system-block-content.d.ts +4 -46
  182. package/dist/_dts/sdk/src/date-time/index.d.ts +2 -68
  183. package/dist/_dts/sdk/src/index.d.ts +1 -0
  184. package/dist/_dts/sdk/src/public-api/contracts.d.ts +1 -0
  185. package/dist/_dts/sdk/src/rendering/image.d.ts +5 -5
  186. package/dist/_dts/sdk/src/rendering/index.d.ts +2 -1
  187. package/dist/_dts/sdk/src/rendering/islands/types.d.ts +1 -1
  188. package/dist/_dts/sdk/src/rendering/link.d.ts +3 -7
  189. package/dist/_dts/sdk/src/rendering/mediaAssets.d.ts +2 -4
  190. package/dist/_dts/sdk/src/version.d.ts +1 -1
  191. package/dist/_dts/theme-core/src/accordions/types.d.ts +1 -1
  192. package/dist/_dts/theme-core/src/boxBackgroundSchema.d.ts +397 -26
  193. package/dist/_dts/theme-core/src/buttons/buttonColourContract.d.ts +2 -0
  194. package/dist/_dts/theme-core/src/buttons/resolveButtonColourStates.d.ts +2 -0
  195. package/dist/_dts/theme-core/src/buttons/styles/recipes/lanternRecipes.d.ts +60 -0
  196. package/dist/_dts/theme-core/src/buttons/styles/registry.d.ts +57 -0
  197. package/dist/_dts/theme-core/src/buttons/styles/selection.d.ts +10 -1
  198. package/dist/_dts/theme-core/src/buttons/types.d.ts +378 -66
  199. package/dist/_dts/theme-core/src/buttons/typography.d.ts +24 -0
  200. package/dist/_dts/theme-core/src/cards/types.d.ts +42 -42
  201. package/dist/_dts/theme-core/src/footer/effectiveNavLinkStyle.d.ts +1 -1
  202. package/dist/_dts/theme-core/src/footer/generateFooterCss.d.ts +4 -1
  203. package/dist/_dts/theme-core/src/footer/mode.d.ts +2 -11
  204. package/dist/_dts/theme-core/src/generated/containerResponsiveThemeCss.d.ts +1 -1
  205. package/dist/_dts/theme-core/src/inputs/types.d.ts +3 -3
  206. package/dist/_dts/theme-core/src/lib/media.d.ts +2 -616
  207. package/dist/_dts/theme-core/src/mock-themes/all.d.ts +495 -2766
  208. package/dist/_dts/theme-core/src/navigation/types.d.ts +4 -4
  209. package/dist/_dts/theme-core/src/palette/curated/types.d.ts +1 -1
  210. package/dist/_dts/theme-core/src/schema.d.ts +838 -3369
  211. package/dist/_dts/theme-core/src/site-styles/appearancePresetTypes.d.ts +23 -7
  212. package/dist/_dts/theme-core/src/site-styles/backgroundAppearance.d.ts +2 -2
  213. package/dist/_dts/theme-core/src/site-styles/compilationPlan.d.ts +4 -6
  214. package/dist/_dts/theme-core/src/site-styles/compileFooterAgainstRow.d.ts +121 -0
  215. package/dist/_dts/theme-core/src/site-styles/curatedSiteStyles.d.ts +25 -0
  216. package/dist/_dts/theme-core/src/site-styles/footerLookDefaults.d.ts +45 -0
  217. package/dist/_dts/theme-core/src/site-styles/footerLookRecipe.d.ts +50 -0
  218. package/dist/_dts/theme-core/src/site-styles/footerLooks.d.ts +9 -35
  219. package/dist/_dts/theme-core/src/site-styles/footerPreferences.d.ts +29 -0
  220. package/dist/_dts/theme-core/src/site-styles/headerPreferencesPersistence.d.ts +2 -3
  221. package/dist/_dts/theme-core/src/site-styles/index.d.ts +4 -0
  222. package/dist/_dts/theme-core/src/site-styles/lookResolution.d.ts +2 -2
  223. package/dist/_dts/theme-core/src/site-styles/previewCompiler.d.ts +1 -1
  224. package/dist/_dts/theme-core/src/site-styles/runtimeBackgroundResolution.d.ts +9 -9
  225. package/dist/_dts/theme-core/src/site-styles/siteChromeBackgrounds.d.ts +8 -0
  226. package/dist/_dts/theme-core/src/site-styles/styleTags.d.ts +1 -1
  227. package/dist/_dts/theme-core/src/site-styles/themeParity.d.ts +1 -1
  228. package/dist/_dts/theme-core/src/site-styles/tokenRecipes.d.ts +2 -2
  229. package/dist/_dts/theme-core/src/styles/skinTokens.d.ts +2 -2
  230. package/dist/_dts/theme-core/src/typography/schema.d.ts +2 -2
  231. package/dist/_dts/ui/src/card.d.ts +1 -1
  232. package/dist/client/{BookingMailingListNote-CBuMKN0w.mjs → BookingMailingListNote-CNoSqFtf.mjs} +2 -2
  233. package/dist/client/{CardListItem-Dc9XTXhB.mjs → CardListItem-BkTkqBkh.mjs} +5 -4
  234. package/dist/client/{CheckboxChoice-CIqx_o0E.mjs → CheckboxChoice-CHJpsty4.mjs} +1 -1
  235. package/dist/client/{DemoBookingPortalAccess-D3VQ_kLj.mjs → DemoBookingPortalAccess-C7KQKFNt.mjs} +2 -2
  236. package/dist/client/{EventCombined.client-BHGEKise.mjs → EventCombined.client-BgeYMjHJ.mjs} +5 -6
  237. package/dist/client/{EventEmbeddedCheckoutStep-Bo1Cm23R.mjs → EventEmbeddedCheckoutStep-BTc_lTkM.mjs} +2 -2
  238. package/dist/client/{EventListing.client-D5OQgVPr.mjs → EventListing.client-ChRs9Hl2.mjs} +2 -2
  239. package/dist/client/{LeafletStaticMap-CLL5cWrr.mjs → LeafletStaticMap-C_dNQgd0.mjs} +1 -1
  240. package/dist/client/{RichText-BoDmnopf.mjs → RichText-BI9bzbjo.mjs} +106 -60
  241. package/dist/client/{ThemedButton-Ciltp0IK.mjs → ThemedButton-wl3Z3wkH.mjs} +1 -2
  242. package/dist/client/{accordion-DOkRS64-.mjs → accordion-6Yz8Wd83.mjs} +1 -1
  243. package/dist/client/{bookingForm-wlMVwo9h.mjs → bookingForm-i_pKIGiY.mjs} +42 -15
  244. package/dist/client/bookings.mjs +118357 -22833
  245. package/dist/client/{carousel-CGWk-Z0u.mjs → carousel-DNqd_PjC.mjs} +2 -2
  246. package/dist/client/{carousel.client-kX5mN1Eg.mjs → carousel.client-BUgjPbb6.mjs} +1 -1
  247. package/dist/client/{cart-OBBPlaH4.mjs → cart-D8OBHuF4.mjs} +3 -3
  248. package/dist/client/{checkout-Bmw2WjQX.mjs → checkout-F3-9IGLU.mjs} +3 -3
  249. package/dist/client/client.mjs +20785 -19238
  250. package/dist/client/{context-BI77UFAn.mjs → context-Dg4ZrxDD.mjs} +1 -1
  251. package/dist/client/{eventCalendar-qkej2Edn.mjs → eventCalendar-BUc7YIBM.mjs} +8 -9
  252. package/dist/client/{eventCombined-DApKHvat.mjs → eventCombined-BwfShk2a.mjs} +4 -4
  253. package/dist/client/{eventDetails-BQyUDPH0.mjs → eventDetails-BMOVC3go.mjs} +3 -3
  254. package/dist/client/{eventListing-CeAnshlZ.mjs → eventListing-BwE9PM-t.mjs} +4 -4
  255. package/dist/client/{eventRegistration-C3A3NyBO.mjs → eventRegistration-CCWPYDc7.mjs} +10 -10
  256. package/dist/client/{form-DW8rU7jO.mjs → form-CXFr0Gd5.mjs} +115 -52
  257. package/dist/client/{headerSection-CkIhsoNm.mjs → headerSection-BX8qw8kH.mjs} +3 -3
  258. package/dist/client/hooks.mjs +17908 -16797
  259. package/dist/client/{locationMap-D4O8wbli.mjs → locationMap-B3La71m0.mjs} +3 -4
  260. package/dist/client/{media-C5K_0xPd.mjs → media-B1Cbv721.mjs} +183 -362
  261. package/dist/client/mediaContext-CwbbimYB.mjs +135 -0
  262. package/dist/client/{newsletterForm-B7IxSPuz.mjs → newsletterForm-DnGyR0x7.mjs} +51 -15
  263. package/dist/client/{productDetail-Bqxpwy5N.mjs → productDetail-BVgTqvkb.mjs} +3 -3
  264. package/dist/client/{productList-u9Lz8V15.mjs → productList-CcO7kUQw.mjs} +3 -3
  265. package/dist/client/{propsDecoder-Bf1jucUp.mjs → propsDecoder-B1OeWavE.mjs} +2193 -374
  266. package/dist/client/renderableMediaAssetAdmission-CHkXYDC_.mjs +143 -0
  267. package/dist/client/rendering/client.mjs +22424 -21488
  268. package/dist/client/rendering/islands.mjs +20 -23
  269. package/dist/client/rendering.mjs +21025 -19413
  270. package/dist/client/{routeIslandApiConfig-BgP-aPMl.mjs → routeIslandApiConfig-Dl4vglJm.mjs} +1 -1
  271. package/dist/client/{shop-B_eykR-_.mjs → shop-P72nX5Fs.mjs} +7 -7
  272. package/dist/client/{shop-commerce-CT0APkFV.mjs → shop-commerce-Bt7uraDx.mjs} +8 -8
  273. package/dist/client/{shop-commerce-store-DcvZxdEK.mjs → shop-commerce-store-C1-mxSye.mjs} +1 -1
  274. package/dist/client/{shopShared-BVJOiUiJ.mjs → shopShared-Db-cRGu3.mjs} +5 -5
  275. package/dist/client/{useDiscountCodeUi-DPmYDunz.mjs → useDiscountCodeUi-jvAiUoUX.mjs} +1 -1
  276. package/dist/client/{useEventPagination-8-U55vH5.mjs → useEventPagination-BdWpCniq.mjs} +6 -7
  277. package/dist/preview-next/before-render.mjs +222 -55
  278. package/dist/preview-next/client/runtime.mjs +3 -3
  279. package/dist/preview-next/editor-chrome.css +5 -2
  280. package/dist/preview-next/keepAlive.mjs +133 -51
  281. package/dist/preview-next/middleware.mjs +133 -51
  282. package/dist/{sdk-runtime-C5jPdSrk.mjs → sdk-runtime-DLhjF2Nw.mjs} +1 -1
  283. package/dist/server/components.mjs +21541 -20118
  284. package/dist/server/config-validation.mjs +2466 -1403
  285. package/dist/server/config.mjs +2466 -1403
  286. package/dist/server/data.mjs +17842 -16759
  287. package/dist/server/date-time.mjs +258 -116
  288. package/dist/server/index.mjs +360 -53
  289. package/dist/server/next.mjs +21913 -20539
  290. package/dist/server/page-converter.mjs +8121 -7322
  291. package/dist/server/prebuild.mjs +1 -1
  292. package/dist/server/rendering/server.mjs +21196 -19760
  293. package/dist/server/rendering.mjs +21554 -20123
  294. package/dist/server/routing.mjs +19806 -18607
  295. package/dist/server/server.mjs +2907 -1845
  296. package/dist/server/theme-bridge.mjs +991 -160
  297. package/dist/server/theme.mjs +501 -100
  298. package/dist/{spinner-B-ab2rJp.mjs → spinner-MTooKfck.mjs} +1 -1
  299. package/dist/styles/index.css +254 -1
  300. package/package.json +1 -1
  301. package/dist/_dts/blocks/src/system/blocks/events/shared/layout.d.ts +0 -12
  302. package/dist/client/aspectTransforms-D-TnDdq4.mjs +0 -93
  303. package/dist/client/colorStyles-ECDNPE_P.mjs +0 -1253
@@ -1,3 +1,29 @@
1
+ //#region ../core/src/date-time-formatter.ts
2
+ /** Shared Intl engine, internal to core's date presentation owners. */
3
+ const FORMATTER_CACHE_LIMIT$1 = 100;
4
+ const dateTimeFormatterCache = /* @__PURE__ */ new Map();
5
+ function getDateTimeFormatter(locale, timeZone, format) {
6
+ const key = `${locale}\u0000${timeZone}\u0000${JSON.stringify(Object.entries(format).sort(([left], [right]) => left.localeCompare(right)))}`;
7
+ const cached = dateTimeFormatterCache.get(key);
8
+ if (cached !== void 0) return cached;
9
+ if (typeof locale !== "string" || Intl.DateTimeFormat.supportedLocalesOf([locale]).length === 0) throw new RangeError("An explicit supported locale is required");
10
+ if (typeof timeZone !== "string" || timeZone.length === 0) throw new RangeError("An explicit time zone is required");
11
+ const formatter = new Intl.DateTimeFormat(locale, {
12
+ ...format,
13
+ timeZone
14
+ });
15
+ if (dateTimeFormatterCache.size >= FORMATTER_CACHE_LIMIT$1) dateTimeFormatterCache.clear();
16
+ dateTimeFormatterCache.set(key, formatter);
17
+ return formatter;
18
+ }
19
+ function formatIntlRange(formatter, start, end) {
20
+ const nativeFormatRange = Reflect.get(formatter, "formatRange");
21
+ if (typeof nativeFormatRange !== "function") throw new Error("Intl.DateTimeFormat.formatRange is required");
22
+ const output = Reflect.apply(nativeFormatRange, formatter, [start, end]);
23
+ if (typeof output !== "string") throw new Error("Intl.DateTimeFormat.formatRange returned a non-string value");
24
+ return output;
25
+ }
26
+ //#endregion
1
27
  //#region ../core/src/result.ts
2
28
  function ok(value) {
3
29
  return {
@@ -40,26 +66,37 @@ function parseBookingTimeZone(timeZone) {
40
66
  }
41
67
  //#endregion
42
68
  //#region ../core/src/booking-date-time.ts
43
- const DATE_TIME_FORMATTER_CACHE_LIMIT = 100;
44
- const dateTimeFormatterCache$1 = /* @__PURE__ */ new Map();
69
+ const FALLBACK_TIMEZONE = "UTC";
70
+ function getSafeTimeZone(timeZone) {
71
+ const normalized = typeof timeZone === "string" ? timeZone.trim() : "";
72
+ return normalized.length > 0 && isValidBookingTimeZone(normalized) ? normalized : FALLBACK_TIMEZONE;
73
+ }
45
74
  function parseStrictBookingTimeZone(timeZone) {
46
75
  const parsed = parseBookingTimeZone(timeZone);
47
76
  return parsed.ok ? parsed.value : null;
48
77
  }
49
78
  function formatToPartsLookup(date, locale, timeZone, format) {
50
- return new Map(getCachedDateTimeFormatter(locale, timeZone, format).formatToParts(date).map((part) => [part.type, part.value]));
79
+ return new Map(getDateTimeFormatter(locale, timeZone, format).formatToParts(date).map((part) => [part.type, part.value]));
51
80
  }
52
- function getCachedDateTimeFormatter(locale, timeZone, format) {
53
- const key = `${locale}\u0000${timeZone}\u0000${JSON.stringify(Object.entries(format).sort(([left], [right]) => left.localeCompare(right)))}`;
54
- const cached = dateTimeFormatterCache$1.get(key);
55
- if (cached !== void 0) return cached;
56
- const formatter = new Intl.DateTimeFormat(locale, {
57
- ...format,
58
- timeZone
81
+ function getZonedDateTimeParts(date, timeZone) {
82
+ const parts = formatToPartsLookup(date, "en-GB", timeZone, {
83
+ year: "numeric",
84
+ month: "2-digit",
85
+ day: "2-digit",
86
+ hour: "2-digit",
87
+ minute: "2-digit",
88
+ second: "2-digit",
89
+ hour12: false
59
90
  });
60
- if (dateTimeFormatterCache$1.size >= DATE_TIME_FORMATTER_CACHE_LIMIT) dateTimeFormatterCache$1.clear();
61
- dateTimeFormatterCache$1.set(key, formatter);
62
- return formatter;
91
+ const read = (type) => Number(parts.get(type) ?? "");
92
+ return {
93
+ year: read("year"),
94
+ month: read("month"),
95
+ day: read("day"),
96
+ hour: read("hour"),
97
+ minute: read("minute"),
98
+ second: read("second")
99
+ };
63
100
  }
64
101
  function parseUtcIsoDateTimeString(value) {
65
102
  const normalized = value.trim();
@@ -151,10 +188,172 @@ function formatBookingCompactEnglishTime(input) {
151
188
  if (hour === void 0 || minute === void 0 || dayPeriod === void 0) return input.startsAt;
152
189
  return `${minute === "00" ? hour : `${hour}:${minute}`}${dayPeriod.toLowerCase()}`;
153
190
  }
191
+ function compareLocalScheduleDates(left, right) {
192
+ return Date.UTC(left.year, left.month - 1, left.day) - Date.UTC(right.year, right.month - 1, right.day);
193
+ }
194
+ function getLocalScheduleDate(date, timeZone) {
195
+ const parts = getZonedDateTimeParts(date, getSafeTimeZone(timeZone));
196
+ return {
197
+ year: parts.year,
198
+ month: parts.month,
199
+ day: parts.day
200
+ };
201
+ }
202
+ //#endregion
203
+ //#region ../core/src/date-display.ts
204
+ const SDK_STANDARD_TIME_FORMAT = {
205
+ hour: "numeric",
206
+ minute: "2-digit"
207
+ };
208
+ /** Public SDK option policy lives beside the display profile, never in its adapter. */
209
+ function sdkPresentationProfile(context, dateFormat, time = {}) {
210
+ const compact = time.timePresentation !== "standard" && new Intl.Locale(context.locale).language === "en";
211
+ const standard = time.timePresentation === "standard" ? time.format ?? SDK_STANDARD_TIME_FORMAT : SDK_STANDARD_TIME_FORMAT;
212
+ return {
213
+ kind: "sdk",
214
+ dateFormat,
215
+ clock: compact ? {
216
+ kind: "compact",
217
+ localeSource: "context"
218
+ } : {
219
+ kind: "intl",
220
+ format: standard
221
+ },
222
+ zone: "omit"
223
+ };
224
+ }
225
+ /** Sole date projection/typography owner, used by display and scheduled adapters. */
226
+ function presentDate(value, context, profile) {
227
+ const date = dateCarrier(value);
228
+ const zone = value.kind === "civil" ? "UTC" : context.timeZone;
229
+ const output = getDateTimeFormatter(context.locale, zone, profile.dateFormat).format(date);
230
+ if (profile.kind === "sdk") return output;
231
+ const normalized = normalizeDisplay(output);
232
+ return profile.dateFormat.weekday && new Intl.Locale(context.locale).language === "en" ? normalized.replace(/^([^,]+), /u, "$1 ") : normalized;
233
+ }
234
+ function presentDateRange(start, end, context, profile) {
235
+ if (dateCarrier(end).getTime() < dateCarrier(start).getTime()) throw new RangeError("Date range end must be on or after its start");
236
+ if (profile.kind === "display" && compareLocalScheduleDates(projectDate(start, context), projectDate(end, context)) === 0) return presentDate(start, context, profile);
237
+ const output = formatIntlRange(getDateTimeFormatter(context.locale, start.kind === "civil" ? "UTC" : context.timeZone, profile.dateFormat), dateCarrier(start), dateCarrier(end));
238
+ if (profile.kind === "sdk") return output;
239
+ const startDate = projectDate(start, context);
240
+ const endDate = projectDate(end, context);
241
+ const separator = startDate.month === endDate.month && startDate.year === endDate.year ? "–" : " – ";
242
+ return normalizeDisplay(output).replace(/\s*–\s*/gu, separator);
243
+ }
244
+ function presentTime(value, context, profile) {
245
+ const clock = presentClock(value, context, profile.clock);
246
+ return profile.zone === "always" ? `${clock} ${zoneLabel(value, context)}` : clock;
247
+ }
248
+ function presentDateTime(value, context, profile) {
249
+ if (profile.clock.kind === "intl") return getDateTimeFormatter(context.locale, context.timeZone, combinedFormat(profile.dateFormat, profile.clock)).format(new Date(value));
250
+ return `${presentDate({
251
+ kind: "instant",
252
+ value
253
+ }, context, profile)}, ${presentTime(value, context, profile)}`;
254
+ }
255
+ function presentTimeRange(span, context, profile) {
256
+ assertOrdered(span.start, span.end);
257
+ if (profile.clock.kind === "intl") return presentNativeRange(span, context, profile.clock.format);
258
+ const startClock = presentClock(span.start, context, profile.clock);
259
+ const endClock = presentClock(span.end, context, profile.clock);
260
+ const clocks = (profile.kind === "sdk" ? startClock === endClock : span.start === span.end) ? startClock : `${startClock}–${endClock}`;
261
+ const labels = decideRangeLabels(span, context, profile);
262
+ switch (labels.kind) {
263
+ case "omit": return clocks;
264
+ case "shared": return `${clocks} ${labels.label}`;
265
+ case "endpoints": return `${startClock} ${labels.start} – ${endClock} ${labels.end}`;
266
+ }
267
+ }
268
+ function presentDateTimeRange(span, context, profile) {
269
+ assertOrdered(span.start, span.end);
270
+ if (profile.clock.kind === "intl") return presentNativeRange(span, context, combinedFormat(profile.dateFormat, profile.clock));
271
+ const startDate = getLocalScheduleDate(new Date(span.start), context.timeZone);
272
+ const endDate = getLocalScheduleDate(new Date(span.end), context.timeZone);
273
+ if (compareLocalScheduleDates(startDate, endDate) === 0) return `${presentDate({
274
+ kind: "instant",
275
+ value: span.start
276
+ }, context, profile)}, ${presentTimeRange(span, context, profile)}`;
277
+ const labels = decideRangeLabels(span, context, profile);
278
+ const startProfile = profile.kind === "display" && startDate.year === endDate.year ? {
279
+ ...profile,
280
+ dateFormat: {
281
+ ...profile.dateFormat,
282
+ year: void 0
283
+ }
284
+ } : profile;
285
+ const start = presentRangeEndpoint(span.start, context, startProfile, labels.kind === "endpoints" ? labels.start : void 0);
286
+ const end = presentRangeEndpoint(span.end, context, profile, labels.kind === "endpoints" ? labels.end : void 0);
287
+ const separator = profile.kind === "sdk" ? "–" : " – ";
288
+ return profile.kind === "sdk" && start === end ? start : `${start}${separator}${end}`;
289
+ }
290
+ /** Offset changes override ordinary venue omission for the approved display profile. */
291
+ function decideRangeLabels(span, context, profile) {
292
+ if (profile.kind === "sdk") return { kind: "omit" };
293
+ const offsetsDiffer = offsetToken(span.start, context) !== offsetToken(span.end, context);
294
+ if (!offsetsDiffer && profile.zone === "omit") return { kind: "omit" };
295
+ const start = zoneLabel(span.start, context);
296
+ const end = zoneLabel(span.end, context);
297
+ return offsetsDiffer || start !== end ? {
298
+ kind: "endpoints",
299
+ start,
300
+ end
301
+ } : {
302
+ kind: "shared",
303
+ label: start
304
+ };
305
+ }
306
+ function presentRangeEndpoint(value, context, profile, label) {
307
+ return `${presentDate({
308
+ kind: "instant",
309
+ value
310
+ }, context, profile)}, ${label === void 0 ? presentTime(value, context, profile) : `${presentClock(value, context, profile.clock)} ${label}`}`;
311
+ }
312
+ function presentNativeRange(span, context, format) {
313
+ return formatIntlRange(getDateTimeFormatter(context.locale, context.timeZone, format), new Date(span.start), new Date(span.end));
314
+ }
315
+ function combinedFormat(date, clock) {
316
+ return {
317
+ ...date,
318
+ ...clock.format
319
+ };
320
+ }
321
+ function dateCarrier(value) {
322
+ return value.kind === "civil" ? civilCarrier(value.value) : new Date(value.value);
323
+ }
324
+ function presentClock(value, context, clock) {
325
+ return clock.kind === "compact" ? formatBookingCompactEnglishTime({
326
+ startsAt: value,
327
+ timeZone: context.timeZone,
328
+ locale: clock.localeSource === "product" ? "en-GB" : context.locale
329
+ }) : getDateTimeFormatter(context.locale, context.timeZone, clock.format).format(new Date(value));
330
+ }
331
+ function offsetToken(value, context) {
332
+ return getDateTimeFormatter("en-GB", context.timeZone, { timeZoneName: "longOffset" }).formatToParts(new Date(value)).find((part) => part.type === "timeZoneName")?.value ?? "";
333
+ }
334
+ function civilCarrier(value) {
335
+ return new Date(Date.UTC(value.year, value.month - 1, value.day, 12));
336
+ }
337
+ function projectDate(value, context) {
338
+ return value.kind === "civil" ? value.value : getLocalScheduleDate(new Date(value.value), context.timeZone);
339
+ }
340
+ function normalizeDisplay(value) {
341
+ return value.replace(/[\u00a0\u202f]/gu, " ");
342
+ }
343
+ function zoneToken(value, context, locale) {
344
+ return getDateTimeFormatter(locale, context.timeZone, { timeZoneName: "short" }).formatToParts(new Date(value)).find((part) => part.type === "timeZoneName")?.value ?? "";
345
+ }
346
+ function zoneLabel(value, context) {
347
+ const abbreviation = [zoneToken(value, context, "en-GB"), zoneToken(value, context, "en-US")].find((token) => /^[A-Z]{2,6}$/u.test(token));
348
+ const fallback = context.timeZone.startsWith("Etc/") ? "local time" : `${context.timeZone.split("/").slice(-1)[0]?.replace(/_/gu, " ") ?? context.timeZone} time`;
349
+ return abbreviation ?? fallback;
350
+ }
351
+ function assertOrdered(start, end) {
352
+ if (new Date(end).getTime() < new Date(start).getTime()) throw new RangeError("Date/time range end must be on or after its start");
353
+ }
154
354
  //#endregion
155
- //#region src/date-time/index.ts
355
+ //#region ../core/src/scheduled-date-time.ts
156
356
  const DEFAULT_LOCALE = "en-GB";
157
- const COMPACT_ENGLISH_RANGE_SEPARATOR = "–";
158
357
  const FORMATTER_CACHE_LIMIT = 100;
159
358
  const DEFAULT_DATE_FORMAT = {
160
359
  weekday: "long",
@@ -168,11 +367,6 @@ const DEFAULT_RANGE_DATE_FORMAT = {
168
367
  month: "short",
169
368
  day: "numeric"
170
369
  };
171
- const DEFAULT_STANDARD_TIME_FORMAT = {
172
- hour: "numeric",
173
- minute: "2-digit"
174
- };
175
- const dateTimeFormatterCache = /* @__PURE__ */ new Map();
176
370
  const parsedLocaleCache = /* @__PURE__ */ new Map();
177
371
  var RiverbankDateTimeFormatError = class extends Error {
178
372
  constructor(details) {
@@ -183,40 +377,51 @@ var RiverbankDateTimeFormatError = class extends Error {
183
377
  this.value = details.value;
184
378
  }
185
379
  };
380
+ /** Public contract adapters: admission/options here, all presentation in date-display. */
186
381
  function formatScheduledDate(input, options = {}) {
187
- return formatInstant(parseDateTime(input), options.format ?? DEFAULT_DATE_FORMAT);
382
+ const parsed = parseDateTime(input);
383
+ return presentDate({
384
+ kind: "instant",
385
+ value: parsed.startsAt
386
+ }, scheduledContext(parsed), sdkPresentationProfile(scheduledContext(parsed), options.format ?? DEFAULT_DATE_FORMAT));
188
387
  }
189
388
  function formatScheduledTime(input, options = {}) {
190
- return formatTime(parseDateTime(input), options);
389
+ const parsed = parseDateTime(input);
390
+ return presentTime(parsed.startsAt, scheduledContext(parsed), sdkPresentationProfile(scheduledContext(parsed), {}, options));
191
391
  }
192
392
  function formatScheduledDateTime(input, options = {}) {
193
- return formatDateTime(parseDateTime(input), options, DEFAULT_DATE_FORMAT);
393
+ const parsed = parseDateTime(input);
394
+ return presentDateTime(parsed.startsAt, scheduledContext(parsed), sdkPresentationProfile(scheduledContext(parsed), options.dateFormat ?? DEFAULT_DATE_FORMAT, options.time));
194
395
  }
195
396
  function formatScheduledDateRange(input, options = {}) {
196
- const range = parseDateRange(input);
197
- return formatRange(rangeStart(range), rangeEnd(range), options.format ?? DEFAULT_RANGE_DATE_FORMAT);
397
+ const parsed = parseDateRange(input);
398
+ return presentDateRange({
399
+ kind: "instant",
400
+ value: parsed.startsAt
401
+ }, {
402
+ kind: "instant",
403
+ value: parsed.endsAt
404
+ }, scheduledContext(parsed), sdkPresentationProfile(scheduledContext(parsed), options.format ?? DEFAULT_RANGE_DATE_FORMAT));
198
405
  }
199
406
  function formatScheduledTimeRange(input, options = {}) {
200
- const range = parseDateRange(input);
201
- const start = rangeStart(range);
202
- const end = rangeEnd(range);
203
- if (!usesCompactEnglishTime(start, options)) return formatRange(start, end, resolveStandardTimeFormat(options));
204
- const startTime = formatTime(start, options);
205
- const endTime = formatTime(end, options);
206
- return startTime === endTime ? startTime : `${startTime}${COMPACT_ENGLISH_RANGE_SEPARATOR}${endTime}`;
407
+ const parsed = parseDateRange(input);
408
+ return presentTimeRange({
409
+ start: parsed.startsAt,
410
+ end: parsed.endsAt
411
+ }, scheduledContext(parsed), sdkPresentationProfile(scheduledContext(parsed), {}, options));
207
412
  }
208
413
  function formatScheduledDateTimeRange(input, options = {}) {
209
- const range = parseDateRange(input);
210
- const start = rangeStart(range);
211
- const end = rangeEnd(range);
212
- if (!usesCompactEnglishTime(start, options.time ?? {})) return formatRange(start, end, resolveCombinedFormat(options, DEFAULT_RANGE_DATE_FORMAT));
213
- const startDate = formatInstant(start, options.dateFormat ?? DEFAULT_RANGE_DATE_FORMAT);
214
- const startTime = formatTime(start, options.time ?? {});
215
- const endTime = formatTime(end, options.time ?? {});
216
- const startDateTime = `${startDate}, ${startTime}`;
217
- if (sameLocalDate(start, end)) return startTime === endTime ? startDateTime : `${startDate}, ${startTime}${COMPACT_ENGLISH_RANGE_SEPARATOR}${endTime}`;
218
- const endDateTime = `${formatInstant(end, options.dateFormat ?? DEFAULT_RANGE_DATE_FORMAT)}, ${endTime}`;
219
- return startDateTime === endDateTime ? startDateTime : `${startDateTime}${COMPACT_ENGLISH_RANGE_SEPARATOR}${endDateTime}`;
414
+ const parsed = parseDateRange(input);
415
+ return presentDateTimeRange({
416
+ start: parsed.startsAt,
417
+ end: parsed.endsAt
418
+ }, scheduledContext(parsed), sdkPresentationProfile(scheduledContext(parsed), options.dateFormat ?? DEFAULT_RANGE_DATE_FORMAT, options.time));
419
+ }
420
+ function scheduledContext(input) {
421
+ return {
422
+ locale: input.locale,
423
+ timeZone: input.timeZone
424
+ };
220
425
  }
221
426
  function parseDateTime(input) {
222
427
  const locale = parseLocale(input.locale);
@@ -234,11 +439,7 @@ function parseDateTime(input) {
234
439
  function parseDateRange(input) {
235
440
  const locale = parseLocale(input.locale);
236
441
  assertStringTimeZone(input.timeZone);
237
- if (input.endsAt === null || input.endsAt === void 0) throw new RiverbankDateTimeFormatError({
238
- code: "missing_ends_at",
239
- field: "endsAt",
240
- value: ""
241
- });
442
+ assertRequiredEnd(input.endsAt);
242
443
  const result = parseScheduledBookingDateRange({
243
444
  ...input,
244
445
  locale: locale.locale
@@ -260,6 +461,13 @@ function parseDateRange(input) {
260
461
  locale: locale.locale
261
462
  };
262
463
  }
464
+ function assertRequiredEnd(value) {
465
+ if (value === null || value === void 0) throw new RiverbankDateTimeFormatError({
466
+ code: "missing_ends_at",
467
+ field: "endsAt",
468
+ value: ""
469
+ });
470
+ }
263
471
  function parseLocale(value) {
264
472
  const locale = value === void 0 ? DEFAULT_LOCALE : value;
265
473
  if (typeof locale !== "string") throw new RiverbankDateTimeFormatError({
@@ -270,13 +478,9 @@ function parseLocale(value) {
270
478
  const cached = parsedLocaleCache.get(locale);
271
479
  if (cached !== void 0) return cached;
272
480
  try {
273
- const parsed = new Intl.Locale(locale);
274
- const canonical = parsed.toString();
481
+ const canonical = new Intl.Locale(locale).toString();
275
482
  if (Intl.DateTimeFormat.supportedLocalesOf([canonical]).length === 0) throw new RangeError("Unsupported locale");
276
- const result = {
277
- locale: canonical,
278
- language: parsed.language
279
- };
483
+ const result = { locale: canonical };
280
484
  if (parsedLocaleCache.size >= FORMATTER_CACHE_LIMIT) parsedLocaleCache.clear();
281
485
  parsedLocaleCache.set(locale, result);
282
486
  return result;
@@ -326,68 +530,6 @@ function formatErrorMessage(details) {
326
530
  default: return assertNever(details);
327
531
  }
328
532
  }
329
- function formatDateTime(input, options, defaultDateFormat) {
330
- if (!usesCompactEnglishTime(input, options.time ?? {})) return formatInstant(input, resolveCombinedFormat(options, defaultDateFormat));
331
- return `${formatInstant(input, options.dateFormat ?? defaultDateFormat)}, ${formatTime(input, options.time ?? {})}`;
332
- }
333
- function formatTime(input, options) {
334
- if (usesCompactEnglishTime(input, options)) return formatBookingCompactEnglishTime(input);
335
- return formatInstant(input, resolveStandardTimeFormat(options));
336
- }
337
- function usesCompactEnglishTime(input, options) {
338
- return options.timePresentation !== "standard" && parseLocale(input.locale).language === "en";
339
- }
340
- function resolveStandardTimeFormat(options) {
341
- return options.timePresentation === "standard" ? options.format ?? DEFAULT_STANDARD_TIME_FORMAT : DEFAULT_STANDARD_TIME_FORMAT;
342
- }
343
- function resolveCombinedFormat(options, defaultDateFormat) {
344
- return {
345
- ...options.dateFormat ?? defaultDateFormat,
346
- ...resolveStandardTimeFormat(options.time ?? {})
347
- };
348
- }
349
- function formatInstant(input, format) {
350
- return getFormatter(input, format).format(new Date(input.startsAt));
351
- }
352
- function formatRange(start, end, format) {
353
- const formatter = getFormatter(start, format);
354
- const nativeFormatRange = Reflect.get(formatter, "formatRange");
355
- if (typeof nativeFormatRange !== "function") throw new Error("Intl.DateTimeFormat.formatRange is required");
356
- const output = Reflect.apply(nativeFormatRange, formatter, [new Date(start.startsAt), new Date(end.startsAt)]);
357
- if (typeof output !== "string") throw new Error("Intl.DateTimeFormat.formatRange returned a non-string value");
358
- return output;
359
- }
360
- function getFormatter(input, format) {
361
- const formatKey = JSON.stringify(Object.entries(format).sort(([left], [right]) => left.localeCompare(right)));
362
- const key = `${input.locale}\u0000${input.timeZone}\u0000${formatKey}`;
363
- const cached = dateTimeFormatterCache.get(key);
364
- if (cached !== void 0) return cached;
365
- const formatter = new Intl.DateTimeFormat(input.locale, {
366
- ...format,
367
- timeZone: input.timeZone
368
- });
369
- if (dateTimeFormatterCache.size >= FORMATTER_CACHE_LIMIT) dateTimeFormatterCache.clear();
370
- dateTimeFormatterCache.set(key, formatter);
371
- return formatter;
372
- }
373
- function rangeStart(range) {
374
- return range;
375
- }
376
- function rangeEnd(range) {
377
- return {
378
- startsAt: range.endsAt,
379
- timeZone: range.timeZone,
380
- locale: range.locale
381
- };
382
- }
383
- function sameLocalDate(start, end) {
384
- const format = {
385
- year: "numeric",
386
- month: "2-digit",
387
- day: "2-digit"
388
- };
389
- return formatInstant(start, format) === formatInstant(end, format);
390
- }
391
533
  function assertNever(value) {
392
534
  throw new Error(`Unhandled date-time variant: ${String(value)}`);
393
535
  }