@aranova/tracking-react 1.13.0 → 1.14.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.
Files changed (36) hide show
  1. package/README.md +26 -0
  2. package/dist/{bookings-C1HMPjQl.d.ts → bookings-CkfA5XOM.d.ts} +283 -8
  3. package/dist/{bookings-CHpplXU7.d.mts → bookings-DFz3BUiP.d.mts} +283 -8
  4. package/dist/client.d.mts +10 -8
  5. package/dist/client.d.ts +10 -8
  6. package/dist/client.js +382 -41
  7. package/dist/client.js.map +1 -1
  8. package/dist/client.mjs +380 -40
  9. package/dist/client.mjs.map +1 -1
  10. package/dist/index.d.mts +8 -180
  11. package/dist/index.d.ts +8 -180
  12. package/dist/index.js +375 -189
  13. package/dist/index.js.map +1 -1
  14. package/dist/index.mjs +372 -189
  15. package/dist/index.mjs.map +1 -1
  16. package/dist/{ingest-typed-sCDoPInT.d.ts → ingest-typed-BO6Arbw-.d.mts} +6 -99
  17. package/dist/{ingest-typed-Ckt4R731.d.mts → ingest-typed-D7I4aQ7p.d.ts} +6 -99
  18. package/dist/{phone-utils-BNiSqeF7.d.mts → phone-utils-CYr6AmEP.d.mts} +231 -3
  19. package/dist/{phone-utils-D12FW8tT.d.ts → phone-utils-CYr6AmEP.d.ts} +231 -3
  20. package/dist/phone.d.mts +1 -2
  21. package/dist/phone.d.ts +1 -2
  22. package/dist/phone.js +2 -2
  23. package/dist/phone.js.map +1 -1
  24. package/dist/phone.mjs +2 -2
  25. package/dist/phone.mjs.map +1 -1
  26. package/dist/{sales-CNvzyF5T.d.ts → sales-C0FMkN4m.d.ts} +1 -1
  27. package/dist/{sales-YUH3bQl9.d.mts → sales-KbTcowYa.d.mts} +1 -1
  28. package/dist/sales.d.mts +3 -3
  29. package/dist/sales.d.ts +3 -3
  30. package/dist/sales.js +1204 -170
  31. package/dist/sales.js.map +1 -1
  32. package/dist/sales.mjs +1204 -170
  33. package/dist/sales.mjs.map +1 -1
  34. package/package.json +1 -1
  35. package/dist/form-submit-CX-CxJjQ.d.mts +0 -47
  36. package/dist/form-submit-CX-CxJjQ.d.ts +0 -47
@@ -1,103 +1,6 @@
1
- import { p as BookingDayWindows, h as BookingMode, q as ConversionIntegrations } from './bookings-C1HMPjQl.js';
2
1
  import * as zod_v4_core from 'zod/v4/core';
3
2
  import * as z from 'zod/mini';
4
- import { J as JsonValue, F as FormSubmitConfig, a as FormSubmitMetadata } from './form-submit-CX-CxJjQ.js';
5
- import './phone-utils-D12FW8tT.js';
6
-
7
- type BookingProvider = "autoleap";
8
- /** One service choice on the booking form, by the site's own key. */
9
- interface BookingOption {
10
- key: string;
11
- label: string;
12
- /** The shop's service category, for a heading over its choices; null when it has none. */
13
- group: string | null;
14
- /** Optional helper text to show under the label. */
15
- description: string | null;
16
- }
17
- /** One heading on the form and the choices under it; `group` null holds the ungrouped ones. */
18
- interface BookingOptionGroup {
19
- group: string | null;
20
- options: BookingOption[];
21
- }
22
- /** The booking rules in camelCase, all in the shop's wall time. */
23
- interface BookingRules {
24
- minDaysAhead: number;
25
- maxDaysAhead: number;
26
- /** Start hours per weekday, `monday` … `sunday`; both lists empty = closed. */
27
- hours: Record<string, BookingDayWindows>;
28
- /** `YYYY-MM-DD` shop dates with no bookings although the weekday is open. */
29
- closedDates: string[];
30
- /** `YYYY-MM-DD` shop dates whose start hours replace their weekday's. */
31
- specialHours: Record<string, BookingDayWindows>;
32
- vehicleRequired: boolean;
33
- /** The vehicle may come after booking: send it with `bookings.updateBooking`. */
34
- vehicleDeferred: boolean;
35
- /** `waitForIt` / `dropOff`; empty when the shop hides the question. */
36
- dropOffOptions: string[];
37
- }
38
- interface BookingIntegration {
39
- provider: BookingProvider;
40
- /** False: render only the handoff link. Never block the customer on it. */
41
- enabled: boolean;
42
- /** The shop's own booking page. */
43
- fallbackUrl: string;
44
- /** True when the site may post a booking: `enabled`, rules captured and options mapped. */
45
- acceptsBookings: boolean;
46
- /** The shop's IANA timezone; every date and hour here is its wall time. */
47
- timezone: string;
48
- /** Sent back with each booking; a stale one is refused and the config refetched. */
49
- configVersion: number | null;
50
- rules: BookingRules | null;
51
- options: BookingOption[];
52
- /**
53
- * Where a booking from this page goes: `live` in production; on a development config `test`
54
- * (the shop's test lead source) or `simulated` (never sent). Show a banner when not `live`.
55
- */
56
- mode: BookingMode;
57
- }
58
- /** What the visitor already typed, carried onto the shop's booking page. */
59
- interface BookingHandoffPrefill {
60
- /** A single full-name field; split on the first space when `firstName` is not given. */
61
- name?: string | null;
62
- firstName?: string | null;
63
- lastName?: string | null;
64
- /** Any format; sent as national digits (no country code), as the shop's portal stores it. */
65
- phone?: string | null;
66
- email?: string | null;
67
- }
68
- /** The enabled-or-fallback booking provider in a config's integrations, if any. */
69
- declare function getBookingIntegration(integrations: ConversionIntegrations | null | undefined): BookingIntegration | null;
70
- /** One bookable day: its start hours split as the shop's portal shows them. */
71
- interface BookableDay {
72
- /** `YYYY-MM-DD`, shop-local. */
73
- date: string;
74
- /** `monday` … `sunday`. */
75
- weekday: string;
76
- /** Start hours before noon (8 = 08:00). */
77
- morning: number[];
78
- /** Start hours from noon on. */
79
- afternoon: number[];
80
- }
81
- /** Today's date in `timeZone` as `YYYY-MM-DD`; the server judges notice by the same date. */
82
- declare function shopToday(timeZone: string, now?: Date): string;
83
- /**
84
- * Every day a customer may book, from the minimum notice to the end of the window, with its
85
- * start hours. Exactly what the server accepts: closed dates removed, special hours applied.
86
- */
87
- declare function bookableSlots(rules: BookingRules, { timeZone, now }: {
88
- timeZone: string;
89
- now?: Date;
90
- }): BookableDay[];
91
- /**
92
- * The handoff URL with the visitor's details prefilled, or null when `fallbackUrl` is not an
93
- * https link on the shop's booking host (a config value never becomes an arbitrary redirect).
94
- */
95
- declare function buildBookingHandoffUrl(fallbackUrl: string, prefill?: BookingHandoffPrefill): string | null;
96
- /**
97
- * The options as headed sections, in published order: one per category, choices in order
98
- * under it. The API saves them grouped, so a category is never split; this keeps the first run.
99
- */
100
- declare function groupBookingOptions(options: readonly BookingOption[]): BookingOptionGroup[];
3
+ import { J as JsonValue, j as FormSubmitConfig, k as FormSubmitMetadata } from './phone-utils-CYr6AmEP.mjs';
101
4
 
102
5
  /**
103
6
  * Metadata for a manually fired `cta_click` event.
@@ -779,6 +682,10 @@ declare const EVENT_REGISTRY: {
779
682
  label: z.ZodMiniString<string>;
780
683
  value: z.ZodMiniType<JsonValue, unknown, zod_v4_core.$ZodTypeInternals<JsonValue, unknown>>;
781
684
  }, zod_v4_core.$strict>>>>;
685
+ contract_violations: z.ZodMiniOptional<z.ZodMiniNullable<z.ZodMiniArray<z.ZodMiniObject<{
686
+ role: z.ZodMiniNullable<z.ZodMiniString<string>>;
687
+ rule: z.ZodMiniString<string>;
688
+ }, zod_v4_core.$strict>>>>;
782
689
  }, zod_v4_core.$strict>;
783
690
  page: z.ZodMiniObject<{
784
691
  path: z.ZodMiniString<string>;
@@ -1026,4 +933,4 @@ interface TypedTrackingClient<TRegistry extends TriggerRegistryConfig> {
1026
933
  getVisitorId(): string;
1027
934
  }
1028
935
 
1029
- export { buildBookingHandoffUrl as $, type AutomaticEventName as A, type BookableDay as B, type CtaClickConfig as C, type RegisteredManualEvents as D, EVENT_SEMANTICS as E, type FormStartConfig as F, type ScrollDepthMetadata as G, type SdkHeartbeatConfig as H, type SdkHeartbeatMetadata as I, type SiteLinkArrivalConfig as J, type SiteLinkArrivalMetadata as K, type SiteLinkClickConfig as L, type ManualEventName as M, type SiteLinkClickMetadata as N, type SpecificPageName as O, type PageExitConfig as P, type SpecificPageVisitConfig as Q, type RegisteredAutomaticEvents as R, type ScrollDepthConfig as S, type SpecificPageVisitMetadata as T, type TimeOnSiteConfig as U, type TimeOnSiteMetadata as V, type TrackableEvent as W, type TriggerRegistryConfig as X, type TypedTrackEventOptions as Y, type TypedTrackingClient as Z, bookableSlots as _, type BookingHandoffPrefill as a, getBookingIntegration as a0, getEventSemantics as a1, groupBookingOptions as a2, shopToday as a3, type BookingIntegration as b, type BookingOption as c, type BookingOptionGroup as d, type BookingProvider as e, type BookingRules as f, type CtaClickMetadata as g, type EventCategory as h, type EventClientVisibility as i, type EventConfig as j, type EventKind as k, type EventMetadata as l, type EventName as m, type EventOutcomeRole as n, type EventSemantics as o, type FormStartMetadata as p, type FormStepConfig as q, type FormStepMetadata as r, type MultiPageSessionConfig as s, type MultiPageSessionMetadata as t, type PageExitMetadata as u, type PageIdentity as v, type PageViewConfig as w, type PageViewMetadata as x, type PhoneClickConfig as y, type PhoneClickMetadata as z };
936
+ export { type AutomaticEventName as A, type SiteLinkClickConfig as B, type CtaClickConfig as C, type SiteLinkClickMetadata as D, EVENT_SEMANTICS as E, type FormStartConfig as F, type SpecificPageName as G, type SpecificPageVisitConfig as H, type SpecificPageVisitMetadata as I, type TimeOnSiteMetadata as J, type TrackableEvent as K, type TriggerRegistryConfig as L, type ManualEventName as M, type TypedTrackEventOptions as N, type TypedTrackingClient as O, type PageExitConfig as P, getEventSemantics as Q, type RegisteredAutomaticEvents as R, type ScrollDepthConfig as S, type TimeOnSiteConfig as T, type CtaClickMetadata as a, type EventCategory as b, type EventClientVisibility as c, type EventConfig as d, type EventKind as e, type EventMetadata as f, type EventName as g, type EventOutcomeRole as h, type EventSemantics as i, type FormStartMetadata as j, type FormStepConfig as k, type FormStepMetadata as l, type MultiPageSessionConfig as m, type MultiPageSessionMetadata as n, type PageExitMetadata as o, type PageIdentity as p, type PageViewConfig as q, type PageViewMetadata as r, type PhoneClickConfig as s, type PhoneClickMetadata as t, type RegisteredManualEvents as u, type ScrollDepthMetadata as v, type SdkHeartbeatConfig as w, type SdkHeartbeatMetadata as x, type SiteLinkArrivalConfig as y, type SiteLinkArrivalMetadata as z };
@@ -1,103 +1,6 @@
1
- import { p as BookingDayWindows, h as BookingMode, q as ConversionIntegrations } from './bookings-CHpplXU7.mjs';
2
1
  import * as zod_v4_core from 'zod/v4/core';
3
2
  import * as z from 'zod/mini';
4
- import { J as JsonValue, F as FormSubmitConfig, a as FormSubmitMetadata } from './form-submit-CX-CxJjQ.mjs';
5
- import './phone-utils-BNiSqeF7.mjs';
6
-
7
- type BookingProvider = "autoleap";
8
- /** One service choice on the booking form, by the site's own key. */
9
- interface BookingOption {
10
- key: string;
11
- label: string;
12
- /** The shop's service category, for a heading over its choices; null when it has none. */
13
- group: string | null;
14
- /** Optional helper text to show under the label. */
15
- description: string | null;
16
- }
17
- /** One heading on the form and the choices under it; `group` null holds the ungrouped ones. */
18
- interface BookingOptionGroup {
19
- group: string | null;
20
- options: BookingOption[];
21
- }
22
- /** The booking rules in camelCase, all in the shop's wall time. */
23
- interface BookingRules {
24
- minDaysAhead: number;
25
- maxDaysAhead: number;
26
- /** Start hours per weekday, `monday` … `sunday`; both lists empty = closed. */
27
- hours: Record<string, BookingDayWindows>;
28
- /** `YYYY-MM-DD` shop dates with no bookings although the weekday is open. */
29
- closedDates: string[];
30
- /** `YYYY-MM-DD` shop dates whose start hours replace their weekday's. */
31
- specialHours: Record<string, BookingDayWindows>;
32
- vehicleRequired: boolean;
33
- /** The vehicle may come after booking: send it with `bookings.updateBooking`. */
34
- vehicleDeferred: boolean;
35
- /** `waitForIt` / `dropOff`; empty when the shop hides the question. */
36
- dropOffOptions: string[];
37
- }
38
- interface BookingIntegration {
39
- provider: BookingProvider;
40
- /** False: render only the handoff link. Never block the customer on it. */
41
- enabled: boolean;
42
- /** The shop's own booking page. */
43
- fallbackUrl: string;
44
- /** True when the site may post a booking: `enabled`, rules captured and options mapped. */
45
- acceptsBookings: boolean;
46
- /** The shop's IANA timezone; every date and hour here is its wall time. */
47
- timezone: string;
48
- /** Sent back with each booking; a stale one is refused and the config refetched. */
49
- configVersion: number | null;
50
- rules: BookingRules | null;
51
- options: BookingOption[];
52
- /**
53
- * Where a booking from this page goes: `live` in production; on a development config `test`
54
- * (the shop's test lead source) or `simulated` (never sent). Show a banner when not `live`.
55
- */
56
- mode: BookingMode;
57
- }
58
- /** What the visitor already typed, carried onto the shop's booking page. */
59
- interface BookingHandoffPrefill {
60
- /** A single full-name field; split on the first space when `firstName` is not given. */
61
- name?: string | null;
62
- firstName?: string | null;
63
- lastName?: string | null;
64
- /** Any format; sent as national digits (no country code), as the shop's portal stores it. */
65
- phone?: string | null;
66
- email?: string | null;
67
- }
68
- /** The enabled-or-fallback booking provider in a config's integrations, if any. */
69
- declare function getBookingIntegration(integrations: ConversionIntegrations | null | undefined): BookingIntegration | null;
70
- /** One bookable day: its start hours split as the shop's portal shows them. */
71
- interface BookableDay {
72
- /** `YYYY-MM-DD`, shop-local. */
73
- date: string;
74
- /** `monday` … `sunday`. */
75
- weekday: string;
76
- /** Start hours before noon (8 = 08:00). */
77
- morning: number[];
78
- /** Start hours from noon on. */
79
- afternoon: number[];
80
- }
81
- /** Today's date in `timeZone` as `YYYY-MM-DD`; the server judges notice by the same date. */
82
- declare function shopToday(timeZone: string, now?: Date): string;
83
- /**
84
- * Every day a customer may book, from the minimum notice to the end of the window, with its
85
- * start hours. Exactly what the server accepts: closed dates removed, special hours applied.
86
- */
87
- declare function bookableSlots(rules: BookingRules, { timeZone, now }: {
88
- timeZone: string;
89
- now?: Date;
90
- }): BookableDay[];
91
- /**
92
- * The handoff URL with the visitor's details prefilled, or null when `fallbackUrl` is not an
93
- * https link on the shop's booking host (a config value never becomes an arbitrary redirect).
94
- */
95
- declare function buildBookingHandoffUrl(fallbackUrl: string, prefill?: BookingHandoffPrefill): string | null;
96
- /**
97
- * The options as headed sections, in published order: one per category, choices in order
98
- * under it. The API saves them grouped, so a category is never split; this keeps the first run.
99
- */
100
- declare function groupBookingOptions(options: readonly BookingOption[]): BookingOptionGroup[];
3
+ import { J as JsonValue, j as FormSubmitConfig, k as FormSubmitMetadata } from './phone-utils-CYr6AmEP.js';
101
4
 
102
5
  /**
103
6
  * Metadata for a manually fired `cta_click` event.
@@ -779,6 +682,10 @@ declare const EVENT_REGISTRY: {
779
682
  label: z.ZodMiniString<string>;
780
683
  value: z.ZodMiniType<JsonValue, unknown, zod_v4_core.$ZodTypeInternals<JsonValue, unknown>>;
781
684
  }, zod_v4_core.$strict>>>>;
685
+ contract_violations: z.ZodMiniOptional<z.ZodMiniNullable<z.ZodMiniArray<z.ZodMiniObject<{
686
+ role: z.ZodMiniNullable<z.ZodMiniString<string>>;
687
+ rule: z.ZodMiniString<string>;
688
+ }, zod_v4_core.$strict>>>>;
782
689
  }, zod_v4_core.$strict>;
783
690
  page: z.ZodMiniObject<{
784
691
  path: z.ZodMiniString<string>;
@@ -1026,4 +933,4 @@ interface TypedTrackingClient<TRegistry extends TriggerRegistryConfig> {
1026
933
  getVisitorId(): string;
1027
934
  }
1028
935
 
1029
- export { buildBookingHandoffUrl as $, type AutomaticEventName as A, type BookableDay as B, type CtaClickConfig as C, type RegisteredManualEvents as D, EVENT_SEMANTICS as E, type FormStartConfig as F, type ScrollDepthMetadata as G, type SdkHeartbeatConfig as H, type SdkHeartbeatMetadata as I, type SiteLinkArrivalConfig as J, type SiteLinkArrivalMetadata as K, type SiteLinkClickConfig as L, type ManualEventName as M, type SiteLinkClickMetadata as N, type SpecificPageName as O, type PageExitConfig as P, type SpecificPageVisitConfig as Q, type RegisteredAutomaticEvents as R, type ScrollDepthConfig as S, type SpecificPageVisitMetadata as T, type TimeOnSiteConfig as U, type TimeOnSiteMetadata as V, type TrackableEvent as W, type TriggerRegistryConfig as X, type TypedTrackEventOptions as Y, type TypedTrackingClient as Z, bookableSlots as _, type BookingHandoffPrefill as a, getBookingIntegration as a0, getEventSemantics as a1, groupBookingOptions as a2, shopToday as a3, type BookingIntegration as b, type BookingOption as c, type BookingOptionGroup as d, type BookingProvider as e, type BookingRules as f, type CtaClickMetadata as g, type EventCategory as h, type EventClientVisibility as i, type EventConfig as j, type EventKind as k, type EventMetadata as l, type EventName as m, type EventOutcomeRole as n, type EventSemantics as o, type FormStartMetadata as p, type FormStepConfig as q, type FormStepMetadata as r, type MultiPageSessionConfig as s, type MultiPageSessionMetadata as t, type PageExitMetadata as u, type PageIdentity as v, type PageViewConfig as w, type PageViewMetadata as x, type PhoneClickConfig as y, type PhoneClickMetadata as z };
936
+ export { type AutomaticEventName as A, type SiteLinkClickConfig as B, type CtaClickConfig as C, type SiteLinkClickMetadata as D, EVENT_SEMANTICS as E, type FormStartConfig as F, type SpecificPageName as G, type SpecificPageVisitConfig as H, type SpecificPageVisitMetadata as I, type TimeOnSiteMetadata as J, type TrackableEvent as K, type TriggerRegistryConfig as L, type ManualEventName as M, type TypedTrackEventOptions as N, type TypedTrackingClient as O, type PageExitConfig as P, getEventSemantics as Q, type RegisteredAutomaticEvents as R, type ScrollDepthConfig as S, type TimeOnSiteConfig as T, type CtaClickMetadata as a, type EventCategory as b, type EventClientVisibility as c, type EventConfig as d, type EventKind as e, type EventMetadata as f, type EventName as g, type EventOutcomeRole as h, type EventSemantics as i, type FormStartMetadata as j, type FormStepConfig as k, type FormStepMetadata as l, type MultiPageSessionConfig as m, type MultiPageSessionMetadata as n, type PageExitMetadata as o, type PageIdentity as p, type PageViewConfig as q, type PageViewMetadata as r, type PhoneClickConfig as s, type PhoneClickMetadata as t, type RegisteredManualEvents as u, type ScrollDepthMetadata as v, type SdkHeartbeatConfig as w, type SdkHeartbeatMetadata as x, type SiteLinkArrivalConfig as y, type SiteLinkArrivalMetadata as z };
@@ -1,6 +1,231 @@
1
- import { J as JsonValue } from './form-submit-CX-CxJjQ.mjs';
1
+ import * as z from 'zod/mini';
2
2
  import { CountryCode } from 'libphonenumber-js';
3
3
 
4
+ /**
5
+ * JSON-serializable value accepted by `form_submit.fields[].value`.
6
+ *
7
+ * This intentionally excludes `undefined`, functions, symbols, `Date`
8
+ * instances, and non-finite numbers. Values are stored in PostgreSQL JSONB, so
9
+ * consumers should send only data that has a stable JSON representation.
10
+ */
11
+ type JsonValue = string | number | boolean | null | JsonValue[] | {
12
+ [key: string]: JsonValue;
13
+ };
14
+ /** What the SDK's ladder found wrong with a submit it sent anyway (ADR-0024 §6). */
15
+ declare const contractViolationSchema: z.ZodMiniObject<{
16
+ role: z.ZodMiniNullable<z.ZodMiniString<string>>;
17
+ rule: z.ZodMiniString<string>;
18
+ }, z.core.$strict>;
19
+ type FormContractViolation = z.infer<typeof contractViolationSchema>;
20
+ declare const formSubmitMetadataSchema: z.ZodMiniObject<{
21
+ form: z.ZodMiniObject<{
22
+ id: z.ZodMiniString<string>;
23
+ action: z.ZodMiniNullable<z.ZodMiniString<string>>;
24
+ fields: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniObject<{
25
+ name: z.ZodMiniString<string>;
26
+ type: z.ZodMiniString<string>;
27
+ label: z.ZodMiniNullable<z.ZodMiniString<string>>;
28
+ value: z.ZodMiniType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>;
29
+ role: z.ZodMiniOptional<z.ZodMiniNullable<z.ZodMiniString<string>>>;
30
+ }, z.core.$strict>>>;
31
+ kind: z.ZodMiniOptional<z.ZodMiniNullable<z.ZodMiniString<string>>>;
32
+ contract_version: z.ZodMiniOptional<z.ZodMiniNullable<z.ZodMiniInt>>;
33
+ contract_hash: z.ZodMiniOptional<z.ZodMiniNullable<z.ZodMiniString<string>>>;
34
+ extra: z.ZodMiniOptional<z.ZodMiniNullable<z.ZodMiniArray<z.ZodMiniObject<{
35
+ key: z.ZodMiniString<string>;
36
+ label: z.ZodMiniString<string>;
37
+ value: z.ZodMiniType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>;
38
+ }, z.core.$strict>>>>;
39
+ contract_violations: z.ZodMiniOptional<z.ZodMiniNullable<z.ZodMiniArray<z.ZodMiniObject<{
40
+ role: z.ZodMiniNullable<z.ZodMiniString<string>>;
41
+ rule: z.ZodMiniString<string>;
42
+ }, z.core.$strict>>>>;
43
+ }, z.core.$strict>;
44
+ page: z.ZodMiniObject<{
45
+ path: z.ZodMiniString<string>;
46
+ }, z.core.$strict>;
47
+ }, z.core.$strict>;
48
+ type FormSubmitMetadata = z.infer<typeof formSubmitMetadataSchema>;
49
+ /**
50
+ * Registration config for `form_submit`.
51
+ *
52
+ * This event is manual-only and currently has no registration options. The
53
+ * empty object enables typed `trackEvent('form_submit', ...)` calls.
54
+ */
55
+ declare const formSubmitConfigSchema: z.ZodMiniObject<{}, z.core.$strict>;
56
+ type FormSubmitConfig = z.infer<typeof formSubmitConfigSchema>;
57
+
58
+ /** Bump-on-change registry version; travels on every contract-typed form_submit. */
59
+ declare const LEAD_FORM_REGISTRY_VERSION = 2;
60
+ declare const LEAD_FORM_KINDS: readonly ["booking", "quote", "contact", "consult", "callback"];
61
+ /** What a form is for; `form_id` stays the instance handle. */
62
+ type LeadFormKind = (typeof LEAD_FORM_KINDS)[number];
63
+ declare const LEAD_FORM_ROLES: readonly ["given_name", "family_name", "phone", "email", "service", "preferred_date", "preferred_time", "note", "visit", "intent", "vehicle", "drop_off", "address", "patient_type", "matter", "language", "products", "goal", "business_type", "lead_volume", "attribution"];
64
+ /** A role from the registry, or `add_on:<key>` for a yes/no extra with its own label. */
65
+ type LeadFormRole = (typeof LEAD_FORM_ROLES)[number] | `add_on:${string}`;
66
+ declare const LEAD_FORM_PRIMITIVES: readonly ["string", "text", "enum", "multi_enum", "bool", "date", "time_window", "phone", "email", "address", "number"];
67
+ type LeadFormPrimitive = (typeof LEAD_FORM_PRIMITIVES)[number];
68
+ /** The wire schema of each primitive's value. */
69
+ declare const leadFormPrimitiveSchemas: {
70
+ readonly string: z.ZodMiniString<string>;
71
+ readonly text: z.ZodMiniString<string>;
72
+ readonly enum: z.ZodMiniString<string>;
73
+ readonly multi_enum: z.ZodMiniArray<z.ZodMiniString<string>>;
74
+ readonly bool: z.ZodMiniBoolean<boolean>;
75
+ readonly date: z.ZodMiniString<string>;
76
+ readonly time_window: z.ZodMiniObject<{
77
+ start: z.ZodMiniString<string>;
78
+ end: z.ZodMiniNullable<z.ZodMiniString<string>>;
79
+ label: z.ZodMiniOptional<z.ZodMiniString<string>>;
80
+ }, z.core.$strict>;
81
+ readonly phone: z.ZodMiniString<string>;
82
+ readonly email: z.ZodMiniString<string>;
83
+ readonly address: z.ZodMiniObject<{
84
+ line1: z.ZodMiniString<string>;
85
+ line2: z.ZodMiniOptional<z.ZodMiniString<string>>;
86
+ city: z.ZodMiniOptional<z.ZodMiniString<string>>;
87
+ region: z.ZodMiniOptional<z.ZodMiniString<string>>;
88
+ postal_code: z.ZodMiniOptional<z.ZodMiniString<string>>;
89
+ country: z.ZodMiniOptional<z.ZodMiniString<string>>;
90
+ }, z.core.$strict>;
91
+ readonly number: z.ZodMiniNumber<number>;
92
+ };
93
+ interface LeadFormRoleOption {
94
+ key: string;
95
+ label: string;
96
+ isNonAnswer?: true;
97
+ }
98
+ interface LeadFormRoleSpec {
99
+ primitive: LeadFormPrimitive;
100
+ smsLabel: string;
101
+ contactIdentity?: true;
102
+ uninteresting?: true;
103
+ options?: readonly LeadFormRoleOption[];
104
+ }
105
+ /** Every role's primitive and text label; `add_on` is the template for `add_on:<key>`. */
106
+ declare const LEAD_FORM_ROLE_SPECS: {
107
+ readonly given_name: {
108
+ readonly primitive: "string";
109
+ readonly smsLabel: "";
110
+ readonly contactIdentity: true;
111
+ };
112
+ readonly family_name: {
113
+ readonly primitive: "string";
114
+ readonly smsLabel: "";
115
+ readonly contactIdentity: true;
116
+ };
117
+ readonly phone: {
118
+ readonly primitive: "phone";
119
+ readonly smsLabel: "";
120
+ readonly contactIdentity: true;
121
+ };
122
+ readonly email: {
123
+ readonly primitive: "email";
124
+ readonly smsLabel: "";
125
+ readonly contactIdentity: true;
126
+ };
127
+ readonly service: {
128
+ readonly primitive: "multi_enum";
129
+ readonly smsLabel: "Service";
130
+ };
131
+ readonly preferred_date: {
132
+ readonly primitive: "date";
133
+ readonly smsLabel: "Date";
134
+ };
135
+ readonly preferred_time: {
136
+ readonly primitive: "time_window";
137
+ readonly smsLabel: "Time";
138
+ };
139
+ readonly note: {
140
+ readonly primitive: "text";
141
+ readonly smsLabel: "Note";
142
+ };
143
+ readonly visit: {
144
+ readonly primitive: "enum";
145
+ readonly smsLabel: "Visit";
146
+ readonly options: readonly [{
147
+ readonly key: "in-shop";
148
+ readonly label: "In shop";
149
+ }, {
150
+ readonly key: "in-home";
151
+ readonly label: "In home";
152
+ }, {
153
+ readonly key: "remote";
154
+ readonly label: "Remote";
155
+ }, {
156
+ readonly key: "on-site";
157
+ readonly label: "On site";
158
+ }];
159
+ };
160
+ readonly intent: {
161
+ readonly primitive: "enum";
162
+ readonly smsLabel: "Wants";
163
+ readonly options: readonly [{
164
+ readonly key: "book";
165
+ readonly label: "Book";
166
+ }, {
167
+ readonly key: "quote";
168
+ readonly label: "Quote";
169
+ }];
170
+ };
171
+ readonly vehicle: {
172
+ readonly primitive: "string";
173
+ readonly smsLabel: "Vehicle";
174
+ };
175
+ readonly drop_off: {
176
+ readonly primitive: "enum";
177
+ readonly smsLabel: "Drop-off";
178
+ readonly options: readonly [{
179
+ readonly key: "wait-for-it";
180
+ readonly label: "Waiting";
181
+ }, {
182
+ readonly key: "drop-off";
183
+ readonly label: "Dropping off";
184
+ }];
185
+ };
186
+ readonly address: {
187
+ readonly primitive: "address";
188
+ readonly smsLabel: "Address";
189
+ };
190
+ readonly patient_type: {
191
+ readonly primitive: "enum";
192
+ readonly smsLabel: "Patient";
193
+ };
194
+ readonly matter: {
195
+ readonly primitive: "enum";
196
+ readonly smsLabel: "Matter";
197
+ };
198
+ readonly language: {
199
+ readonly primitive: "enum";
200
+ readonly smsLabel: "Language";
201
+ };
202
+ readonly products: {
203
+ readonly primitive: "multi_enum";
204
+ readonly smsLabel: "Products";
205
+ };
206
+ readonly goal: {
207
+ readonly primitive: "enum";
208
+ readonly smsLabel: "Goal";
209
+ };
210
+ readonly business_type: {
211
+ readonly primitive: "enum";
212
+ readonly smsLabel: "Business";
213
+ };
214
+ readonly lead_volume: {
215
+ readonly primitive: "enum";
216
+ readonly smsLabel: "Lead volume";
217
+ };
218
+ readonly add_on: {
219
+ readonly primitive: "bool";
220
+ readonly smsLabel: "";
221
+ };
222
+ readonly attribution: {
223
+ readonly primitive: "enum";
224
+ readonly smsLabel: "";
225
+ readonly uninteresting: true;
226
+ };
227
+ };
228
+
4
229
  /**
5
230
  * How a phone number is shown in the UI. The transmitted value is always E.164
6
231
  * and is deliberately NOT part of this — only the display format is configurable.
@@ -44,14 +269,17 @@ interface TrackedField {
44
269
  name: string;
45
270
  type: string;
46
271
  value: JsonValue;
272
+ /** `null` when the field has no visible label; the wire requires the key. */
47
273
  label?: string | null;
274
+ /** The ADR-0024 registry role this field answers, e.g. `phone`. */
275
+ role?: LeadFormRole;
48
276
  }
49
277
  /**
50
278
  * Build a tracked field whose wire value is ALWAYS E.164. The client keeps its
51
279
  * own display value for UI/email; this puts `+E.164` on the wire (or `null` when
52
280
  * the input isn't a valid number).
53
281
  */
54
- declare function phoneField(name: string, raw: string, country?: CountryCode): TrackedField;
282
+ declare function phoneField(name: string, raw: string, country?: CountryCode, label?: string | null): TrackedField;
55
283
 
56
284
  /**
57
285
  * Visitor consent state as reported by `getConsentState()`.
@@ -394,4 +622,4 @@ declare function optOut(options?: SetConsentOptions): void;
394
622
  */
395
623
  declare function resetConsent(): void;
396
624
 
397
- export { type ConsentChoice as C, DEFAULT_DECLINE_TTL_DAYS as D, type GtagEnvironmentMap as G, type MetaPixelEnvironmentMap as M, type ParsedPhone as P, type SetConsentOptions as S, type TrackingParams as T, type TrackingInstallSurface as a, type TrackingEnvironment as b, type TrackingClientContext as c, type TrackingEventCreatePayload as d, type TrackingSessionUpsertPayload as e, type ConsentChoiceState as f, type ConsentSource as g, type ConsentState as h, DEFAULT_PHONE_COUNTRY as i, type PhoneConfig as j, type PhoneDisplayFormat as k, type TrackedField as l, type TrackingInitConfig as m, formatPhone as n, formatPhoneAsTyped as o, getConsentChoice as p, getConsentState as q, onConsentChange as r, optIn as s, optOut as t, parsePhone as u, phoneField as v, resetConsent as w, setConsentState as x, toE164 as y };
625
+ export { getConsentChoice as A, getConsentState as B, type ConsentChoice as C, DEFAULT_DECLINE_TTL_DAYS as D, leadFormPrimitiveSchemas as E, type FormContractViolation as F, type GtagEnvironmentMap as G, onConsentChange as H, optIn as I, type JsonValue as J, optOut as K, LEAD_FORM_KINDS as L, type MetaPixelEnvironmentMap as M, parsePhone as N, phoneField as O, type ParsedPhone as P, resetConsent as Q, setConsentState as R, type SetConsentOptions as S, type TrackingParams as T, toE164 as U, type TrackingInstallSurface as a, type TrackingEnvironment as b, type TrackingClientContext as c, type TrackingEventCreatePayload as d, type TrackingSessionUpsertPayload as e, type ConsentChoiceState as f, type ConsentSource as g, type ConsentState as h, DEFAULT_PHONE_COUNTRY as i, type FormSubmitConfig as j, type FormSubmitMetadata as k, LEAD_FORM_PRIMITIVES as l, LEAD_FORM_REGISTRY_VERSION as m, LEAD_FORM_ROLES as n, LEAD_FORM_ROLE_SPECS as o, type LeadFormKind as p, type LeadFormPrimitive as q, type LeadFormRole as r, type LeadFormRoleOption as s, type LeadFormRoleSpec as t, type PhoneConfig as u, type PhoneDisplayFormat as v, type TrackedField as w, type TrackingInitConfig as x, formatPhone as y, formatPhoneAsTyped as z };