@suiteop/storefront 0.1.0 → 0.2.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 (57) hide show
  1. package/CHANGELOG.md +38 -2
  2. package/README.md +74 -0
  3. package/dist/astro-content-model.cjs +17 -0
  4. package/dist/astro-content-model.d.cts +4 -0
  5. package/dist/astro-content-model.d.ts +4 -0
  6. package/dist/astro-content-model.js +10 -0
  7. package/dist/astro.cjs +3 -1
  8. package/dist/astro.d.cts +38 -17
  9. package/dist/astro.d.ts +38 -17
  10. package/dist/astro.js +2 -2
  11. package/dist/{availability-CYvqeJ6X.d.cts → availability-CnzmxuV3.d.cts} +2 -2
  12. package/dist/{availability-CYvqeJ6X.d.ts → availability-CnzmxuV3.d.ts} +2 -2
  13. package/dist/checkout.cjs +3 -3
  14. package/dist/checkout.js +2 -2
  15. package/dist/chunk-2U6L33AT.cjs +19 -0
  16. package/dist/chunk-4GZBXKBU.cjs +18 -0
  17. package/dist/chunk-GJSCEBSU.js +5 -0
  18. package/dist/chunk-HLGSWF4I.js +9 -0
  19. package/dist/{chunk-ZYDFRRFU.js → chunk-HMLBMNGA.js} +1 -1
  20. package/dist/chunk-KKJCPKPY.js +8 -0
  21. package/dist/chunk-PYVUDQSQ.js +3 -0
  22. package/dist/chunk-USOISC2R.cjs +17 -0
  23. package/dist/{chunk-TBADVD2J.cjs → chunk-VV2UNVQ2.cjs} +2 -2
  24. package/dist/chunk-ZHFZ6II2.cjs +16 -0
  25. package/dist/chunk-ZI2PG7LS.js +6 -0
  26. package/dist/chunk-ZLAOY6IF.cjs +9 -0
  27. package/dist/{errors-DPtiZNoK.d.ts → client-DER7y1WE.d.cts} +111 -151
  28. package/dist/{errors-B3sinzJq.d.cts → client-goQnVoLP.d.ts} +111 -151
  29. package/dist/components.cjs +1 -1
  30. package/dist/components.d.cts +1 -1
  31. package/dist/components.d.ts +1 -1
  32. package/dist/components.js +1 -1
  33. package/dist/config.cjs +6 -2
  34. package/dist/config.d.cts +33 -1
  35. package/dist/config.d.ts +33 -1
  36. package/dist/config.js +3 -2
  37. package/dist/content.cjs +37 -0
  38. package/dist/content.d.cts +254 -0
  39. package/dist/content.d.ts +254 -0
  40. package/dist/content.js +4 -0
  41. package/dist/errors-B2eCo5Cz.d.cts +151 -0
  42. package/dist/errors-D-dULpp1.d.ts +151 -0
  43. package/dist/index.cjs +21 -20
  44. package/dist/index.d.cts +11 -3
  45. package/dist/index.d.ts +11 -3
  46. package/dist/index.js +4 -3
  47. package/dist/react.cjs +6 -5
  48. package/dist/react.d.cts +3 -2
  49. package/dist/react.d.ts +3 -2
  50. package/dist/react.js +5 -4
  51. package/package.json +22 -6
  52. package/dist/chunk-AI6STRZP.cjs +0 -18
  53. package/dist/chunk-AIQUVZEI.cjs +0 -8
  54. package/dist/chunk-MJA3R7NP.js +0 -8
  55. package/dist/chunk-NNZZWGM2.js +0 -6
  56. package/dist/chunk-SK5TD73J.js +0 -3
  57. package/dist/chunk-T2GQ3DOZ.cjs +0 -17
@@ -1,5 +1,5 @@
1
1
  import { z } from 'zod';
2
- import { d as StorefrontStay, S as StorefrontAvailability, c as StorefrontCalendarQuery, a as StorefrontCalendar } from './availability-CYvqeJ6X.cjs';
2
+ import { d as StorefrontStay, S as StorefrontAvailability, c as StorefrontCalendarQuery, a as StorefrontCalendar } from './availability-CnzmxuV3.js';
3
3
 
4
4
  declare const storefrontGuestInputSchema: z.ZodObject<{
5
5
  firstName: z.ZodString;
@@ -27,13 +27,13 @@ type ConfirmCheckoutSessionInput = z.infer<typeof confirmCheckoutSessionInputSch
27
27
  declare const bookingResultSchema: z.ZodObject<{
28
28
  bookingRequestId: z.ZodUUID;
29
29
  confirmationToken: z.ZodString;
30
- status: z.ZodType<(string & {}) | "inquiry" | "processing" | "confirmed" | "failed" | "expired" | "pending_pms_sync" | "pending_payment" | "authorized" | "reserved" | "cancelled", unknown, z.core.$ZodTypeInternals<(string & {}) | "inquiry" | "processing" | "confirmed" | "failed" | "expired" | "pending_pms_sync" | "pending_payment" | "authorized" | "reserved" | "cancelled", unknown>>;
30
+ status: z.ZodType<"inquiry" | "processing" | "confirmed" | "failed" | "expired" | "pending_pms_sync" | "pending_payment" | "authorized" | "reserved" | "cancelled" | (string & {}), unknown, z.core.$ZodTypeInternals<"inquiry" | "processing" | "confirmed" | "failed" | "expired" | "pending_pms_sync" | "pending_payment" | "authorized" | "reserved" | "cancelled" | (string & {}), unknown>>;
31
31
  confirmationCode: z.ZodNullable<z.ZodString>;
32
32
  }, z.core.$strip>;
33
33
  type BookingResult = z.infer<typeof bookingResultSchema>;
34
34
  declare const storefrontBookingSchema: z.ZodObject<{
35
35
  id: z.ZodUUID;
36
- status: z.ZodType<(string & {}) | "inquiry" | "processing" | "confirmed" | "failed" | "expired" | "pending_pms_sync" | "pending_payment" | "authorized" | "reserved" | "cancelled", unknown, z.core.$ZodTypeInternals<(string & {}) | "inquiry" | "processing" | "confirmed" | "failed" | "expired" | "pending_pms_sync" | "pending_payment" | "authorized" | "reserved" | "cancelled", unknown>>;
36
+ status: z.ZodType<"inquiry" | "processing" | "confirmed" | "failed" | "expired" | "pending_pms_sync" | "pending_payment" | "authorized" | "reserved" | "cancelled" | (string & {}), unknown, z.core.$ZodTypeInternals<"inquiry" | "processing" | "confirmed" | "failed" | "expired" | "pending_pms_sync" | "pending_payment" | "authorized" | "reserved" | "cancelled" | (string & {}), unknown>>;
37
37
  propertyId: z.ZodNullable<z.ZodUUID>;
38
38
  checkIn: z.ZodNullable<z.ZodISODate>;
39
39
  checkOut: z.ZodNullable<z.ZodISODate>;
@@ -42,6 +42,11 @@ declare const storefrontBookingSchema: z.ZodObject<{
42
42
  totalMinor: z.ZodNullable<z.ZodNumber>;
43
43
  currency: z.ZodNullable<z.ZodString>;
44
44
  confirmationCode: z.ZodNullable<z.ZodString>;
45
+ lines: z.ZodOptional<z.ZodArray<z.ZodObject<{
46
+ title: z.ZodString;
47
+ quantity: z.ZodNumber;
48
+ totalMinor: z.ZodNumber;
49
+ }, z.core.$strip>>>;
45
50
  }, z.core.$strip>;
46
51
  type StorefrontBooking = z.infer<typeof storefrontBookingSchema>;
47
52
 
@@ -53,6 +58,7 @@ declare const storefrontSiteSchema: z.ZodObject<{
53
58
  enableWebChat: z.ZodBoolean;
54
59
  mapEmbedHost: z.ZodNullable<z.ZodString>;
55
60
  countryCode: z.ZodOptional<z.ZodNullable<z.ZodString>>;
61
+ bookingsOpen: z.ZodOptional<z.ZodBoolean>;
56
62
  }, z.core.$strip>;
57
63
  type StorefrontSite = z.infer<typeof storefrontSiteSchema>;
58
64
  declare const storefrontListingSummarySchema: z.ZodObject<{
@@ -109,6 +115,13 @@ declare const storefrontListingsQuerySchema: z.ZodObject<{
109
115
  offset: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
110
116
  }, z.core.$strip>;
111
117
  type StorefrontListingsQuery = z.infer<typeof storefrontListingsQuerySchema>;
118
+ declare const storefrontImageSchema: z.ZodObject<{
119
+ url: z.ZodString;
120
+ alt: z.ZodNullable<z.ZodString>;
121
+ width: z.ZodNullable<z.ZodNumber>;
122
+ height: z.ZodNullable<z.ZodNumber>;
123
+ }, z.core.$strip>;
124
+ type StorefrontImage = z.infer<typeof storefrontImageSchema>;
112
125
  declare const storefrontBuildingSchema: z.ZodObject<{
113
126
  id: z.ZodUUID;
114
127
  locationId: z.ZodNullable<z.ZodUUID>;
@@ -119,6 +132,18 @@ declare const storefrontBuildingSchema: z.ZodObject<{
119
132
  latitude: z.ZodNullable<z.ZodNumber>;
120
133
  longitude: z.ZodNullable<z.ZodNumber>;
121
134
  address: z.ZodUnknown;
135
+ name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
136
+ description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
137
+ imageUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
138
+ images: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
139
+ url: z.ZodString;
140
+ alt: z.ZodNullable<z.ZodString>;
141
+ width: z.ZodNullable<z.ZodNumber>;
142
+ height: z.ZodNullable<z.ZodNumber>;
143
+ }, z.core.$strip>>>>;
144
+ sortOrder: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
145
+ listingCount: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
146
+ fields: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodUnknown>>>>;
122
147
  }, z.core.$strip>;
123
148
  type StorefrontBuilding = z.infer<typeof storefrontBuildingSchema>;
124
149
  declare const storefrontLocationSchema: z.ZodObject<{
@@ -132,6 +157,17 @@ declare const storefrontLocationSchema: z.ZodObject<{
132
157
  longitude: z.ZodNullable<z.ZodNumber>;
133
158
  address: z.ZodUnknown;
134
159
  sortOrder: z.ZodNumber;
160
+ name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
161
+ description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
162
+ imageUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
163
+ images: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
164
+ url: z.ZodString;
165
+ alt: z.ZodNullable<z.ZodString>;
166
+ width: z.ZodNullable<z.ZodNumber>;
167
+ height: z.ZodNullable<z.ZodNumber>;
168
+ }, z.core.$strip>>>>;
169
+ buildingCount: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
170
+ fields: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodUnknown>>>>;
135
171
  }, z.core.$strip>;
136
172
  type StorefrontLocation = z.infer<typeof storefrontLocationSchema>;
137
173
  declare const storefrontReviewSchema: z.ZodObject<{
@@ -242,6 +278,10 @@ declare const createCheckoutSessionInputSchema: z.ZodObject<{
242
278
  region: "restricted" | "other";
243
279
  decidedAt: string | null;
244
280
  };
281
+ experiment?: {
282
+ id: string;
283
+ variant: "a" | "b";
284
+ } | undefined;
245
285
  } | null, {
246
286
  first: {
247
287
  ts: string;
@@ -288,12 +328,24 @@ declare const createCheckoutSessionInputSchema: z.ZodObject<{
288
328
  region: "restricted" | "other";
289
329
  decidedAt: string | null;
290
330
  };
331
+ experiment?: {
332
+ id: string;
333
+ variant: "a" | "b";
334
+ } | undefined;
291
335
  } | null>>;
336
+ extras: z.ZodOptional<z.ZodObject<{
337
+ customFields: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
338
+ upsells: z.ZodDefault<z.ZodArray<z.ZodObject<{
339
+ portalUpsellId: z.ZodUUID;
340
+ quantity: z.ZodNumber;
341
+ }, z.core.$strip>>>;
342
+ }, z.core.$strip>>;
343
+ hostSessionId: z.ZodOptional<z.ZodUUID>;
292
344
  }, z.core.$strip>;
293
345
  type CreateCheckoutSessionInput = z.infer<typeof createCheckoutSessionInputSchema>;
294
346
  declare const checkoutSessionSchema: z.ZodObject<{
295
347
  id: z.ZodUUID;
296
- status: z.ZodType<(string & {}) | "inquiry" | "processing" | "confirmed" | "failed" | "expired" | "pending_pms_sync" | "pending_payment" | "authorized" | "reserved" | "cancelled", unknown, z.core.$ZodTypeInternals<(string & {}) | "inquiry" | "processing" | "confirmed" | "failed" | "expired" | "pending_pms_sync" | "pending_payment" | "authorized" | "reserved" | "cancelled", unknown>>;
348
+ status: z.ZodType<"inquiry" | "processing" | "confirmed" | "failed" | "expired" | "pending_pms_sync" | "pending_payment" | "authorized" | "reserved" | "cancelled" | (string & {}), unknown, z.core.$ZodTypeInternals<"inquiry" | "processing" | "confirmed" | "failed" | "expired" | "pending_pms_sync" | "pending_payment" | "authorized" | "reserved" | "cancelled" | (string & {}), unknown>>;
297
349
  quote: z.ZodObject<{
298
350
  listingId: z.ZodUUID;
299
351
  checkIn: z.ZodISODate;
@@ -339,81 +391,50 @@ declare const checkoutSessionSchema: z.ZodObject<{
339
391
  provider: z.ZodString;
340
392
  }, z.core.$loose>]>>;
341
393
  chargedBy: z.ZodOptional<z.ZodLiteral<"host">>;
394
+ guestSaved: z.ZodOptional<z.ZodLiteral<true>>;
395
+ extras: z.ZodOptional<z.ZodObject<{
396
+ lines: z.ZodArray<z.ZodObject<{
397
+ portalUpsellId: z.ZodNullable<z.ZodUUID>;
398
+ title: z.ZodString;
399
+ quantity: z.ZodNumber;
400
+ totalMinor: z.ZodNumber;
401
+ }, z.core.$strip>>;
402
+ extrasTotalMinor: z.ZodNumber;
403
+ heldTotalMinor: z.ZodNumber;
404
+ }, z.core.$strip>>;
405
+ extrasSessionId: z.ZodOptional<z.ZodUUID>;
342
406
  expiresAt: z.ZodISODateTime;
343
407
  }, z.core.$strip>;
344
408
  type CheckoutSession = z.infer<typeof checkoutSessionSchema>;
345
409
 
346
- declare const storefrontClientEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
347
- name: z.ZodLiteral<"page_view">;
348
- eventId: z.ZodUUID;
349
- ts: z.ZodNumber;
350
- path: z.ZodString;
351
- referrerHost: z.ZodNullable<z.ZodString>;
352
- }, z.core.$strip>, z.ZodObject<{
353
- name: z.ZodLiteral<"view_search_results">;
354
- checkIn: z.ZodOptional<z.ZodISODate>;
355
- checkOut: z.ZodOptional<z.ZodISODate>;
356
- guests: z.ZodOptional<z.ZodNumber>;
357
- locationId: z.ZodOptional<z.ZodUUID>;
358
- eventId: z.ZodUUID;
359
- ts: z.ZodNumber;
360
- path: z.ZodString;
361
- referrerHost: z.ZodNullable<z.ZodString>;
362
- }, z.core.$strip>, z.ZodObject<{
363
- name: z.ZodLiteral<"view_item_list">;
364
- listName: z.ZodString;
365
- itemCount: z.ZodNumber;
366
- eventId: z.ZodUUID;
367
- ts: z.ZodNumber;
368
- path: z.ZodString;
369
- referrerHost: z.ZodNullable<z.ZodString>;
370
- }, z.core.$strip>, z.ZodObject<{
371
- name: z.ZodLiteral<"view_item">;
372
- listingId: z.ZodUUID;
373
- eventId: z.ZodUUID;
374
- ts: z.ZodNumber;
375
- path: z.ZodString;
376
- referrerHost: z.ZodNullable<z.ZodString>;
377
- }, z.core.$strip>, z.ZodObject<{
378
- name: z.ZodLiteral<"view_quote">;
379
- listingId: z.ZodUUID;
380
- valueMinor: z.ZodNumber;
381
- currency: z.ZodString;
382
- nights: z.ZodNumber;
383
- eventId: z.ZodUUID;
384
- ts: z.ZodNumber;
385
- path: z.ZodString;
386
- referrerHost: z.ZodNullable<z.ZodString>;
387
- }, z.core.$strip>, z.ZodObject<{
388
- name: z.ZodLiteral<"begin_checkout">;
389
- checkoutSessionId: z.ZodUUID;
390
- eventId: z.ZodUUID;
391
- ts: z.ZodNumber;
392
- path: z.ZodString;
393
- referrerHost: z.ZodNullable<z.ZodString>;
394
- }, z.core.$strip>, z.ZodObject<{
395
- name: z.ZodLiteral<"add_payment_info">;
396
- checkoutSessionId: z.ZodUUID;
397
- eventId: z.ZodUUID;
398
- ts: z.ZodNumber;
399
- path: z.ZodString;
400
- referrerHost: z.ZodNullable<z.ZodString>;
401
- }, z.core.$strip>, z.ZodObject<{
402
- name: z.ZodLiteral<"generate_lead">;
403
- formId: z.ZodOptional<z.ZodString>;
404
- eventId: z.ZodUUID;
405
- ts: z.ZodNumber;
406
- path: z.ZodString;
407
- referrerHost: z.ZodNullable<z.ZodString>;
408
- }, z.core.$strip>, z.ZodObject<{
409
- name: z.ZodLiteral<"sign_up">;
410
- method: z.ZodLiteral<"newsletter">;
411
- eventId: z.ZodUUID;
412
- ts: z.ZodNumber;
413
- path: z.ZodString;
414
- referrerHost: z.ZodNullable<z.ZodString>;
415
- }, z.core.$strip>], "name">;
416
- type StorefrontClientEvent = z.infer<typeof storefrontClientEventSchema>;
410
+ declare const storefrontContentRefSchema: z.ZodObject<{
411
+ kind: z.ZodString;
412
+ id: z.ZodUUID;
413
+ slug: z.ZodNullable<z.ZodString>;
414
+ }, z.core.$strip>;
415
+ type StorefrontContentRef = z.infer<typeof storefrontContentRefSchema>;
416
+ declare const storefrontContentItemSchema: z.ZodObject<{
417
+ id: z.ZodUUID;
418
+ type: z.ZodString;
419
+ slug: z.ZodNullable<z.ZodString>;
420
+ publishedAt: z.ZodNullable<z.ZodString>;
421
+ updatedAt: z.ZodString;
422
+ sortOrder: z.ZodNumber;
423
+ fields: z.ZodRecord<z.ZodString, z.ZodUnknown>;
424
+ }, z.core.$strip>;
425
+ type StorefrontContentItem = z.infer<typeof storefrontContentItemSchema>;
426
+ declare const storefrontContentModelSchema: z.ZodObject<{
427
+ version: z.ZodNumber;
428
+ types: z.ZodArray<z.ZodObject<{
429
+ key: z.ZodString;
430
+ kind: z.ZodString;
431
+ fields: z.ZodArray<z.ZodObject<{
432
+ key: z.ZodString;
433
+ type: z.ZodString;
434
+ }, z.core.$catchall<z.ZodUnknown>>>;
435
+ }, z.core.$catchall<z.ZodUnknown>>>;
436
+ }, z.core.$strip>;
437
+ type StorefrontContentModel = z.infer<typeof storefrontContentModelSchema>;
417
438
 
418
439
  declare const storefrontRatePlanQuoteSchema: z.ZodObject<{
419
440
  ratePlanId: z.ZodString;
@@ -457,28 +478,6 @@ declare const storefrontQuoteSchema: z.ZodObject<{
457
478
  }, z.core.$strip>;
458
479
  type StorefrontQuote = z.infer<typeof storefrontQuoteSchema>;
459
480
 
460
- type DistributiveOmit<T, K extends PropertyKey> = T extends unknown ? Omit<T, K> : never;
461
- type TrackEvent = DistributiveOmit<StorefrontClientEvent, 'eventId' | 'ts' | 'path' | 'referrerHost'>;
462
- type AnalyticsReporter = (err: unknown) => void;
463
- interface AnalyticsOptions {
464
- publishableKey: string;
465
- report?: AnalyticsReporter;
466
- }
467
- interface StorefrontAnalytics {
468
- track(event: TrackEvent): void;
469
- pageView(): void;
470
- flush(opts?: {
471
- beacon?: boolean;
472
- }): void;
473
- dispose(): void;
474
- }
475
- declare function trackPurchasePixel(booking: Pick<BookingResult, 'bookingRequestId'> & {
476
- totalMinor?: number | null;
477
- currency?: string | null;
478
- }): void;
479
- declare function createAnalytics(opts: AnalyticsOptions): StorefrontAnalytics;
480
- declare function analyticsFor(publishableKey: string): StorefrontAnalytics;
481
-
482
481
  declare const STOREFRONT_API_PATH = "/api/storefront/v1";
483
482
  interface StorefrontClientOptions {
484
483
  publishableKey: string;
@@ -493,6 +492,10 @@ interface RequestOptions {
493
492
  interface CreateCheckoutSessionOptions extends RequestOptions {
494
493
  idempotencyKey?: string;
495
494
  }
495
+ interface ContentListQuery {
496
+ limit?: number;
497
+ offset?: number;
498
+ }
496
499
  interface Page<T> {
497
500
  items: T[];
498
501
  total: number;
@@ -520,6 +523,16 @@ interface StorefrontClient {
520
523
  locations: {
521
524
  list(opts?: RequestOptions): Promise<StorefrontLocation[]>;
522
525
  };
526
+ contentModel: {
527
+ get(opts?: RequestOptions): Promise<StorefrontContentModel>;
528
+ };
529
+ collections: {
530
+ list(key: string, query?: ContentListQuery, opts?: RequestOptions): Promise<Page<StorefrontContentItem>>;
531
+ get(key: string, slugOrId: string, opts?: RequestOptions): Promise<StorefrontContentItem | null>;
532
+ };
533
+ sections: {
534
+ get(key: string, opts?: RequestOptions): Promise<StorefrontContentItem>;
535
+ };
523
536
  amenities: {
524
537
  list(opts?: RequestOptions): Promise<string[]>;
525
538
  };
@@ -550,57 +563,4 @@ interface StorefrontClient {
550
563
  }
551
564
  declare function createStorefrontClient(options: StorefrontClientOptions): StorefrontClient;
552
565
 
553
- declare const STOREFRONT_ERROR_CODES: readonly ["wrong_region", "origin_not_allowed", "origin_required", "site_archived", "not_bookable", "quote_invalid", "quote_expired", "price_changed", "currency_unsupported", "payment_declined", "session_expired", "rate_limited", "contact_not_configured", "payment_account_unavailable", "idempotency_key_required", "idempotency_key_reused", "payment_mode_unsupported", "payment_not_authorized", "payment_method_required", "site_not_published", "UNAUTHORIZED", "VALIDATION_ERROR", "NOT_FOUND", "site_not_found", "upstream_timeout", "timeout", "network", "invalid_response", "internal_error", "checkout_unavailable"];
554
- type StorefrontErrorCode = (typeof STOREFRONT_ERROR_CODES)[number];
555
- type StorefrontRegion = 'us' | 'eu' | 'apac';
556
- interface StorefrontErrorInit {
557
- status: number;
558
- code: string;
559
- message: string;
560
- type?: string;
561
- requestId?: string | null;
562
- details?: Record<string, unknown>;
563
- cause?: unknown;
564
- }
565
- declare class StorefrontError extends Error {
566
- name: string;
567
- readonly status: number;
568
- readonly type: string;
569
- readonly code: StorefrontErrorCode | (string & {});
570
- readonly requestId: string | null;
571
- readonly details: Record<string, unknown>;
572
- constructor(init: StorefrontErrorInit);
573
- }
574
- declare class PriceChangedError extends StorefrontError {
575
- name: string;
576
- readonly quote: StorefrontQuote | null;
577
- readonly requiresNewSession: boolean;
578
- constructor(init: StorefrontErrorInit);
579
- }
580
- declare class WrongRegionError extends StorefrontError {
581
- name: string;
582
- readonly region: StorefrontRegion | null;
583
- readonly baseUrl: string | null;
584
- constructor(init: StorefrontErrorInit);
585
- }
586
- declare class RateLimitedError extends StorefrontError {
587
- name: string;
588
- readonly retryAfterSec: number | null;
589
- readonly scope: 'key' | 'ip' | 'pms' | null;
590
- constructor(init: StorefrontErrorInit & {
591
- retryAfterSec: number | null;
592
- });
593
- }
594
- declare class StorefrontTimeoutError extends StorefrontError {
595
- name: string;
596
- constructor(timeoutMs: number, requestId?: string | null);
597
- }
598
- declare class StorefrontNetworkError extends StorefrontError {
599
- name: string;
600
- constructor(cause: unknown);
601
- }
602
- declare class StorefrontConfigError extends Error {
603
- name: string;
604
- }
605
-
606
- export { type AnalyticsOptions as A, type BookingResult as B, type CheckoutMountDescriptor as C, StorefrontNetworkError as D, type StorefrontQuote as E, type StorefrontQuoteInput as F, type StorefrontRatePlanQuote as G, type StorefrontReview as H, type StorefrontReviewsQuery as I, type StorefrontSite as J, StorefrontTimeoutError as K, analyticsFor as L, createAnalytics as M, createStorefrontClient as N, trackPurchasePixel as O, type Page as P, RateLimitedError as R, type StorefrontRegion as S, type TrackEvent as T, WrongRegionError as W, type AnalyticsReporter as a, type CheckoutSession as b, type ConfirmCheckoutSessionInput as c, type ConfirmCheckoutSessionRequest as d, type CreateCheckoutSessionInput as e, type CreateCheckoutSessionOptions as f, type CreatedCheckoutSession as g, PriceChangedError as h, type RequestOptions as i, STOREFRONT_API_PATH as j, STOREFRONT_ERROR_CODES as k, type StorefrontAnalytics as l, type StorefrontBooking as m, type StorefrontBuilding as n, type StorefrontClient as o, type StorefrontClientOptions as p, StorefrontConfigError as q, type StorefrontContactInput as r, StorefrontError as s, type StorefrontErrorCode as t, type StorefrontErrorInit as u, type StorefrontGuestInput as v, type StorefrontListing as w, type StorefrontListingSummary as x, type StorefrontListingsQuery as y, type StorefrontLocation as z };
566
+ export { type StorefrontSite as A, type BookingResult as B, type CheckoutMountDescriptor as C, createStorefrontClient as D, type Page as P, type RequestOptions as R, STOREFRONT_API_PATH as S, type CheckoutSession as a, type ConfirmCheckoutSessionInput as b, type ConfirmCheckoutSessionRequest as c, type ContentListQuery as d, type CreateCheckoutSessionInput as e, type CreateCheckoutSessionOptions as f, type CreatedCheckoutSession as g, type StorefrontBooking as h, type StorefrontBuilding as i, type StorefrontClient as j, type StorefrontClientOptions as k, type StorefrontContactInput as l, type StorefrontContentItem as m, type StorefrontContentModel as n, type StorefrontContentRef as o, type StorefrontGuestInput as p, type StorefrontImage as q, type StorefrontListing as r, type StorefrontListingSummary as s, type StorefrontListingsQuery as t, type StorefrontLocation as u, type StorefrontQuote as v, type StorefrontQuoteInput as w, type StorefrontRatePlanQuote as x, type StorefrontReview as y, type StorefrontReviewsQuery as z };
@@ -4,7 +4,7 @@ var chunkLVFRVNT3_cjs = require('./chunk-LVFRVNT3.cjs');
4
4
  var react = require('react');
5
5
  var jsxRuntime = require('react/jsx-runtime');
6
6
 
7
- var monthFormat=new Intl.DateTimeFormat("en-US",{month:"long",year:"numeric",timeZone:"UTC"});var dayFormat=new Intl.DateTimeFormat("en-US",{dateStyle:"full",timeZone:"UTC"});var WEEKDAYS=["Su","Mo","Tu","We","Th","Fr","Sa"];var utc=isoDate=>new Date(`${isoDate}T00:00:00Z`);var defaultLabels={dateRangePicker:{month:monthStart=>monthFormat.format(utc(monthStart)),weekday:dayIndex=>WEEKDAYS[dayIndex]??"",day:date=>dayFormat.format(utc(date)),previousMonth:"Previous month",nextMonth:"Next month"},guestPicker:{adults:"Adults",children:"Children",increment:field=>`Add ${field}`,decrement:field=>`Remove ${field}`},gallery:{region:"Photos",photo:(index,total)=>`Photo ${index+1} of ${total}`,previous:"Previous photo",next:"Next photo"}};function unavailableDates(days){return days.filter(d=>d.status!=="available").map(d=>d.date)}var DAY_MS=864e5;var toTime=date=>Date.parse(`${date}T00:00:00Z`);var fromTime=time=>new Date(time).toISOString().slice(0,10);var addDays=(date,days)=>fromTime(toTime(date)+days*DAY_MS);var monthOf=date=>`${date.slice(0,7)}-01`;function addMonths(monthStart,months){const d=new Date(toTime(monthStart));d.setUTCMonth(d.getUTCMonth()+months,1);return fromTime(d.getTime())}function localToday(){const now=new Date;const pad=n=>String(n).padStart(2,"0");return `${now.getFullYear()}-${pad(now.getMonth()+1)}-${pad(now.getDate())}`}function monthWeeks(monthStart,weekStartsOn){const lead=(new Date(toTime(monthStart)).getUTCDay()-weekStartsOn+7)%7;const next=addMonths(monthStart,1);const cells=Array.from({length:lead},()=>null);for(let d=monthStart;d<next;d=addDays(d,1))cells.push(d);while(cells.length%7)cells.push(null);return Array.from({length:cells.length/7},(_,w)=>cells.slice(w*7,w*7+7))}function DateRangePicker({value,onChange,unavailable,minNights=1,today:todayProp,defaultMonth,weekStartsOn=0,labels:labelsProp,className,classNames={}}){const labels={...defaultLabels.dateRangePicker,...labelsProp};const today=todayProp??localToday();const blocked=react.useMemo(()=>new Set(unavailable??[]),[unavailable]);const[focused,setFocused]=react.useState(()=>value.checkIn??today);const[month,setMonth]=react.useState(()=>defaultMonth?`${defaultMonth}-01`:monthOf(value.checkIn??today));const[shownCheckIn,setShownCheckIn]=react.useState(value.checkIn);if(value.checkIn!==shownCheckIn){setShownCheckIn(value.checkIn);if(value.checkIn!==null){setFocused(value.checkIn);setMonth(monthOf(value.checkIn));}}const grid=react.useRef(null);const moveFocus=react.useRef(false);react.useEffect(()=>{if(!moveFocus.current)return;moveFocus.current=false;grid.current?.querySelector(`[data-date="${focused}"]`)?.focus();},[focused,month]);const{checkIn,checkOut}=value;const pickingEnd=checkIn!==null&&checkOut===null;const nightFree=d=>d>=today&&!blocked.has(d);const validEnd=d=>{if(checkIn===null||d<=checkIn)return false;if((toTime(d)-toTime(checkIn))/DAY_MS<minNights)return false;for(let n=checkIn;n<d;n=addDays(n,1))if(!nightFree(n))return false;return true};const disabled=d=>pickingEnd&&checkIn!==null&&d>checkIn?!validEnd(d):!nightFree(d);function select(d){if(disabled(d))return;onChange(pickingEnd&&checkIn!==null&&d>checkIn?{checkIn,checkOut:d}:{checkIn:d,checkOut:null});}function stateOf(d){if(d===checkIn)return "start";if(d===checkOut)return "end";if(checkIn!==null&&checkOut!==null&&d>checkIn&&d<checkOut)return "in-range";return disabled(d)?"disabled":"available"}function focusDate(d){moveFocus.current=true;setFocused(d);setMonth(monthOf(d));}function onKeyDown(event,d){const step={ArrowLeft:-1,ArrowRight:1,ArrowUp:-7,ArrowDown:7}[event.key];if(step!==void 0){event.preventDefault();focusDate(addDays(d,step));}else if(event.key==="Enter"||event.key===" "){event.preventDefault();select(d);}}const tabStop=monthOf(focused)===month?focused:month;const weekdays=Array.from({length:7},(_,i)=>(i+weekStartsOn)%7);return jsxRuntime.jsxs("div",{className,children:[jsxRuntime.jsxs("div",{className:classNames.header,children:[jsxRuntime.jsx("button",{type:"button",className:classNames.nav,"aria-label":labels.previousMonth,onClick:()=>setMonth(addMonths(month,-1)),children:"\u2039"}),jsxRuntime.jsx("span",{className:classNames.title,"aria-live":"polite",children:labels.month(month)}),jsxRuntime.jsx("button",{type:"button",className:classNames.nav,"aria-label":labels.nextMonth,onClick:()=>setMonth(addMonths(month,1)),children:"\u203A"})]}),jsxRuntime.jsxs("table",{role:"grid","aria-label":labels.month(month),className:classNames.grid,ref:grid,children:[jsxRuntime.jsx("thead",{children:jsxRuntime.jsx("tr",{children:weekdays.map(i=>jsxRuntime.jsx("th",{scope:"col",className:classNames.weekday,children:labels.weekday(i)},i))})}),jsxRuntime.jsx("tbody",{children:monthWeeks(month,weekStartsOn).map((week,w)=>jsxRuntime.jsx("tr",{children:week.map((d,i)=>{if(d===null)return jsxRuntime.jsx("td",{role:"gridcell"},`pad-${i}`);const state=stateOf(d);return jsxRuntime.jsx("td",{role:"gridcell","data-date":d,"data-state":state,"data-today":d===today?"":void 0,className:classNames.day,tabIndex:d===tabStop?0:-1,"aria-label":labels.day(d),"aria-selected":state==="start"||state==="end"||state==="in-range","aria-disabled":disabled(d)||void 0,onClick:()=>select(d),onKeyDown:event=>onKeyDown(event,d),onFocus:()=>setFocused(d),children:Number(d.slice(8))},d)})},w))})]})]})}function isRecord(value){return typeof value==="object"&&value!==null}var firstString=(record,keys)=>keys.map(k=>record[k]).find(v=>typeof v==="string"&&v.length>0);function listingPhotos(pictures){if(!Array.isArray(pictures))return [];return pictures.flatMap(picture=>{if(typeof picture==="string")return picture?[{url:picture,caption:null}]:[];if(!isRecord(picture))return [];const url=firstString(picture,["original","url","large","regular","thumbnail"]);if(!url)return [];return [{url,caption:firstString(picture,["caption","description"])??null}]})}function Gallery({photos,onIndexChange,labels:labelsProp,className,classNames={}}){const labels={...defaultLabels.gallery,...labelsProp};const[index,setIndex]=react.useState(0);const total=photos.length;const current=Math.min(index,Math.max(0,total-1));const go=next=>{if(next<0||next>=total||next===current)return;setIndex(next);onIndexChange?.(next);};const onKeyDown=event=>{if(event.key==="ArrowLeft")go(current-1);else if(event.key==="ArrowRight")go(current+1);};return jsxRuntime.jsxs("section",{role:"region","aria-roledescription":"carousel","aria-label":labels.region,className,onKeyDown,children:[jsxRuntime.jsx("div",{className:classNames.viewport,"aria-live":"polite",children:photos.map((photo,i)=>jsxRuntime.jsx("div",{role:"group","aria-roledescription":"slide","aria-label":labels.photo(i,total),"data-state":i===current?"active":"inactive",hidden:i!==current,className:classNames.slide,children:jsxRuntime.jsx("img",{src:photo.url,alt:photo.caption||labels.photo(i,total),loading:i===0?"eager":"lazy",decoding:"async",className:classNames.image})},`${i}-${photo.url}`))}),jsxRuntime.jsx("button",{type:"button",className:classNames.button,"aria-label":labels.previous,disabled:current===0,onClick:()=>go(current-1),children:"\u2039"}),jsxRuntime.jsx("button",{type:"button",className:classNames.button,"aria-label":labels.next,disabled:current>=total-1,onClick:()=>go(current+1),children:"\u203A"})]})}function GuestPicker({value,onChange,max=chunkLVFRVNT3_cjs.STOREFRONT_MAX_GUESTS,labels:labelsProp,className,classNames={}}){const labels={...defaultLabels.guestPicker,...labelsProp};const id=react.useId();const fields=[{key:"adults",label:labels.adults,min:1,max:Math.max(value.adults,max-value.children)},{key:"children",label:labels.children,min:0,max:Math.max(value.children,max-value.adults)}];return jsxRuntime.jsx("div",{className,children:fields.map(field=>{const now=value[field.key];const set=next=>{const clamped=Math.min(field.max,Math.max(field.min,next));if(clamped!==now)onChange({...value,[field.key]:clamped});};const onKeyDown=event=>{const next={ArrowUp:now+1,ArrowRight:now+1,ArrowDown:now-1,ArrowLeft:now-1,Home:field.min,End:field.max}[event.key];if(next===void 0)return;event.preventDefault();set(next);};const labelId=`${id}-${field.key}`;return jsxRuntime.jsxs("div",{className:classNames.field,"data-field":field.key,children:[jsxRuntime.jsx("span",{id:labelId,className:classNames.label,children:field.label}),jsxRuntime.jsx("button",{type:"button",className:classNames.button,"aria-label":labels.decrement(field.label),disabled:now<=field.min,onClick:()=>set(now-1),children:"\u2212"}),jsxRuntime.jsx("div",{role:"spinbutton",tabIndex:0,className:classNames.value,"aria-labelledby":labelId,"aria-valuenow":now,"aria-valuemin":field.min,"aria-valuemax":field.max,onKeyDown,children:now}),jsxRuntime.jsx("button",{type:"button",className:classNames.button,"aria-label":labels.increment(field.label),disabled:now>=field.max,onClick:()=>set(now+1),children:"+"})]},field.key)})})}var usable=(lat,lng)=>typeof lat==="number"&&typeof lng==="number"&&Number.isFinite(lat)&&Number.isFinite(lng)&&Math.abs(lat)<=90&&Math.abs(lng)<=180;function Map({listings,children}){const markers=[];for(const listing of listings){if(usable(listing.latitude,listing.longitude)){markers.push({id:listing.id,lat:listing.latitude,lng:listing.longitude,listing});}}const bounds=markers.length===0?null:{north:Math.max(...markers.map(m=>m.lat)),south:Math.min(...markers.map(m=>m.lat)),east:Math.max(...markers.map(m=>m.lng)),west:Math.min(...markers.map(m=>m.lng))};return jsxRuntime.jsx(jsxRuntime.Fragment,{children:children({markers,bounds})})}
7
+ var monthFormat=new Intl.DateTimeFormat("en-US",{month:"long",year:"numeric",timeZone:"UTC"});var dayFormat=new Intl.DateTimeFormat("en-US",{dateStyle:"full",timeZone:"UTC"});var WEEKDAYS=["Su","Mo","Tu","We","Th","Fr","Sa"];var utc=isoDate=>new Date(`${isoDate}T00:00:00Z`);var defaultLabels={dateRangePicker:{month:monthStart=>monthFormat.format(utc(monthStart)),weekday:dayIndex=>WEEKDAYS[dayIndex]??"",day:date=>dayFormat.format(utc(date)),previousMonth:"Previous month",nextMonth:"Next month"},guestPicker:{adults:"Adults",children:"Children",increment:field=>`Add ${field}`,decrement:field=>`Remove ${field}`},gallery:{region:"Photos",photo:(index,total)=>`Photo ${index+1} of ${total}`,previous:"Previous photo",next:"Next photo"}};function unavailableDates(days){return days.filter(d=>d.status!=="available").map(d=>d.date)}var DAY_MS=864e5;var toTime=date=>Date.parse(`${date}T00:00:00Z`);var fromTime=time=>new Date(time).toISOString().slice(0,10);var addDays=(date,days)=>fromTime(toTime(date)+days*DAY_MS);var monthOf=date=>`${date.slice(0,7)}-01`;function addMonths(monthStart,months){const d=new Date(toTime(monthStart));d.setUTCMonth(d.getUTCMonth()+months,1);return fromTime(d.getTime())}function localToday(){const now=new Date;const pad=n=>String(n).padStart(2,"0");return `${now.getFullYear()}-${pad(now.getMonth()+1)}-${pad(now.getDate())}`}function monthWeeks(monthStart,weekStartsOn){const lead=(new Date(toTime(monthStart)).getUTCDay()-weekStartsOn+7)%7;const next=addMonths(monthStart,1);const cells=Array.from({length:lead},()=>null);for(let d=monthStart;d<next;d=addDays(d,1))cells.push(d);while(cells.length%7)cells.push(null);return Array.from({length:cells.length/7},(_,w)=>cells.slice(w*7,w*7+7))}function DateRangePicker({value,onChange,unavailable,minNights=1,today:todayProp,defaultMonth,weekStartsOn=0,labels:labelsProp,className,classNames={}}){const labels={...defaultLabels.dateRangePicker,...labelsProp};const today=todayProp??localToday();const blocked=react.useMemo(()=>new Set(unavailable??[]),[unavailable]);const[focused,setFocused]=react.useState(()=>value.checkIn??today);const[month,setMonth]=react.useState(()=>defaultMonth?`${defaultMonth}-01`:monthOf(value.checkIn??today));const[shownCheckIn,setShownCheckIn]=react.useState(value.checkIn);if(value.checkIn!==shownCheckIn){setShownCheckIn(value.checkIn);if(value.checkIn!==null){setFocused(value.checkIn);setMonth(monthOf(value.checkIn));}}const grid=react.useRef(null);const moveFocus=react.useRef(false);react.useEffect(()=>{if(!moveFocus.current)return;moveFocus.current=false;grid.current?.querySelector(`[data-date="${focused}"]`)?.focus();},[focused,month]);const{checkIn,checkOut}=value;const pickingEnd=checkIn!==null&&checkOut===null;const nightFree=d=>d>=today&&!blocked.has(d);const validEnd=d=>{if(checkIn===null||d<=checkIn)return false;if((toTime(d)-toTime(checkIn))/DAY_MS<minNights)return false;for(let n=checkIn;n<d;n=addDays(n,1))if(!nightFree(n))return false;return true};const disabled=d=>pickingEnd&&checkIn!==null&&d>checkIn?!validEnd(d):!nightFree(d);function select(d){if(disabled(d))return;onChange(pickingEnd&&checkIn!==null&&d>checkIn?{checkIn,checkOut:d}:{checkIn:d,checkOut:null});}function stateOf(d){if(d===checkIn)return "start";if(d===checkOut)return "end";if(checkIn!==null&&checkOut!==null&&d>checkIn&&d<checkOut)return "in-range";return disabled(d)?"disabled":"available"}function focusDate(d){moveFocus.current=true;setFocused(d);setMonth(monthOf(d));}function onKeyDown(event,d){const step={ArrowLeft:-1,ArrowRight:1,ArrowUp:-7,ArrowDown:7}[event.key];if(step!==void 0){event.preventDefault();focusDate(addDays(d,step));}else if(event.key==="Enter"||event.key===" "){event.preventDefault();select(d);}}const tabStop=monthOf(focused)===month?focused:month;const weekdays=Array.from({length:7},(_,i)=>(i+weekStartsOn)%7);return jsxRuntime.jsxs("div",{className,children:[jsxRuntime.jsxs("div",{className:classNames.header,children:[jsxRuntime.jsx("button",{type:"button",className:classNames.nav,"aria-label":labels.previousMonth,onClick:()=>setMonth(addMonths(month,-1)),children:"\u2039"}),jsxRuntime.jsx("span",{className:classNames.title,"aria-live":"polite",children:labels.month(month)}),jsxRuntime.jsx("button",{type:"button",className:classNames.nav,"aria-label":labels.nextMonth,onClick:()=>setMonth(addMonths(month,1)),children:"\u203A"})]}),jsxRuntime.jsxs("table",{role:"grid","aria-label":labels.month(month),className:classNames.grid,ref:grid,children:[jsxRuntime.jsx("thead",{children:jsxRuntime.jsx("tr",{children:weekdays.map(i=>jsxRuntime.jsx("th",{scope:"col",className:classNames.weekday,children:labels.weekday(i)},i))})}),jsxRuntime.jsx("tbody",{children:monthWeeks(month,weekStartsOn).map((week,w)=>jsxRuntime.jsx("tr",{children:week.map((d,i)=>{if(d===null)return jsxRuntime.jsx("td",{role:"gridcell"},`pad-${i}`);const state=stateOf(d);return jsxRuntime.jsx("td",{role:"gridcell","data-date":d,"data-state":state,"data-today":d===today?"":void 0,className:classNames.day,tabIndex:d===tabStop?0:-1,"aria-label":labels.day(d),"aria-selected":state==="start"||state==="end"||state==="in-range","aria-disabled":disabled(d)||void 0,onClick:()=>select(d),onKeyDown:event=>onKeyDown(event,d),onFocus:()=>setFocused(d),children:Number(d.slice(8))},d)})},w))})]})]})}function isRecord(value){return typeof value==="object"&&value!==null}var firstString=(record,keys)=>keys.map(k=>record[k]).find(v=>typeof v==="string"&&v.length>0);function listingPhotos(pictures){if(!Array.isArray(pictures))return [];return pictures.flatMap(picture=>{if(typeof picture==="string")return picture?[{url:picture,caption:null}]:[];if(!isRecord(picture))return [];const url=firstString(picture,["original","url","large","regular","original_path","image_path","thumbnail","thumbnail_path"]);if(!url)return [];return [{url,caption:firstString(picture,["caption","description"])??null}]})}function Gallery({photos,onIndexChange,labels:labelsProp,className,classNames={}}){const labels={...defaultLabels.gallery,...labelsProp};const[index,setIndex]=react.useState(0);const total=photos.length;const current=Math.min(index,Math.max(0,total-1));const go=next=>{if(next<0||next>=total||next===current)return;setIndex(next);onIndexChange?.(next);};const onKeyDown=event=>{if(event.key==="ArrowLeft")go(current-1);else if(event.key==="ArrowRight")go(current+1);};return jsxRuntime.jsxs("section",{role:"region","aria-roledescription":"carousel","aria-label":labels.region,className,onKeyDown,children:[jsxRuntime.jsx("div",{className:classNames.viewport,"aria-live":"polite",children:photos.map((photo,i)=>jsxRuntime.jsx("div",{role:"group","aria-roledescription":"slide","aria-label":labels.photo(i,total),"data-state":i===current?"active":"inactive",hidden:i!==current,className:classNames.slide,children:jsxRuntime.jsx("img",{src:photo.url,alt:photo.caption||labels.photo(i,total),loading:i===0?"eager":"lazy",decoding:"async",className:classNames.image})},`${i}-${photo.url}`))}),jsxRuntime.jsx("button",{type:"button",className:classNames.button,"aria-label":labels.previous,disabled:current===0,onClick:()=>go(current-1),children:"\u2039"}),jsxRuntime.jsx("button",{type:"button",className:classNames.button,"aria-label":labels.next,disabled:current>=total-1,onClick:()=>go(current+1),children:"\u203A"})]})}function GuestPicker({value,onChange,max=chunkLVFRVNT3_cjs.STOREFRONT_MAX_GUESTS,labels:labelsProp,className,classNames={}}){const labels={...defaultLabels.guestPicker,...labelsProp};const id=react.useId();const fields=[{key:"adults",label:labels.adults,min:1,max:Math.max(value.adults,max-value.children)},{key:"children",label:labels.children,min:0,max:Math.max(value.children,max-value.adults)}];return jsxRuntime.jsx("div",{className,children:fields.map(field=>{const now=value[field.key];const set=next=>{const clamped=Math.min(field.max,Math.max(field.min,next));if(clamped!==now)onChange({...value,[field.key]:clamped});};const onKeyDown=event=>{const next={ArrowUp:now+1,ArrowRight:now+1,ArrowDown:now-1,ArrowLeft:now-1,Home:field.min,End:field.max}[event.key];if(next===void 0)return;event.preventDefault();set(next);};const labelId=`${id}-${field.key}`;return jsxRuntime.jsxs("div",{className:classNames.field,"data-field":field.key,children:[jsxRuntime.jsx("span",{id:labelId,className:classNames.label,children:field.label}),jsxRuntime.jsx("button",{type:"button",className:classNames.button,"aria-label":labels.decrement(field.label),disabled:now<=field.min,onClick:()=>set(now-1),children:"\u2212"}),jsxRuntime.jsx("div",{role:"spinbutton",tabIndex:0,className:classNames.value,"aria-labelledby":labelId,"aria-valuenow":now,"aria-valuemin":field.min,"aria-valuemax":field.max,onKeyDown,children:now}),jsxRuntime.jsx("button",{type:"button",className:classNames.button,"aria-label":labels.increment(field.label),disabled:now>=field.max,onClick:()=>set(now+1),children:"+"})]},field.key)})})}var usable=(lat,lng)=>typeof lat==="number"&&typeof lng==="number"&&Number.isFinite(lat)&&Number.isFinite(lng)&&Math.abs(lat)<=90&&Math.abs(lng)<=180;function Map({listings,children}){const markers=[];for(const listing of listings){if(usable(listing.latitude,listing.longitude)){markers.push({id:listing.id,lat:listing.latitude,lng:listing.longitude,listing});}}const bounds=markers.length===0?null:{north:Math.max(...markers.map(m=>m.lat)),south:Math.min(...markers.map(m=>m.lat)),east:Math.max(...markers.map(m=>m.lng)),west:Math.min(...markers.map(m=>m.lng))};return jsxRuntime.jsx(jsxRuntime.Fragment,{children:children({markers,bounds})})}
8
8
 
9
9
  exports.DateRangePicker = DateRangePicker;
10
10
  exports.Gallery = Gallery;
@@ -1,6 +1,6 @@
1
1
  import * as react from 'react';
2
2
  import { ReactNode } from 'react';
3
- import { b as StorefrontCalendarDay } from './availability-CYvqeJ6X.cjs';
3
+ import { b as StorefrontCalendarDay } from './availability-CnzmxuV3.cjs';
4
4
  import 'zod';
5
5
 
6
6
  declare const defaultLabels: {
@@ -1,6 +1,6 @@
1
1
  import * as react from 'react';
2
2
  import { ReactNode } from 'react';
3
- import { b as StorefrontCalendarDay } from './availability-CYvqeJ6X.js';
3
+ import { b as StorefrontCalendarDay } from './availability-CnzmxuV3.js';
4
4
  import 'zod';
5
5
 
6
6
  declare const defaultLabels: {
@@ -2,6 +2,6 @@ import { STOREFRONT_MAX_GUESTS } from './chunk-6NFURJXI.js';
2
2
  import { useMemo, useState, useRef, useEffect, useId } from 'react';
3
3
  import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
4
4
 
5
- var monthFormat=new Intl.DateTimeFormat("en-US",{month:"long",year:"numeric",timeZone:"UTC"});var dayFormat=new Intl.DateTimeFormat("en-US",{dateStyle:"full",timeZone:"UTC"});var WEEKDAYS=["Su","Mo","Tu","We","Th","Fr","Sa"];var utc=isoDate=>new Date(`${isoDate}T00:00:00Z`);var defaultLabels={dateRangePicker:{month:monthStart=>monthFormat.format(utc(monthStart)),weekday:dayIndex=>WEEKDAYS[dayIndex]??"",day:date=>dayFormat.format(utc(date)),previousMonth:"Previous month",nextMonth:"Next month"},guestPicker:{adults:"Adults",children:"Children",increment:field=>`Add ${field}`,decrement:field=>`Remove ${field}`},gallery:{region:"Photos",photo:(index,total)=>`Photo ${index+1} of ${total}`,previous:"Previous photo",next:"Next photo"}};function unavailableDates(days){return days.filter(d=>d.status!=="available").map(d=>d.date)}var DAY_MS=864e5;var toTime=date=>Date.parse(`${date}T00:00:00Z`);var fromTime=time=>new Date(time).toISOString().slice(0,10);var addDays=(date,days)=>fromTime(toTime(date)+days*DAY_MS);var monthOf=date=>`${date.slice(0,7)}-01`;function addMonths(monthStart,months){const d=new Date(toTime(monthStart));d.setUTCMonth(d.getUTCMonth()+months,1);return fromTime(d.getTime())}function localToday(){const now=new Date;const pad=n=>String(n).padStart(2,"0");return `${now.getFullYear()}-${pad(now.getMonth()+1)}-${pad(now.getDate())}`}function monthWeeks(monthStart,weekStartsOn){const lead=(new Date(toTime(monthStart)).getUTCDay()-weekStartsOn+7)%7;const next=addMonths(monthStart,1);const cells=Array.from({length:lead},()=>null);for(let d=monthStart;d<next;d=addDays(d,1))cells.push(d);while(cells.length%7)cells.push(null);return Array.from({length:cells.length/7},(_,w)=>cells.slice(w*7,w*7+7))}function DateRangePicker({value,onChange,unavailable,minNights=1,today:todayProp,defaultMonth,weekStartsOn=0,labels:labelsProp,className,classNames={}}){const labels={...defaultLabels.dateRangePicker,...labelsProp};const today=todayProp??localToday();const blocked=useMemo(()=>new Set(unavailable??[]),[unavailable]);const[focused,setFocused]=useState(()=>value.checkIn??today);const[month,setMonth]=useState(()=>defaultMonth?`${defaultMonth}-01`:monthOf(value.checkIn??today));const[shownCheckIn,setShownCheckIn]=useState(value.checkIn);if(value.checkIn!==shownCheckIn){setShownCheckIn(value.checkIn);if(value.checkIn!==null){setFocused(value.checkIn);setMonth(monthOf(value.checkIn));}}const grid=useRef(null);const moveFocus=useRef(false);useEffect(()=>{if(!moveFocus.current)return;moveFocus.current=false;grid.current?.querySelector(`[data-date="${focused}"]`)?.focus();},[focused,month]);const{checkIn,checkOut}=value;const pickingEnd=checkIn!==null&&checkOut===null;const nightFree=d=>d>=today&&!blocked.has(d);const validEnd=d=>{if(checkIn===null||d<=checkIn)return false;if((toTime(d)-toTime(checkIn))/DAY_MS<minNights)return false;for(let n=checkIn;n<d;n=addDays(n,1))if(!nightFree(n))return false;return true};const disabled=d=>pickingEnd&&checkIn!==null&&d>checkIn?!validEnd(d):!nightFree(d);function select(d){if(disabled(d))return;onChange(pickingEnd&&checkIn!==null&&d>checkIn?{checkIn,checkOut:d}:{checkIn:d,checkOut:null});}function stateOf(d){if(d===checkIn)return "start";if(d===checkOut)return "end";if(checkIn!==null&&checkOut!==null&&d>checkIn&&d<checkOut)return "in-range";return disabled(d)?"disabled":"available"}function focusDate(d){moveFocus.current=true;setFocused(d);setMonth(monthOf(d));}function onKeyDown(event,d){const step={ArrowLeft:-1,ArrowRight:1,ArrowUp:-7,ArrowDown:7}[event.key];if(step!==void 0){event.preventDefault();focusDate(addDays(d,step));}else if(event.key==="Enter"||event.key===" "){event.preventDefault();select(d);}}const tabStop=monthOf(focused)===month?focused:month;const weekdays=Array.from({length:7},(_,i)=>(i+weekStartsOn)%7);return jsxs("div",{className,children:[jsxs("div",{className:classNames.header,children:[jsx("button",{type:"button",className:classNames.nav,"aria-label":labels.previousMonth,onClick:()=>setMonth(addMonths(month,-1)),children:"\u2039"}),jsx("span",{className:classNames.title,"aria-live":"polite",children:labels.month(month)}),jsx("button",{type:"button",className:classNames.nav,"aria-label":labels.nextMonth,onClick:()=>setMonth(addMonths(month,1)),children:"\u203A"})]}),jsxs("table",{role:"grid","aria-label":labels.month(month),className:classNames.grid,ref:grid,children:[jsx("thead",{children:jsx("tr",{children:weekdays.map(i=>jsx("th",{scope:"col",className:classNames.weekday,children:labels.weekday(i)},i))})}),jsx("tbody",{children:monthWeeks(month,weekStartsOn).map((week,w)=>jsx("tr",{children:week.map((d,i)=>{if(d===null)return jsx("td",{role:"gridcell"},`pad-${i}`);const state=stateOf(d);return jsx("td",{role:"gridcell","data-date":d,"data-state":state,"data-today":d===today?"":void 0,className:classNames.day,tabIndex:d===tabStop?0:-1,"aria-label":labels.day(d),"aria-selected":state==="start"||state==="end"||state==="in-range","aria-disabled":disabled(d)||void 0,onClick:()=>select(d),onKeyDown:event=>onKeyDown(event,d),onFocus:()=>setFocused(d),children:Number(d.slice(8))},d)})},w))})]})]})}function isRecord(value){return typeof value==="object"&&value!==null}var firstString=(record,keys)=>keys.map(k=>record[k]).find(v=>typeof v==="string"&&v.length>0);function listingPhotos(pictures){if(!Array.isArray(pictures))return [];return pictures.flatMap(picture=>{if(typeof picture==="string")return picture?[{url:picture,caption:null}]:[];if(!isRecord(picture))return [];const url=firstString(picture,["original","url","large","regular","thumbnail"]);if(!url)return [];return [{url,caption:firstString(picture,["caption","description"])??null}]})}function Gallery({photos,onIndexChange,labels:labelsProp,className,classNames={}}){const labels={...defaultLabels.gallery,...labelsProp};const[index,setIndex]=useState(0);const total=photos.length;const current=Math.min(index,Math.max(0,total-1));const go=next=>{if(next<0||next>=total||next===current)return;setIndex(next);onIndexChange?.(next);};const onKeyDown=event=>{if(event.key==="ArrowLeft")go(current-1);else if(event.key==="ArrowRight")go(current+1);};return jsxs("section",{role:"region","aria-roledescription":"carousel","aria-label":labels.region,className,onKeyDown,children:[jsx("div",{className:classNames.viewport,"aria-live":"polite",children:photos.map((photo,i)=>jsx("div",{role:"group","aria-roledescription":"slide","aria-label":labels.photo(i,total),"data-state":i===current?"active":"inactive",hidden:i!==current,className:classNames.slide,children:jsx("img",{src:photo.url,alt:photo.caption||labels.photo(i,total),loading:i===0?"eager":"lazy",decoding:"async",className:classNames.image})},`${i}-${photo.url}`))}),jsx("button",{type:"button",className:classNames.button,"aria-label":labels.previous,disabled:current===0,onClick:()=>go(current-1),children:"\u2039"}),jsx("button",{type:"button",className:classNames.button,"aria-label":labels.next,disabled:current>=total-1,onClick:()=>go(current+1),children:"\u203A"})]})}function GuestPicker({value,onChange,max=STOREFRONT_MAX_GUESTS,labels:labelsProp,className,classNames={}}){const labels={...defaultLabels.guestPicker,...labelsProp};const id=useId();const fields=[{key:"adults",label:labels.adults,min:1,max:Math.max(value.adults,max-value.children)},{key:"children",label:labels.children,min:0,max:Math.max(value.children,max-value.adults)}];return jsx("div",{className,children:fields.map(field=>{const now=value[field.key];const set=next=>{const clamped=Math.min(field.max,Math.max(field.min,next));if(clamped!==now)onChange({...value,[field.key]:clamped});};const onKeyDown=event=>{const next={ArrowUp:now+1,ArrowRight:now+1,ArrowDown:now-1,ArrowLeft:now-1,Home:field.min,End:field.max}[event.key];if(next===void 0)return;event.preventDefault();set(next);};const labelId=`${id}-${field.key}`;return jsxs("div",{className:classNames.field,"data-field":field.key,children:[jsx("span",{id:labelId,className:classNames.label,children:field.label}),jsx("button",{type:"button",className:classNames.button,"aria-label":labels.decrement(field.label),disabled:now<=field.min,onClick:()=>set(now-1),children:"\u2212"}),jsx("div",{role:"spinbutton",tabIndex:0,className:classNames.value,"aria-labelledby":labelId,"aria-valuenow":now,"aria-valuemin":field.min,"aria-valuemax":field.max,onKeyDown,children:now}),jsx("button",{type:"button",className:classNames.button,"aria-label":labels.increment(field.label),disabled:now>=field.max,onClick:()=>set(now+1),children:"+"})]},field.key)})})}var usable=(lat,lng)=>typeof lat==="number"&&typeof lng==="number"&&Number.isFinite(lat)&&Number.isFinite(lng)&&Math.abs(lat)<=90&&Math.abs(lng)<=180;function Map({listings,children}){const markers=[];for(const listing of listings){if(usable(listing.latitude,listing.longitude)){markers.push({id:listing.id,lat:listing.latitude,lng:listing.longitude,listing});}}const bounds=markers.length===0?null:{north:Math.max(...markers.map(m=>m.lat)),south:Math.min(...markers.map(m=>m.lat)),east:Math.max(...markers.map(m=>m.lng)),west:Math.min(...markers.map(m=>m.lng))};return jsx(Fragment,{children:children({markers,bounds})})}
5
+ var monthFormat=new Intl.DateTimeFormat("en-US",{month:"long",year:"numeric",timeZone:"UTC"});var dayFormat=new Intl.DateTimeFormat("en-US",{dateStyle:"full",timeZone:"UTC"});var WEEKDAYS=["Su","Mo","Tu","We","Th","Fr","Sa"];var utc=isoDate=>new Date(`${isoDate}T00:00:00Z`);var defaultLabels={dateRangePicker:{month:monthStart=>monthFormat.format(utc(monthStart)),weekday:dayIndex=>WEEKDAYS[dayIndex]??"",day:date=>dayFormat.format(utc(date)),previousMonth:"Previous month",nextMonth:"Next month"},guestPicker:{adults:"Adults",children:"Children",increment:field=>`Add ${field}`,decrement:field=>`Remove ${field}`},gallery:{region:"Photos",photo:(index,total)=>`Photo ${index+1} of ${total}`,previous:"Previous photo",next:"Next photo"}};function unavailableDates(days){return days.filter(d=>d.status!=="available").map(d=>d.date)}var DAY_MS=864e5;var toTime=date=>Date.parse(`${date}T00:00:00Z`);var fromTime=time=>new Date(time).toISOString().slice(0,10);var addDays=(date,days)=>fromTime(toTime(date)+days*DAY_MS);var monthOf=date=>`${date.slice(0,7)}-01`;function addMonths(monthStart,months){const d=new Date(toTime(monthStart));d.setUTCMonth(d.getUTCMonth()+months,1);return fromTime(d.getTime())}function localToday(){const now=new Date;const pad=n=>String(n).padStart(2,"0");return `${now.getFullYear()}-${pad(now.getMonth()+1)}-${pad(now.getDate())}`}function monthWeeks(monthStart,weekStartsOn){const lead=(new Date(toTime(monthStart)).getUTCDay()-weekStartsOn+7)%7;const next=addMonths(monthStart,1);const cells=Array.from({length:lead},()=>null);for(let d=monthStart;d<next;d=addDays(d,1))cells.push(d);while(cells.length%7)cells.push(null);return Array.from({length:cells.length/7},(_,w)=>cells.slice(w*7,w*7+7))}function DateRangePicker({value,onChange,unavailable,minNights=1,today:todayProp,defaultMonth,weekStartsOn=0,labels:labelsProp,className,classNames={}}){const labels={...defaultLabels.dateRangePicker,...labelsProp};const today=todayProp??localToday();const blocked=useMemo(()=>new Set(unavailable??[]),[unavailable]);const[focused,setFocused]=useState(()=>value.checkIn??today);const[month,setMonth]=useState(()=>defaultMonth?`${defaultMonth}-01`:monthOf(value.checkIn??today));const[shownCheckIn,setShownCheckIn]=useState(value.checkIn);if(value.checkIn!==shownCheckIn){setShownCheckIn(value.checkIn);if(value.checkIn!==null){setFocused(value.checkIn);setMonth(monthOf(value.checkIn));}}const grid=useRef(null);const moveFocus=useRef(false);useEffect(()=>{if(!moveFocus.current)return;moveFocus.current=false;grid.current?.querySelector(`[data-date="${focused}"]`)?.focus();},[focused,month]);const{checkIn,checkOut}=value;const pickingEnd=checkIn!==null&&checkOut===null;const nightFree=d=>d>=today&&!blocked.has(d);const validEnd=d=>{if(checkIn===null||d<=checkIn)return false;if((toTime(d)-toTime(checkIn))/DAY_MS<minNights)return false;for(let n=checkIn;n<d;n=addDays(n,1))if(!nightFree(n))return false;return true};const disabled=d=>pickingEnd&&checkIn!==null&&d>checkIn?!validEnd(d):!nightFree(d);function select(d){if(disabled(d))return;onChange(pickingEnd&&checkIn!==null&&d>checkIn?{checkIn,checkOut:d}:{checkIn:d,checkOut:null});}function stateOf(d){if(d===checkIn)return "start";if(d===checkOut)return "end";if(checkIn!==null&&checkOut!==null&&d>checkIn&&d<checkOut)return "in-range";return disabled(d)?"disabled":"available"}function focusDate(d){moveFocus.current=true;setFocused(d);setMonth(monthOf(d));}function onKeyDown(event,d){const step={ArrowLeft:-1,ArrowRight:1,ArrowUp:-7,ArrowDown:7}[event.key];if(step!==void 0){event.preventDefault();focusDate(addDays(d,step));}else if(event.key==="Enter"||event.key===" "){event.preventDefault();select(d);}}const tabStop=monthOf(focused)===month?focused:month;const weekdays=Array.from({length:7},(_,i)=>(i+weekStartsOn)%7);return jsxs("div",{className,children:[jsxs("div",{className:classNames.header,children:[jsx("button",{type:"button",className:classNames.nav,"aria-label":labels.previousMonth,onClick:()=>setMonth(addMonths(month,-1)),children:"\u2039"}),jsx("span",{className:classNames.title,"aria-live":"polite",children:labels.month(month)}),jsx("button",{type:"button",className:classNames.nav,"aria-label":labels.nextMonth,onClick:()=>setMonth(addMonths(month,1)),children:"\u203A"})]}),jsxs("table",{role:"grid","aria-label":labels.month(month),className:classNames.grid,ref:grid,children:[jsx("thead",{children:jsx("tr",{children:weekdays.map(i=>jsx("th",{scope:"col",className:classNames.weekday,children:labels.weekday(i)},i))})}),jsx("tbody",{children:monthWeeks(month,weekStartsOn).map((week,w)=>jsx("tr",{children:week.map((d,i)=>{if(d===null)return jsx("td",{role:"gridcell"},`pad-${i}`);const state=stateOf(d);return jsx("td",{role:"gridcell","data-date":d,"data-state":state,"data-today":d===today?"":void 0,className:classNames.day,tabIndex:d===tabStop?0:-1,"aria-label":labels.day(d),"aria-selected":state==="start"||state==="end"||state==="in-range","aria-disabled":disabled(d)||void 0,onClick:()=>select(d),onKeyDown:event=>onKeyDown(event,d),onFocus:()=>setFocused(d),children:Number(d.slice(8))},d)})},w))})]})]})}function isRecord(value){return typeof value==="object"&&value!==null}var firstString=(record,keys)=>keys.map(k=>record[k]).find(v=>typeof v==="string"&&v.length>0);function listingPhotos(pictures){if(!Array.isArray(pictures))return [];return pictures.flatMap(picture=>{if(typeof picture==="string")return picture?[{url:picture,caption:null}]:[];if(!isRecord(picture))return [];const url=firstString(picture,["original","url","large","regular","original_path","image_path","thumbnail","thumbnail_path"]);if(!url)return [];return [{url,caption:firstString(picture,["caption","description"])??null}]})}function Gallery({photos,onIndexChange,labels:labelsProp,className,classNames={}}){const labels={...defaultLabels.gallery,...labelsProp};const[index,setIndex]=useState(0);const total=photos.length;const current=Math.min(index,Math.max(0,total-1));const go=next=>{if(next<0||next>=total||next===current)return;setIndex(next);onIndexChange?.(next);};const onKeyDown=event=>{if(event.key==="ArrowLeft")go(current-1);else if(event.key==="ArrowRight")go(current+1);};return jsxs("section",{role:"region","aria-roledescription":"carousel","aria-label":labels.region,className,onKeyDown,children:[jsx("div",{className:classNames.viewport,"aria-live":"polite",children:photos.map((photo,i)=>jsx("div",{role:"group","aria-roledescription":"slide","aria-label":labels.photo(i,total),"data-state":i===current?"active":"inactive",hidden:i!==current,className:classNames.slide,children:jsx("img",{src:photo.url,alt:photo.caption||labels.photo(i,total),loading:i===0?"eager":"lazy",decoding:"async",className:classNames.image})},`${i}-${photo.url}`))}),jsx("button",{type:"button",className:classNames.button,"aria-label":labels.previous,disabled:current===0,onClick:()=>go(current-1),children:"\u2039"}),jsx("button",{type:"button",className:classNames.button,"aria-label":labels.next,disabled:current>=total-1,onClick:()=>go(current+1),children:"\u203A"})]})}function GuestPicker({value,onChange,max=STOREFRONT_MAX_GUESTS,labels:labelsProp,className,classNames={}}){const labels={...defaultLabels.guestPicker,...labelsProp};const id=useId();const fields=[{key:"adults",label:labels.adults,min:1,max:Math.max(value.adults,max-value.children)},{key:"children",label:labels.children,min:0,max:Math.max(value.children,max-value.adults)}];return jsx("div",{className,children:fields.map(field=>{const now=value[field.key];const set=next=>{const clamped=Math.min(field.max,Math.max(field.min,next));if(clamped!==now)onChange({...value,[field.key]:clamped});};const onKeyDown=event=>{const next={ArrowUp:now+1,ArrowRight:now+1,ArrowDown:now-1,ArrowLeft:now-1,Home:field.min,End:field.max}[event.key];if(next===void 0)return;event.preventDefault();set(next);};const labelId=`${id}-${field.key}`;return jsxs("div",{className:classNames.field,"data-field":field.key,children:[jsx("span",{id:labelId,className:classNames.label,children:field.label}),jsx("button",{type:"button",className:classNames.button,"aria-label":labels.decrement(field.label),disabled:now<=field.min,onClick:()=>set(now-1),children:"\u2212"}),jsx("div",{role:"spinbutton",tabIndex:0,className:classNames.value,"aria-labelledby":labelId,"aria-valuenow":now,"aria-valuemin":field.min,"aria-valuemax":field.max,onKeyDown,children:now}),jsx("button",{type:"button",className:classNames.button,"aria-label":labels.increment(field.label),disabled:now>=field.max,onClick:()=>set(now+1),children:"+"})]},field.key)})})}var usable=(lat,lng)=>typeof lat==="number"&&typeof lng==="number"&&Number.isFinite(lat)&&Number.isFinite(lng)&&Math.abs(lat)<=90&&Math.abs(lng)<=180;function Map({listings,children}){const markers=[];for(const listing of listings){if(usable(listing.latitude,listing.longitude)){markers.push({id:listing.id,lat:listing.latitude,lng:listing.longitude,listing});}}const bounds=markers.length===0?null:{north:Math.max(...markers.map(m=>m.lat)),south:Math.min(...markers.map(m=>m.lat)),east:Math.max(...markers.map(m=>m.lng)),west:Math.min(...markers.map(m=>m.lng))};return jsx(Fragment,{children:children({markers,bounds})})}
6
6
 
7
7
  export { DateRangePicker, Gallery, GuestPicker, Map, defaultLabels, listingPhotos, unavailableDates };
package/dist/config.cjs CHANGED
@@ -1,10 +1,14 @@
1
1
  'use strict';
2
2
 
3
- var chunkAIQUVZEI_cjs = require('./chunk-AIQUVZEI.cjs');
3
+ var chunkZLAOY6IF_cjs = require('./chunk-ZLAOY6IF.cjs');
4
4
  var zod = require('zod');
5
5
 
6
- var STOREFRONT_LOCALES=["en","fr","es","de","it","pt","nl"];var REQUIRED="validation.required";var TOO_LONG="validation.max_length";var TOO_MANY="validation.too_large";var INVALID="validation.invalid";var text=max=>zod.z.string(INVALID).max(max,TOO_LONG);var localeSchema=zod.z.enum(STOREFRONT_LOCALES,"validation.storefront.locale_unsupported");var hexSchema=zod.z.string(INVALID).regex(/^#[0-9A-Fa-f]{6}$/,"validation.storefront.color_hex");var assetUrlSchema=zod.z.url({protocol:/^https$/,error:"validation.storefront.url_https"});var localizedSchema=zod.z.partialRecord(localeSchema,text(200),INVALID);var linkSchema=zod.z.object({label:localizedSchema,href:text(500).regex(/^(\/(?!\/)|https:\/\/)/,"validation.storefront.link_href")},INVALID);var fontSchema=zod.z.enum(chunkAIQUVZEI_cjs.GOOGLE_FONTS,"validation.invalid_option");var storefrontSiteConfigSchema=zod.z.object({brand:zod.z.object({name:text(80).min(1,REQUIRED),logoUrl:assetUrlSchema.nullable(),faviconUrl:assetUrlSchema.nullable()},INVALID),colors:zod.z.object({primary:hexSchema,primaryForeground:hexSchema,background:hexSchema,foreground:hexSchema,accent:hexSchema},INVALID),fonts:zod.z.object({heading:fontSchema,body:fontSchema},INVALID),nav:zod.z.array(linkSchema,INVALID).max(8,TOO_MANY),footer:zod.z.object({text:localizedSchema,links:zod.z.array(linkSchema,INVALID).max(12,TOO_MANY)},INVALID),defaultLocale:localeSchema,locales:zod.z.array(localeSchema,INVALID).min(1,REQUIRED).max(STOREFRONT_LOCALES.length,TOO_MANY),seo:zod.z.object({titleTemplate:text(80).includes("%s",{error:"validation.storefront.title_template_placeholder"}),defaultDescription:localizedSchema,ogImageUrl:assetUrlSchema.nullable()},INVALID)},INVALID).refine(c=>c.locales.includes(c.defaultLocale),{path:["defaultLocale"],message:"validation.storefront.default_locale_not_listed"});function defineSuiteOpConfig(config){return storefrontSiteConfigSchema.parse(config)}
6
+ var STOREFRONT_LOCALES=["en","fr","es","de","it","pt","nl"];var REQUIRED="validation.required";var TOO_LONG="validation.max_length";var TOO_MANY="validation.too_large";var INVALID="validation.invalid";var text=max=>zod.z.string(INVALID).max(max,TOO_LONG);var localeSchema=zod.z.enum(STOREFRONT_LOCALES,"validation.storefront.locale_unsupported");var hexSchema=zod.z.string(INVALID).regex(/^#[0-9A-Fa-f]{6}$/,"validation.storefront.color_hex");var assetUrlSchema=zod.z.url({protocol:/^https$/,error:"validation.storefront.url_https"});var localizedSchema=zod.z.partialRecord(localeSchema,text(200),INVALID);var linkSchema=zod.z.object({label:localizedSchema,href:text(500).regex(/^(\/(?!\/)|https:\/\/)/,"validation.storefront.link_href")},INVALID);var fontSchema=zod.z.enum(chunkZLAOY6IF_cjs.STOREFRONT_FONTS,"validation.invalid_option");var storefrontSiteConfigSchema=zod.z.object({brand:zod.z.object({name:text(80).min(1,REQUIRED),logoUrl:assetUrlSchema.nullable(),faviconUrl:assetUrlSchema.nullable()},INVALID),colors:zod.z.object({primary:hexSchema,primaryForeground:hexSchema,background:hexSchema,foreground:hexSchema,accent:hexSchema},INVALID),fonts:zod.z.object({heading:fontSchema,body:fontSchema},INVALID),nav:zod.z.array(linkSchema,INVALID).max(8,TOO_MANY),footer:zod.z.object({text:localizedSchema,links:zod.z.array(linkSchema,INVALID).max(12,TOO_MANY)},INVALID),defaultLocale:localeSchema,locales:zod.z.array(localeSchema,INVALID).min(1,REQUIRED).max(STOREFRONT_LOCALES.length,TOO_MANY),seo:zod.z.object({titleTemplate:text(80).includes("%s",{error:"validation.storefront.title_template_placeholder"}),defaultDescription:localizedSchema,ogImageUrl:assetUrlSchema.nullable()},INVALID)},INVALID).refine(c=>c.locales.includes(c.defaultLocale),{path:["defaultLocale"],message:"validation.storefront.default_locale_not_listed"});function defineSuiteOpConfig(config){return storefrontSiteConfigSchema.parse(config)}
7
7
 
8
+ Object.defineProperty(exports, "STOREFRONT_FONT_FAMILIES", {
9
+ enumerable: true,
10
+ get: function () { return chunkZLAOY6IF_cjs.STOREFRONT_FONT_FAMILIES; }
11
+ });
8
12
  exports.STOREFRONT_LOCALES = STOREFRONT_LOCALES;
9
13
  exports.defineSuiteOpConfig = defineSuiteOpConfig;
10
14
  exports.storefrontSiteConfigSchema = storefrontSiteConfigSchema;
package/dist/config.d.cts CHANGED
@@ -1,5 +1,9 @@
1
1
  import { z } from 'zod';
2
2
 
3
+ declare const STOREFRONT_FONTS: readonly ["inter", "montserrat", "poppins", "raleway", "nunito", "work_sans", "mulish", "barlow", "jost", "bitter", "archivo", "public_sans", "gantari", "anybody", "lato", "playfair_display", "karla", "reddit_sans", "overpass", "roboto", "open_sans", "merriweather", "outfit", "fraunces", "dm_sans", "cormorant_garamond", "eb_garamond", "lora", "crimson_pro", "source_serif_4", "ibm_plex_serif", "manrope", "plus_jakarta_sans", "space_grotesk", "ibm_plex_sans", "libre_franklin", "josefin_sans"];
4
+ type StorefrontFont = (typeof STOREFRONT_FONTS)[number];
5
+ declare const STOREFRONT_FONT_FAMILIES: Record<StorefrontFont, string>;
6
+
3
7
  declare const STOREFRONT_LOCALES: readonly ["en", "fr", "es", "de", "it", "pt", "nl"];
4
8
  type StorefrontLocale = (typeof STOREFRONT_LOCALES)[number];
5
9
  declare const storefrontSiteConfigSchema: z.ZodObject<{
@@ -40,6 +44,20 @@ declare const storefrontSiteConfigSchema: z.ZodObject<{
40
44
  open_sans: "open_sans";
41
45
  merriweather: "merriweather";
42
46
  outfit: "outfit";
47
+ fraunces: "fraunces";
48
+ dm_sans: "dm_sans";
49
+ cormorant_garamond: "cormorant_garamond";
50
+ eb_garamond: "eb_garamond";
51
+ lora: "lora";
52
+ crimson_pro: "crimson_pro";
53
+ source_serif_4: "source_serif_4";
54
+ ibm_plex_serif: "ibm_plex_serif";
55
+ manrope: "manrope";
56
+ plus_jakarta_sans: "plus_jakarta_sans";
57
+ space_grotesk: "space_grotesk";
58
+ ibm_plex_sans: "ibm_plex_sans";
59
+ libre_franklin: "libre_franklin";
60
+ josefin_sans: "josefin_sans";
43
61
  }>;
44
62
  body: z.ZodEnum<{
45
63
  inter: "inter";
@@ -65,6 +83,20 @@ declare const storefrontSiteConfigSchema: z.ZodObject<{
65
83
  open_sans: "open_sans";
66
84
  merriweather: "merriweather";
67
85
  outfit: "outfit";
86
+ fraunces: "fraunces";
87
+ dm_sans: "dm_sans";
88
+ cormorant_garamond: "cormorant_garamond";
89
+ eb_garamond: "eb_garamond";
90
+ lora: "lora";
91
+ crimson_pro: "crimson_pro";
92
+ source_serif_4: "source_serif_4";
93
+ ibm_plex_serif: "ibm_plex_serif";
94
+ manrope: "manrope";
95
+ plus_jakarta_sans: "plus_jakarta_sans";
96
+ space_grotesk: "space_grotesk";
97
+ ibm_plex_sans: "ibm_plex_sans";
98
+ libre_franklin: "libre_franklin";
99
+ josefin_sans: "josefin_sans";
68
100
  }>;
69
101
  }, z.core.$strip>;
70
102
  nav: z.ZodArray<z.ZodObject<{
@@ -138,4 +170,4 @@ type StorefrontSiteConfig = z.infer<typeof storefrontSiteConfigSchema>;
138
170
 
139
171
  declare function defineSuiteOpConfig(config: StorefrontSiteConfig): StorefrontSiteConfig;
140
172
 
141
- export { STOREFRONT_LOCALES, type StorefrontLocale, type StorefrontSiteConfig, defineSuiteOpConfig, storefrontSiteConfigSchema };
173
+ export { STOREFRONT_FONT_FAMILIES, STOREFRONT_LOCALES, type StorefrontLocale, type StorefrontSiteConfig, defineSuiteOpConfig, storefrontSiteConfigSchema };