@flamingo-stack/openframe-frontend-core 0.0.676-2437.7341.1 → 0.0.676-2439.7332.1

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.
@@ -1,5 +1,5 @@
1
1
  import type { ReactNode, Ref } from 'react';
2
- import { type BuiltInBookingFieldName, type DeniedEmailDomains, type MeetingAvailability } from '../../schemas/meeting-booking-schema';
2
+ import { type BuiltInBookingFieldName, type MeetingAvailability } from '../../schemas/meeting-booking-schema';
3
3
  import type { FormRescueDefinition } from '../../utils/form-rescue';
4
4
  /**
5
5
  * One field in a host-supplied row. `name` is a built-in (`email`, `firstName`,
@@ -14,20 +14,6 @@ export interface BookingFieldSlot {
14
14
  /** Columns out of `GRID_COLUMNS` at `md` and up — the keys of `SPAN_CLASS`. */
15
15
  export type BookingFieldSpan = keyof typeof SPAN_CLASS;
16
16
  export type BookingFieldRow = BookingFieldSlot[];
17
- /**
18
- * Display copy a HOST overrides for ONE field, keyed by its name — a built-in
19
- * (`email`) or a HubSpot-declared question. It replaces what is DRAWN and
20
- * nothing else: the name the answer rides under, the validation and the
21
- * schema's own messages are untouched, so a campaign page can ask for a
22
- * "Business Email" without owning a second email rule.
23
- *
24
- * An overridden `label` also feeds the type's derived placeholder
25
- * (`Enter <label>`), so overriding the label alone keeps the pair consistent.
26
- */
27
- export interface BookingFieldCopy {
28
- label?: string;
29
- placeholder?: string;
30
- }
31
17
  /**
32
18
  * A HOST-supplied consent row — the block the waitlist form draws for its SMS
33
19
  * consent, here for "I agree to the Privacy Policy and to be contacted". It is
@@ -90,11 +76,6 @@ export interface BookingFormProps {
90
76
  * appended full width. Both are deliberate — see `slotNode`/`unplacedFields`.
91
77
  */
92
78
  fieldRows?: BookingFieldRow[];
93
- /** Per-field display overrides, keyed by field name — see `BookingFieldCopy`. */
94
- fieldCopy?: Record<string, BookingFieldCopy>;
95
- /** Email domains this form refuses, with the message it shows — see `DeniedEmailDomains`.
96
- * MEMOIZE it: a new object every render rebuilds the resolver's schema. */
97
- deniedEmailDomains?: DeniedEmailDomains;
98
79
  /** Host-supplied consent row, rendered after the fields — see `BookingFormConsent`. */
99
80
  consent?: BookingFormConsent;
100
81
  isSubmitting: boolean;
@@ -125,7 +106,7 @@ export interface BookingFormProps {
125
106
  * submit; the parent calls `resetSignals()` after a SLOT_TAKEN refetch so a
126
107
  * legitimate retry isn't flagged too-fast.
127
108
  */
128
- export declare function BookingForm({ availability, meetingId, startTimeMs, durationMs, timezone, deferSlot, initialValues, submitLabel, footerNote, fieldRows, fieldCopy, deniedEmailDomains, consent, isSubmitting, onSubmit, honeypotInputProps, getSignals, rescue, }: BookingFormProps): import("react").JSX.Element;
109
+ export declare function BookingForm({ availability, meetingId, startTimeMs, durationMs, timezone, deferSlot, initialValues, submitLabel, footerNote, fieldRows, consent, isSubmitting, onSubmit, honeypotInputProps, getSignals, rescue, }: BookingFormProps): import("react").JSX.Element;
129
110
  /**
130
111
  * Cold-start placeholder for `flow="details-first"`, where the FORM is the
131
112
  * first thing in the action panel.
@@ -1 +1 @@
1
- {"version":3,"file":"booking-form.d.ts","sourceRoot":"","sources":["../../../src/components/meeting-scheduler/booking-form.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAa,SAAS,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAKvD,OAAO,EAEL,KAAK,uBAAuB,EAM5B,KAAK,kBAAkB,EAKvB,KAAK,mBAAmB,EAKzB,MAAM,sCAAsC,CAAC;AAE9C,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAqBpE;;;GAGG;AACH,MAAM,WAAW,gBAAgB;IAC/B,yFAAyF;IACzF,IAAI,EAAE,uBAAuB,GAAG,CAAC,MAAM,GAAG,WAAW,CAAC,OAAO,CAAC,CAAC,CAAC;IAChE,gFAAgF;IAChF,IAAI,CAAC,EAAE,gBAAgB,CAAC;CACzB;AAED,+EAA+E;AAC/E,MAAM,MAAM,gBAAgB,GAA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CAAC,EAAE,kBAAkB,CAAC;IACxC,uFAAuF;IACvF,OAAO,CAAC,EAAE,kBAAkB,CAAC;IAC7B,YAAY,EAAE,OAAO,CAAC;IACtB,QAAQ,EAAE,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC9D,mFAAmF;IACnF,kBAAkB,EAAE;QAAE,GAAG,EAAE,GAAG,CAAC,gBAAgB,CAAC,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC;IACjE,UAAU,EAAE,MAAM,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,CAAC;IAClD;;;6BAGyB;IACzB,MAAM,CAAC,EAAE,oBAAoB,GAAG,IAAI,CAAC;CACtC;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,WAAW,CAAC,EAC1B,YAAY,EACZ,SAAS,EACT,WAAW,EACX,UAAU,EACV,QAAQ,EACR,SAAiB,EACjB,aAAa,EACb,WAAW,EACX,UAAU,EACV,SAAS,EACT,SAAS,EACT,kBAAkB,EAClB,OAAO,EACP,YAAY,EACZ,QAAQ,EACR,kBAAkB,EAClB,UAAU,EACV,MAAa,GACd,EAAE,gBAAgB,+BA+WlB;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,mBAAmB,CAAC,EAClC,SAAS,EACT,OAAO,EACP,UAAU,GACX,EAAE;IACD,SAAS,CAAC,EAAE,eAAe,EAAE,CAAC;IAC9B;;qDAEiD;IACjD,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,+BA2BA"}
1
+ {"version":3,"file":"booking-form.d.ts","sourceRoot":"","sources":["../../../src/components/meeting-scheduler/booking-form.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAa,SAAS,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAIvD,OAAO,EAEL,KAAK,uBAAuB,EAQ5B,KA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rB,uEAAuE;IACvE,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;;;;;;OAQG;IACH,SAAS,CAAC,EAAE,eAAe,EAAE,CAAC;IAC9B,uFAAuF;IACvF,OAAO,CAAC,EAAE,kBAAkB,CAAC;IAC7B,YAAY,EAAE,OAAO,CAAC;IACtB,QAAQ,EAAE,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC9D,mFAAmF;IACnF,kBAAkB,EAAE;QAAE,GAAG,EAAE,GAAG,CAAC,gBAAgB,CAAC,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC;IACjE,UAAU,EAAE,MAAM,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,CAAC;IAClD;;;6BAGyB;IACzB,MAAM,CAAC,EAAE,oBAAoB,GAAG,IAAI,CAAC;CACtC;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,WAAW,CAAC,EAC1B,YAAY,EACZ,SAAS,EACT,WAAW,EACX,UAAU,EACV,QAAQ,EACR,SAAiB,EACjB,aAAa,EACb,WAAW,EACX,UAAU,EACV,SAAS,EACT,OAAO,EACP,YAAY,EACZ,QAAQ,EACR,kBAAkB,EAClB,UAAU,EACV,MAAa,GACd,EAAE,gBAAgB,+BA2UlB;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,mBAAmB,CAAC,EAClC,SAAS,EACT,OAAO,EACP,UAAU,GACX,EAAE;IACD,SAAS,CAAC,EAAE,eAAe,EAAE,CAAC;IAC9B;;qDAEiD;IACjD,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,+BA2BA"}
@@ -331,20 +331,6 @@ function makeDeferredBookingSchema(formFields, legalConsent) {
331
331
  timezone: TIMEZONE.nullish()
332
332
  });
333
333
  }
334
- function emailDomainDenied(email, rule) {
335
- if (typeof email !== "string") return false;
336
- const domain = _optionalChain([email, 'access', _5 => _5.split, 'call', _6 => _6("@"), 'access', _7 => _7[1], 'optionalAccess', _8 => _8.trim, 'call', _9 => _9(), 'access', _10 => _10.toLowerCase, 'call', _11 => _11()]);
337
- if (domain === void 0 || domain === "") return false;
338
- return rule.domains.includes(domain);
339
- }
340
- function withDeniedEmailDomains(schema, rule) {
341
- if (!rule) return schema;
342
- return schema.superRefine((values, ctx) => {
343
- if (emailDomainDenied(values.email, rule)) {
344
- ctx.addIssue({ code: "custom", path: ["email"], message: rule.message });
345
- }
346
- });
347
- }
348
334
 
349
335
  // src/hooks/use-meeting-booking.ts
350
336
  var AVAILABILITY_STALE_MS = 0;
@@ -355,7 +341,7 @@ var BOOKING_IN_FLIGHT_MESSAGE = "Already submitting";
355
341
  function useMeetingBooking(options) {
356
342
  const { meetingId, apiBaseUrl = "", initialAvailability } = options;
357
343
  const queryClient = _reactquery.useQueryClient.call(void 0, );
358
- const seededOffset = _optionalChain([initialAvailability, 'optionalAccess', _12 => _12.meetingId]) === meetingId ? initialAvailability.monthOffset : void 0;
344
+ const seededOffset = _optionalChain([initialAvailability, 'optionalAccess', _5 => _5.meetingId]) === meetingId ? initialAvailability.monthOffset : void 0;
359
345
  const [monthOffset, setMonthOffsetState] = _react.useState.call(void 0, _nullishCoalesce(seededOffset, () => ( 0)));
360
346
  const setMonthOffset = _react.useCallback.call(void 0, (offset) => {
361
347
  setMonthOffsetState(Math.max(0, Math.min(_chunkVZMST7BDcjs.MAX_MONTH_OFFSET, offset)));
@@ -366,7 +352,7 @@ function useMeetingBooking(options) {
366
352
  prevMeetingIdRef.current = meetingId;
367
353
  setMonthOffsetState(0);
368
354
  }, [meetingId]);
369
- const seed = _optionalChain([initialAvailability, 'optionalAccess', _13 => _13.meetingId]) === meetingId && initialAvailability.monthOffset === monthOffset ? initialAvailability : void 0;
355
+ const seed = _optionalChain([initialAvailability, 'optionalAccess', _6 => _6.meetingId]) === meetingId && initialAvailability.monthOffset === monthOffset ? initialAvailability : void 0;
370
356
  const availabilityQuery = _reactquery.useQuery.call(void 0, {
371
357
  queryKey: meetingAvailabilityKey(apiBaseUrl, meetingId, monthOffset),
372
358
  queryFn: async ({ signal }) => {
@@ -462,8 +448,8 @@ var evenSpan = (count, index) => {
462
448
  return Math.min(GRID_COLUMNS, Math.max(1, index < extra ? base + 1 : base));
463
449
  };
464
450
  var slotColumnClass = (row, slot, index) => _chunkX7CEWD6Vcjs.cn.call(void 0, row.length === 2 ? "col-span-1" : "col-span-2", SPAN_CLASS[_nullishCoalesce(slot.span, () => ( evenSpan(row.length, index)))]);
465
- var placeholderFor = (field) => _nullishCoalesce(field.placeholder, () => ( _optionalChain([fieldTypeSpec, 'call', _14 => _14(field.type), 'access', _15 => _15.placeholder, 'optionalCall', _16 => _16(field)])));
466
- var optionLabel = (field, value) => _nullishCoalesce(_optionalChain([field, 'access', _17 => _17.optionLabels, 'optionalAccess', _18 => _18[value]]), () => ( value));
451
+ var placeholderFor = (field) => _nullishCoalesce(field.placeholder, () => ( _optionalChain([fieldTypeSpec, 'call', _7 => _7(field.type), 'access', _8 => _8.placeholder, 'optionalCall', _9 => _9(field)])));
452
+ var optionLabel = (field, value) => _nullishCoalesce(_optionalChain([field, 'access', _10 => _10.optionLabels, 'optionalAccess', _11 => _11[value]]), () => ( value));
467
453
  var trimmed = (v) => String(_nullishCoalesce(v, () => ( ""))).trim();
468
454
  var canonicalNumber = (v) => {
469
455
  const s = String(_nullishCoalesce(v, () => ( ""))).trim();
@@ -481,7 +467,6 @@ var FIELD_CONTROLS = {
481
467
  type: _nullishCoalesce(field.inputType, () => ( "text")),
482
468
  required: field.required,
483
469
  "aria-invalid": Boolean(error),
484
- invalid: Boolean(error),
485
470
  autoComplete: field.autoComplete,
486
471
  placeholder: placeholderFor(field),
487
472
  ...register(registerName)
@@ -493,7 +478,6 @@ var FIELD_CONTROLS = {
493
478
  id,
494
479
  required: field.required,
495
480
  "aria-invalid": Boolean(error),
496
- invalid: Boolean(error),
497
481
  placeholder: placeholderFor(field),
498
482
  ...register(registerName)
499
483
  }
@@ -507,7 +491,6 @@ var FIELD_CONTROLS = {
507
491
  step: "any",
508
492
  required: field.required,
509
493
  "aria-invalid": Boolean(error),
510
- invalid: Boolean(error),
511
494
  ...register(registerName, { setValueAs: canonicalNumber })
512
495
  }
513
496
  ),
@@ -520,7 +503,6 @@ var FIELD_CONTROLS = {
520
503
  autoComplete: "tel",
521
504
  required: field.required,
522
505
  "aria-invalid": Boolean(error),
523
- invalid: Boolean(error),
524
506
  placeholder: placeholderFor(field),
525
507
  ...register(registerName, { setValueAs: trimmed })
526
508
  }
@@ -534,7 +516,6 @@ var FIELD_CONTROLS = {
534
516
  type: "date",
535
517
  required: field.required,
536
518
  "aria-invalid": Boolean(error),
537
- invalid: Boolean(error),
538
519
  ...register(registerName)
539
520
  }
540
521
  )
@@ -545,16 +526,7 @@ var FIELD_CONTROLS = {
545
526
  control,
546
527
  name: registerName,
547
528
  render: ({ field: rhf }) => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkVZMST7BDcjs.Select, { value: _nullishCoalesce(rhf.value, () => ( "")), onValueChange: rhf.onChange, children: [
548
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
549
- _chunkVZMST7BDcjs.SelectTrigger,
550
- {
551
- id,
552
- "aria-required": field.required || void 0,
553
- "aria-invalid": Boolean(error),
554
- invalid: Boolean(error),
555
- children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVZMST7BDcjs.SelectValue, { placeholder: "Select\u2026" })
556
- }
557
- ),
529
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVZMST7BDcjs.SelectTrigger, { id, "aria-required": field.required || void 0, "aria-invalid": Boolean(error), children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVZMST7BDcjs.SelectValue, { placeholder: "Select\u2026" }) }),
558
530
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVZMST7BDcjs.SelectContent, { children: (_nullishCoalesce(field.options, () => ( []))).map((opt) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVZMST7BDcjs.SelectItem, { value: opt, children: optionLabel(field, opt) }, opt)) })
559
531
  ] })
560
532
  }
@@ -644,8 +616,6 @@ function BookingForm({
644
616
  submitLabel,
645
617
  footerNote,
646
618
  fieldRows,
647
- fieldCopy,
648
- deniedEmailDomains,
649
619
  consent,
650
620
  isSubmitting,
651
621
  onSubmit,
@@ -656,11 +626,11 @@ function BookingForm({
656
626
  const { formFields, legalConsent } = availability;
657
627
  const supportedFields = _react.useMemo.call(void 0, () => normalizeFormFields(formFields), [formFields]);
658
628
  const schema = _react.useMemo.call(void 0,
659
- () => withDeniedEmailDomains(makeDeferredBookingSchema(supportedFields, legalConsent), deniedEmailDomains),
660
- [supportedFields, legalConsent, deniedEmailDomains]
629
+ () => makeDeferredBookingSchema(supportedFields, legalConsent),
630
+ [supportedFields, legalConsent]
661
631
  );
662
632
  const consentDefaults = _react.useMemo.call(void 0,
663
- () => (_nullishCoalesce(_optionalChain([legalConsent, 'optionalAccess', _19 => _19.communicationConsentCheckboxes]), () => ( []))).map((c) => ({
633
+ () => (_nullishCoalesce(_optionalChain([legalConsent, 'optionalAccess', _12 => _12.communicationConsentCheckboxes]), () => ( []))).map((c) => ({
664
634
  communicationTypeId: c.communicationTypeId,
665
635
  consented: false
666
636
  })),
@@ -692,8 +662,8 @@ function BookingForm({
692
662
  ..._nullishCoalesce(initialValues, () => ( {}))
693
663
  }
694
664
  });
695
- const priorConsents = _optionalChain([initialValues, 'optionalAccess', _20 => _20.legalConsentResponses]);
696
- const [consented, setConsented] = _react.useState.call(void 0, _optionalChain([initialValues, 'optionalAccess', _21 => _21[HOST_CONSENT_KEY]]) === true);
665
+ const priorConsents = _optionalChain([initialValues, 'optionalAccess', _13 => _13.legalConsentResponses]);
666
+ const [consented, setConsented] = _react.useState.call(void 0, _optionalChain([initialValues, 'optionalAccess', _14 => _14[HOST_CONSENT_KEY]]) === true);
697
667
  const [consentError, setConsentError] = _react.useState.call(void 0, null);
698
668
  const consentMissing = Boolean(consent) && !consented;
699
669
  _react.useEffect.call(void 0, () => {
@@ -702,7 +672,7 @@ function BookingForm({
702
672
  "legalConsentResponses",
703
673
  consentDefaults.map((next) => ({
704
674
  ...next,
705
- consented: _nullishCoalesce(_optionalChain([current, 'access', _22 => _22.find, 'call', _23 => _23((r) => r.communicationTypeId === next.communicationTypeId), 'optionalAccess', _24 => _24.consented]), () => ( false))
675
+ consented: _nullishCoalesce(_optionalChain([current, 'access', _15 => _15.find, 'call', _16 => _16((r) => r.communicationTypeId === next.communicationTypeId), 'optionalAccess', _17 => _17.consented]), () => ( false))
706
676
  })),
707
677
  { shouldDirty: false }
708
678
  );
@@ -720,16 +690,6 @@ function BookingForm({
720
690
  fieldPath: (name) => BUILT_IN_BOOKING_FIELDS.some((field) => field.name === name) ? name : `formFields.${name}`
721
691
  }
722
692
  );
723
- const { toast } = _chunkRCLYHHB3cjs.useToast.call(void 0, );
724
- const onInvalid = () => {
725
- if (deniedEmailDomains && emailDomainDenied(getValues("email"), deniedEmailDomains)) {
726
- toast({
727
- variant: "error",
728
- title: "Check your email address",
729
- description: deniedEmailDomains.message
730
- });
731
- }
732
- };
733
693
  const submitValid = handleSubmit(async (data) => {
734
694
  if (consentMissing) return;
735
695
  if (deferSlot) {
@@ -746,41 +706,27 @@ function BookingForm({
746
706
  ...getSignals(),
747
707
  ...formRescue.submitFields()
748
708
  });
749
- }, onInvalid);
709
+ });
750
710
  const submit = (event) => {
751
- if (consentMissing) setConsentError(_nullishCoalesce(_optionalChain([consent, 'optionalAccess', _25 => _25.errorMessage]), () => ( "Please agree to continue.")));
711
+ if (consentMissing) setConsentError(_nullishCoalesce(_optionalChain([consent, 'optionalAccess', _18 => _18.errorMessage]), () => ( "Please agree to continue.")));
752
712
  return submitValid(event);
753
713
  };
754
714
  const fieldError = (name) => {
755
- const err = _optionalChain([errors, 'access', _26 => _26.formFields, 'optionalAccess', _27 => _27[name]]);
756
- return _optionalChain([err, 'optionalAccess', _28 => _28.message]);
757
- };
758
- const renderField = (field, where) => {
759
- const copy = _optionalChain([fieldCopy, 'optionalAccess', _29 => _29[field.name]]);
760
- const shown = copy ? { ...field, label: _nullishCoalesce(copy.label, () => ( field.label)), placeholder: _nullishCoalesce(copy.placeholder, () => ( field.placeholder)) } : field;
761
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
762
- _chunkQVSVRG7Icjs.FieldWrapper,
763
- {
764
- label: shown.label,
765
- htmlFor: where.id,
766
- required: shown.required,
767
- error: where.error,
768
- children: FIELD_CONTROLS[shown.type]({
769
- field: shown,
770
- id: where.id,
771
- registerName: where.registerName,
772
- error: where.error,
773
- register,
774
- control
775
- })
776
- },
777
- shown.name
778
- );
715
+ const err = _optionalChain([errors, 'access', _19 => _19.formFields, 'optionalAccess', _20 => _20[name]]);
716
+ return _optionalChain([err, 'optionalAccess', _21 => _21.message]);
779
717
  };
718
+ const renderField = (field, where) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkQVSVRG7Icjs.FieldWrapper, { label: field.label, htmlFor: where.id, required: field.required, error: where.error, children: FIELD_CONTROLS[field.type]({
719
+ field,
720
+ id: where.id,
721
+ registerName: where.registerName,
722
+ error: where.error,
723
+ register,
724
+ control
725
+ }) }, field.name);
780
726
  const builtInFields = Object.fromEntries(
781
727
  BUILT_IN_BOOKING_FIELDS.map((field) => [
782
728
  field.name,
783
- renderField(field, { id: builtInId(field.name), registerName: field.name, error: _optionalChain([errors, 'access', _30 => _30[field.name], 'optionalAccess', _31 => _31.message]) })
729
+ renderField(field, { id: builtInId(field.name), registerName: field.name, error: _optionalChain([errors, 'access', _22 => _22[field.name], 'optionalAccess', _23 => _23.message]) })
784
730
  ])
785
731
  );
786
732
  const renderDeclaredField = (field) => renderField(field, {
@@ -841,7 +787,7 @@ function BookingForm({
841
787
  // box doesn't shove the submit button down the card. With no error the
842
788
  // wrapper is `display:contents` and the panel below is the flex item,
843
789
  // exactly as it was.
844
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkQVSVRG7Icjs.FieldWrapper, { error: _optionalChain([errors, 'access', _32 => _32.legalConsentResponses, 'optionalAccess', _33 => _33.message]), children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex flex-col gap-[var(--spacing-system-xs)]", children: [
790
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkQVSVRG7Icjs.FieldWrapper, { error: _optionalChain([errors, 'access', _24 => _24.legalConsentResponses, 'optionalAccess', _25 => _25.message]), children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex flex-col gap-[var(--spacing-system-xs)]", children: [
845
791
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-ods-text-secondary text-h6", children: legalConsent.processingConsentText }),
846
792
  legalConsent.communicationConsentText && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-ods-text-secondary text-h6", children: legalConsent.communicationConsentText }),
847
793
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
@@ -860,7 +806,7 @@ function BookingForm({
860
806
  _chunkVZMST7BDcjs.CheckboxBlock,
861
807
  {
862
808
  id: `ms-consent-${box.communicationTypeId}`,
863
- checked: _nullishCoalesce(_optionalChain([current, 'optionalAccess', _34 => _34.consented]), () => ( false)),
809
+ checked: _nullishCoalesce(_optionalChain([current, 'optionalAccess', _26 => _26.consented]), () => ( false)),
864
810
  onCheckedChange: (v) => rhf.onChange(
865
811
  responses.map(
866
812
  (r) => r.communicationTypeId === box.communicationTypeId ? { ...r, consented: v } : r
@@ -955,7 +901,7 @@ function zoneLabel(tz) {
955
901
  timeZone: tz,
956
902
  timeZoneName: "shortOffset"
957
903
  }).formatToParts(/* @__PURE__ */ new Date());
958
- const offset = _nullishCoalesce(_optionalChain([parts, 'access', _35 => _35.find, 'call', _36 => _36((p) => p.type === "timeZoneName"), 'optionalAccess', _37 => _37.value]), () => ( ""));
904
+ const offset = _nullishCoalesce(_optionalChain([parts, 'access', _27 => _27.find, 'call', _28 => _28((p) => p.type === "timeZoneName"), 'optionalAccess', _29 => _29.value]), () => ( ""));
959
905
  return offset ? `${tz.replace(/_/g, " ")} (${offset})` : tz.replace(/_/g, " ");
960
906
  } catch (e4) {
961
907
  return tz.replace(/_/g, " ");
@@ -1082,7 +1028,7 @@ function SchedulerContextPanel({
1082
1028
  value: timezone,
1083
1029
  disabled,
1084
1030
  onChange: (tz) => {
1085
- if (tz) _optionalChain([onTimezoneChange, 'optionalCall', _38 => _38(tz)]);
1031
+ if (tz) _optionalChain([onTimezoneChange, 'optionalCall', _30 => _30(tz)]);
1086
1032
  },
1087
1033
  options: zoneOptions,
1088
1034
  placeholder: "Search timezone\u2026",
@@ -1166,7 +1112,7 @@ function DayCalendar({ monthOffset, onMonthOffsetChange, selectedDay, onSelectDa
1166
1112
  const startMonth = new Date(now.getFullYear(), now.getMonth(), 1);
1167
1113
  const endMonth = new Date(now.getFullYear(), now.getMonth() + _chunkVZMST7BDcjs.MAX_MONTH_OFFSET + 1, 0);
1168
1114
  const visibleMonth = new Date(now.getFullYear(), now.getMonth() + monthOffset, 1);
1169
- const dayHasNoSlots = _react.useCallback.call(void 0, (day) => !_optionalChain([slotsByDay, 'optionalAccess', _39 => _39.has, 'call', _40 => _40(calendarDayKey(day))]), [slotsByDay]);
1115
+ const dayHasNoSlots = _react.useCallback.call(void 0, (day) => !_optionalChain([slotsByDay, 'optionalAccess', _31 => _31.has, 'call', _32 => _32(calendarDayKey(day))]), [slotsByDay]);
1170
1116
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "flex min-h-0 flex-1 flex-col", "aria-busy": slotsByDay === null, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1171
1117
  _chunkVZMST7BDcjs.DatePickerCalendar,
1172
1118
  {
@@ -1184,7 +1130,7 @@ function DayCalendar({ monthOffset, onMonthOffsetChange, selectedDay, onSelectDa
1184
1130
  const day = value;
1185
1131
  if (!day) return;
1186
1132
  const key = calendarDayKey(day);
1187
- if (_optionalChain([slotsByDay, 'optionalAccess', _41 => _41.has, 'call', _42 => _42(key)])) onSelectDay(key);
1133
+ if (_optionalChain([slotsByDay, 'optionalAccess', _33 => _33.has, 'call', _34 => _34(key)])) onSelectDay(key);
1188
1134
  },
1189
1135
  disabledDays: slotsByDay === null ? DISABLE_EVERY_DAY : dayHasNoSlots
1190
1136
  }
@@ -1408,7 +1354,7 @@ function MeetingSchedulerDirectory({
1408
1354
  };
1409
1355
  }, [initialData, includeAll, apiBaseUrl]);
1410
1356
  const rows = _react.useMemo.call(void 0, () => {
1411
- const purposes = _nullishCoalesce(_optionalChain([data, 'optionalAccess', _43 => _43.purposes]), () => ( []));
1357
+ const purposes = _nullishCoalesce(_optionalChain([data, 'optionalAccess', _35 => _35.purposes]), () => ( []));
1412
1358
  return purposes.flatMap((p) => p.links.map((link) => ({ link, audienceLabel: p.label })));
1413
1359
  }, [data]);
1414
1360
  const totalPages = _chunkVTYP25OWcjs.pageCount.call(void 0, rows.length, pageSize);
@@ -1565,7 +1511,7 @@ function HubSpotMeetingScheduler({
1565
1511
  onStageChangeRef.current = onStageChange;
1566
1512
  });
1567
1513
  _react.useEffect.call(void 0, () => {
1568
- _optionalChain([onStageChangeRef, 'access', _44 => _44.current, 'optionalCall', _45 => _45(stage)]);
1514
+ _optionalChain([onStageChangeRef, 'access', _36 => _36.current, 'optionalCall', _37 => _37(stage)]);
1569
1515
  }, [stage]);
1570
1516
  const [stash, setStash] = _react.useState.call(void 0, null);
1571
1517
  const inFlightRef = _react.useRef.call(void 0, false);
@@ -1596,8 +1542,8 @@ function HubSpotMeetingScheduler({
1596
1542
  _react.useEffect.call(void 0, () => {
1597
1543
  autoAdvanceCount.current = 0;
1598
1544
  }, [meetingId]);
1599
- const durations = _react.useMemo.call(void 0, () => _nullishCoalesce(_optionalChain([availability, 'optionalAccess', _46 => _46.durationsMs]), () => ( [])), [_optionalChain([availability, 'optionalAccess', _47 => _47.durationsMs])]);
1600
- const shownHosts = _nullishCoalesce(_nullishCoalesce(hosts, () => ( _optionalChain([availability, 'optionalAccess', _48 => _48.hosts]))), () => ( []));
1545
+ const durations = _react.useMemo.call(void 0, () => _nullishCoalesce(_optionalChain([availability, 'optionalAccess', _38 => _38.durationsMs]), () => ( [])), [_optionalChain([availability, 'optionalAccess', _39 => _39.durationsMs])]);
1546
+ const shownHosts = _nullishCoalesce(_nullishCoalesce(hosts, () => ( _optionalChain([availability, 'optionalAccess', _40 => _40.hosts]))), () => ( []));
1601
1547
  const durationMs = _nullishCoalesce(_nullishCoalesce(pickedDurationMs, () => ( durations[0])), () => ( null));
1602
1548
  const slots = _react.useMemo.call(void 0, () => {
1603
1549
  if (!availability || durationMs == null) return [];
@@ -1657,7 +1603,7 @@ function HubSpotMeetingScheduler({
1657
1603
  _chunkRCLYHHB3cjs.completeFormRescue.call(void 0, rescue, payload[_chunkRCLYHHB3cjs.FORM_RESCUE_ATTEMPT_FIELD]);
1658
1604
  setConfirmation(result.confirmation);
1659
1605
  setStep("confirmed");
1660
- _optionalChain([onBooked, 'optionalCall', _49 => _49(result.confirmation)]);
1606
+ _optionalChain([onBooked, 'optionalCall', _41 => _41(result.confirmation)]);
1661
1607
  return;
1662
1608
  }
1663
1609
  const code = _nullishCoalesce(result.code, () => ( "TEMPORARILY_UNAVAILABLE"));
@@ -1705,8 +1651,8 @@ function HubSpotMeetingScheduler({
1705
1651
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: stepPanelClass, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1706
1652
  BookingFormSkeleton,
1707
1653
  {
1708
- fieldRows: _optionalChain([detailsFormProps, 'optionalAccess', _50 => _50.fieldRows]),
1709
- consent: Boolean(_optionalChain([detailsFormProps, 'optionalAccess', _51 => _51.consent])),
1654
+ fieldRows: _optionalChain([detailsFormProps, 'optionalAccess', _42 => _42.fieldRows]),
1655
+ consent: Boolean(_optionalChain([detailsFormProps, 'optionalAccess', _43 => _43.consent])),
1710
1656
  footerNote: preset.footerNote
1711
1657
  }
1712
1658
  ) })
@@ -1767,7 +1713,7 @@ function HubSpotMeetingScheduler({
1767
1713
  deferSlot: detailsFirst,
1768
1714
  submitLabel: preset.submitLabel,
1769
1715
  footerNote: preset.footerNote,
1770
- initialValues: detailsFirst ? _optionalChain([stash, 'optionalAccess', _52 => _52.payload]) : void 0,
1716
+ initialValues: detailsFirst ? _optionalChain([stash, 'optionalAccess', _44 => _44.payload]) : void 0,
1771
1717
  isSubmitting,
1772
1718
  onSubmit: detailsFirst ? stashDetails : handleSubmit,
1773
1719
  honeypotInputProps,