@active-reach/web-sdk 1.52.0 → 1.54.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/boot.d.ts ADDED
@@ -0,0 +1,46 @@
1
+ /**
2
+ * `@active-reach/web-sdk/boot` — the early-boot script (Aman 2026-11-19,
3
+ * "preconnect + earlier boot").
4
+ *
5
+ * A tiny script, safe to load before the page is interactive, that starts the
6
+ * page's FIRST `/v1/in-app/active` read the moment the HTML is parsed, instead
7
+ * of after the app bundle loaded, hydrated and built the SDK runtime (the
8
+ * Cake House store paid ~0.7 s of that on a phone, then lost the request to
9
+ * the cold connection). The request is built by the SAME builder the manager
10
+ * uses (inapp/active-request.ts), so when `AegisInAppManager.refreshCampaigns`
11
+ * runs it finds `window.__aegisActiveBoot`, sees its own URL + headers, and
12
+ * adopts the answer in flight. A boot for a different page context (or a
13
+ * different identity) is ignored and cleared; nothing is asked twice.
14
+ *
15
+ * Script tag (IIFE build `aegis-boot.min.js`, or this module bundled):
16
+ * <script src=".../aegis-boot.min.js" data-write-key="wk_…"
17
+ * data-api-host="https://api.active-reach.ai" data-surface="storefront_catalog"
18
+ * data-screen="storefront.home" data-location-id="loc_…"
19
+ * data-organization-id="org_…" data-property-id="prop_…"></script>
20
+ * Optional: data-contact-id / data-contact-token (a signed-in visitor the host
21
+ * already knows server-side); without them an identified session is not
22
+ * adopted (the manager's answer carries X-Contact-ID, the boot's did not).
23
+ *
24
+ * Same endpoint, same budget: one 800 ms try plus one retry on an abort
25
+ * (utils/fetch-abort.ts). No new API.
26
+ */
27
+ import { type ActiveBootHandle } from './inapp/active-request';
28
+ export interface AegisActiveBootOptions {
29
+ writeKey: string;
30
+ apiHost: string;
31
+ surface?: string | null;
32
+ screen?: string | null;
33
+ locationId?: string | null;
34
+ organizationId?: string | null;
35
+ propertyId?: string | null;
36
+ contactId?: string | null;
37
+ contactToken?: string | null;
38
+ }
39
+ /** Start the page's first /active read and publish it for the SDK to adopt.
40
+ * Returns the handle, or null outside a browser / with no write key. */
41
+ export declare function bootActive(options: AegisActiveBootOptions): ActiveBootHandle | null;
42
+ /** Read the options off a script tag's data-* attributes. */
43
+ export declare function bootOptionsFromScript(script: Element | null): AegisActiveBootOptions | null;
44
+ /** Boot from the running script tag's data-* attributes (no-op without them). */
45
+ export declare function bootFromScript(script?: Element | null): ActiveBootHandle | null;
46
+ //# sourceMappingURL=boot.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"boot.d.ts","sourceRoot":"","sources":["../src/boot.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,OAAO,EAKL,KAAK,gBAAgB,EACtB,MAAM,wBAAwB,CAAC;AAIhC,MAAM,WAAW,sBAAsB;IACrC,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC9B;AAED;yEACyE;AACzE,wBAAgB,UAAU,CAAC,OAAO,EAAE,sBAAsB,GAAG,gBAAgB,GAAG,IAAI,CA6BnF;AAED,6DAA6D;AAC7D,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI,GAAG,sBAAsB,GAAG,IAAI,CAiB3F;AAED,iFAAiF;AACjF,wBAAgB,cAAc,CAAC,MAAM,GAAE,OAAO,GAAG,IAAsB,GAAG,gBAAgB,GAAG,IAAI,CAGhG"}
package/dist/boot.js ADDED
@@ -0,0 +1,63 @@
1
+ import { n as normalizePageContext, b as buildActiveRequest, r as readAnonIdFromStorage, f as fetchWithAbortRetry, s as storeActiveBoot } from "./fetch-abort-Bs-Stg-I.mjs";
2
+ import { i as isPreviewPage } from "./storage-D5jp9bO-.mjs";
3
+ function bootActive(options) {
4
+ if (typeof window === "undefined" || !options.writeKey || !options.apiHost) return null;
5
+ const page = normalizePageContext(options.surface, options.screen);
6
+ const req = buildActiveRequest({
7
+ apiHost: options.apiHost,
8
+ writeKey: options.writeKey,
9
+ userId: readAnonIdFromStorage(),
10
+ contactId: options.contactId || void 0,
11
+ contactToken: options.contactToken || void 0,
12
+ organizationId: options.organizationId || void 0,
13
+ propertyId: options.propertyId || void 0,
14
+ surface: page.surface,
15
+ screen: page.screen,
16
+ locationId: options.locationId || null,
17
+ cartProductIds: null,
18
+ // A preview page records nothing; the manager sends `preview=1` there too.
19
+ previewOnly: isPreviewPage()
20
+ });
21
+ const promise = fetchWithAbortRetry(req.url, {
22
+ method: "GET",
23
+ headers: req.headers,
24
+ credentials: "include"
25
+ });
26
+ promise.catch(() => void 0);
27
+ const handle = { key: req.key, url: req.url, headers: req.headers, promise };
28
+ storeActiveBoot(handle);
29
+ return handle;
30
+ }
31
+ function bootOptionsFromScript(script) {
32
+ if (!script) return null;
33
+ const attr = (name) => script.getAttribute(`data-${name}`);
34
+ const writeKey = attr("write-key");
35
+ const apiHost = attr("api-host");
36
+ if (!writeKey || !apiHost) return null;
37
+ return {
38
+ writeKey,
39
+ apiHost,
40
+ surface: attr("surface"),
41
+ screen: attr("screen"),
42
+ locationId: attr("location-id"),
43
+ organizationId: attr("organization-id"),
44
+ propertyId: attr("property-id"),
45
+ contactId: attr("contact-id"),
46
+ contactToken: attr("contact-token")
47
+ };
48
+ }
49
+ function bootFromScript(script = currentScript()) {
50
+ const options = bootOptionsFromScript(script);
51
+ return options ? bootActive(options) : null;
52
+ }
53
+ function currentScript() {
54
+ if (typeof document === "undefined") return null;
55
+ return document.currentScript ?? document.querySelector("script[data-aegis-boot][data-write-key]");
56
+ }
57
+ bootFromScript();
58
+ export {
59
+ bootActive,
60
+ bootFromScript,
61
+ bootOptionsFromScript
62
+ };
63
+ //# sourceMappingURL=boot.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"boot.js","sources":["../src/boot.ts"],"sourcesContent":["/**\n * `@active-reach/web-sdk/boot` — the early-boot script (Aman 2026-11-19,\n * \"preconnect + earlier boot\").\n *\n * A tiny script, safe to load before the page is interactive, that starts the\n * page's FIRST `/v1/in-app/active` read the moment the HTML is parsed, instead\n * of after the app bundle loaded, hydrated and built the SDK runtime (the\n * Cake House store paid ~0.7 s of that on a phone, then lost the request to\n * the cold connection). The request is built by the SAME builder the manager\n * uses (inapp/active-request.ts), so when `AegisInAppManager.refreshCampaigns`\n * runs it finds `window.__aegisActiveBoot`, sees its own URL + headers, and\n * adopts the answer in flight. A boot for a different page context (or a\n * different identity) is ignored and cleared; nothing is asked twice.\n *\n * Script tag (IIFE build `aegis-boot.min.js`, or this module bundled):\n * <script src=\".../aegis-boot.min.js\" data-write-key=\"wk_…\"\n * data-api-host=\"https://api.active-reach.ai\" data-surface=\"storefront_catalog\"\n * data-screen=\"storefront.home\" data-location-id=\"loc_…\"\n * data-organization-id=\"org_…\" data-property-id=\"prop_…\"></script>\n * Optional: data-contact-id / data-contact-token (a signed-in visitor the host\n * already knows server-side); without them an identified session is not\n * adopted (the manager's answer carries X-Contact-ID, the boot's did not).\n *\n * Same endpoint, same budget: one 800 ms try plus one retry on an abort\n * (utils/fetch-abort.ts). No new API.\n */\nimport {\n buildActiveRequest,\n normalizePageContext,\n readAnonIdFromStorage,\n storeActiveBoot,\n type ActiveBootHandle,\n} from './inapp/active-request';\nimport { fetchWithAbortRetry } from './utils/fetch-abort';\nimport { isPreviewPage } from './utils/preview-as-of';\n\nexport interface AegisActiveBootOptions {\n writeKey: string;\n apiHost: string;\n surface?: string | null;\n screen?: string | null;\n locationId?: string | null;\n organizationId?: string | null;\n propertyId?: string | null;\n contactId?: string | null;\n contactToken?: string | null;\n}\n\n/** Start the page's first /active read and publish it for the SDK to adopt.\n * Returns the handle, or null outside a browser / with no write key. */\nexport function bootActive(options: AegisActiveBootOptions): ActiveBootHandle | null {\n if (typeof window === 'undefined' || !options.writeKey || !options.apiHost) return null;\n const page = normalizePageContext(options.surface, options.screen);\n const req = buildActiveRequest({\n apiHost: options.apiHost,\n writeKey: options.writeKey,\n userId: readAnonIdFromStorage(),\n contactId: options.contactId || undefined,\n contactToken: options.contactToken || undefined,\n organizationId: options.organizationId || undefined,\n propertyId: options.propertyId || undefined,\n surface: page.surface,\n screen: page.screen,\n locationId: options.locationId || null,\n cartProductIds: null,\n // A preview page records nothing; the manager sends `preview=1` there too.\n previewOnly: isPreviewPage(),\n });\n const promise = fetchWithAbortRetry(req.url, {\n method: 'GET',\n headers: req.headers,\n credentials: 'include',\n });\n // An unadopted boot (the SDK never loaded, or asked for another page) must\n // not surface as an unhandled rejection.\n promise.catch(() => undefined);\n const handle: ActiveBootHandle = { key: req.key, url: req.url, headers: req.headers, promise };\n storeActiveBoot(handle);\n return handle;\n}\n\n/** Read the options off a script tag's data-* attributes. */\nexport function bootOptionsFromScript(script: Element | null): AegisActiveBootOptions | null {\n if (!script) return null;\n const attr = (name: string): string | null => script.getAttribute(`data-${name}`);\n const writeKey = attr('write-key');\n const apiHost = attr('api-host');\n if (!writeKey || !apiHost) return null;\n return {\n writeKey,\n apiHost,\n surface: attr('surface'),\n screen: attr('screen'),\n locationId: attr('location-id'),\n organizationId: attr('organization-id'),\n propertyId: attr('property-id'),\n contactId: attr('contact-id'),\n contactToken: attr('contact-token'),\n };\n}\n\n/** Boot from the running script tag's data-* attributes (no-op without them). */\nexport function bootFromScript(script: Element | null = currentScript()): ActiveBootHandle | null {\n const options = bootOptionsFromScript(script);\n return options ? bootActive(options) : null;\n}\n\nfunction currentScript(): Element | null {\n if (typeof document === 'undefined') return null;\n return document.currentScript ?? document.querySelector('script[data-aegis-boot][data-write-key]');\n}\n\n// Auto-run for the script-tag distribution: a tag with data-write-key boots\n// on load; an npm import with no such tag does nothing until bootActive().\nbootFromScript();\n"],"names":[],"mappings":";;AAkDO,SAAS,WAAW,SAA0D;AACnF,MAAI,OAAO,WAAW,eAAe,CAAC,QAAQ,YAAY,CAAC,QAAQ,QAAS,QAAO;AACnF,QAAM,OAAO,qBAAqB,QAAQ,SAAS,QAAQ,MAAM;AACjE,QAAM,MAAM,mBAAmB;AAAA,IAC7B,SAAS,QAAQ;AAAA,IACjB,UAAU,QAAQ;AAAA,IAClB,QAAQ,sBAAA;AAAA,IACR,WAAW,QAAQ,aAAa;AAAA,IAChC,cAAc,QAAQ,gBAAgB;AAAA,IACtC,gBAAgB,QAAQ,kBAAkB;AAAA,IAC1C,YAAY,QAAQ,cAAc;AAAA,IAClC,SAAS,KAAK;AAAA,IACd,QAAQ,KAAK;AAAA,IACb,YAAY,QAAQ,cAAc;AAAA,IAClC,gBAAgB;AAAA;AAAA,IAEhB,aAAa,cAAA;AAAA,EAAc,CAC5B;AACD,QAAM,UAAU,oBAAoB,IAAI,KAAK;AAAA,IAC3C,QAAQ;AAAA,IACR,SAAS,IAAI;AAAA,IACb,aAAa;AAAA,EAAA,CACd;AAGD,UAAQ,MAAM,MAAM,MAAS;AAC7B,QAAM,SAA2B,EAAE,KAAK,IAAI,KAAK,KAAK,IAAI,KAAK,SAAS,IAAI,SAAS,QAAA;AACrF,kBAAgB,MAAM;AACtB,SAAO;AACT;AAGO,SAAS,sBAAsB,QAAuD;AAC3F,MAAI,CAAC,OAAQ,QAAO;AACpB,QAAM,OAAO,CAAC,SAAgC,OAAO,aAAa,QAAQ,IAAI,EAAE;AAChF,QAAM,WAAW,KAAK,WAAW;AACjC,QAAM,UAAU,KAAK,UAAU;AAC/B,MAAI,CAAC,YAAY,CAAC,QAAS,QAAO;AAClC,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA,SAAS,KAAK,SAAS;AAAA,IACvB,QAAQ,KAAK,QAA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AAI;IAQtD;;;;OAIG;IACH,cAAc,CAAC,OAAO,EAAE;QACtB,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,YAAY,CAAC,EAAE,MAAM,CAAC;QACtB,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,cAAc,CAAC,EAAE,MAAM,CAAC;QACxB,UAAU,CAAC,EAAE,MAAM,CAAC;KACrB,GAAG,IAAI;IAoCR;8EAC0E;IAC1E,gBAAgB,CAAC,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI;IAI3D;;;;;;;;;;;;;;OAcG;IACH,sBAAsB,CAAC,UAAU,EAAE;QACjC,SAAS,EAAE,CAAC,OAAO,EAAE,CAAC,GAAG,EAAE;YAAE,IAAI,CAAC,EAAE,MAAM,CAAC;YAAC,CAAC,CAAC,EAAE,MAAM,GAAG,OAAO,CAAA;SAAE,KAAK,IAAI,KAAK,MAAM,IAAI,CAAC;KAC5F,GAAG,MAAM,IAAI;YAkBA,KAAK;CAoGpB"}
@@ -0,0 +1,216 @@
1
+ import { p as previewAsOfToken, S as Storage, r as redactUrl } from "./storage-D5jp9bO-.mjs";
2
+ const RETURNING_MARKER_KEY = "aegis_returning_user";
3
+ const SESSION_VERDICT_KEY = "aegis_new_visitor_session";
4
+ let cachedVerdict = null;
5
+ function readSessionVerdict() {
6
+ try {
7
+ if (typeof sessionStorage === "undefined") return null;
8
+ const stored = sessionStorage.getItem(SESSION_VERDICT_KEY);
9
+ if (stored === "1") return true;
10
+ if (stored === "0") return false;
11
+ return null;
12
+ } catch {
13
+ return null;
14
+ }
15
+ }
16
+ function writeSessionVerdict(verdict) {
17
+ try {
18
+ if (typeof sessionStorage === "undefined") return;
19
+ sessionStorage.setItem(SESSION_VERDICT_KEY, verdict ? "1" : "0");
20
+ } catch {
21
+ }
22
+ }
23
+ function readMarkerVerdict() {
24
+ try {
25
+ if (typeof localStorage === "undefined") return false;
26
+ return localStorage.getItem(RETURNING_MARKER_KEY) === null;
27
+ } catch {
28
+ return false;
29
+ }
30
+ }
31
+ function isNewVisitor() {
32
+ if (cachedVerdict !== null) return cachedVerdict;
33
+ const sessionVerdict = readSessionVerdict();
34
+ if (sessionVerdict !== null) {
35
+ cachedVerdict = sessionVerdict;
36
+ return cachedVerdict;
37
+ }
38
+ cachedVerdict = readMarkerVerdict();
39
+ writeSessionVerdict(cachedVerdict);
40
+ return cachedVerdict;
41
+ }
42
+ function markReturningVisitor() {
43
+ isNewVisitor();
44
+ try {
45
+ if (typeof localStorage === "undefined") return;
46
+ localStorage.setItem(RETURNING_MARKER_KEY, "1");
47
+ } catch {
48
+ }
49
+ }
50
+ const KNOWN_SURFACES = /* @__PURE__ */ new Set([
51
+ "bill",
52
+ "storefront_catalog",
53
+ "storefront_rewards",
54
+ "storefront_feedback",
55
+ "storefront_reviews",
56
+ "storefront_members",
57
+ "storefront_orders",
58
+ "storefront_account",
59
+ "storefront_referrals",
60
+ "external_website",
61
+ "external_mobile_screen"
62
+ ]);
63
+ function normalizePageContext(surface, screen) {
64
+ const s = surface && KNOWN_SURFACES.has(surface) ? surface : null;
65
+ const sc = screen || surface || null;
66
+ return { surface: s, screen: sc && sc !== "page_view" ? sc : null };
67
+ }
68
+ function readAnonIdFromStorage() {
69
+ if (typeof document === "undefined") return void 0;
70
+ try {
71
+ const storage = new Storage();
72
+ return storage.get("anon_id") ?? void 0;
73
+ } catch {
74
+ return void 0;
75
+ }
76
+ }
77
+ function detectDeviceType() {
78
+ if (typeof navigator === "undefined") return "desktop";
79
+ const ua = navigator.userAgent;
80
+ if (/Mobi|Android/i.test(ua)) return "mobile";
81
+ if (/iPad|Tablet/i.test(ua)) return "tablet";
82
+ return "desktop";
83
+ }
84
+ function readABAssignments() {
85
+ try {
86
+ if (typeof localStorage === "undefined") return {};
87
+ return JSON.parse(localStorage.getItem("aegis_ab_assignments") || "{}");
88
+ } catch {
89
+ return {};
90
+ }
91
+ }
92
+ function currentPageUrl() {
93
+ if (typeof window === "undefined" || !window.location) return null;
94
+ return redactUrl((window.location.pathname || "") + (window.location.search || ""));
95
+ }
96
+ function cartKeyPartOf(ids) {
97
+ return ids === null ? "-" : [...ids].sort().join(",");
98
+ }
99
+ function activeRequestKey(ctx) {
100
+ const url = currentPageUrl() ?? "/";
101
+ return [url, ctx.surface ?? "", ctx.screen ?? "", ctx.locationId ?? "", cartKeyPartOf(ctx.cartProductIds)].join("|");
102
+ }
103
+ function normalizeApiHost(apiHost) {
104
+ return apiHost.replace(/\/+$/, "");
105
+ }
106
+ function buildActiveRequest(ctx) {
107
+ const context = new URLSearchParams({
108
+ device_type: detectDeviceType(),
109
+ page_url: currentPageUrl() ?? "/"
110
+ });
111
+ context.set("is_new_user", isNewVisitor() ? "true" : "false");
112
+ if (ctx.surface) context.set("current_surface", ctx.surface);
113
+ if (ctx.screen) context.set("current_screen", ctx.screen);
114
+ if (ctx.locationId) context.set("location_id", ctx.locationId);
115
+ if (ctx.cartProductIds !== null) context.set("cart_product_ids", ctx.cartProductIds.join(","));
116
+ const previewAsOf = previewAsOfToken();
117
+ if (previewAsOf) context.set("preview_as_of", previewAsOf);
118
+ if (ctx.previewOnly) context.set("preview", "1");
119
+ const headers = {
120
+ "X-Aegis-Write-Key": ctx.writeKey,
121
+ "Content-Type": "application/json"
122
+ };
123
+ if (ctx.userId) headers["X-User-ID"] = ctx.userId;
124
+ if (ctx.contactId) headers["X-Contact-ID"] = ctx.contactId;
125
+ if (ctx.contactId && ctx.contactToken) headers["X-Contact-Token"] = ctx.contactToken;
126
+ if (ctx.organizationId) headers["X-Organization-ID"] = ctx.organizationId;
127
+ if (ctx.propertyId) headers["X-Property-Id"] = ctx.propertyId;
128
+ const abAssignments = readABAssignments();
129
+ if (Object.keys(abAssignments).length > 0) {
130
+ headers["X-AB-Assignments"] = btoa(JSON.stringify(abAssignments));
131
+ }
132
+ return {
133
+ url: `${normalizeApiHost(ctx.apiHost)}/v1/in-app/active?${context.toString()}`,
134
+ headers,
135
+ key: activeRequestKey(ctx)
136
+ };
137
+ }
138
+ const ACTIVE_BOOT_GLOBAL = "__aegisActiveBoot";
139
+ function readActiveBoot() {
140
+ if (typeof window === "undefined") return void 0;
141
+ return window[ACTIVE_BOOT_GLOBAL];
142
+ }
143
+ function storeActiveBoot(handle) {
144
+ if (typeof window === "undefined") return;
145
+ window[ACTIVE_BOOT_GLOBAL] = handle;
146
+ }
147
+ function clearActiveBoot() {
148
+ if (typeof window === "undefined") return;
149
+ delete window[ACTIVE_BOOT_GLOBAL];
150
+ }
151
+ function bootMatches(boot, req) {
152
+ if (boot.key !== req.key || boot.url !== req.url) return false;
153
+ for (const [name, value] of Object.entries(boot.headers)) {
154
+ if (req.headers[name] !== value) return false;
155
+ }
156
+ for (const name of Object.keys(req.headers)) {
157
+ if (!(name in boot.headers) && name !== "X-User-ID") return false;
158
+ }
159
+ return true;
160
+ }
161
+ function takeActiveBoot(req) {
162
+ const boot = readActiveBoot();
163
+ if (!boot) return null;
164
+ clearActiveBoot();
165
+ return bootMatches(boot, req) ? boot.promise : null;
166
+ }
167
+ const SDK_FETCH_ABORT_MS = 800;
168
+ function fetchWithAbort(input, init = {}, timeoutMs = SDK_FETCH_ABORT_MS) {
169
+ const budget = Math.min(timeoutMs, SDK_FETCH_ABORT_MS);
170
+ if (typeof AbortController === "undefined") {
171
+ return fetch(input, init);
172
+ }
173
+ const controller = new AbortController();
174
+ const outer = init.signal;
175
+ if (outer) {
176
+ if (outer.aborted) controller.abort();
177
+ else outer.addEventListener("abort", () => controller.abort(), { once: true });
178
+ }
179
+ const timer = setTimeout(() => controller.abort(), budget);
180
+ return fetch(input, { ...init, signal: controller.signal }).catch((err) => {
181
+ clearTimeout(timer);
182
+ throw err;
183
+ });
184
+ }
185
+ async function fetchWithAbortRetry(input, init = {}, timeoutMs = SDK_FETCH_ABORT_MS) {
186
+ var _a;
187
+ try {
188
+ return await fetchWithAbort(input, init, timeoutMs);
189
+ } catch (err) {
190
+ if (!isAbortError(err) || ((_a = init.signal) == null ? void 0 : _a.aborted)) throw err;
191
+ return fetchWithAbort(input, init, timeoutMs);
192
+ }
193
+ }
194
+ function isAbortError(err) {
195
+ return !!err && typeof err === "object" && (err.name === "AbortError" || err.name === "TimeoutError");
196
+ }
197
+ export {
198
+ KNOWN_SURFACES as K,
199
+ SDK_FETCH_ABORT_MS as S,
200
+ activeRequestKey as a,
201
+ buildActiveRequest as b,
202
+ cartKeyPartOf as c,
203
+ fetchWithAbort as d,
204
+ detectDeviceType as e,
205
+ fetchWithAbortRetry as f,
206
+ readABAssignments as g,
207
+ currentPageUrl as h,
208
+ isNewVisitor as i,
209
+ isAbortError as j,
210
+ markReturningVisitor as m,
211
+ normalizePageContext as n,
212
+ readAnonIdFromStorage as r,
213
+ storeActiveBoot as s,
214
+ takeActiveBoot as t
215
+ };
216
+ //# sourceMappingURL=fetch-abort-Bs-Stg-I.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fetch-abort-Bs-Stg-I.mjs","sources":["../src/utils/visitor.ts","../src/inapp/active-request.ts","../src/utils/fetch-abort.ts"],"sourcesContent":["/**\n * New-visitor verdict — the ONE reader and writer of the returning-visitor\n * marker (2026-09-13).\n *\n * `/v1/in-app/active` and `/v1/sdk/prefetch-bundle` both take `is_new_user`,\n * and the server drops any campaign whose `display_rules.show_to_new_users_only`\n * is set when it arrives false. The SDK used to write `aegis_returning_user=1`\n * at the top of `AegisInAppManager.initialize()` and read it afterwards, inside\n * the fetch — so the read always saw its own write, every fetch said\n * `is_new_user=false`, and a new-users-only campaign could never be served.\n *\n * The rule this module enforces: the marker is read ONCE, before anything\n * writes it, and the verdict is held for the whole browsing session.\n *\n * - `isNewVisitor()` resolves the verdict on first call and caches it in\n * memory (this page load) and in sessionStorage (later page loads in the\n * same tab session), so every fetch in a session sends the same value and\n * the verdict does not flip after the marker is written.\n * - `markReturningVisitor()` is the only writer. It resolves the verdict\n * first, so no call order can make the read see the write.\n *\n * Storage unavailable (SSR, blocked site data, a browser that throws on\n * access): the verdict is RETURNING (`false`). \"New\" is a positive claim that\n * unlocks first-visit-only messages; when the SDK cannot remember a visit it\n * cannot prove one never happened, and because the marker can never be saved,\n * answering \"new\" would re-show a first-visit message on every page of every\n * visit forever. `false` is also what the server assumes when the parameter is\n * absent, so an unknown visitor reads the same on both sides.\n */\n\nconst RETURNING_MARKER_KEY = 'aegis_returning_user';\nconst SESSION_VERDICT_KEY = 'aegis_new_visitor_session';\n\nlet cachedVerdict: boolean | null = null;\n\nfunction readSessionVerdict(): boolean | null {\n try {\n if (typeof sessionStorage === 'undefined') return null;\n const stored = sessionStorage.getItem(SESSION_VERDICT_KEY);\n if (stored === '1') return true;\n if (stored === '0') return false;\n return null;\n } catch {\n return null;\n }\n}\n\nfunction writeSessionVerdict(verdict: boolean): void {\n try {\n if (typeof sessionStorage === 'undefined') return;\n sessionStorage.setItem(SESSION_VERDICT_KEY, verdict ? '1' : '0');\n } catch {\n // sessionStorage blocked — the in-memory cache still holds this page load\n }\n}\n\nfunction readMarkerVerdict(): boolean {\n try {\n if (typeof localStorage === 'undefined') return false;\n return localStorage.getItem(RETURNING_MARKER_KEY) === null;\n } catch {\n return false;\n }\n}\n\n/**\n * Whether this browsing session belongs to a visitor the SDK has never seen\n * before. Stable for the whole session; see the module doc for the default\n * when storage is unavailable.\n */\nexport function isNewVisitor(): boolean {\n if (cachedVerdict !== null) return cachedVerdict;\n const sessionVerdict = readSessionVerdict();\n if (sessionVerdict !== null) {\n cachedVerdict = sessionVerdict;\n return cachedVerdict;\n }\n cachedVerdict = readMarkerVerdict();\n writeSessionVerdict(cachedVerdict);\n return cachedVerdict;\n}\n\n/**\n * Record that this visitor has now been seen, so the NEXT session reads as\n * returning. Resolves the current session's verdict before writing.\n */\nexport function markReturningVisitor(): void {\n isNewVisitor();\n try {\n if (typeof localStorage === 'undefined') return;\n localStorage.setItem(RETURNING_MARKER_KEY, '1');\n } catch {\n // storage blocked — nothing to remember; the verdict stays as resolved\n }\n}\n\n/** Test seam: forget the in-memory verdict, as a fresh page load would. */\nexport function resetVisitorVerdictCacheForTests(): void {\n cachedVerdict = null;\n}\n","/**\n * The ONE builder for the `/v1/in-app/active` request (Aman 2026-11-19).\n *\n * `AegisInAppManager.refreshCampaigns()` and the early-boot script\n * (`@active-reach/web-sdk/boot`, src/boot.ts) build the SAME URL, headers and\n * request key through this module, so a response the boot script started\n * before the SDK loaded is exactly the one the manager would have asked for,\n * and the manager adopts it instead of asking again. Never a second builder.\n *\n * The request key (`activeRequestKey`) is the page context the answer is for:\n * redacted page URL + surface + screen + outlet + cart ids. Identity and the\n * write key travel in headers and are matched separately when a boot answer is\n * adopted (`takeActiveBoot`).\n */\nimport { redactUrl } from '../utils/redact-url';\nimport { isNewVisitor } from '../utils/visitor';\nimport { previewAsOfToken } from '../utils/preview-as-of';\nimport { Storage } from '../utils/storage';\n\n/** The logical surfaces a host may declare (aegis.page(name) / config.surface). */\nexport const KNOWN_SURFACES: ReadonlySet<string> = new Set([\n 'bill',\n 'storefront_catalog',\n 'storefront_rewards',\n 'storefront_feedback',\n 'storefront_reviews',\n 'storefront_members',\n 'storefront_orders',\n 'storefront_account',\n 'storefront_referrals',\n 'external_website',\n 'external_mobile_screen',\n]);\n\nexport interface ActiveRequestContext {\n apiHost: string;\n writeKey: string;\n /** The visitor's anonymous id (analytics `anon_id`) or the host's user id. */\n userId?: string;\n contactId?: string;\n contactToken?: string;\n organizationId?: string;\n propertyId?: string;\n surface: string | null;\n screen: string | null;\n locationId: string | null;\n /** `null` = no cart known (param omitted); `[]` = an empty cart (sent empty). */\n cartProductIds: string[] | null;\n previewOnly: boolean;\n}\n\nexport interface ActiveRequest {\n url: string;\n headers: Record<string, string>;\n key: string;\n}\n\n/** The page context a host declares before init, normalised exactly as the\n * manager's constructor records it: only a known surface sets the surface,\n * the screen falls back to the surface, and `page_view` is no screen. */\nexport function normalizePageContext(\n surface: string | null | undefined,\n screen: string | null | undefined,\n): { surface: string | null; screen: string | null } {\n const s = surface && KNOWN_SURFACES.has(surface) ? surface : null;\n const sc = screen || surface || null;\n return { surface: s, screen: sc && sc !== 'page_view' ? sc : null };\n}\n\n/** The visitor's anonymous id as the analytics SDK stores it (`anon_id`). */\nexport function readAnonIdFromStorage(): string | undefined {\n if (typeof document === 'undefined') return undefined;\n try {\n const storage = new Storage();\n return storage.get('anon_id') ?? undefined;\n } catch {\n return undefined;\n }\n}\n\nexport function detectDeviceType(): 'mobile' | 'desktop' | 'tablet' {\n if (typeof navigator === 'undefined') return 'desktop';\n const ua = navigator.userAgent;\n if (/Mobi|Android/i.test(ua)) return 'mobile';\n if (/iPad|Tablet/i.test(ua)) return 'tablet';\n return 'desktop';\n}\n\nexport function readABAssignments(): Record<string, string> {\n try {\n if (typeof localStorage === 'undefined') return {};\n return JSON.parse(localStorage.getItem('aegis_ab_assignments') || '{}');\n } catch {\n return {};\n }\n}\n\n/** The redacted page URL the request sends as `page_url` (null outside a window). */\nexport function currentPageUrl(): string | null {\n if (typeof window === 'undefined' || !window.location) return null;\n return redactUrl((window.location.pathname || '') + (window.location.search || ''));\n}\n\n/** The cart ids as a request-key part: sorted + deduped so a reorder is not a\n * change; `-` = no cart known, distinct from `` = an empty cart. */\nexport function cartKeyPartOf(ids: string[] | null): string {\n return ids === null ? '-' : [...ids].sort().join(',');\n}\n\nexport function activeRequestKey(\n ctx: Pick<ActiveRequestContext, 'surface' | 'screen' | 'locationId' | 'cartProductIds'>,\n): string {\n const url = currentPageUrl() ?? '/';\n return [url, ctx.surface ?? '', ctx.screen ?? '', ctx.locationId ?? '', cartKeyPartOf(ctx.cartProductIds)].join('|');\n}\n\n/** The api host without a trailing slash (one spelling for the request URL). */\nexport function normalizeApiHost(apiHost: string): string {\n return apiHost.replace(/\\/+$/, '');\n}\n\nexport function buildActiveRequest(ctx: ActiveRequestContext): ActiveRequest {\n const context = new URLSearchParams({\n device_type: detectDeviceType(),\n page_url: currentPageUrl() ?? '/',\n });\n // Geo is resolved server-side from IP. The new-visitor verdict is fixed for\n // the session (utils/visitor.ts), so every request in a session sends the\n // same value, the boot script's included.\n context.set('is_new_user', isNewVisitor() ? 'true' : 'false');\n if (ctx.surface) context.set('current_surface', ctx.surface);\n if (ctx.screen) context.set('current_screen', ctx.screen);\n if (ctx.locationId) context.set('location_id', ctx.locationId);\n if (ctx.cartProductIds !== null) context.set('cart_product_ids', ctx.cartProductIds.join(','));\n const previewAsOf = previewAsOfToken();\n if (previewAsOf) context.set('preview_as_of', previewAsOf);\n if (ctx.previewOnly) context.set('preview', '1');\n\n const headers: Record<string, string> = {\n 'X-Aegis-Write-Key': ctx.writeKey,\n 'Content-Type': 'application/json',\n };\n if (ctx.userId) headers['X-User-ID'] = ctx.userId;\n if (ctx.contactId) headers['X-Contact-ID'] = ctx.contactId;\n if (ctx.contactId && ctx.contactToken) headers['X-Contact-Token'] = ctx.contactToken;\n if (ctx.organizationId) headers['X-Organization-ID'] = ctx.organizationId;\n if (ctx.propertyId) headers['X-Property-Id'] = ctx.propertyId;\n const abAssignments = readABAssignments();\n if (Object.keys(abAssignments).length > 0) {\n headers['X-AB-Assignments'] = btoa(JSON.stringify(abAssignments));\n }\n // The host is normalised HERE, for the manager and the boot script alike: a\n // configured `https://api.example/` and `https://api.example` build the same\n // URL, so a boot answer is adopted either way (portal audit 2026-11-20).\n return {\n url: `${normalizeApiHost(ctx.apiHost)}/v1/in-app/active?${context.toString()}`,\n headers,\n key: activeRequestKey(ctx),\n };\n}\n\n/** What the early-boot script leaves on `window.__aegisActiveBoot`. */\nexport interface ActiveBootHandle {\n key: string;\n url: string;\n headers: Record<string, string>;\n promise: Promise<Response>;\n}\n\nexport const ACTIVE_BOOT_GLOBAL = '__aegisActiveBoot';\n\ntype BootWindow = Window & { [ACTIVE_BOOT_GLOBAL]?: ActiveBootHandle };\n\nexport function readActiveBoot(): ActiveBootHandle | undefined {\n if (typeof window === 'undefined') return undefined;\n return (window as BootWindow)[ACTIVE_BOOT_GLOBAL];\n}\n\nexport function storeActiveBoot(handle: ActiveBootHandle): void {\n if (typeof window === 'undefined') return;\n (window as BootWindow)[ACTIVE_BOOT_GLOBAL] = handle;\n}\n\nexport function clearActiveBoot(): void {\n if (typeof window === 'undefined') return;\n delete (window as BootWindow)[ACTIVE_BOOT_GLOBAL];\n}\n\n/** A boot answer is the manager's own when it asked the same URL with the same\n * headers. The one header the manager may ADD is `X-User-ID`: on a first\n * visit the analytics SDK mints the anonymous id after the boot script ran,\n * and the server holds no state for a brand-new id, so the answer is the same. */\nexport function bootMatches(boot: Pick<ActiveBootHandle, 'key' | 'url' | 'headers'>, req: ActiveRequest): boolean {\n if (boot.key !== req.key || boot.url !== req.url) return false;\n for (const [name, value] of Object.entries(boot.headers)) {\n if (req.headers[name] !== value) return false;\n }\n for (const name of Object.keys(req.headers)) {\n if (!(name in boot.headers) && name !== 'X-User-ID') return false;\n }\n return true;\n}\n\n/** Adopt the early-boot answer for `req` (the global is cleared either way:\n * a boot answer is for the page's FIRST request only). */\nexport function takeActiveBoot(req: ActiveRequest): Promise<Response> | null {\n const boot = readActiveBoot();\n if (!boot) return null;\n clearActiveBoot();\n return bootMatches(boot, req) ? boot.promise : null;\n}\n","/**\n * The SDK's client abort (Aman 11-01, Q3 speed ruling / WP17 L14): SDK and\n * rail reads answer p95 < 300 ms, and the client gives up at 800 ms so a slow\n * gateway never holds the host page. Each caller then falls back (last config,\n * last bundle, last good rail; bootstrap raises) and never blocks render or\n * checkout.\n *\n * The timer keeps running after the headers arrive, so the BODY read is inside\n * the same 800 ms budget: a body still streaming at 800 ms rejects with an\n * AbortError, which every caller already treats as a failed fetch. An abort\n * after the body was read is a no-op.\n *\n * Uses an AbortController + setTimeout rather than `AbortSignal.timeout`\n * (Safari < 16 lacks it). A caller-supplied signal still aborts the request.\n *\n * Guard: tests/drift-sdk-fetch-abort.test.ts (every listed SDK read passes\n * through here with a budget <= 800 ms).\n */\nexport const SDK_FETCH_ABORT_MS = 800;\n\nexport function fetchWithAbort(\n input: string,\n init: RequestInit = {},\n timeoutMs: number = SDK_FETCH_ABORT_MS\n): Promise<Response> {\n const budget = Math.min(timeoutMs, SDK_FETCH_ABORT_MS);\n if (typeof AbortController === 'undefined') {\n return fetch(input, init);\n }\n const controller = new AbortController();\n const outer = init.signal;\n if (outer) {\n if (outer.aborted) controller.abort();\n else outer.addEventListener('abort', () => controller.abort(), { once: true });\n }\n const timer = setTimeout(() => controller.abort(), budget);\n return fetch(input, { ...init, signal: controller.signal }).catch((err: unknown) => {\n clearTimeout(timer);\n throw err;\n });\n}\n\n/**\n * A BOOT read: the first answer a page gets from an endpoint, with nothing to\n * fall back on (no last bundle, no saved rails, no cookie). On a cold\n * connection the 800 ms budget is spent on DNS + TCP + TLS + the CORS\n * preflight, and the browser aborts before the real request ever leaves\n * (measured on the Cake House store 2026-11-19: two `OPTIONS /v1/in-app/active`\n * reached the gateway, no GET followed, and the page stayed empty until a\n * reload). The second try rides the warm connection and lands in 100-250 ms,\n * so one retry on an ABORT (never on an HTTP status or a network error) is\n * the whole fix. Budget: 800 ms per try, one retry on abort only (Aman\n * 2026-11-20; the 11-01 ruling reads \"per try\", no cap on the total). A\n * caller's own aborted signal is honoured and never retried. Readers that already hold an answer\n * (a later poll) keep using fetchWithAbort: a stale answer beats a late one.\n *\n * Guard: tests/drift-sdk-fetch-abort.test.ts (the boot reads use this helper).\n */\nexport async function fetchWithAbortRetry(\n input: string,\n init: RequestInit = {},\n timeoutMs: number = SDK_FETCH_ABORT_MS\n): Promise<Response> {\n try {\n return await fetchWithAbort(input, init, timeoutMs);\n } catch (err) {\n if (!isAbortError(err) || init.signal?.aborted) throw err;\n return fetchWithAbort(input, init, timeoutMs);\n }\n}\n\n/** True when `err` is the abort raised by fetchWithAbort's budget (or any abort). */\nexport function isAbortError(err: unknown): boolean {\n return (\n !!err &&\n typeof err === 'object' &&\n ((err as { name?: string }).name === 'AbortError' || (err as { name?: string }).name === 'TimeoutError')\n );\n}\n"],"names":[],"mappings":";AA8BA,MAAM,uBAAuB;AAC7B,MAAM,sBAAsB;AAE5B,IAAI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BACpB,OACA,OAAoB,CAAA,GACpB,YAAoB,oBACD;;AACnB,MAAI;AACF,WAAO,MAAM,eAAe,OAAO,MAAM,SAAS;AAAA,EACpD,SAAS,KAAK;AACZ,QAAI,CAAC,aAAa,GAAG,OAAK,UAAK,WAAL,mBAAa,SAAS,OAAM;AACtD,WAAO,eAAe,OAAO,MAAM,SAAS;AAAA,EAC9C;AACF;AAGO,SAAS,aAAa,KAAuB;AAClD,SACE,CAAC,CAAC,OACF,OAAO,QAAQ,aACb,IAA0B,SAAS,gBAAiB,IAA0B,SAAS;AAE7F;"}
@@ -290,6 +290,9 @@ export declare class AegisInAppManager {
290
290
  private lastActiveRequestKey;
291
291
  /** The page context a `/v1/in-app/active` request is built from now. */
292
292
  private activeRequestKey;
293
+ /** Everything the shared /active builder needs (inapp/active-request.ts):
294
+ * the ONE place this manager's request is described. */
295
+ private requestContext;
293
296
  /** The cart ids as a request-key part: sorted + deduped so a reorder is not a
294
297
  * change; `-` = no cart known, distinct from `` = an empty cart. */
295
298
  private cartKeyPart;
@@ -422,7 +425,9 @@ export declare class AegisInAppManager {
422
425
  private connectSSE;
423
426
  private disconnectSSE;
424
427
  private attemptReconnect;
428
+ private inflightActive;
425
429
  private refreshCampaigns;
430
+ private refreshCampaignsNow;
426
431
  private static readonly SERVED_DEDUP_PREFIX;
427
432
  private emitServedEvents;
428
433
  private detectDeviceType;
@@ -480,6 +485,8 @@ export declare class AegisInAppManager {
480
485
  /** True once an /active answered: from then on a shell whose slot has no
481
486
  * winner collapses (slot-shells.ts). */
482
487
  private campaignsLoaded;
488
+ private activeETag;
489
+ private activeETagKey;
483
490
  /** The page context (`activeRequestKey()`) the cached campaigns answer. A
484
491
  * shell may collapse only on campaigns that answer the CURRENT page: after
485
492
  * an SPA navigation the cache is the previous page's until /active answers. */
@@ -693,6 +700,7 @@ export declare class AegisInAppManager {
693
700
  /**
694
701
  * §7.13.I — embedded profile FORM. Renders one input per `form_fields` entry
695
702
  * and, on submit, POSTs `{response_type:'form', payload:{fields:{key:value}}}`
703
+ * (plus `marketing_consent: true` when the Q5 permission box was ticked)
696
704
  * to `/in-app/responses` — the cell-plane enrichment writes the mapped answers
697
705
  * back onto the contact. Keyed by each field's `key` so it matches the
698
706
  * campaign's field→contact map.
@@ -1 +1 @@
1
- {"version":3,"file":"AegisInAppManager.d.ts","sourceRoot":"","sources":["../../src/inapp/AegisInAppManager.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,KAAK,EAAiB,SAAS,EAAE,MAAM,aAAa,CAAC;AAC5D,OAAO,EAIL,KAAK,WAAW,EAEjB,MAAM,WAAW,CAAC;AAyCnB,OAAO,EAA+B,KAAK,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAI7F,OAAO,EASL,KAAK,SAAS,EACf,MAAM,eAAe,CAAC;AAsDvB,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EACA,OAAO,GACP,QAAQ,GACR,SAAS,GACT,aAAa,GACb,mBAAmB,GACnB,OAAO,GACP,KAAK,GACL,OAAO,GAEP,SAAS,GAET,gBAAgB,GAChB,YAAY,GACZ,cAAc,GACd,gBAAgB,GAChB,wBAAwB,GAGxB,iBAAiB,GACjB,aAAa,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE;QACV,eAAe,CAAC,EAAE,MAAM,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CAAC,gBAAgB;IA2IxB,OAAO,CAAC,sBAAsB;IA0K9B,OAAO,CAAC,WAAW;IAgInB,OAAO,CAAC,aAAa;IAgBrB,OAAO,CAAC,SAAS;IA0QjB,OAAO,CAAC,YAAY;IAWpB,OAAO,CAAC,WAAW;IASnB;;;;;OAKG;IACH,OAAO,CAAC,kBAAkB;IAW1B,OAAO,CAAC,aAAa;IA6PrB;;;0BAGsB;IACtB,OAAO,CAAC,aAAa;IAmCrB;;;;;;;;;;;;;;;;OAgBG;IACH,OAAO,CAAC,aAAa;IA6IrB;;+EAE2E;IAC3E,OAAO,CAAC,YAAY;IAyCpB;;;uDAGmD;IACnD,OAAO,CAAC,UAAU;IAWlB;+EAC2E;IAC3E,OAAO,CAAC,WAAW;IAmBnB,OAAO,CAAC,kBAAkB;IAiI1B,OAAO,CAAC,WAAW;IAUnB,OAAO,CAAC,aAAa;IAqBrB;;;;;;;;;;;OAWG;YACW,UAAU;IAyKxB,+EAA+E;IAC/E,OAAO,CAAC,qBAAqB,CAA6B;IAC1D,+EAA+E;IAC/E,OAAO,CAAC,WAAW,CAAqB;IACxC,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,oBAAoB,CAAQ;IAEpD;;;;;;;;;OASG;YACW,mBAAmB;IAqDjC,OAAO,CAAC,GAAG;IAMX,OAAO,CAAC,OAAO,CAAC,EAAE;QAAE,YAAY,CAAC,EAAE,OAAO,CAAA;KAAE,GAAG,IAAI;CAmFpD"}
@@ -0,0 +1,63 @@
1
+ /** The logical surfaces a host may declare (aegis.page(name) / config.surface). */
2
+ export declare const KNOWN_SURFACES: ReadonlySet<string>;
3
+ export interface ActiveRequestContext {
4
+ apiHost: string;
5
+ writeKey: string;
6
+ /** The visitor's anonymous id (analytics `anon_id`) or the host's user id. */
7
+ userId?: string;
8
+ contactId?: string;
9
+ contactToken?: string;
10
+ organizationId?: string;
11
+ propertyId?: string;
12
+ surface: string | null;
13
+ screen: string | null;
14
+ locationId: string | null;
15
+ /** `null` = no cart known (param omitted); `[]` = an empty cart (sent empty). */
16
+ cartProductIds: string[] | null;
17
+ previewOnly: boolean;
18
+ }
19
+ export interface ActiveRequest {
20
+ url: string;
21
+ headers: Record<string, string>;
22
+ key: string;
23
+ }
24
+ /** The page context a host declares before init, normalised exactly as the
25
+ * manager's constructor records it: only a known surface sets the surface,
26
+ * the screen falls back to the surface, and `page_view` is no screen. */
27
+ export declare function normalizePageContext(surface: string | null | undefined, screen: string | null | undefined): {
28
+ surface: string | null;
29
+ screen: string | null;
30
+ };
31
+ /** The visitor's anonymous id as the analytics SDK stores it (`anon_id`). */
32
+ export declare function readAnonIdFromStorage(): string | undefined;
33
+ export declare function detectDeviceType(): 'mobile' | 'desktop' | 'tablet';
34
+ export declare function readABAssignments(): Record<string, string>;
35
+ /** The redacted page URL the request sends as `page_url` (null outside a window). */
36
+ export declare function currentPageUrl(): string | null;
37
+ /** The cart ids as a request-key part: sorted + deduped so a reorder is not a
38
+ * change; `-` = no cart known, distinct from `` = an empty cart. */
39
+ export declare function cartKeyPartOf(ids: string[] | null): string;
40
+ export declare function activeRequestKey(ctx: Pick<ActiveRequestContext, 'surface' | 'screen' | 'locationId' | 'cartProductIds'>): string;
41
+ /** The api host without a trailing slash (one spelling for the request URL). */
42
+ export declare function normalizeApiHost(apiHost: string): string;
43
+ export declare function buildActiveRequest(ctx: ActiveRequestContext): ActiveRequest;
44
+ /** What the early-boot script leaves on `window.__aegisActiveBoot`. */
45
+ export interface ActiveBootHandle {
46
+ key: string;
47
+ url: string;
48
+ headers: Record<string, string>;
49
+ promise: Promise<Response>;
50
+ }
51
+ export declare const ACTIVE_BOOT_GLOBAL = "__aegisActiveBoot";
52
+ export declare function readActiveBoot(): ActiveBootHandle | undefined;
53
+ export declare function storeActiveBoot(handle: ActiveBootHandle): void;
54
+ export declare function clearActiveBoot(): void;
55
+ /** A boot answer is the manager's own when it asked the same URL with the same
56
+ * headers. The one header the manager may ADD is `X-User-ID`: on a first
57
+ * visit the analytics SDK mints the anonymous id after the boot script ran,
58
+ * and the server holds no state for a brand-new id, so the answer is the same. */
59
+ export declare function bootMatches(boot: Pick<ActiveBootHandle, 'key' | 'url' | 'headers'>, req: ActiveRequest): boolean;
60
+ /** Adopt the early-boot answer for `req` (the global is cleared either way:
61
+ * a boot answer is for the page's FIRST request only). */
62
+ export declare function takeActiveBoot(req: ActiveRequest): Promise<Response> | null;
63
+ //# sourceMappingURL=active-request.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"active-request.d.ts","sourceRoot":"","sources":["../../src/inapp/active-request.ts"],"names":[],"mappings":"AAmBA,mFAAmF;AACnF,eAAO,MAAM,cAAc,EAAE,WAAW,CAAC,MAAM,CAY7C,CAAC;AAEH,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,8EAA8E;IAC9E,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,iFAAiF;IACjF,cAAc,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;IAChC,WAAW,EAAE,OAAO,CAAC;CACtB;AAED,MAAM,WAAW,aAAa;IAC5B,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAChC,GAAG,EAAE,MAAM,CAAC;CACb;AAED;;0EAE0E;AAC1E,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EAClC,MAAM,EAAE,MAAM,GAAG,IAAI,GAAG,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I,CAAC,gBAAgB,EAAE,KAAK,GAAG,KAAK,GAAG,SAAS,CAAC,EAAE,GAAG,EAAE,aAAa,GAAG,OAAO,CAShH;AAED;2DAC2D;AAC3D,wBAAgB,cAAc,CAAC,GAAG,EAAE,aAAa,GAAG,OAAO,CAAC,QAAQ,CAAC,GAAG,IAAI,CAK3E"}
@@ -0,0 +1,45 @@
1
+ /**
2
+ * In-app FORM "Ask permission to send offers" tick box (In-app redesign Q5,
3
+ * Aman 2026-11-19). The SDK half of ONE contract:
4
+ *
5
+ * - the campaign switch is `interactive_config.ask_marketing_consent`
6
+ * (cell `InteractiveConfig.ask_marketing_consent`, web schema
7
+ * `ask_marketing_consent: z.boolean()`);
8
+ * - the submit carries the customer's OWN tick as
9
+ * `payload.marketing_consent: true`, read by the cell at
10
+ * `promo_consent.in_app_form_ticked` through `IN_APP_FORM_CONSENT_KEY`
11
+ * (apps/cell-plane/app/services/commerce/promo_consent.py). An unticked box
12
+ * sends NO key: the cell writes nothing for a missing key, so permission is
13
+ * never assumed from a submit.
14
+ *
15
+ * The row is appended by the ONE form body renderer
16
+ * (`AegisInAppManager._buildFormBody`), so every form that posts through
17
+ * `submitFormResponse` (embedded form slot, multi_step_form steps-as-fields,
18
+ * the overlay form modal) gets the same box.
19
+ */
20
+ /** The payload key the cell reads. Mirrors promo_consent.IN_APP_FORM_CONSENT_KEY. */
21
+ export declare const MARKETING_CONSENT_KEY = "marketing_consent";
22
+ /** Customer-facing words, always (the campaign has a switch, not a label field). */
23
+ export declare const MARKETING_CONSENT_DEFAULT_LABEL = "Send me offers on WhatsApp, SMS and email";
24
+ export declare const MARKETING_CONSENT_ROW_CLASS = "aegis-in-app-consent";
25
+ export declare const MARKETING_CONSENT_BOX_CLASS = "aegis-in-app-consent-box";
26
+ /** Does this campaign ask the permission question? Only an explicit `true`. */
27
+ export declare function asksMarketingConsent(ic: Record<string, unknown> | undefined | null): boolean;
28
+ /** The label to show: always the SDK default words. */
29
+ export declare function marketingConsentLabel(): string;
30
+ /**
31
+ * The payload the form posts: `{fields}` plus `marketing_consent: true` ONLY
32
+ * when the box was ticked. Unticked (or no box) adds nothing.
33
+ */
34
+ export declare function formPayload(fields: Record<string, string>, marketingConsent: boolean): Record<string, unknown>;
35
+ /**
36
+ * ONE unticked tick box with its label: a real `<label>` wrapping a real
37
+ * `<input type="checkbox">` (a11y: the whole label is the hit target and the
38
+ * input is announced with its text). Styled like the sibling form fields —
39
+ * the campaign's text colour tints the box (`accent-color`) and the label.
40
+ */
41
+ export declare function renderMarketingConsentRow(label: string, text: string, campaignId: string): {
42
+ row: HTMLLabelElement;
43
+ input: HTMLInputElement;
44
+ };
45
+ //# sourceMappingURL=marketing-consent.d.ts.map