flowgrid-sdk 1.7.1 → 1.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 (39) hide show
  1. package/README.md +94 -129
  2. package/dist/browser.d.ts +3 -0
  3. package/dist/browser.js +39 -0
  4. package/dist/browser.js.map +1 -1
  5. package/dist/flowgrid.min.js +1 -1
  6. package/dist/flowgrid.min.js.map +1 -1
  7. package/dist/index.d.ts +4 -4
  8. package/dist/index.js +4 -2
  9. package/dist/index.js.map +1 -1
  10. package/dist/lib/consent/declarativeBanner.d.ts +73 -0
  11. package/dist/lib/consent/declarativeBanner.js +260 -0
  12. package/dist/lib/consent/declarativeBanner.js.map +1 -0
  13. package/dist/lib/consent/index.d.ts +2 -0
  14. package/dist/lib/consent/index.js +3 -1
  15. package/dist/lib/consent/index.js.map +1 -1
  16. package/dist/lib/consent/manager.js +6 -1
  17. package/dist/lib/consent/manager.js.map +1 -1
  18. package/dist/lib/consent/types.d.ts +31 -1
  19. package/dist/lib/features/core/activation.d.ts +10 -0
  20. package/dist/lib/features/core/activation.js +19 -0
  21. package/dist/lib/features/core/activation.js.map +1 -1
  22. package/dist/lib/features/core/declarativeExperiments.d.ts +4 -0
  23. package/dist/lib/features/core/declarativeExperiments.js +23 -1
  24. package/dist/lib/features/core/declarativeExperiments.js.map +1 -1
  25. package/dist/lib/flowgrid.d.ts +40 -1
  26. package/dist/lib/flowgrid.js +31 -4
  27. package/dist/lib/flowgrid.js.map +1 -1
  28. package/dist/lib/helpers/consent.d.ts +53 -2
  29. package/dist/lib/helpers/consent.js +339 -8
  30. package/dist/lib/helpers/consent.js.map +1 -1
  31. package/dist/lib/helpers/index.d.ts +2 -2
  32. package/dist/lib/helpers/index.js +2 -1
  33. package/dist/lib/helpers/index.js.map +1 -1
  34. package/dist/lib/tracking/core/activation.d.ts +2 -0
  35. package/dist/lib/tracking/core/activation.js +4 -0
  36. package/dist/lib/tracking/core/activation.js.map +1 -1
  37. package/dist/umd/index.js +1 -1
  38. package/dist/umd/index.js.map +1 -1
  39. package/package.json +1 -1
package/README.md CHANGED
@@ -5,7 +5,7 @@
5
5
  [![types](https://img.shields.io/npm/types/flowgrid-sdk.svg)](https://www.npmjs.com/package/flowgrid-sdk)
6
6
 
7
7
  A production-grade, **framework-agnostic** TypeScript SDK for product analytics,
8
- ecommerce, experiments, and enterprise insights — with a single unified entry
8
+ e-commerce, experiments, and enterprise insights — with a single unified entry
9
9
  point that works in any JavaScript environment (Node, browsers, edge runtimes,
10
10
  React, Vue, Next, Nuxt, Svelte, Angular, etc.).
11
11
 
@@ -17,9 +17,13 @@ import { FlowGrid } from "flowgrid-sdk";
17
17
  const fg = FlowGrid.init({
18
18
  webId: "wx_123",
19
19
  apiKey: "pk_xxx",
20
- user: { userId: "u_1", traits: { plan: "pro" } },
21
- // Opt in to session replay (rrweb) when you want it.
22
- replay: { sampleRate: 0.25, maskAllInputs: true },
20
+ // Opt in to the extras you want at init.
21
+ autoTrack: {
22
+ replay: true,
23
+ engagement: true,
24
+ performance: true,
25
+ passiveIdentity: true,
26
+ },
23
27
  });
24
28
 
25
29
  await fg.track("signup_completed", { plan: "pro" });
@@ -28,19 +32,16 @@ await fg.track("experiment_exposure", { experimentId: "checkout_v2", variantId:
28
32
  await fg.track("add_to_cart", { productId: "sku_1", name: "T-Shirt", price: 29, currency: "USD", quantity: 1 });
29
33
  ```
30
34
 
31
-
32
35
  ---
33
36
 
34
37
  ## Highlights
35
38
 
36
39
  - **One class, every feature** — `new FlowGrid(...)` exposes analytics, ecommerce, experiments, and enterprise modules as lazy properties.
37
40
  - **Feature usage, explicit** — `fg.track("feature_usage", { featureId, featureName })`. You say what happened; the SDK just sends it.
38
- - **Passive identity** — opt in with `autoTrack({ passiveIdentity: true })` to recognise anonymous visitors from any form (PII hashed in the browser).
41
+ - **Passive identity** — opt in at init with `autoTrack: { passiveIdentity: true }` (or later via `fg.autoTrack({ passiveIdentity: true })`) to recognise anonymous visitors from any form (PII hashed in the browser).
39
42
  - **Framework-agnostic** — zero peer dependencies. Works with React, Vue, Next.js, Nuxt, Svelte, Astro, plain Node, Cloudflare Workers, etc.
40
- - **Tree-shake-friendly** — also export individual modules (`Events`, `Products`, `Experiment`, …) for minimal bundles.
41
43
  - **Privacy & consent built-in** — DNT/GPC support, `ConsentManager`, bot filtering.
42
44
  - **Resilient transport** — retry with exponential backoff, `sendBeacon` fallback, offline `localStorage` buffering, 10KB payload guard.
43
- - **Identity layer** — visitor + session lifecycle, SSR-safe, backwards-compatible with track.js cookies.
44
45
  - **Strict TypeScript** — strong types for every config and response.
45
46
 
46
47
  ---
@@ -92,17 +93,9 @@ Available namespaces on `FlowGrid`:
92
93
  | ----------- | ----------------------------------------------------------------------------------------------------------------------- |
93
94
  | Core | `activation`, `features`, `prompts`, `experiments` |
94
95
  | Analytics | `pageViews`, `sessions`, `events`, `identify`, `funnels`, `retention`, `attribution`, `heatmaps`, `performance`, `replay` |
95
- | Ecommerce | `products`, `cart`, `checkout`, `purchases`, `refunds`, `promotions`, `wishlist`, `ltv`, `search`, `subscriptions` |
96
+ | E-commerce | `products`, `cart`, `checkout`, `purchases`, `refunds`, `promotions`, `wishlist`, `ltv`, `search`, `subscriptions` |
96
97
  | Enterprise | `engagement`, `cohorts`, `churn`, `monetization`, `multiPathFunnels`, `support`, `acquisition`, `paths`, `alerts`, `security`, `forecasting` |
97
98
 
98
- ### Direct module imports (tree-shaking)
99
-
100
- ```ts
101
- import { Events, Products } from "flowgrid-sdk";
102
-
103
- const events = new Events("web_123", "https://core.flow-grid.xyz", "key_xxx");
104
- await events.track({ eventName: "signup", properties: { plan: "pro" } });
105
- ```
106
99
 
107
100
  ### Browser script tag (CMS / no-build)
108
101
 
@@ -127,47 +120,8 @@ The script-tag API is intentionally small: `init`, `track`, `page`, `identify`,
127
120
  consent helpers (`setConsent` / `hasConsent`), `reset`, and `instance()` for the
128
121
  full SDK. `FlowGrid.init()` auto-instruments sessions, page views, SPA route
129
122
  changes, scroll depth, time on page, performance, heatmaps, and attribution by
130
- default; session replay is opt-in with `replay: true`, and passive identity
131
- capture with `autoTrack({ passiveIdentity: true })`.
132
-
133
- ---
134
-
135
- ## Session Replay
136
-
137
- Replay is opt-in and browser-only. It uses `rrweb` dynamically, records DOM/input/scroll/mouse events, and sends sequenced chunks to core with `call=replay_chunk`.
138
-
139
- ```ts
140
- const fg = FlowGrid.init({
141
- webId: "wx_123",
142
- apiKey: "pk_xxx",
143
- user: { userId: "u_1" },
144
- replay: {
145
- sampleRate: 0.25,
146
- maskAllInputs: true,
147
- flushIntervalMs: 5000,
148
- flushBytes: 512 * 1024,
149
- onFlush: ({ sessionId, sequence, eventsCount }) => {
150
- console.debug("replay chunk", sessionId, sequence, eventsCount);
151
- },
152
- },
153
- });
154
-
155
- fg.replay.identify("u_1");
156
- await fg.replay.flush();
157
- fg.replay.stop();
158
- ```
159
-
160
- Manual lifecycle control is available when you do not want init-time recording:
161
-
162
- ```ts
163
- const stop = await fg.replay.start({ sampleRate: 1, maskAllInputs: true });
164
- const status = fg.replay.status();
165
-
166
- await fg.replay.flush("manual");
167
- stop();
168
- ```
169
-
170
- Each replay chunk includes the core ingestion fields `web_id`, `visitor_id`, `session_id`, `sequence`, `started_at`, `captured_at`, `events`, plus replay metadata such as `page_url`, `idempotency_key`, `compression`, `is_final`, `privacy`, `flush_reason`, `dropped_events`, and `recorder_version`.
123
+ default; session replay is opt-in with `autoTrack: { replay: true }`, and passive
124
+ identity capture with `autoTrack: { passiveIdentity: true }`.
171
125
 
172
126
  ---
173
127
 
@@ -203,12 +157,12 @@ what happened — each maps to a lifecycle stage the dashboard funnel understand
203
157
  (a *viewed* feature is Discovered, a *used* one is Adopted):
204
158
 
205
159
  ```ts
206
- const agent = fg.defineFeature("ai-agent-builder", "AI Agent Builder", { category: "automation" });
160
+ const feature = fg.defineFeature("ai-agent-builder", "AI Agent Builder", { category: "automation" });
207
161
 
208
- agent.viewed(); // action: "viewed" → Discovered + Viewed
209
- agent.used({ model: "opus" }); // action: "used" → Adopted
210
- agent.completed(); // action: "completed" → Completed
211
- agent.abandoned(); // action: "abandoned" → Abandonment
162
+ feature.viewed(); // action: "viewed" → Discovered + Viewed
163
+ feature.used({ model: "opus" }); // action: "used" → Adopted
164
+ feature.completed(); // action: "completed" → Completed
165
+ feature.abandoned(); // action: "abandoned" → Abandonment
212
166
  // script tag: FlowGrid.defineFeature("ai-agent-builder", "AI Agent Builder").used()
213
167
  ```
214
168
 
@@ -221,7 +175,7 @@ one-off calls, and `fg.features.record(id, name, action)` for a dynamic action.
221
175
 
222
176
  ## Passive Identity Capture
223
177
 
224
- Recognise anonymous visitors automatically: when a visitor types their email /
178
+ Recognize anonymous visitors automatically: when a visitor types their email /
225
179
  name / phone into **any** form, FlowGrid classifies the field, hashes PII in the
226
180
  browser, and links the identity to their `visitor_id` — so the dashboard shows
227
181
  them by name (and, with a CRM connected, matches them to the contact). No
@@ -242,8 +196,7 @@ fg.autoTrack({ passiveIdentity: { debounceMs: 800, excludePath: /\/(checkout|adm
242
196
  Never reads `password`/`hidden`/card/cvv/ssn/pin fields, anything marked
243
197
  `data-analytics="ignore"` or `.no-track`, free-text (message/comment/search), or
244
198
  sensitive paths (`/checkout`, `/account/settings`, `/admin`). Raw email goes only
245
- to the server-side identity store; the event stream sees hashes. Full guide:
246
- `vission_manager/docs/PASSIVE_IDENTITY_DEVELOPER_GUIDE.md`.
199
+ to the server-side identity store; the event stream sees hashes.
247
200
 
248
201
  ---
249
202
 
@@ -253,9 +206,7 @@ Works in any JavaScript runtime that supports `fetch` — Node, Bun, Deno, Cloud
253
206
 
254
207
  ```ts
255
208
  // app/api/track/route.ts (Next.js example, but works anywhere)
256
- import { FlowGrid } from "flowgrid-sdk";
257
-
258
- const fg = new FlowGrid("web_123", "https://core.flow-grid.xyz", process.env.FG_API_KEY!);
209
+ import { fg } from "@/lib/utils";
259
210
 
260
211
  export async function POST(req: Request) {
261
212
  const { userId } = await req.json();
@@ -270,6 +221,78 @@ For Node-style batch jobs, simply create a `FlowGrid` instance, fire your tracki
270
221
 
271
222
  ## Cookie Consent
272
223
 
224
+ ### No-code (one tag) — recommended
225
+
226
+ Drop a single element on the page and FlowGrid renders a styled, **opt-in**,
227
+ GDPR/CCPA-friendly consent banner that blocks analytics, marketing and
228
+ session-replay tracking until the visitor accepts — with **zero JavaScript**:
229
+
230
+ ```html
231
+ <script src="https://cdn.flow-grid.xyz/flowgrid.min.js" data-site="YOUR_WEBSITE_ID"></script>
232
+ <div data-cookie-ccbanner></div>
233
+ ```
234
+
235
+ The banner auto-initializes ahead of (and independently of) tracking, so consent
236
+ gates engage before the first event fires. It re-scans for late-mounted markers
237
+ (page builders / SPA routes) and is idempotent.
238
+
239
+ **Tier 1 — attributes (no CSS).** Tune copy, colours, position via `data-cc-*`:
240
+
241
+ ```html
242
+ <div data-cookie-ccbanner
243
+ data-cc-position="bottom-right"
244
+ data-cc-primary="#EBF212"
245
+ data-cc-radius="16px"
246
+ data-cc-privacy-url="/privacy"></div>
247
+ ```
248
+
249
+ Common attributes: `data-cc-mode` (`opt-in`|`opt-out`), `data-cc-title`,
250
+ `data-cc-description`, `data-cc-accept-label`, `data-cc-reject-label`,
251
+ `data-cc-position`, `data-cc-primary` / `-bg` / `-text`, `data-cc-radius`,
252
+ `data-cc-categories` (`analytics,marketing`), `data-cc-cookie-name` / `-days` /
253
+ `-domain`, `data-cc-respect-dnt`, `data-cc-theme` (`flowgrid`|`light`|`dark`),
254
+ `data-cc-manage-selector` (re-open hook). Add `data-cc-manual` to a tag to skip
255
+ auto-init.
256
+
257
+ **Tier 2 — your CSS.** Add `data-cc-unstyled` to drop the default look and style
258
+ the stable class hooks (`.fg-cc-banner`, `.fg-cc-card`, `.fg-cc-btn--accept`, …)
259
+ and CSS variables (`--fg-cc-bg`, `--fg-cc-primary`, …) from your own stylesheet.
260
+
261
+ **Tier 3 — bring your own markup.** Put your own HTML inside the marker; FlowGrid
262
+ binds your buttons by data-role and never injects DOM:
263
+
264
+ ```html
265
+ <div data-cookie-ccbanner style="display:none">
266
+ <h2>Cookies?</h2>
267
+ <button data-cc-accept>Sure</button>
268
+ <button data-cc-reject>No thanks</button>
269
+ </div>
270
+ ```
271
+
272
+ Global defaults can be set on `window.FlowGridConfig.consentBanner` before the
273
+ tag; per-element `data-cc-*` attributes override them. SPA apps can re-scan after
274
+ a client-side navigation with `FlowGrid.wireConsentBanner()` (or import
275
+ `wireDeclarativeBanners()` directly).
276
+
277
+ ### Programmatic banner
278
+
279
+ Render the same banner from code with `renderConsentBanner()`:
280
+
281
+ ```ts
282
+ import { renderConsentBanner } from "flowgrid-sdk";
283
+
284
+ const banner = renderConsentBanner({
285
+ mode: "opt-in",
286
+ title: "We value your privacy",
287
+ privacyPolicyUrl: "/privacy",
288
+ theme: { position: "bottom-right", primaryColor: "#EBF212" },
289
+ });
290
+
291
+ document.getElementById("manage-cookies")?.addEventListener("click", () => banner?.show());
292
+ ```
293
+
294
+ ### Core `ConsentManager`
295
+
273
296
  The SDK ships a framework-agnostic `ConsentManager`. Render your own banner UI in whatever framework you use, and call into the manager to persist preferences.
274
297
 
275
298
  ```ts
@@ -307,34 +330,6 @@ FlowGridTransport.hasConsent("analytics"); // true
307
330
 
308
331
  ---
309
332
 
310
- ## Identity & Storage Helpers
311
-
312
- ```ts
313
- import {
314
- FlowGrid,
315
- IdentityManager,
316
- getVisitorId,
317
- getSessionId,
318
- getWebId,
319
- getUTM,
320
- getUTMHistory,
321
- } from "flowgrid-sdk";
322
-
323
- const identity = new IdentityManager({ cookieDomain: ".example.com" });
324
- const visitorId = identity.getVisitorId();
325
-
326
- // Pass to FlowGrid for shared identity across modules
327
- const fg = new FlowGrid(
328
- "web_123",
329
- "https://core.flow-grid.xyz",
330
- "key_xxx",
331
- visitorId,
332
- identity
333
- );
334
- ```
335
-
336
- ---
337
-
338
333
  ## Package Exports
339
334
 
340
335
  | Import path | Description |
@@ -348,42 +343,12 @@ const fg = new FlowGrid(
348
343
 
349
344
  ---
350
345
 
351
- ## Configuration
352
-
353
- The transport accepts an optional `FlowGridTransportConfig` as its 6th argument:
354
-
355
- ```ts
356
- new FlowGrid(webId, endpoint, apiKey, visitorId, identityManager, {
357
- botDetection: "block", // "block" | "tag" | "disabled"
358
- respectDNT: true, // honour Do-Not-Track / GPC
359
- sampleRate: 1.0, // 0.0 – 1.0
360
- });
361
- ```
362
-
363
- Defaults: `botDetection: "block"`, `respectDNT: true`, `sampleRate: 1.0`.
364
-
365
- ---
366
-
367
- ## Scripts
368
-
369
- ```bash
370
- npm run build # tsc + webpack production build
371
- npm run build:browser # browser UMD bundle (flowgrid.min.js)
372
- npm run build:all # both
373
- npm run build:types # emit .d.ts only
374
- npm test # run audit-fixes test suite
375
- ```
376
-
377
- ---
378
-
379
346
  ## Documentation
380
347
 
381
348
  Full reference: <https://flow-grid.xyz/documentation>
382
349
 
383
- ## Contributing
384
-
385
- Issues and PRs welcome on [GitHub](https://github.com/FrostXk9/flowgrid-sdk).
386
-
387
350
  ## License
388
351
 
389
352
  MIT © Brandon Roulstone
353
+
354
+ Contact Support suport@toastlabz.com
package/dist/browser.d.ts CHANGED
@@ -44,9 +44,12 @@ type BrowserFacade = {
44
44
  track: FlowGrid["track"];
45
45
  page: FlowGrid["page"];
46
46
  identify: FlowGrid["identifyUser"];
47
+ signup: FlowGrid["signup"];
48
+ login: FlowGrid["login"];
47
49
  defineFeature: FlowGrid["defineFeature"];
48
50
  experiment: FlowGrid["experiment"];
49
51
  wireExperiments(): void;
52
+ wireConsentBanner(): void;
50
53
  productView(product: BrowserProduct, properties?: Record<string, unknown>): ReturnType<FlowGrid["products"]["view"]>;
51
54
  addToCart(product: BrowserProduct, quantity?: number, cartId?: string): ReturnType<FlowGrid["cart"]["add"]>;
52
55
  purchase(order: BrowserOrder): ReturnType<FlowGrid["purchases"]["complete"]>;
package/dist/browser.js CHANGED
@@ -24,6 +24,7 @@ exports.FlowGrid = void 0;
24
24
  const flowgrid_1 = require("./lib/flowgrid");
25
25
  Object.defineProperty(exports, "FlowGrid", { enumerable: true, get: function () { return flowgrid_1.FlowGrid; } });
26
26
  const declarativeExperiments_1 = require("./lib/features/core/declarativeExperiments");
27
+ const declarativeBanner_1 = require("./lib/consent/declarativeBanner");
27
28
  function getInstance() {
28
29
  const instance = flowgrid_1.FlowGrid.instance();
29
30
  if (!instance) {
@@ -85,6 +86,14 @@ const browserFlowGrid = {
85
86
  identify(userId, traits, anonymousId) {
86
87
  return getInstance().identifyUser(userId, traits, anonymousId);
87
88
  },
89
+ // Programmatic signup/login from the script tag (the declarative
90
+ // `data-fg-signup` / `data-fg-login` attributes are wired automatically).
91
+ signup(userId, method, source, properties) {
92
+ return getInstance().signup(userId, method, source, properties);
93
+ },
94
+ login(userId, method, properties) {
95
+ return getInstance().login(userId, method, properties);
96
+ },
88
97
  defineFeature(featureId, featureName, opts) {
89
98
  return getInstance().defineFeature(featureId, featureName, opts);
90
99
  },
@@ -98,6 +107,17 @@ const browserFlowGrid = {
98
107
  const wiring = (0, declarativeExperiments_1.wireDeclarativeExperiments)(getInstance());
99
108
  wiring.flushLoad();
100
109
  },
110
+ // Manually (re-)scan the DOM for `[data-cookie-ccbanner]` consent markers.
111
+ // The no-build path wires this automatically on load; SPA/programmatic users
112
+ // call it after a client-side navigation re-renders the page. Independent of
113
+ // FlowGrid.init() — consent must be able to gate before tracking starts.
114
+ wireConsentBanner() {
115
+ (0, declarativeBanner_1.wireDeclarativeBanners)({
116
+ globalConfig: typeof window !== "undefined"
117
+ ? window.FlowGridConfig?.consentBanner
118
+ : undefined,
119
+ });
120
+ },
101
121
  productView(product, properties) {
102
122
  return getInstance().products.view(normalizeProduct(product), properties);
103
123
  },
@@ -167,6 +187,25 @@ if (typeof window !== "undefined") {
167
187
  if (typeof window.flowgrid === "undefined") {
168
188
  window.flowgrid = browserFlowGrid;
169
189
  }
190
+ // Consent must be able to gate BEFORE any tracking, so wire declarative cookie
191
+ // banners ahead of — and independently of — FlowGrid.init(). A
192
+ // `<div data-cookie-ccbanner>` renders an opt-in banner that immediately flips
193
+ // the transport gates to "blocked" (via setupConsent) until the visitor
194
+ // accepts. Global defaults come from FlowGridConfig.consentBanner; per-element
195
+ // data-cc-* override them. Suppress globally with `data-cc-manual` /
196
+ // `data-no-consent-banner` on the script tag (or per element with data-cc-manual).
197
+ const consentScript = typeof document !== "undefined" ? document.currentScript : null;
198
+ const consentManual = (consentScript?.getAttribute?.("data-cc-manual") ?? consentScript?.getAttribute?.("data-no-consent-banner")) != null;
199
+ if (!consentManual) {
200
+ try {
201
+ (0, declarativeBanner_1.wireDeclarativeBanners)({
202
+ globalConfig: window.FlowGridConfig?.consentBanner,
203
+ });
204
+ }
205
+ catch {
206
+ /* never throw from the bundle's top level */
207
+ }
208
+ }
170
209
  // Auto-init from FlowGridConfig / data-* (no-build path). Skipped entirely if
171
210
  // an instance already exists (a synchronous manual init won) or `data-manual`
172
211
  // is set — so full programmatic configuration is never locked out.
@@ -1 +1 @@
1
- {"version":3,"file":"browser.js","sourceRoot":"","sources":["../src/browser.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;;;AAEH,6CAA8D;AAwPrD,yFAxPA,mBAAQ,OAwPA;AArPjB,uFAAwF;AAiCxF,SAAS,WAAW;IAClB,MAAM,QAAQ,GAAG,mBAAQ,CAAC,QAAQ,EAAE,CAAC;IACrC,IAAI,CAAC,QAAQ,EAAE,CAAC;QACd,MAAM,IAAI,KAAK,CAAC,uDAAuD,CAAC,CAAC;IAC3E,CAAC;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED,SAAS,gBAAgB,CAAC,OAAuB;IAC/C,OAAO;QACL,GAAG,OAAO;QACV,QAAQ,EAAE,OAAO,CAAC,QAAQ,IAAI,KAAK;KACpC,CAAC;AACJ,CAAC;AAED,SAAS,cAAc,CAAC,KAAmB;IACzC,MAAM,QAAQ,GAAG,KAAK,CAAC,QAAQ,IAAI,KAAK,CAAC;IACzC,MAAM,KAAK,GAAG,KAAK,CAAC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