@decocms/blocks 8.16.1 → 8.18.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/v8/analytics/client.d.ts +48 -0
- package/dist/v8/analytics/client.d.ts.map +1 -0
- package/dist/v8/analytics/client.js +71 -0
- package/dist/v8/analytics/client.js.map +1 -0
- package/dist/v8/analytics/runtime/modules/click.d.ts +2 -0
- package/dist/v8/analytics/runtime/modules/click.d.ts.map +1 -0
- package/dist/v8/analytics/runtime/modules/click.js +48 -0
- package/dist/v8/analytics/runtime/modules/click.js.map +1 -0
- package/dist/v8/analytics/runtime/modules/commerce.d.ts +2 -0
- package/dist/v8/analytics/runtime/modules/commerce.d.ts.map +1 -0
- package/dist/v8/analytics/runtime/modules/commerce.js +41 -0
- package/dist/v8/analytics/runtime/modules/commerce.js.map +1 -0
- package/dist/v8/analytics/runtime/modules/consent.d.ts +33 -0
- package/dist/v8/analytics/runtime/modules/consent.d.ts.map +1 -0
- package/dist/v8/analytics/runtime/modules/consent.js +154 -0
- package/dist/v8/analytics/runtime/modules/consent.js.map +1 -0
- package/dist/v8/analytics/runtime/modules/deco.d.ts +2 -0
- package/dist/v8/analytics/runtime/modules/deco.d.ts.map +1 -0
- package/dist/v8/analytics/runtime/modules/deco.js +209 -0
- package/dist/v8/analytics/runtime/modules/deco.js.map +1 -0
- package/dist/v8/analytics/runtime/modules/engagement.d.ts +2 -0
- package/dist/v8/analytics/runtime/modules/engagement.d.ts.map +1 -0
- package/dist/v8/analytics/runtime/modules/engagement.js +128 -0
- package/dist/v8/analytics/runtime/modules/engagement.js.map +1 -0
- package/dist/v8/analytics/runtime/modules/errors.d.ts +2 -0
- package/dist/v8/analytics/runtime/modules/errors.d.ts.map +1 -0
- package/dist/v8/analytics/runtime/modules/errors.js +167 -0
- package/dist/v8/analytics/runtime/modules/errors.js.map +1 -0
- package/dist/v8/analytics/runtime/modules/heatmap.d.ts +2 -0
- package/dist/v8/analytics/runtime/modules/heatmap.d.ts.map +1 -0
- package/dist/v8/analytics/runtime/modules/heatmap.js +316 -0
- package/dist/v8/analytics/runtime/modules/heatmap.js.map +1 -0
- package/dist/v8/analytics/runtime/modules/vitals.d.ts +2 -0
- package/dist/v8/analytics/runtime/modules/vitals.d.ts.map +1 -0
- package/dist/v8/analytics/runtime/modules/vitals.js +119 -0
- package/dist/v8/analytics/runtime/modules/vitals.js.map +1 -0
- package/dist/v8/analytics/runtime/src/guards.d.ts +10 -0
- package/dist/v8/analytics/runtime/src/guards.d.ts.map +1 -0
- package/dist/v8/analytics/runtime/src/guards.js +70 -0
- package/dist/v8/analytics/runtime/src/guards.js.map +1 -0
- package/dist/v8/analytics/runtime/src/index.d.ts +2 -0
- package/dist/v8/analytics/runtime/src/index.d.ts.map +1 -0
- package/dist/v8/analytics/runtime/src/index.js +562 -0
- package/dist/v8/analytics/runtime/src/index.js.map +1 -0
- package/dist/v8/analytics/runtime/src/queue.d.ts +15 -0
- package/dist/v8/analytics/runtime/src/queue.d.ts.map +1 -0
- package/dist/v8/analytics/runtime/src/queue.js +36 -0
- package/dist/v8/analytics/runtime/src/queue.js.map +1 -0
- package/dist/v8/analytics/runtime/src/trim.d.ts +13 -0
- package/dist/v8/analytics/runtime/src/trim.d.ts.map +1 -0
- package/dist/v8/analytics/runtime/src/trim.js +38 -0
- package/dist/v8/analytics/runtime/src/trim.js.map +1 -0
- package/dist/v8/analytics/runtime/view/heat-core.d.ts +69 -0
- package/dist/v8/analytics/runtime/view/heat-core.d.ts.map +1 -0
- package/dist/v8/analytics/runtime/view/heat-core.js +314 -0
- package/dist/v8/analytics/runtime/view/heat-core.js.map +1 -0
- package/dist/v8/analytics/runtime/view/view.d.ts +51 -0
- package/dist/v8/analytics/runtime/view/view.d.ts.map +1 -0
- package/dist/v8/analytics/runtime/view/view.js +525 -0
- package/dist/v8/analytics/runtime/view/view.js.map +1 -0
- package/dist/v8/analytics/shared/anchor.d.ts +71 -0
- package/dist/v8/analytics/shared/anchor.d.ts.map +1 -0
- package/dist/v8/analytics/shared/anchor.js +155 -0
- package/dist/v8/analytics/shared/anchor.js.map +1 -0
- package/dist/v8/analytics/shared/contract.d.ts +294 -0
- package/dist/v8/analytics/shared/contract.d.ts.map +1 -0
- package/dist/v8/analytics/shared/contract.js +652 -0
- package/dist/v8/analytics/shared/contract.js.map +1 -0
- package/dist/v8/builtins/data.d.ts +20 -6
- package/dist/v8/builtins/data.d.ts.map +1 -1
- package/dist/v8/builtins/data.js +33 -8
- package/dist/v8/builtins/data.js.map +1 -1
- package/dist/v8/cms.js +2 -2
- package/dist/v8/cms.js.map +1 -1
- package/dist/v8/settings.d.ts +28 -9
- package/dist/v8/settings.d.ts.map +1 -1
- package/dist/v8/settings.js +6 -10
- package/dist/v8/settings.js.map +1 -1
- package/dist/v8/telemetry.d.ts +13 -11
- package/dist/v8/telemetry.d.ts.map +1 -1
- package/dist/v8/telemetry.js +27 -17
- package/dist/v8/telemetry.js.map +1 -1
- package/dist/v8/types.d.ts +7 -3
- package/dist/v8/types.d.ts.map +1 -1
- package/package.json +6 -1
- package/skills/deco-storefront-performance/references/render-location.md +3 -2
- package/skills/deco-v7-to-v8-migration/references/telemetry.md +1 -1
- package/skills/deco-v7-to-v8-migration/scripts/siteSettings.ts +1 -1
- package/src/v8/analytics/client.ts +110 -0
- package/src/v8/analytics/runtime/globals.d.ts +36 -0
- package/src/v8/analytics/runtime/modules/click.ts +54 -0
- package/src/v8/analytics/runtime/modules/commerce.ts +73 -0
- package/src/v8/analytics/runtime/modules/consent.ts +150 -0
- package/src/v8/analytics/runtime/modules/deco.ts +207 -0
- package/src/v8/analytics/runtime/modules/engagement.ts +140 -0
- package/src/v8/analytics/runtime/modules/errors.ts +217 -0
- package/src/v8/analytics/runtime/modules/heatmap.ts +360 -0
- package/src/v8/analytics/runtime/modules/vitals.ts +128 -0
- package/src/v8/analytics/runtime/src/guards.ts +70 -0
- package/src/v8/analytics/runtime/src/index.ts +606 -0
- package/src/v8/analytics/runtime/src/queue.ts +40 -0
- package/src/v8/analytics/runtime/src/trim.ts +39 -0
- package/src/v8/analytics/runtime/view/heat-core.ts +335 -0
- package/src/v8/analytics/runtime/view/view.ts +596 -0
- package/src/v8/analytics/shared/anchor.ts +171 -0
- package/src/v8/analytics/shared/contract.ts +691 -0
- package/src/v8/analytics/tsconfig.json +14 -0
- package/src/v8/builtins/data.ts +44 -9
- package/src/v8/cms.ts +4 -4
- package/src/v8/settings.ts +13 -16
- package/src/v8/telemetry.ts +33 -29
- package/src/v8/types.ts +7 -3
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
/** Adapter for deco storefronts.
|
|
2
|
+
*
|
|
3
|
+
* Two jobs, both about not asking a site to instrument twice: read the experiment
|
|
4
|
+
* assignment the origin already made, and forward the analytics events the framework
|
|
5
|
+
* already dispatches.
|
|
6
|
+
*
|
|
7
|
+
* It reads `deco_segment` rather than the event bus for flags because the cookie is set
|
|
8
|
+
* by the origin before any script runs, so the assignment is on the very first event —
|
|
9
|
+
* including the pageview. Waiting for the bus would attribute the landing pageview to no
|
|
10
|
+
* variant, which is the one event an experiment most needs attributed.
|
|
11
|
+
*/
|
|
12
|
+
import { LIMITS, STOREFRONT_EXP } from "../../shared/contract.js";
|
|
13
|
+
window.__dqRegister?.((enqueue, api) => {
|
|
14
|
+
const setExperiment = api.setExperiment;
|
|
15
|
+
// ---- assignment, from the cookie the origin already set ---------------------
|
|
16
|
+
//
|
|
17
|
+
// deco_segment is base64 of URI-encoded JSON: { active: string[], inactiveDrawn: [] }.
|
|
18
|
+
// It carries flag NAMES and nothing else — see deco/runtime/middleware.ts, which writes
|
|
19
|
+
// it from `flag.value` as a boolean.
|
|
20
|
+
//
|
|
21
|
+
// So both lists matter. `inactiveDrawn` means "evaluated for this visitor and came out
|
|
22
|
+
// false", which IS the control group: recording only the active flags would leave an
|
|
23
|
+
// experiment with a treatment arm and no baseline to compare it against, and a
|
|
24
|
+
// conversion rate with nothing to compare it to is not a result.
|
|
25
|
+
try {
|
|
26
|
+
const raw = document.cookie
|
|
27
|
+
.split(";")
|
|
28
|
+
.map((c) => c.trim())
|
|
29
|
+
.find((c) => c.startsWith("deco_segment="));
|
|
30
|
+
if (raw) {
|
|
31
|
+
const json = JSON.parse(decodeURIComponent(atob(raw.slice("deco_segment=".length))));
|
|
32
|
+
const set = (name, variant) => {
|
|
33
|
+
// Experiment keys allow hyphens; anything else the Worker normalises and flags.
|
|
34
|
+
if (name && name.length <= LIMITS.expKeyLen)
|
|
35
|
+
setExperiment?.(name, variant);
|
|
36
|
+
};
|
|
37
|
+
for (const name of json.active ?? [])
|
|
38
|
+
set(String(name), "on");
|
|
39
|
+
for (const name of json.inactiveDrawn ?? [])
|
|
40
|
+
set(String(name), "off");
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
catch {
|
|
44
|
+
// A malformed cookie is a site problem, not a reason to stop collecting.
|
|
45
|
+
}
|
|
46
|
+
// ---- the side of a Fresh x TanStack split ------------------------------------
|
|
47
|
+
//
|
|
48
|
+
// `withABTesting` keeps the side in `_deco_bucket` as `<side>:<percent>` (`worker:50`), set at
|
|
49
|
+
// the edge before the document reaches the browser, so it too is on the first event. Recorded
|
|
50
|
+
// as the `storefront` experiment with the names the store Worker stamps on what it sends
|
|
51
|
+
// through `EdgeIngest` -- the two halves of the funnel only group together if they agree, and
|
|
52
|
+
// `STOREFRONT_EXP` is where they do. An unknown side is skipped rather than recorded raw: a
|
|
53
|
+
// third variant nobody emits at the edge would be a funnel with no ruler.
|
|
54
|
+
try {
|
|
55
|
+
const raw = document.cookie
|
|
56
|
+
.split(";")
|
|
57
|
+
.map((c) => c.trim())
|
|
58
|
+
.find((c) => c.startsWith(`${STOREFRONT_EXP.cookie}=`));
|
|
59
|
+
const side = raw
|
|
60
|
+
? decodeURIComponent(raw.slice(STOREFRONT_EXP.cookie.length + 1)).split(":")[0]
|
|
61
|
+
: "";
|
|
62
|
+
const variant = STOREFRONT_EXP.variants[side];
|
|
63
|
+
if (variant)
|
|
64
|
+
setExperiment?.(STOREFRONT_EXP.name, variant);
|
|
65
|
+
}
|
|
66
|
+
catch {
|
|
67
|
+
// Same as above: a bad cookie costs the arm, never the collection.
|
|
68
|
+
}
|
|
69
|
+
// ---- events, from the bus the framework already has -------------------------
|
|
70
|
+
//
|
|
71
|
+
// deco dispatches commerce events in the Google Analytics shape. Mapped to our names
|
|
72
|
+
// rather than forwarded verbatim: `add_to_cart` here has a typed value column, and
|
|
73
|
+
// passing GA's nested `ecommerce.items` through as props would put money in a string.
|
|
74
|
+
const NAME_MAP = {
|
|
75
|
+
view_item: "view_item",
|
|
76
|
+
view_item_list: "view_item_list",
|
|
77
|
+
select_item: "select_item",
|
|
78
|
+
add_to_cart: "add_to_cart",
|
|
79
|
+
remove_from_cart: "remove_from_cart",
|
|
80
|
+
begin_checkout: "begin_checkout",
|
|
81
|
+
purchase: "purchase",
|
|
82
|
+
search: "$search",
|
|
83
|
+
view_promotion: "view_promotion",
|
|
84
|
+
select_promotion: "select_promotion",
|
|
85
|
+
};
|
|
86
|
+
/** A storefront can hand the bus its products in one of two shapes, and both are deco's.
|
|
87
|
+
*
|
|
88
|
+
* `items` is the GA4 shape `mapProductToAnalyticsItem` builds. `products` is the schema.org
|
|
89
|
+
* `Product` itself, which the `DECO` adapter of the Azzas tracking SDK expects and builds the
|
|
90
|
+
* GA4 payload from on its own -- the FARM sends every commerce event that way. Reading only
|
|
91
|
+
* `items` stored 94k `add_to_cart` from the FARM in five days with not one item id or value:
|
|
92
|
+
* the event names arrived, so every panel looked instrumented, and nothing said which product.
|
|
93
|
+
*
|
|
94
|
+
* The id follows `mapProductToAnalyticsItem`: `item_id` is `productID` (the SKU), so a site
|
|
95
|
+
* sending either shape lands the same id in `item_ids`. `sku` is the fallback because the
|
|
96
|
+
* lighter Product the FARM puts on shelf cards carries `sku` and no `productID`. */
|
|
97
|
+
const productId = (pr) => String(pr?.productID ?? pr?.sku ?? "");
|
|
98
|
+
/** Price of one unit off a schema.org `AggregateOffer`. `lowPrice` is the price the shopper
|
|
99
|
+
* sees; the first offer is the fallback for the trimmed Product on shelf cards. */
|
|
100
|
+
const unitPrice = (pr) => {
|
|
101
|
+
const o = pr?.offers;
|
|
102
|
+
const v = o?.lowPrice ?? o?.offers?.[0]?.price;
|
|
103
|
+
return typeof v === "number" ? v : undefined;
|
|
104
|
+
};
|
|
105
|
+
/** Events where `value` means money that moved. A `view_item_list` of 40 cards has no value:
|
|
106
|
+
* summing the shelf would put a number in a revenue column that no shopper ever paid. */
|
|
107
|
+
const VALUED = new Set(["add_to_cart", "remove_from_cart", "begin_checkout", "purchase"]);
|
|
108
|
+
const money = (name, p) => {
|
|
109
|
+
const items = p?.items ?? p?.ecommerce?.items;
|
|
110
|
+
const products = Array.isArray(items) ? undefined : p?.products;
|
|
111
|
+
const out = {};
|
|
112
|
+
if (typeof p?.value === "number")
|
|
113
|
+
out.value = p.value;
|
|
114
|
+
if (typeof p?.currency === "string")
|
|
115
|
+
out.currency = p.currency;
|
|
116
|
+
if (Array.isArray(items)) {
|
|
117
|
+
out.items_count = items.length;
|
|
118
|
+
out.item_ids = items
|
|
119
|
+
.map((i) => String(i?.item_id ?? i?.id ?? ""))
|
|
120
|
+
.filter(Boolean)
|
|
121
|
+
.slice(0, LIMITS.itemIds);
|
|
122
|
+
}
|
|
123
|
+
else if (Array.isArray(products)) {
|
|
124
|
+
out.items_count = products.length;
|
|
125
|
+
out.item_ids = products.map(productId).filter(Boolean).slice(0, LIMITS.itemIds);
|
|
126
|
+
// Only when the site did not say it, and only on events where a value is money.
|
|
127
|
+
if (out.value === undefined && VALUED.has(name)) {
|
|
128
|
+
let sum = 0;
|
|
129
|
+
let priced = 0;
|
|
130
|
+
for (const pr of products) {
|
|
131
|
+
const u = unitPrice(pr);
|
|
132
|
+
if (u === undefined)
|
|
133
|
+
continue;
|
|
134
|
+
sum += u * (typeof pr?.quantity === "number" && pr.quantity > 0 ? pr.quantity : 1);
|
|
135
|
+
priced++;
|
|
136
|
+
}
|
|
137
|
+
// All or nothing: a cart of three with one unpriced item is not worth the two we
|
|
138
|
+
// could price, and a partial sum would look exactly like a real one.
|
|
139
|
+
if (priced && priced === products.length)
|
|
140
|
+
out.value = Math.round(sum * 100) / 100;
|
|
141
|
+
}
|
|
142
|
+
const cur = products[0]?.offers?.priceCurrency;
|
|
143
|
+
if (out.currency === undefined && typeof cur === "string" && out.value !== undefined)
|
|
144
|
+
out.currency = cur;
|
|
145
|
+
}
|
|
146
|
+
if (typeof p?.transaction_id === "string")
|
|
147
|
+
out.transaction_id = p.transaction_id;
|
|
148
|
+
return out;
|
|
149
|
+
};
|
|
150
|
+
/** Subscribe WHENEVER the bus shows up, not only if it is already there.
|
|
151
|
+
*
|
|
152
|
+
* This was `window?.DECO?.events?.subscribe?.(…)` — one attempt, optional-chained, no retry —
|
|
153
|
+
* and it lost every commerce event on a real site. React hoists `<script async>` into `<head>`
|
|
154
|
+
* regardless of where the component sits in the tree: measured on igor-tanstack.deco.site,
|
|
155
|
+
* our tag is at byte 200 and the inline block that defines `DECO.events` is at byte 1905, in
|
|
156
|
+
* the body. So this ran first, found nothing, and never tried again. Two `view_promotion`
|
|
157
|
+
* events fired and went nowhere, with no error and a page that looked perfectly instrumented.
|
|
158
|
+
*
|
|
159
|
+
* NOTHING IS LOST BY ARRIVING LATE, which is what makes polling the right answer rather than
|
|
160
|
+
* a patch: the bus keeps a `_q` and `subscribe` replays it to a new subscriber. So the only
|
|
161
|
+
* requirement is to subscribe eventually.
|
|
162
|
+
*
|
|
163
|
+
* Bounded at ten seconds. A page that has not defined the bus by then does not have one —
|
|
164
|
+
* a site without the deco runtime is a normal thing, and an interval left running forever
|
|
165
|
+
* would be this module's parting gift to every such page.
|
|
166
|
+
*/
|
|
167
|
+
const onBus = (fn) => {
|
|
168
|
+
const w = globalThis.window;
|
|
169
|
+
const now = w?.DECO?.events;
|
|
170
|
+
if (typeof now?.subscribe === "function") {
|
|
171
|
+
now.subscribe(fn);
|
|
172
|
+
return;
|
|
173
|
+
}
|
|
174
|
+
let tries = 0;
|
|
175
|
+
const iv = setInterval(() => {
|
|
176
|
+
const bus = globalThis.window?.DECO?.events;
|
|
177
|
+
if (typeof bus?.subscribe === "function") {
|
|
178
|
+
clearInterval(iv);
|
|
179
|
+
bus.subscribe(fn);
|
|
180
|
+
return;
|
|
181
|
+
}
|
|
182
|
+
if (++tries >= 100)
|
|
183
|
+
clearInterval(iv);
|
|
184
|
+
}, 100);
|
|
185
|
+
};
|
|
186
|
+
onBus((event) => {
|
|
187
|
+
if (!event?.name)
|
|
188
|
+
return;
|
|
189
|
+
// The bus replays a synthetic "deco" event on subscribe, carrying the same flags the
|
|
190
|
+
// cookie already gave us. Ignored rather than mapped: it is not something a visitor
|
|
191
|
+
// did, and turning it into an event would put a row in the table for every page load
|
|
192
|
+
// that means nothing.
|
|
193
|
+
if (event.name === "deco")
|
|
194
|
+
return;
|
|
195
|
+
const mapped = NAME_MAP[event.name];
|
|
196
|
+
if (!mapped)
|
|
197
|
+
return; // unknown bus events are not forwarded blind
|
|
198
|
+
const p = event.params ?? {};
|
|
199
|
+
const props = {};
|
|
200
|
+
// The schema.org shape carries the list on the product, not on the event.
|
|
201
|
+
const list = p.item_list_name ?? p.products?.[0]?.item_list_name;
|
|
202
|
+
if (typeof list === "string")
|
|
203
|
+
props.list = list.slice(0, 200);
|
|
204
|
+
if (typeof p.search_term === "string")
|
|
205
|
+
props.term = p.search_term.trim().toLowerCase().slice(0, 200);
|
|
206
|
+
enqueue(mapped, props, money(event.name, p));
|
|
207
|
+
});
|
|
208
|
+
});
|
|
209
|
+
//# sourceMappingURL=deco.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deco.js","sourceRoot":"","sources":["../../../../../src/v8/analytics/runtime/modules/deco.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAIlE,MAAM,CAAC,YA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CAAC,CAAC,KAAU,EAAE,EAAE;QACnB,IAAI,CAAC,KAAK,EAAE,IAAI;YAAE,OAAO;QAEzB,qFAAqF;QACrF,oFAAoF;QACpF,qFAAqF;QACrF,sBAAsB;QACtB,IAAI,KAAK,CAAC,IAAI,KAAK,MAAM;YAAE,OAAO;QAElC,MAAM,MAAM,GAAG,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QACpC,IAAI,CAAC,MAAM;YAAE,OAAO,CAAC,6CAA6C;QAElE,MAAM,CAAC,GAAG,KAAK,CAAC,MAAM,IAAI,EAAE,CAAC;QAC7B,MAAM,KAAK,GAAU,EAAE,CAAC;QACxB,0EAA0E;QAC1E,MAAM,IAAI,GAAG,CAAC,CAAC,cAAc,IAAI,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,EAAE,cAAc,CAAC;QACjE,IAAI,OAAO,IAAI,KAAK,QAAQ;YAAE,KAAK,CAAC,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;QAC9D,IAAI,OAAO,CAAC,CAAC,WAAW,KAAK,QAAQ;YACnC,KAAK,CAAC,IAAI,GAAG,CAAC,CAAC,WAAW,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;QAEhE,OAAO,CAAC,MAAM,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;IAC/C,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"engagement.d.ts","sourceRoot":"","sources":["../../../../../src/v8/analytics/runtime/modules/engagement.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
/** Enhanced measurement: the four things every site wants counted and nobody wants to
|
|
2
|
+
* instrument by hand — how far people scroll, which links take them away, what they
|
|
3
|
+
* download, and what they search for.
|
|
4
|
+
*
|
|
5
|
+
* The reason this is a MODULE and not core: it is automatic, and automatic collection is
|
|
6
|
+
* where an analytics SDK gets expensive without anyone deciding to spend. A blog does not
|
|
7
|
+
* need outbound-click tracking and should not download the code for it.
|
|
8
|
+
*
|
|
9
|
+
* Every counter here is bounded on purpose. GA4 fires a scroll event at each of four
|
|
10
|
+
* thresholds, which is four events per page for one number; it sends an outbound event
|
|
11
|
+
* per click including the same link clicked twice; and none of it is capped. At 400M
|
|
12
|
+
* events a month those choices are the difference between a bill you planned and one you
|
|
13
|
+
* did not.
|
|
14
|
+
*/
|
|
15
|
+
import { LIMITS } from "../../shared/contract.js";
|
|
16
|
+
window.__dqRegister?.((enqueue, _api, onFinal, onRoute) => {
|
|
17
|
+
// ---- scroll ---------------------------------------------------------------
|
|
18
|
+
// One event per page load carrying the DEEPEST point reached, not one per threshold
|
|
19
|
+
// crossed. Four events to communicate a single number is the shape GA4 chose, and the
|
|
20
|
+
// extra three carry no information the fourth does not.
|
|
21
|
+
let deepest = 0;
|
|
22
|
+
let scrollSent = false;
|
|
23
|
+
const depth = () => {
|
|
24
|
+
const doc = document.documentElement;
|
|
25
|
+
const viewport = window.innerHeight || doc.clientHeight || 0;
|
|
26
|
+
const total = Math.max(doc.scrollHeight, document.body?.scrollHeight ?? 0);
|
|
27
|
+
if (total <= viewport)
|
|
28
|
+
return 100; // nothing to scroll: the page was fully seen
|
|
29
|
+
const seen = (window.scrollY || doc.scrollTop || 0) + viewport;
|
|
30
|
+
return Math.max(0, Math.min(100, Math.round((seen / total) * 100)));
|
|
31
|
+
};
|
|
32
|
+
// Passive: a scroll listener that can block scrolling is a listener that made the site
|
|
33
|
+
// worse to use, which is the one thing analytics must never do.
|
|
34
|
+
addEventListener("scroll", () => {
|
|
35
|
+
const d = depth();
|
|
36
|
+
if (d > deepest)
|
|
37
|
+
deepest = d;
|
|
38
|
+
}, { passive: true });
|
|
39
|
+
// `prev` is set when an SPA route closes the view: the path it was measured on goes with it,
|
|
40
|
+
// and the live document is already the next route's, so only what was tracked counts.
|
|
41
|
+
function sendScroll(prev) {
|
|
42
|
+
if (scrollSent)
|
|
43
|
+
return;
|
|
44
|
+
const d = prev ? deepest : Math.max(deepest, depth());
|
|
45
|
+
// Rounded to a bucket. The difference between 61% and 62% is noise, and storing it
|
|
46
|
+
// raw would put a hundred distinct values into a LowCardinality dictionary for no
|
|
47
|
+
// question anyone asks.
|
|
48
|
+
const bucket = Math.min(100, Math.round(d / 25) * 25);
|
|
49
|
+
scrollSent = true;
|
|
50
|
+
enqueue("$scroll", { depth: String(bucket) }, prev ? { path: prev } : undefined);
|
|
51
|
+
}
|
|
52
|
+
// ---- outbound links and downloads -----------------------------------------
|
|
53
|
+
const DOWNLOAD_EXT = /\.(pdf|zip|rar|7z|gz|tar|csv|xlsx?|docx?|pptx?|txt|dmg|exe|pkg|apk|mp3|mp4|mov|avi|wav)($|\?)/i;
|
|
54
|
+
// Same link clicked twice in one page load is one fact, not two. Rage-clicking a slow
|
|
55
|
+
// link is the common case and it is exactly the case that would inflate the number.
|
|
56
|
+
const clicked = new Set();
|
|
57
|
+
const MAX_CLICKS = 20;
|
|
58
|
+
addEventListener("click", (e) => {
|
|
59
|
+
const el = e.target?.closest?.("a[href]");
|
|
60
|
+
if (!el)
|
|
61
|
+
return;
|
|
62
|
+
const href = el.href;
|
|
63
|
+
if (!href || href.startsWith("javascript:"))
|
|
64
|
+
return;
|
|
65
|
+
let url;
|
|
66
|
+
try {
|
|
67
|
+
url = new URL(href, location.href);
|
|
68
|
+
}
|
|
69
|
+
catch {
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
if (url.protocol !== "http:" && url.protocol !== "https:")
|
|
73
|
+
return;
|
|
74
|
+
if (clicked.size >= MAX_CLICKS || clicked.has(href))
|
|
75
|
+
return;
|
|
76
|
+
const isDownload = el.hasAttribute("download") || DOWNLOAD_EXT.test(url.pathname + url.search);
|
|
77
|
+
const isOutbound = url.host !== location.host;
|
|
78
|
+
if (!isDownload && !isOutbound)
|
|
79
|
+
return;
|
|
80
|
+
clicked.add(href);
|
|
81
|
+
// The URL is the whole point of the event, so it gets the path budget rather than the
|
|
82
|
+
// value budget — a truncated destination answers nothing.
|
|
83
|
+
const target = (url.host + url.pathname).slice(0, LIMITS.pathLen);
|
|
84
|
+
enqueue(isDownload ? "$download" : "$outbound", { target });
|
|
85
|
+
}, { capture: true, passive: true });
|
|
86
|
+
// ---- site search ----------------------------------------------------------
|
|
87
|
+
// A closed list of parameter names, for the same reason the campaign vocabulary is
|
|
88
|
+
// closed: an open one lets any query string mint a dimension value. These are the ones
|
|
89
|
+
// that actually appear on storefronts.
|
|
90
|
+
const SEARCH_PARAMS = ["q", "s", "search", "query", "termo", "busca", "keyword"];
|
|
91
|
+
(function searchOnce() {
|
|
92
|
+
try {
|
|
93
|
+
const qs = new URLSearchParams(location.search);
|
|
94
|
+
for (const key of SEARCH_PARAMS) {
|
|
95
|
+
const term = qs.get(key);
|
|
96
|
+
if (!term)
|
|
97
|
+
continue;
|
|
98
|
+
enqueue("$search", {
|
|
99
|
+
// Lowercased and trimmed so "Tenis", "tenis " and "tenis" are one term rather
|
|
100
|
+
// than three rows in a top-searches report.
|
|
101
|
+
term: term.trim().toLowerCase().slice(0, LIMITS.valueLen),
|
|
102
|
+
param: key,
|
|
103
|
+
});
|
|
104
|
+
return;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
catch {
|
|
108
|
+
/* a malformed query string is not worth breaking collection over */
|
|
109
|
+
}
|
|
110
|
+
})();
|
|
111
|
+
// ---- flush ----------------------------------------------------------------
|
|
112
|
+
// Scroll depth is only known when the visitor leaves. Core runs this immediately
|
|
113
|
+
// before its own last flush, so the event rides out with everything else instead of
|
|
114
|
+
// buying a request of its own — three modules each flushing cost three requests for
|
|
115
|
+
// what is one visit's worth of data.
|
|
116
|
+
onFinal(() => sendScroll());
|
|
117
|
+
// One `$scroll` per VIEW. Before this, an SPA's route 2 inherited route 1's depth and the
|
|
118
|
+
// whole visit sent a single event at the end, attributed to whichever path was last. A
|
|
119
|
+
// query-string change on the same path is the same view, as it is for core's pageview.
|
|
120
|
+
onRoute?.((prev) => {
|
|
121
|
+
if (prev === location.pathname)
|
|
122
|
+
return;
|
|
123
|
+
sendScroll(prev);
|
|
124
|
+
deepest = 0;
|
|
125
|
+
scrollSent = false;
|
|
126
|
+
});
|
|
127
|
+
});
|
|
128
|
+
//# sourceMappingURL=engagement.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"engagement.js","sourceRoot":"","sources":["../../../../../src/v8/analytics/runtime/modules/engagement.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAElD,MAAM,CAAC,YAAY,EAAE,CAAC,CAAC,OAAO,EAAE,IAA6B,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE;IACjF,8EAA8E;IAC9E,oFAAoF;IACpF,sFAAsF;IACtF,wDAAwD;IACxD,IAAI,OAAO,GAAG,CAAC,CAAC;IAChB,IAAI,UAAU,GAAG,KAAK,CAAC;IAEvB,MAAM,KAAK,GAAG,GAAG,EAAE;QACjB,MAAM,GAAG,GAAG,QAAQ,CAAC,eAAe,CAAC;QACrC,MAAM,QAAQ,GAAG,MAAM,CAAC,WAAW,IAAI,GAAG,CAAC,YAAY,IAAI,CAAC,CAAC;QAC7D,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,YAAY,EAAE,QAAQ,CAAC,IAAI,EAAE,YAAY,IAAI,CAAC,CAAC,CAAC;QAC3E,IAAI,KAAK,IAAI,QAAQ;YAAE,OAAO,GAAG,CAAC,CAAC,6CAA6C;QAChF,MAAM,IAAI,GAAG,CAAC,MAAM,CAAC,OAAO,IAAI,GAAG,CAAC,SAAS,IAAI,CAAC,CAAC,GAAG,QAAQ,CAAC;QAC/D,OAAO,IAAI,CAA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K,CAAC;IACrB,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../../../src/v8/analytics/runtime/modules/errors.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
/** Automatic error capture.
|
|
2
|
+
*
|
|
3
|
+
* `captureException` in core only ever sees what a site already wrapped in try/catch,
|
|
4
|
+
* which is the minority of what breaks. This module attaches the two listeners that
|
|
5
|
+
* see the rest, and does the two things that separate an error product from an error
|
|
6
|
+
* log: it gives every error a stable fingerprint so repeats group, and it collapses a
|
|
7
|
+
* repeating error into one event with a count instead of one event per occurrence.
|
|
8
|
+
*
|
|
9
|
+
* That second part is not an optimisation. A render loop throwing on every frame is
|
|
10
|
+
* the normal shape of a bad deploy; without collapsing, one visitor's broken tab sends
|
|
11
|
+
* thousands of events, the queue drops the rest of their session, and the bill and the
|
|
12
|
+
* data are both wrong.
|
|
13
|
+
*/
|
|
14
|
+
import { LIMITS } from "../../shared/contract.js";
|
|
15
|
+
window.__dqRegister?.((enqueue, api, onFinal) => {
|
|
16
|
+
// Volatile parts of a message are what stop repeats grouping: ids, timestamps, URLs
|
|
17
|
+
// and offsets differ per occurrence while the fault is identical. Strip them before
|
|
18
|
+
// hashing, keep the original message on the event as a sample.
|
|
19
|
+
const stable = (msg) => msg
|
|
20
|
+
.replace(/https?:\/\/[^\s)'"]+/g, "<url>")
|
|
21
|
+
.replace(/\b[0-9a-f]{8,}\b/gi, "<hex>")
|
|
22
|
+
.replace(/\b\d[\d.,]*\b/g, "<n>")
|
|
23
|
+
.replace(/['"][^'"]{0,80}['"]/g, "<str>")
|
|
24
|
+
.slice(0, 200);
|
|
25
|
+
// A file path is the same fault whether it arrives absolute, with a cache-busting
|
|
26
|
+
// query, or with a hash fragment.
|
|
27
|
+
const cleanFile = (f) => {
|
|
28
|
+
if (!f)
|
|
29
|
+
return "";
|
|
30
|
+
try {
|
|
31
|
+
const u = new URL(f, location.href);
|
|
32
|
+
return (u.origin === location.origin ? "" : u.origin) + u.pathname;
|
|
33
|
+
}
|
|
34
|
+
catch {
|
|
35
|
+
return f.split("?")[0].split("#")[0];
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
// A URL in a message or a stack keeps its origin and path and loses its query and fragment:
|
|
39
|
+
// `fetch failed for /api/cart?email=...&token=...` is the fault, the values are a visitor's.
|
|
40
|
+
// A frame's trailing `:line:col` survives, since it is what points at the fault.
|
|
41
|
+
const noQuery = (s) => s.replace(/([a-z][\w+.-]*:\/\/[^\s?#()'"]*)[?#][^\s()'"]*?(?=:\d+:\d+(?![^\s)])|[\s()'"]|$)/gi, "$1");
|
|
42
|
+
// FNV-1a with a murmur3 finaliser. The finaliser matters: without it the low bits are
|
|
43
|
+
// just an XOR of the input's low bits, and near-identical inputs land in adjacent
|
|
44
|
+
// buckets rather than spread.
|
|
45
|
+
const fingerprint = (parts) => {
|
|
46
|
+
let h = 2166136261;
|
|
47
|
+
const s = parts.join("|");
|
|
48
|
+
for (let i = 0; i < s.length; i++) {
|
|
49
|
+
h ^= s.charCodeAt(i);
|
|
50
|
+
h = Math.imul(h, 16777619);
|
|
51
|
+
}
|
|
52
|
+
h = Math.imul(h ^ (h >>> 16), 2246822507);
|
|
53
|
+
h = Math.imul(h ^ (h >>> 13), 3266489909);
|
|
54
|
+
return ((h ^ (h >>> 16)) >>> 0).toString(36).padStart(7, "0");
|
|
55
|
+
};
|
|
56
|
+
// Seen this page load: fingerprint -> how many times since the last send. A repeating
|
|
57
|
+
// error increments rather than enqueues.
|
|
58
|
+
const seen = new Map();
|
|
59
|
+
// A hard ceiling on DISTINCT errors per page load. A loop that generates a new
|
|
60
|
+
// fingerprint each time (a message with an unstrippable varying part) would otherwise
|
|
61
|
+
// defeat the collapsing entirely, which is the failure mode this guard exists for.
|
|
62
|
+
const MAX_DISTINCT = 20;
|
|
63
|
+
// OURS = this origin, or a host the site declared as its own in `errorHosts` (served as `er`;
|
|
64
|
+
// a separate asset CDN, say). Everything else on a storefront is a vendor: a GTM tag, a pixel,
|
|
65
|
+
// a chat widget. Measured on FILA, New Balance and Umbro, 96-100% of `$error` was a
|
|
66
|
+
// cross-origin ResourceError -- a dead tag, a 403'd account, an ad blocker -- none of it
|
|
67
|
+
// actionable here, and between them 18-26% of every event those sites sent.
|
|
68
|
+
const ours = (u) => {
|
|
69
|
+
try {
|
|
70
|
+
const x = new URL(u, location.href);
|
|
71
|
+
return (x.origin === location.origin || (api.er ?? []).includes(x.host));
|
|
72
|
+
}
|
|
73
|
+
catch {
|
|
74
|
+
return false;
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
function report(type, message, file, line, stack, props) {
|
|
78
|
+
// Read by the heatmap module: a click followed by an error within a second is an
|
|
79
|
+
// "error click". On the performance timeline, which is what the click is timed on.
|
|
80
|
+
// Only OUR faults flag it. Vendor tags boot on the storefront's first interaction, so their
|
|
81
|
+
// failures land right after the first click -- every header "error click" reproduced on
|
|
82
|
+
// FILA, New Balance and Umbro was one. The source is the file, else the first stack frame
|
|
83
|
+
// (a URL followed by :line:col, which a URL quoted in the message is not). "Script error."
|
|
84
|
+
// and a fault with no source cannot be attributed, so they do not flag.
|
|
85
|
+
const src = file || (/([a-z][\w+.-]*:\/\/[^\s()]+):\d+:\d+/i.exec(String(stack))?.[1] ?? "");
|
|
86
|
+
// Not the site's code at all: a script the BROWSER injected -- an in-app browser's bridge
|
|
87
|
+
// (`iabjs://`, Instagram/Facebook), an extension (`chrome-extension://`, `moz-extension://`,
|
|
88
|
+
// `safari-web-extension://`). Nothing the site ships can fix it, and it was the largest single
|
|
89
|
+
// fault on two storefronts after #27 (newbalance: 130 an hour, "Error invoking postMessage:
|
|
90
|
+
// Java object is gone").
|
|
91
|
+
if (/^[a-z][\w+.-]*:\/\//i.test(src) && !/^https?:/i.test(src))
|
|
92
|
+
return;
|
|
93
|
+
if (src && message !== "Script error." && ours(src))
|
|
94
|
+
window.__dqLastErrorTs = performance.now();
|
|
95
|
+
const fp = fingerprint([type, stable(message), cleanFile(file), String(line)]);
|
|
96
|
+
const prev = seen.get(fp);
|
|
97
|
+
if (prev) {
|
|
98
|
+
prev.n++;
|
|
99
|
+
return;
|
|
100
|
+
} // already reported this page load
|
|
101
|
+
if (seen.size >= MAX_DISTINCT)
|
|
102
|
+
return; // storm guard
|
|
103
|
+
seen.set(fp, { n: 1, sent: true });
|
|
104
|
+
enqueue("$error", props, {
|
|
105
|
+
error_type: (type || "Error").slice(0, 40),
|
|
106
|
+
error_fingerprint: fp,
|
|
107
|
+
error_message: noQuery(String(message ?? "")).slice(0, LIMITS.valueLen),
|
|
108
|
+
error_file: cleanFile(file).slice(0, LIMITS.pathLen),
|
|
109
|
+
error_line: Number(line) || 0,
|
|
110
|
+
error_count: 1,
|
|
111
|
+
error_stack: noQuery(String(stack ?? "")).slice(0, LIMITS.errorEventBytes),
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
// Repeats accumulated after the first report are sent once, at the end, as a single
|
|
115
|
+
// event carrying the count. One event per thousand occurrences, and the thousand is
|
|
116
|
+
// still visible.
|
|
117
|
+
function flushRepeats() {
|
|
118
|
+
let any = false;
|
|
119
|
+
for (const [fp, rec] of seen) {
|
|
120
|
+
if (rec.n <= 1)
|
|
121
|
+
continue;
|
|
122
|
+
enqueue("$error", undefined, {
|
|
123
|
+
error_fingerprint: fp,
|
|
124
|
+
error_type: "repeat",
|
|
125
|
+
error_count: rec.n - 1,
|
|
126
|
+
error_message: "",
|
|
127
|
+
});
|
|
128
|
+
rec.n = 1;
|
|
129
|
+
any = true;
|
|
130
|
+
}
|
|
131
|
+
void any;
|
|
132
|
+
}
|
|
133
|
+
// Ordering, not a second request: core runs this BEFORE its final flush, so the
|
|
134
|
+
// repeats are in the queue when that flush happens. Enqueueing after it used to
|
|
135
|
+
// report eight occurrences as one; flushing again to compensate cost a request.
|
|
136
|
+
onFinal(flushRepeats);
|
|
137
|
+
addEventListener("error", (e) => {
|
|
138
|
+
// A failed <img>/<script>/<link> also fires "error" on window, with no `error`
|
|
139
|
+
// object and the element as target. It is a real fault worth recording, but it is
|
|
140
|
+
// not an exception and must not be reported as one.
|
|
141
|
+
if (!e?.error && e?.target && e.target !== window) {
|
|
142
|
+
const el = e.target;
|
|
143
|
+
// `.href` on an SVG element is an SVGAnimatedString, NOT a string — so a failing
|
|
144
|
+
// `<use href="/sprite.svg#icon">` used to be reported as
|
|
145
|
+
// `/[object%20SVGAnimatedString]`, which names no resource and masks which sprite
|
|
146
|
+
// actually failed (seen live on a storefront whose icons are one `<use>` sprite).
|
|
147
|
+
// `.src` has the same shape on SVGScriptElement.
|
|
148
|
+
const raw = el.src || el.href || "";
|
|
149
|
+
const src = typeof raw === "string" ? raw : (raw.baseVal ?? "");
|
|
150
|
+
// A vendor's asset failing is the vendor's problem (see `ours`): dropped, not reported.
|
|
151
|
+
// Ours -- our chunks, our sprite, a declared `errorHosts` CDN -- is a real fault.
|
|
152
|
+
if (!src || !ours(src))
|
|
153
|
+
return;
|
|
154
|
+
report("ResourceError", `failed to load ${el.tagName?.toLowerCase?.() ?? "resource"}`, src, 0, "");
|
|
155
|
+
return;
|
|
156
|
+
}
|
|
157
|
+
report(e?.error?.name ?? "Error", e?.message ?? String(e?.error ?? "error"), e?.filename ?? "", e?.lineno ?? 0, e?.error?.stack ?? "");
|
|
158
|
+
}, true); // capture phase: resource errors do not bubble
|
|
159
|
+
addEventListener("unhandledrejection", (e) => {
|
|
160
|
+
const r = e?.reason;
|
|
161
|
+
report(r?.name ?? "UnhandledRejection", r?.message ?? String(r ?? "rejected"), r?.fileName ?? "", r?.lineNumber ?? 0, r?.stack ?? "");
|
|
162
|
+
});
|
|
163
|
+
// Same fingerprinting for the manual path, so an error caught by the site and the
|
|
164
|
+
// same error escaping uncaught land in one group rather than two.
|
|
165
|
+
api.captureException = (err, props) => report(err?.name ?? "Error", err?.message ?? String(err), err?.fileName ?? "", err?.lineNumber ?? 0, err?.stack ?? "", props);
|
|
166
|
+
});
|
|
167
|
+
//# sourceMappingURL=errors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../../../../src/v8/analytics/runtime/modules/errors.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAIlD,MAAM,CAAC,YAAY,EAAE,CAAC,CAAC,OAAO,EAAE,GAA4B,EAAE,OAAO,EAAE,EAAE;IACvE,oFAAoF;IACpF,oFAAoF;IACpF,+DAA+D;IAC/D,MAAM,MAAM,GAAG,CAAC,GAAW,EAAE,EAAE,CAC7B,GAAG;SACA,OAAO,CAAC,uBAAuB,EAAE,OAAO,CAAC;SACzC,OAAO,CAAC,oBAAoB,EAAE,OAAO,CAAC;SACtC,OAAO,CAAC,gBAAgB,EAAE,KAAK,CAAC;SAChC,OAAO,CAAC,sBAAsB,EAAE,OAAO,CAAC;SACxC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;IAEnB,kFAAkF;IAClF,kCAAkC;IAClC,MAAM,SAAS,GAAG,CAAC,CAAS,EAAE,EAAE;QAC9B,IAAI,CAAC,CAAC;YAAE,OAAO,EAAE,CAAC;QAClB,IAAI,CAAC;YACH,MAAM,CAAC,GAAG,IAAI,GAAG,CAAC,CAAC,EAAE,QAAQ,CAAC,IAAI,CAAC,CAAC;YACpC,OAAO,CAAC,CAAC,CAAC,MAAM,KAAK,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,QAAQ,CAAC;QACrE,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;QACvC,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