@codefast/tracking 0.7.1 → 0.7.3

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 (214) hide show
  1. package/CHANGELOG.md +49 -0
  2. package/LICENSE +1 -1
  3. package/README.md +235 -105
  4. package/dist/adapters/tanstack-start.d.ts +5 -6
  5. package/dist/adapters/tanstack-start.js +5 -6
  6. package/dist/client/ad-framework-consent.d.ts +2 -3
  7. package/dist/client/ad-framework-consent.js +1 -2
  8. package/dist/client/browser-cookie.d.ts +1 -2
  9. package/dist/client/browser-cookie.js +1 -2
  10. package/dist/client/consent-runtime.d.ts +4 -5
  11. package/dist/client/consent-runtime.js +5 -6
  12. package/dist/client/consent-storage.d.ts +2 -3
  13. package/dist/client/consent-storage.js +2 -3
  14. package/dist/client/consent-withdrawal.d.ts +2 -3
  15. package/dist/client/consent-withdrawal.js +1 -2
  16. package/dist/client/cookie-anonymous-id.d.ts +1 -2
  17. package/dist/client/cookie-anonymous-id.js +3 -4
  18. package/dist/client/create-client-tracker.d.ts +4 -5
  19. package/dist/client/create-client-tracker.js +3 -4
  20. package/dist/client/gpc.d.ts +1 -2
  21. package/dist/client/gpc.js +1 -2
  22. package/dist/client/initial-consent-store.d.ts +2 -3
  23. package/dist/client/initial-consent-store.js +2 -3
  24. package/dist/client/is-analytics-allowed.d.ts +3 -4
  25. package/dist/client/is-analytics-allowed.js +2 -3
  26. package/dist/client/server-persisted-anonymous-id.d.ts +2 -3
  27. package/dist/client/server-persisted-anonymous-id.js +3 -4
  28. package/dist/core/consent-config.d.ts +2 -3
  29. package/dist/core/consent-config.js +1 -2
  30. package/dist/core/consent-receipt.d.ts +2 -3
  31. package/dist/core/consent-receipt.js +2 -3
  32. package/dist/core/consent.d.ts +1 -2
  33. package/dist/core/consent.js +1 -2
  34. package/dist/core/cookie.d.ts +1 -2
  35. package/dist/core/cookie.js +1 -2
  36. package/dist/core/destination.d.ts +2 -3
  37. package/dist/core/destination.js +1 -2
  38. package/dist/core/event-catalog.d.ts +1 -2
  39. package/dist/core/event-catalog.js +1 -2
  40. package/dist/core/event-id.d.ts +1 -2
  41. package/dist/core/event-id.js +1 -2
  42. package/dist/core/tracked-event.d.ts +1 -2
  43. package/dist/core/tracked-event.js +1 -2
  44. package/dist/destinations/ad-consent.d.ts +2 -3
  45. package/dist/destinations/ad-consent.js +1 -2
  46. package/dist/destinations/google-analytics.d.ts +6 -7
  47. package/dist/destinations/google-analytics.js +3 -4
  48. package/dist/destinations/google-consent.d.ts +2 -3
  49. package/dist/destinations/google-consent.js +2 -3
  50. package/dist/destinations/meta.d.ts +4 -5
  51. package/dist/destinations/meta.js +3 -4
  52. package/dist/destinations/microsoft-uet.d.ts +4 -5
  53. package/dist/destinations/microsoft-uet.js +3 -4
  54. package/dist/destinations/shared.d.ts +1 -2
  55. package/dist/destinations/shared.js +1 -2
  56. package/dist/destinations/tiktok.d.ts +4 -5
  57. package/dist/destinations/tiktok.js +3 -4
  58. package/dist/destinations/vercel-analytics.d.ts +2 -3
  59. package/dist/destinations/vercel-analytics.js +2 -3
  60. package/dist/index.d.ts +49 -50
  61. package/dist/index.js +26 -27
  62. package/dist/react/consent-banner.d.ts +3 -4
  63. package/dist/react/consent-banner.js +1 -2
  64. package/dist/react/gtag-consent-bootstrap.d.ts +2 -3
  65. package/dist/react/gtag-consent-bootstrap.js +2 -3
  66. package/dist/react/use-consent.d.ts +3 -4
  67. package/dist/react/use-consent.js +2 -3
  68. package/dist/react/use-google-consent-sync.d.ts +2 -3
  69. package/dist/react/use-google-consent-sync.js +2 -3
  70. package/dist/react/use-initial-consent.d.ts +2 -3
  71. package/dist/react/use-initial-consent.js +1 -2
  72. package/dist/server/anonymous-id-cookie.d.ts +1 -2
  73. package/dist/server/anonymous-id-cookie.js +2 -3
  74. package/dist/server/consent-receipt-store.d.ts +2 -3
  75. package/dist/server/consent-receipt-store.js +1 -2
  76. package/dist/server/consent-receipt.d.ts +2 -3
  77. package/dist/server/consent-receipt.js +1 -2
  78. package/dist/server/initial-consent.d.ts +2 -3
  79. package/dist/server/initial-consent.js +3 -4
  80. package/dist/server/measurement-protocol.d.ts +2 -3
  81. package/dist/server/measurement-protocol.js +1 -2
  82. package/dist/server/region.d.ts +2 -3
  83. package/dist/server/region.js +1 -2
  84. package/dist/server/user-deletion.d.ts +1 -2
  85. package/dist/server/user-deletion.js +1 -2
  86. package/dist/tooling/import-protection.d.ts +2 -3
  87. package/dist/tooling/import-protection.js +2 -3
  88. package/package.json +5 -94
  89. package/dist/adapters/tanstack-start.d.ts.map +0 -1
  90. package/dist/adapters/tanstack-start.js.map +0 -1
  91. package/dist/client/ad-framework-consent.d.ts.map +0 -1
  92. package/dist/client/ad-framework-consent.js.map +0 -1
  93. package/dist/client/browser-cookie.d.ts.map +0 -1
  94. package/dist/client/browser-cookie.js.map +0 -1
  95. package/dist/client/consent-runtime.d.ts.map +0 -1
  96. package/dist/client/consent-runtime.js.map +0 -1
  97. package/dist/client/consent-storage.d.ts.map +0 -1
  98. package/dist/client/consent-storage.js.map +0 -1
  99. package/dist/client/consent-withdrawal.d.ts.map +0 -1
  100. package/dist/client/consent-withdrawal.js.map +0 -1
  101. package/dist/client/cookie-anonymous-id.d.ts.map +0 -1
  102. package/dist/client/cookie-anonymous-id.js.map +0 -1
  103. package/dist/client/create-client-tracker.d.ts.map +0 -1
  104. package/dist/client/create-client-tracker.js.map +0 -1
  105. package/dist/client/gpc.d.ts.map +0 -1
  106. package/dist/client/gpc.js.map +0 -1
  107. package/dist/client/initial-consent-store.d.ts.map +0 -1
  108. package/dist/client/initial-consent-store.js.map +0 -1
  109. package/dist/client/is-analytics-allowed.d.ts.map +0 -1
  110. package/dist/client/is-analytics-allowed.js.map +0 -1
  111. package/dist/client/server-persisted-anonymous-id.d.ts.map +0 -1
  112. package/dist/client/server-persisted-anonymous-id.js.map +0 -1
  113. package/dist/core/consent-config.d.ts.map +0 -1
  114. package/dist/core/consent-config.js.map +0 -1
  115. package/dist/core/consent-receipt.d.ts.map +0 -1
  116. package/dist/core/consent-receipt.js.map +0 -1
  117. package/dist/core/consent.d.ts.map +0 -1
  118. package/dist/core/consent.js.map +0 -1
  119. package/dist/core/cookie.d.ts.map +0 -1
  120. package/dist/core/cookie.js.map +0 -1
  121. package/dist/core/destination.d.ts.map +0 -1
  122. package/dist/core/destination.js.map +0 -1
  123. package/dist/core/event-catalog.d.ts.map +0 -1
  124. package/dist/core/event-catalog.js.map +0 -1
  125. package/dist/core/event-id.d.ts.map +0 -1
  126. package/dist/core/event-id.js.map +0 -1
  127. package/dist/core/tracked-event.d.ts.map +0 -1
  128. package/dist/core/tracked-event.js.map +0 -1
  129. package/dist/destinations/ad-consent.d.ts.map +0 -1
  130. package/dist/destinations/ad-consent.js.map +0 -1
  131. package/dist/destinations/google-analytics.d.ts.map +0 -1
  132. package/dist/destinations/google-analytics.js.map +0 -1
  133. package/dist/destinations/google-consent.d.ts.map +0 -1
  134. package/dist/destinations/google-consent.js.map +0 -1
  135. package/dist/destinations/meta.d.ts.map +0 -1
  136. package/dist/destinations/meta.js.map +0 -1
  137. package/dist/destinations/microsoft-uet.d.ts.map +0 -1
  138. package/dist/destinations/microsoft-uet.js.map +0 -1
  139. package/dist/destinations/shared.d.ts.map +0 -1
  140. package/dist/destinations/shared.js.map +0 -1
  141. package/dist/destinations/tiktok.d.ts.map +0 -1
  142. package/dist/destinations/tiktok.js.map +0 -1
  143. package/dist/destinations/vercel-analytics.d.ts.map +0 -1
  144. package/dist/destinations/vercel-analytics.js.map +0 -1
  145. package/dist/index.d.ts.map +0 -1
  146. package/dist/index.js.map +0 -1
  147. package/dist/react/consent-banner.d.ts.map +0 -1
  148. package/dist/react/consent-banner.js.map +0 -1
  149. package/dist/react/gtag-consent-bootstrap.d.ts.map +0 -1
  150. package/dist/react/gtag-consent-bootstrap.js.map +0 -1
  151. package/dist/react/use-consent.d.ts.map +0 -1
  152. package/dist/react/use-consent.js.map +0 -1
  153. package/dist/react/use-google-consent-sync.d.ts.map +0 -1
  154. package/dist/react/use-google-consent-sync.js.map +0 -1
  155. package/dist/react/use-initial-consent.d.ts.map +0 -1
  156. package/dist/react/use-initial-consent.js.map +0 -1
  157. package/dist/server/anonymous-id-cookie.d.ts.map +0 -1
  158. package/dist/server/anonymous-id-cookie.js.map +0 -1
  159. package/dist/server/consent-receipt-store.d.ts.map +0 -1
  160. package/dist/server/consent-receipt-store.js.map +0 -1
  161. package/dist/server/consent-receipt.d.ts.map +0 -1
  162. package/dist/server/consent-receipt.js.map +0 -1
  163. package/dist/server/initial-consent.d.ts.map +0 -1
  164. package/dist/server/initial-consent.js.map +0 -1
  165. package/dist/server/measurement-protocol.d.ts.map +0 -1
  166. package/dist/server/measurement-protocol.js.map +0 -1
  167. package/dist/server/region.d.ts.map +0 -1
  168. package/dist/server/region.js.map +0 -1
  169. package/dist/server/user-deletion.d.ts.map +0 -1
  170. package/dist/server/user-deletion.js.map +0 -1
  171. package/dist/tooling/import-protection.d.ts.map +0 -1
  172. package/dist/tooling/import-protection.js.map +0 -1
  173. package/src/adapters/tanstack-start.ts +0 -139
  174. package/src/client/ad-framework-consent.ts +0 -88
  175. package/src/client/browser-cookie.ts +0 -16
  176. package/src/client/consent-runtime.ts +0 -82
  177. package/src/client/consent-storage.ts +0 -125
  178. package/src/client/consent-withdrawal.ts +0 -34
  179. package/src/client/cookie-anonymous-id.ts +0 -116
  180. package/src/client/create-client-tracker.ts +0 -174
  181. package/src/client/gpc.ts +0 -15
  182. package/src/client/initial-consent-store.ts +0 -220
  183. package/src/client/is-analytics-allowed.ts +0 -45
  184. package/src/client/server-persisted-anonymous-id.ts +0 -104
  185. package/src/core/consent-config.ts +0 -27
  186. package/src/core/consent-receipt.ts +0 -115
  187. package/src/core/consent.ts +0 -298
  188. package/src/core/cookie.ts +0 -29
  189. package/src/core/destination.ts +0 -29
  190. package/src/core/event-catalog.ts +0 -54
  191. package/src/core/event-id.ts +0 -8
  192. package/src/core/tracked-event.ts +0 -14
  193. package/src/destinations/ad-consent.ts +0 -29
  194. package/src/destinations/google-analytics.ts +0 -304
  195. package/src/destinations/google-consent.ts +0 -166
  196. package/src/destinations/meta.ts +0 -98
  197. package/src/destinations/microsoft-uet.ts +0 -88
  198. package/src/destinations/shared.ts +0 -51
  199. package/src/destinations/tiktok.ts +0 -87
  200. package/src/destinations/vercel-analytics.ts +0 -41
  201. package/src/index.ts +0 -171
  202. package/src/react/consent-banner.tsx +0 -386
  203. package/src/react/gtag-consent-bootstrap.tsx +0 -50
  204. package/src/react/use-consent.ts +0 -123
  205. package/src/react/use-google-consent-sync.ts +0 -40
  206. package/src/react/use-initial-consent.ts +0 -22
  207. package/src/server/anonymous-id-cookie.ts +0 -105
  208. package/src/server/consent-receipt-store.ts +0 -79
  209. package/src/server/consent-receipt.ts +0 -89
  210. package/src/server/initial-consent.ts +0 -48
  211. package/src/server/measurement-protocol.ts +0 -116
  212. package/src/server/region.ts +0 -77
  213. package/src/server/user-deletion.ts +0 -97
  214. package/src/tooling/import-protection.ts +0 -22
@@ -1,4 +1,4 @@
1
- import type { ConsentDecision } from "#/core/consent";
1
+ import type { ConsentDecision } from "#core/consent";
2
2
  /**
3
3
  * Options for `createConsentWithdrawalHandler`.
4
4
  *
@@ -16,5 +16,4 @@ export interface ConsentWithdrawalHandlerOptions {
16
16
  *
17
17
  * @since 0.5.0-canary.6
18
18
  */
19
- export declare function createConsentWithdrawalHandler(options: ConsentWithdrawalHandlerOptions): (decision: ConsentDecision) => void;
20
- //# sourceMappingURL=consent-withdrawal.d.ts.map
19
+ export declare function createConsentWithdrawalHandler(options: ConsentWithdrawalHandlerOptions): (decision: ConsentDecision) => void;
@@ -13,5 +13,4 @@ export function createConsentWithdrawalHandler(options) {
13
13
  clearAnonymousId?.();
14
14
  clearGoogleAnalyticsCookies?.();
15
15
  };
16
- }
17
- //# sourceMappingURL=consent-withdrawal.js.map
16
+ }
@@ -41,5 +41,4 @@ export interface CookieAnonymousId {
41
41
  *
42
42
  * @since 0.5.0-canary.6
43
43
  */
44
- export declare function createCookieAnonymousId(options: CookieAnonymousIdOptions): CookieAnonymousId;
45
- //# sourceMappingURL=cookie-anonymous-id.d.ts.map
44
+ export declare function createCookieAnonymousId(options: CookieAnonymousIdOptions): CookieAnonymousId;
@@ -1,5 +1,5 @@
1
- import { writeBrowserCookie } from "#/client/browser-cookie";
2
- import { ONE_YEAR_IN_SECONDS, readCookieValue } from "#/core/cookie";
1
+ import { writeBrowserCookie } from "#client/browser-cookie";
2
+ import { ONE_YEAR_IN_SECONDS, readCookieValue } from "#core/cookie";
3
3
  /**
4
4
  * A `document.cookie`-backed anonymous id — not `localStorage`-only, so a server-owned
5
5
  * event can read the same id from the request and correlate to this visitor. Pass
@@ -61,5 +61,4 @@ export function createCookieAnonymousId(options) {
61
61
  }
62
62
  },
63
63
  };
64
- }
65
- //# sourceMappingURL=cookie-anonymous-id.js.map
64
+ }
@@ -1,7 +1,7 @@
1
1
  import type { StandardSchemaV1 } from "@standard-schema/spec";
2
- import type { Destination } from "#/core/destination";
3
- import type { EventCatalog } from "#/core/event-catalog";
4
- import type { TrackedEvent } from "#/core/tracked-event";
2
+ import type { Destination } from "#core/destination";
3
+ import type { EventCatalog } from "#core/event-catalog";
4
+ import type { TrackedEvent } from "#core/tracked-event";
5
5
  /**
6
6
  * Context handed to {@link ClientTrackerOptions.onDeliveryError} for one failed delivery.
7
7
  *
@@ -62,5 +62,4 @@ export interface ClientTracker<Catalog extends EventCatalog> {
62
62
  *
63
63
  * @since 0.5.0-canary.4
64
64
  */
65
- export declare function createClientTracker<Catalog extends EventCatalog>(options: ClientTrackerOptions<Catalog>): ClientTracker<Catalog>;
66
- //# sourceMappingURL=create-client-tracker.d.ts.map
65
+ export declare function createClientTracker<Catalog extends EventCatalog>(options: ClientTrackerOptions<Catalog>): ClientTracker<Catalog>;
@@ -1,5 +1,5 @@
1
- import { assertValidEventProperties } from "#/core/event-catalog";
2
- import { generateEventId } from "#/core/event-id";
1
+ import { assertValidEventProperties } from "#core/event-catalog";
2
+ import { generateEventId } from "#core/event-id";
3
3
  /**
4
4
  * `Destination.send` is typed to always return a `Promise`, but that's unenforceable at
5
5
  * runtime for a third-party/plain-JS destination — one that ignores the contract and
@@ -89,5 +89,4 @@ export function createClientTracker(options) {
89
89
  }
90
90
  },
91
91
  };
92
- }
93
- //# sourceMappingURL=create-client-tracker.js.map
92
+ }
@@ -6,5 +6,4 @@
6
6
  *
7
7
  * @since 0.5.0-canary.4
8
8
  */
9
- export declare function hasGlobalPrivacyControlSignal(): boolean;
10
- //# sourceMappingURL=gpc.d.ts.map
9
+ export declare function hasGlobalPrivacyControlSignal(): boolean;
@@ -8,5 +8,4 @@
8
8
  */
9
9
  export function hasGlobalPrivacyControlSignal() {
10
10
  return typeof navigator !== "undefined" && navigator.globalPrivacyControl === true;
11
- }
12
- //# sourceMappingURL=gpc.js.map
11
+ }
@@ -1,4 +1,4 @@
1
- import type { InitialConsent } from "#/core/consent";
1
+ import type { InitialConsent } from "#core/consent";
2
2
  /**
3
3
  * External-store view of the visitor's region default — the strictest value until the
4
4
  * server lane answers, then the resolved one.
@@ -61,5 +61,4 @@ export interface InitialConsentStore {
61
61
  *
62
62
  * @since 0.5.0-canary.6
63
63
  */
64
- export declare function createInitialConsentStore(options: InitialConsentStoreOptions): InitialConsentStore;
65
- //# sourceMappingURL=initial-consent-store.d.ts.map
64
+ export declare function createInitialConsentStore(options: InitialConsentStoreOptions): InitialConsentStore;
@@ -1,4 +1,4 @@
1
- import { isInitialConsent, STRICTEST_INITIAL_CONSENT } from "#/core/consent";
1
+ import { isInitialConsent, STRICTEST_INITIAL_CONSENT } from "#core/consent";
2
2
  const SERVER_SNAPSHOT = {
3
3
  initialConsent: STRICTEST_INITIAL_CONSENT,
4
4
  isResolved: false,
@@ -134,5 +134,4 @@ export function createInitialConsentStore(options) {
134
134
  };
135
135
  },
136
136
  };
137
- }
138
- //# sourceMappingURL=initial-consent-store.js.map
137
+ }
@@ -1,5 +1,5 @@
1
- import type { ConsentMode, ConsentStorage } from "#/core/consent";
2
- import type { ConsentConfig } from "#/core/consent-config";
1
+ import type { ConsentMode, ConsentStorage } from "#core/consent";
2
+ import type { ConsentConfig } from "#core/consent-config";
3
3
  /**
4
4
  * Options for `createIsAnalyticsAllowed`.
5
5
  *
@@ -24,5 +24,4 @@ export interface IsAnalyticsAllowedOptions {
24
24
  *
25
25
  * @since 0.5.0-canary.6
26
26
  */
27
- export declare function createIsAnalyticsAllowed(options: IsAnalyticsAllowedOptions): () => boolean;
28
- //# sourceMappingURL=is-analytics-allowed.d.ts.map
27
+ export declare function createIsAnalyticsAllowed(options: IsAnalyticsAllowedOptions): () => boolean;
@@ -1,4 +1,4 @@
1
- import { resolveEffectiveConsent } from "#/core/consent";
1
+ import { resolveEffectiveConsent } from "#core/consent";
2
2
  /**
3
3
  * Non-React mirror of `useConsent`'s `isAnalyticsAllowed` — pass the returned function as
4
4
  * `createClientTracker({ isAnalyticsAllowed })` so the pipeline and the banner share one rule.
@@ -18,5 +18,4 @@ export function createIsAnalyticsAllowed(options) {
18
18
  });
19
19
  return effectiveConsent.analytics;
20
20
  };
21
- }
22
- //# sourceMappingURL=is-analytics-allowed.js.map
21
+ }
@@ -1,4 +1,4 @@
1
- import type { CookieAnonymousId } from "#/client/cookie-anonymous-id";
1
+ import type { CookieAnonymousId } from "#client/cookie-anonymous-id";
2
2
  /**
3
3
  * Options for `createServerPersistedAnonymousId`.
4
4
  *
@@ -28,5 +28,4 @@ export interface ServerPersistedAnonymousIdOptions {
28
28
  *
29
29
  * @since 0.5.0-canary.6
30
30
  */
31
- export declare function createServerPersistedAnonymousId(options: ServerPersistedAnonymousIdOptions): CookieAnonymousId;
32
- //# sourceMappingURL=server-persisted-anonymous-id.d.ts.map
31
+ export declare function createServerPersistedAnonymousId(options: ServerPersistedAnonymousIdOptions): CookieAnonymousId;
@@ -1,5 +1,5 @@
1
- import { createCookieAnonymousId } from "#/client/cookie-anonymous-id";
2
- import { readCookieValue } from "#/core/cookie";
1
+ import { createCookieAnonymousId } from "#client/cookie-anonymous-id";
2
+ import { readCookieValue } from "#core/cookie";
3
3
  /**
4
4
  * `createCookieAnonymousId` plus server persistence: the client still mints the id
5
5
  * (lazily, only once an event is allowed to send — consent stays client-owned), then
@@ -68,5 +68,4 @@ export function createServerPersistedAnonymousId(options) {
68
68
  }
69
69
  },
70
70
  };
71
- }
72
- //# sourceMappingURL=server-persisted-anonymous-id.js.map
71
+ }
@@ -1,4 +1,4 @@
1
- import type { ConsentCategory } from "#/core/consent";
1
+ import type { ConsentCategory } from "#core/consent";
2
2
  /**
3
3
  * The consent constants every surface must agree on. The React hooks, the client
4
4
  * tracker gate, and the pre-hydration tag bootstrap all accept this object, so the
@@ -20,5 +20,4 @@ export interface ConsentConfig {
20
20
  *
21
21
  * @since 0.5.0-canary.6
22
22
  */
23
- export declare function defineConsentConfig<Config extends ConsentConfig>(config: Config): Config;
24
- //# sourceMappingURL=consent-config.d.ts.map
23
+ export declare function defineConsentConfig<Config extends ConsentConfig>(config: Config): Config;
@@ -5,5 +5,4 @@
5
5
  */
6
6
  export function defineConsentConfig(config) {
7
7
  return config;
8
- }
9
- //# sourceMappingURL=consent-config.js.map
8
+ }
@@ -1,4 +1,4 @@
1
- import type { ConsentDecision } from "#/core/consent";
1
+ import type { ConsentDecision } from "#core/consent";
2
2
  /**
3
3
  * Which consent event a receipt records. Receipts are append-only: an `update` or
4
4
  * `withdraw` is a new receipt referencing the prior one, never a mutation.
@@ -67,5 +67,4 @@ export interface ConsentReceipt extends ConsentReceiptInput {
67
67
  *
68
68
  * @since 0.5.0-canary.6
69
69
  */
70
- export declare function isConsentReceiptInput(value: unknown): value is ConsentReceiptInput;
71
- //# sourceMappingURL=consent-receipt.d.ts.map
70
+ export declare function isConsentReceiptInput(value: unknown): value is ConsentReceiptInput;
@@ -1,4 +1,4 @@
1
- import { isConsentDecision } from "#/core/consent";
1
+ import { isConsentDecision } from "#core/consent";
2
2
  function isString(value) {
3
3
  return typeof value === "string";
4
4
  }
@@ -35,5 +35,4 @@ export function isConsentReceiptInput(value) {
35
35
  isString(input.subjectId) &&
36
36
  isString(input.subjectIdType) &&
37
37
  RECEIPT_SUBJECT_ID_TYPES.has(input.subjectIdType));
38
- }
39
- //# sourceMappingURL=consent-receipt.js.map
38
+ }
@@ -190,5 +190,4 @@ export interface ResolveEffectiveConsentOptions {
190
190
  *
191
191
  * @since 0.5.0-canary.6
192
192
  */
193
- export declare function resolveEffectiveConsent(options: ResolveEffectiveConsentOptions): ConsentDecision;
194
- //# sourceMappingURL=consent.d.ts.map
193
+ export declare function resolveEffectiveConsent(options: ResolveEffectiveConsentOptions): ConsentDecision;
@@ -159,5 +159,4 @@ export function resolveEffectiveConsent(options) {
159
159
  const { hasGlobalPrivacyControlSignal, mode, policyVersion, requestedCategories, storage } = options;
160
160
  return (readStoredDecision(storage, policyVersion) ??
161
161
  resolveDefaultConsent({ hasGlobalPrivacyControlSignal, mode, requestedCategories }));
162
- }
163
- //# sourceMappingURL=consent.js.map
162
+ }
@@ -11,5 +11,4 @@ export declare const ONE_YEAR_IN_SECONDS: number;
11
11
  *
12
12
  * @since 0.5.0-canary.6
13
13
  */
14
- export declare function readCookieValue(cookieString: string | null | undefined, cookieName: string): string | undefined;
15
- //# sourceMappingURL=cookie.d.ts.map
14
+ export declare function readCookieValue(cookieString: string | null | undefined, cookieName: string): string | undefined;
@@ -22,5 +22,4 @@ export function readCookieValue(cookieString, cookieName) {
22
22
  }
23
23
  }
24
24
  return undefined;
25
- }
26
- //# sourceMappingURL=cookie.js.map
25
+ }
@@ -1,4 +1,4 @@
1
- import type { TrackedEvent } from "#/core/tracked-event";
1
+ import type { TrackedEvent } from "#core/tracked-event";
2
2
  /**
3
3
  * Fan-out target for tracked events. The tracker depends only on this interface, never
4
4
  * on a specific provider SDK — destinations own their transport (gtag.js and Vercel both
@@ -25,5 +25,4 @@ export interface Destination {
25
25
  onErasure?: ((id: string) => Promise<void> | void) | undefined;
26
26
  /** Must always return a `Promise` — mark `send` `async` even if the body has no `await`. */
27
27
  send: (event: TrackedEvent) => Promise<void>;
28
- }
29
- //# sourceMappingURL=destination.d.ts.map
28
+ }
@@ -1,2 +1 @@
1
- export {};
2
- //# sourceMappingURL=destination.js.map
1
+ export {};
@@ -31,5 +31,4 @@ export declare function defineEventCatalog<Catalog extends EventCatalog>(catalog
31
31
  *
32
32
  * @since 0.5.0-canary.6
33
33
  */
34
- export declare function assertValidEventProperties(schema: StandardSchemaV1, eventName: string, properties: unknown): unknown;
35
- //# sourceMappingURL=event-catalog.d.ts.map
34
+ export declare function assertValidEventProperties(schema: StandardSchemaV1, eventName: string, properties: unknown): unknown;
@@ -26,5 +26,4 @@ export function assertValidEventProperties(schema, eventName, properties) {
26
26
  throw new Error(`Invalid properties for event "${eventName}": ${detail}`);
27
27
  }
28
28
  return result.value;
29
- }
30
- //# sourceMappingURL=event-catalog.js.map
29
+ }
@@ -3,5 +3,4 @@
3
3
  *
4
4
  * @since 0.5.0-canary.4
5
5
  */
6
- export declare function generateEventId(): string;
7
- //# sourceMappingURL=event-id.d.ts.map
6
+ export declare function generateEventId(): string;
@@ -5,5 +5,4 @@
5
5
  */
6
6
  export function generateEventId() {
7
7
  return crypto.randomUUID();
8
- }
9
- //# sourceMappingURL=event-id.js.map
8
+ }
@@ -11,5 +11,4 @@ export interface TrackedEvent {
11
11
  properties: Record<string, unknown>;
12
12
  timestamp: number;
13
13
  type: "track";
14
- }
15
- //# sourceMappingURL=tracked-event.d.ts.map
14
+ }
@@ -1,2 +1 @@
1
- export {};
2
- //# sourceMappingURL=tracked-event.js.map
1
+ export {};
@@ -1,4 +1,4 @@
1
- import type { ConsentDecision } from "#/core/consent";
1
+ import type { ConsentDecision } from "#core/consent";
2
2
  /**
3
3
  * The normalized two-lever ad-platform consent state derived from one `{ ads, analytics }`
4
4
  * decision (spec-destinations §5): `analytics` drives whether events transmit at all, and
@@ -19,5 +19,4 @@ export interface AdConsentState {
19
19
  *
20
20
  * @since 0.5.0-canary.6
21
21
  */
22
- export declare function toAdConsentState(decision: ConsentDecision): AdConsentState;
23
- //# sourceMappingURL=ad-consent.d.ts.map
22
+ export declare function toAdConsentState(decision: ConsentDecision): AdConsentState;
@@ -8,5 +8,4 @@ export function toAdConsentState(decision) {
8
8
  limitedDataUse: !decision.ads,
9
9
  transmissionAllowed: decision.analytics,
10
10
  };
11
- }
12
- //# sourceMappingURL=ad-consent.js.map
11
+ }
@@ -1,8 +1,8 @@
1
- import type { ConsentDecision } from "#/core/consent";
2
- import type { ConsentConfig } from "#/core/consent-config";
3
- import type { Destination } from "#/core/destination";
4
- import type { GoogleConsentParams } from "#/destinations/google-consent";
5
- import type { FlatPropertyValue } from "#/destinations/shared";
1
+ import type { ConsentDecision } from "#core/consent";
2
+ import type { ConsentConfig } from "#core/consent-config";
3
+ import type { Destination } from "#core/destination";
4
+ import type { GoogleConsentParams } from "#destinations/google-consent";
5
+ import type { FlatPropertyValue } from "#destinations/shared";
6
6
  type GtagPropertyValue = FlatPropertyValue;
7
7
  /**
8
8
  * All signatures share one `gtag` global, so they must live in a single overloaded type —
@@ -152,5 +152,4 @@ export interface GoogleAnalyticsDestinationOptions {
152
152
  * @since 0.5.0-canary.4
153
153
  */
154
154
  export declare function createGoogleAnalyticsDestination(options?: GoogleAnalyticsDestinationOptions): Destination;
155
- export {};
156
- //# sourceMappingURL=google-analytics.d.ts.map
155
+ export {};
@@ -1,5 +1,5 @@
1
- import { buildGoogleConsentBootstrapPreamble, DEFAULT_DATA_LAYER_NAME, ensureDataLayer, toGoogleConsentParams, warnUnlessGa4EventName, } from "#/destinations/google-consent";
2
- import { flattenEventProps } from "#/destinations/shared";
1
+ import { buildGoogleConsentBootstrapPreamble, DEFAULT_DATA_LAYER_NAME, ensureDataLayer, toGoogleConsentParams, warnUnlessGa4EventName, } from "#destinations/google-consent";
2
+ import { flattenEventProps } from "#destinations/shared";
3
3
  const GTAG_SCRIPT_BASE_URL = "https://www.googletagmanager.com/gtag/js";
4
4
  function gtagScriptSrc(gaMeasurementId, dataLayerName) {
5
5
  const url = new URL(GTAG_SCRIPT_BASE_URL);
@@ -152,5 +152,4 @@ export function createGoogleAnalyticsDestination(options = {}) {
152
152
  window.gtag("event", event.name, flattenEventProps(event.properties));
153
153
  },
154
154
  };
155
- }
156
- //# sourceMappingURL=google-analytics.js.map
155
+ }
@@ -1,4 +1,4 @@
1
- import type { ConsentDecision } from "#/core/consent";
1
+ import type { ConsentDecision } from "#core/consent";
2
2
  /**
3
3
  * gtag.js/gtm.js's default queue-array name — shared so the gtag and GTM helpers cannot disagree.
4
4
  *
@@ -60,5 +60,4 @@ export declare function ensureDataLayer(dataLayerName: string): Array<unknown> |
60
60
  * @since 0.5.0-canary.6
61
61
  */
62
62
  export declare function warnUnlessGa4EventName(destinationName: string, eventName: string): boolean;
63
- export {};
64
- //# sourceMappingURL=google-consent.d.ts.map
63
+ export {};
@@ -1,4 +1,4 @@
1
- import { CONSENT_CATEGORIES } from "#/core/consent";
1
+ import { CONSENT_CATEGORIES } from "#core/consent";
2
2
  /**
3
3
  * gtag.js/gtm.js's default queue-array name — shared so the gtag and GTM helpers cannot disagree.
4
4
  *
@@ -105,5 +105,4 @@ export function warnUnlessGa4EventName(destinationName, eventName) {
105
105
  }
106
106
  console.warn(`[tracking] "${destinationName}" dropped event "${eventName}" — GA4 event names must start with a letter and contain only letters, digits, or underscores (max 40 chars)`);
107
107
  return false;
108
- }
109
- //# sourceMappingURL=google-consent.js.map
108
+ }
@@ -1,6 +1,6 @@
1
- import type { ConsentDecision } from "#/core/consent";
2
- import type { Destination } from "#/core/destination";
3
- import type { FlatPropertyValue } from "#/destinations/shared";
1
+ import type { ConsentDecision } from "#core/consent";
2
+ import type { Destination } from "#core/destination";
3
+ import type { FlatPropertyValue } from "#destinations/shared";
4
4
  /**
5
5
  * Meta's `dataProcessingOptions` restriction. `['LDU'], 0, 0` turns on Limited Data Use and
6
6
  * lets Meta geolocate the user — the recommended default beyond California, where only
@@ -61,5 +61,4 @@ export interface MetaDestinationOptions {
61
61
  *
62
62
  * @since 0.5.0-canary.6
63
63
  */
64
- export declare function createMetaDestination(options: MetaDestinationOptions): Destination;
65
- //# sourceMappingURL=meta.d.ts.map
64
+ export declare function createMetaDestination(options: MetaDestinationOptions): Destination;
@@ -1,5 +1,5 @@
1
- import { toAdConsentState } from "#/destinations/ad-consent";
2
- import { flattenEventProps } from "#/destinations/shared";
1
+ import { toAdConsentState } from "#destinations/ad-consent";
2
+ import { flattenEventProps } from "#destinations/shared";
3
3
  /**
4
4
  * Maps a `ConsentDecision` to Meta's `dataProcessingOptions`: LDU when `ads` is denied.
5
5
  *
@@ -40,5 +40,4 @@ export function createMetaDestination(options) {
40
40
  });
41
41
  },
42
42
  };
43
- }
44
- //# sourceMappingURL=meta.js.map
43
+ }
@@ -1,6 +1,6 @@
1
- import type { ConsentDecision } from "#/core/consent";
2
- import type { Destination } from "#/core/destination";
3
- import type { FlatPropertyValue } from "#/destinations/shared";
1
+ import type { ConsentDecision } from "#core/consent";
2
+ import type { Destination } from "#core/destination";
3
+ import type { FlatPropertyValue } from "#destinations/shared";
4
4
  /**
5
5
  * Microsoft UET consent. UET enforces **only** `ad_storage` — it has no `analytics_storage`,
6
6
  * and its `ad_user_data`/`ad_personalization` fields have no documented behavior, so this
@@ -54,5 +54,4 @@ export interface MicrosoftUetDestinationOptions {
54
54
  *
55
55
  * @since 0.5.0-canary.6
56
56
  */
57
- export declare function createMicrosoftUetDestination(options: MicrosoftUetDestinationOptions): Destination;
58
- //# sourceMappingURL=microsoft-uet.d.ts.map
57
+ export declare function createMicrosoftUetDestination(options: MicrosoftUetDestinationOptions): Destination;
@@ -1,5 +1,5 @@
1
- import { toAdConsentState } from "#/destinations/ad-consent";
2
- import { flattenEventProps } from "#/destinations/shared";
1
+ import { toAdConsentState } from "#destinations/ad-consent";
2
+ import { flattenEventProps } from "#destinations/shared";
3
3
  /**
4
4
  * Maps a `ConsentDecision` to UET's enforced `ad_storage` signal via the shared ad lever, so
5
5
  * it can't drift from Meta/TikTok — `ad_storage` is the inverse of Limited Data Use.
@@ -37,5 +37,4 @@ export function createMicrosoftUetDestination(options) {
37
37
  });
38
38
  },
39
39
  };
40
- }
41
- //# sourceMappingURL=microsoft-uet.js.map
40
+ }
@@ -18,5 +18,4 @@ export declare function flattenEventProps(properties: Record<string, unknown>):
18
18
  */
19
19
  export declare function flattenEventProps(properties: Record<string, unknown>, options: {
20
20
  allowNull: true;
21
- }): Record<string, FlatPropertyValue | null>;
22
- //# sourceMappingURL=shared.d.ts.map
21
+ }): Record<string, FlatPropertyValue | null>;
@@ -17,5 +17,4 @@ export function flattenEventProps(properties, options = {}) {
17
17
  }
18
18
  }
19
19
  return result;
20
- }
21
- //# sourceMappingURL=shared.js.map
20
+ }
@@ -1,6 +1,6 @@
1
- import type { ConsentDecision } from "#/core/consent";
2
- import type { Destination } from "#/core/destination";
3
- import type { FlatPropertyValue } from "#/destinations/shared";
1
+ import type { ConsentDecision } from "#core/consent";
2
+ import type { Destination } from "#core/destination";
3
+ import type { FlatPropertyValue } from "#destinations/shared";
4
4
  /**
5
5
  * TikTok consent. TikTok uses a **single Limited Data Use boolean**, not Meta's
6
6
  * `dataProcessingOptions` structure and no signal object (spec-destinations §5). Its
@@ -53,5 +53,4 @@ export interface TiktokDestinationOptions {
53
53
  *
54
54
  * @since 0.5.0-canary.6
55
55
  */
56
- export declare function createTiktokDestination(options: TiktokDestinationOptions): Destination;
57
- //# sourceMappingURL=tiktok.d.ts.map
56
+ export declare function createTiktokDestination(options: TiktokDestinationOptions): Destination;
@@ -1,5 +1,5 @@
1
- import { toAdConsentState } from "#/destinations/ad-consent";
2
- import { flattenEventProps } from "#/destinations/shared";
1
+ import { toAdConsentState } from "#destinations/ad-consent";
2
+ import { flattenEventProps } from "#destinations/shared";
3
3
  /**
4
4
  * Maps a `ConsentDecision` to TikTok's LDU boolean — on when `ads` is denied.
5
5
  *
@@ -36,5 +36,4 @@ export function createTiktokDestination(options) {
36
36
  });
37
37
  },
38
38
  };
39
- }
40
- //# sourceMappingURL=tiktok.js.map
39
+ }
@@ -1,4 +1,4 @@
1
- import type { Destination } from "#/core/destination";
1
+ import type { Destination } from "#core/destination";
2
2
  /**
3
3
  * Options for `createVercelAnalyticsDestination`.
4
4
  *
@@ -23,5 +23,4 @@ export interface VercelAnalyticsDestinationOptions {
23
23
  *
24
24
  * @since 0.5.0-canary.4
25
25
  */
26
- export declare function createVercelAnalyticsDestination(options?: VercelAnalyticsDestinationOptions): Destination;
27
- //# sourceMappingURL=vercel-analytics.d.ts.map
26
+ export declare function createVercelAnalyticsDestination(options?: VercelAnalyticsDestinationOptions): Destination;
@@ -1,5 +1,5 @@
1
1
  import { track } from "@vercel/analytics";
2
- import { flattenEventProps } from "#/destinations/shared";
2
+ import { flattenEventProps } from "#destinations/shared";
3
3
  /**
4
4
  * `track()` only pushes onto Vercel's own in-page queue (`window.va`/`window.vaq`), which
5
5
  * handles batching and unload delivery itself. Requires the Vercel Analytics script to be
@@ -19,5 +19,4 @@ export function createVercelAnalyticsDestination(options = {}) {
19
19
  track(event.name, flattenEventProps(event.properties, { allowNull: true }));
20
20
  },
21
21
  };
22
- }
23
- //# sourceMappingURL=vercel-analytics.js.map
22
+ }