@picked/analytics 0.0.44 → 0.0.45-next.2

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.
@@ -1,1267 +0,0 @@
1
- import { trackSelfDescribingEvent as Q, newTracker as At, addGlobalContexts as Ht, enableActivityTracking as Ot, enableActivityTrackingCallback as jt } from "@snowplow/browser-tracker";
2
- import { ButtonClickTrackingPlugin as qt, enableButtonClickTracking as Ft } from "@snowplow/browser-plugin-button-click-tracking";
3
- import { PerformanceNavigationTimingPlugin as It } from "@snowplow/browser-plugin-performance-navigation-timing";
4
- import { ErrorTrackingPlugin as Rt, enableErrorTracking as Wt } from "@snowplow/browser-plugin-error-tracking";
5
- import { WebVitalsPlugin as zt } from "@snowplow/browser-plugin-web-vitals";
6
- import { supportsDocument as at, supportsWindow as Ut, supportsCookies as Gt } from "@picked/client";
7
- function it(t, n) {
8
- return `iglu:dev.pckd/${t}/jsonschema/${n}`;
9
- }
10
- function L(t, ...n) {
11
- }
12
- function h(t, ...n) {
13
- }
14
- function l(t, n, o = {}) {
15
- return {
16
- event: {
17
- schema: it("event", "1-0-0"),
18
- data: {
19
- type: t,
20
- meta: o
21
- }
22
- },
23
- context: n.filter(
24
- (i) => i !== void 0
25
- )
26
- };
27
- }
28
- function e(t, n, o) {
29
- return {
30
- schema: it(t, n),
31
- data: o
32
- };
33
- }
34
- function p(t, n) {
35
- return (o, i) => {
36
- const s = n(o, i);
37
- Q(s);
38
- };
39
- }
40
- function k(t, n, o = { passive: !0 }) {
41
- const i = /* @__PURE__ */ new WeakMap();
42
- return (s, a) => {
43
- let r = i.get(s);
44
- if (r || (r = /* @__PURE__ */ new Set(), i.set(s, r)), r.has(t))
45
- return;
46
- function c(m) {
47
- const E = a();
48
- n({ event: m, analyticsContext: E });
49
- }
50
- s.addEventListener(t, c, o), r.add(t);
51
- };
52
- }
53
- function Kt(t, n) {
54
- const o = /* @__PURE__ */ new Set();
55
- return (i) => {
56
- if (o.has(t) || !at())
57
- return;
58
- function s(a) {
59
- const r = i();
60
- n({ event: a, analyticsContext: r });
61
- }
62
- document.addEventListener(t, s, { passive: !0 }), o.add(t);
63
- };
64
- }
65
- function S(t, n) {
66
- const o = /* @__PURE__ */ new Set();
67
- return (i) => {
68
- if (o.has(t) || !Ut())
69
- return;
70
- function s(a) {
71
- const r = i();
72
- n({ event: a, analyticsContext: r });
73
- }
74
- window.addEventListener(t, s, { passive: !0 }), o.add(t);
75
- };
76
- }
77
- function u(t) {
78
- return { items: t.features?.map(({ feature: o, name: i, key: s, bucket: a }) => ({
79
- ab_feature: o,
80
- ab_name: i,
81
- ab_key: s,
82
- ab_bucket: a
83
- })) || [] };
84
- }
85
- const _ = "unknown";
86
- function f(t) {
87
- const n = Mt(), o = {
88
- id: t.sessionId || null
89
- };
90
- return t.isUser !== void 0 && (o.is_user = t.isUser), t.identifiers && Object.assign(o, t.identifiers), n && (o.gaid = n), t.shopifySession?.clientId && (o.shopify_client_id = t.shopifySession.clientId), t.shopifySession?.customerId && (o.shopify_customer_id = t.shopifySession.customerId), t.shopifySession?.checkoutToken && (o.shopify_checkout_token = t.shopifySession.checkoutToken), o;
91
- }
92
- function B(t) {
93
- if (t.fields)
94
- return {
95
- items: t.fields.map(({ id: n, type: o, label: i, options: s }) => ({
96
- id: n,
97
- type: o,
98
- label: i,
99
- options: Array.isArray(s) ? s : void 0
100
- }))
101
- };
102
- }
103
- function j(t) {
104
- if (t.responses)
105
- return {
106
- items: t.responses.map(
107
- ({ fieldId: n, value: o }) => ({
108
- field_id: n,
109
- values: Array.isArray(o) ? o.map((i) => ({ value: i })) : [{ value: o }]
110
- })
111
- )
112
- };
113
- }
114
- function d(t, n = !1) {
115
- const { step: o } = t;
116
- if (o)
117
- return {
118
- id: o.id,
119
- title: o.label
120
- };
121
- if (n)
122
- return h('"step" is required for this event', t), {
123
- id: _,
124
- title: _
125
- };
126
- }
127
- function rt(t, n = !1) {
128
- const { productList: o } = t;
129
- if (o) {
130
- const i = {};
131
- "title" in o && o.title && Object.assign(i, { title: o.title });
132
- const s = "items" in o ? o.items : o;
133
- return Object.assign(i, {
134
- items: s.map((a) => ({
135
- item_id: a.itemId,
136
- item_name: a.itemName,
137
- affiliation: a.affiliation,
138
- coupon: a.coupon,
139
- currency: a.currency,
140
- creative_name: a.creativeName,
141
- creative_slot: a.creativeSlot,
142
- discount: H(a.discount),
143
- index: H(a.index),
144
- item_brand: a.itemBrand,
145
- item_category: a.itemCategory,
146
- item_category2: a.itemCategory2,
147
- item_category3: a.itemCategory3,
148
- item_category4: a.itemCategory4,
149
- item_category5: a.itemCategory5,
150
- item_list_id: a.itemListId,
151
- item_list_name: a.itemListName,
152
- item_variant: a.itemVariant,
153
- location_id: a.locationId,
154
- price: H(a.price),
155
- promotion_id: a.promotionId,
156
- promotion_name: a.promotionName,
157
- quantity: H(a.quantity),
158
- in_stock: a.inStock
159
- }))
160
- }), i;
161
- }
162
- if (n)
163
- return h('"productList" is required for this event', t), {
164
- items: []
165
- };
166
- }
167
- function ct(t, n = !1) {
168
- const { order: o } = t;
169
- if (o) {
170
- const i = {
171
- id: o.id
172
- };
173
- return o.checkoutToken && (i.checkout_token = o.checkoutToken), o.cartToken && (i.cart_token = o.cartToken), o.customerId && (i.customer_id = o.customerId), i;
174
- }
175
- if (n)
176
- return h('"order" is required for this event', t), {
177
- id: _
178
- };
179
- }
180
- function x(t, n = !1) {
181
- const { experience: o } = t;
182
- if (o)
183
- return {
184
- id: o.id,
185
- title: o.title
186
- };
187
- if (n)
188
- return h('"experience" is required for this event', t), {
189
- id: _,
190
- title: _
191
- };
192
- }
193
- function q(t, n = !1) {
194
- const { exception: o } = t;
195
- if (o)
196
- return typeof o == "string" ? { reason: o } : {
197
- reason: o.systemMessage
198
- };
199
- if (n)
200
- return h('"exception" is required for this event', t), {
201
- reason: _
202
- };
203
- }
204
- function Y(t) {
205
- const { form: n } = t;
206
- return n ? {
207
- id: n.id,
208
- title: n.title
209
- } : (h('"form" is required for this event', t), {
210
- id: _,
211
- title: _
212
- });
213
- }
214
- function lt(t) {
215
- const { modal: n } = t;
216
- return n ? {
217
- id: n.id,
218
- title: n.title
219
- } : (h('"modal" is required for this event', t), {
220
- id: _,
221
- title: _
222
- });
223
- }
224
- function F(t, n = 300) {
225
- let o;
226
- return function(...i) {
227
- clearTimeout(o), o = setTimeout(() => t.apply(this, i), n);
228
- };
229
- }
230
- function H(t) {
231
- if (typeof t == "number")
232
- return t;
233
- if (typeof t != "string")
234
- return;
235
- const n = parseFloat(t);
236
- if (!isNaN(n))
237
- return n;
238
- }
239
- function Mt() {
240
- if (!at() || !Gt())
241
- return null;
242
- const t = "_ga=", n = document.cookie ? document.cookie.split(";") : [];
243
- for (const o of n) {
244
- const i = o.trim();
245
- if (i.startsWith(t)) {
246
- const a = i.substring(t.length).split(".");
247
- if (a.length > 2)
248
- return a.slice(2).join(".");
249
- }
250
- }
251
- }
252
- function Xt(t) {
253
- const n = [];
254
- return t.trackErrors && (L(), n.push(Rt())), t.trackVitals && (L(), n.push(zt())), t.trackPerformance && (L(), n.push(It())), (t.trackButtonClickAllowList || t.trackButtonClickFilter) && n.push(qt()), n;
255
- }
256
- function Jt(t) {
257
- t.trackActivity && !t.trackActivityCallback && (L(), Ot({
258
- minimumVisitLength: 30,
259
- heartbeatDelay: 10
260
- })), t.trackActivity && t.trackActivityCallback && (L(), jt({
261
- minimumVisitLength: 30,
262
- heartbeatDelay: 10,
263
- callback: t.trackActivityCallback
264
- })), (t.trackButtonClickAllowList || t.trackButtonClickFilter) && (L(), Ft({
265
- filter: t.trackButtonClickAllowList ? {
266
- allowlist: t.trackButtonClickAllowList
267
- } : t.trackButtonClickFilter
268
- })), t.trackErrors && (L(), Wt());
269
- }
270
- function Un({
271
- organizationId: t,
272
- projectId: n,
273
- cvlyX: o,
274
- deployment: i,
275
- collectorUrl: s = "evnts.pckd.dev",
276
- appId: a = "picked-analytics",
277
- trackVitals: r = !1,
278
- trackPerformance: c = !1,
279
- trackWebPage: m = !0,
280
- trackSessions: E = !0,
281
- trackBrowser: $ = !0,
282
- trackActivity: g = !1,
283
- trackErrors: N = !1,
284
- trackActivityCallback: w,
285
- trackButtonClickAllowList: P
286
- }) {
287
- L();
288
- const A = {
289
- trackVitals: r,
290
- trackErrors: N,
291
- trackActivity: g,
292
- trackPerformance: c,
293
- trackActivityCallback: w,
294
- trackButtonClickAllowList: P
295
- }, Yt = {
296
- appId: a,
297
- platform: "web",
298
- keepalive: !0,
299
- contexts: {
300
- webPage: m,
301
- session: E,
302
- browser: $ || !1
303
- },
304
- plugins: Xt(A)
305
- }, Bt = At(a, s, Yt);
306
- return Qt({
307
- organizationId: t,
308
- projectId: n,
309
- cvlyX: o,
310
- deployment: i
311
- }), Jt(A), Bt;
312
- }
313
- function Qt({ organizationId: t, projectId: n, cvlyX: o, deployment: i }) {
314
- if (!t || !n)
315
- throw new Error("bindGlobalContext: Both organizationId and projectId are required");
316
- const s = [];
317
- s.push(
318
- e("app", "1-0-0", {
319
- organization_id: t,
320
- project_id: n
321
- }),
322
- e("deployment", "1-0-1", {
323
- sha: i.sha,
324
- id: i.id,
325
- env: i.env,
326
- host: i.host
327
- })
328
- ), o && s.push(
329
- e("cvly_x", "1-0-1", {
330
- vercel_deployment_id: o.vercelDeploymentId,
331
- vercel_env: o.vercelEnv,
332
- vercel_url: o.vercelUrl
333
- })
334
- ), Ht(s);
335
- }
336
- const ut = "app_close";
337
- function Zt(t, n) {
338
- const o = u(t), i = f(t), s = x(t), a = d(t);
339
- return l(
340
- ut,
341
- [
342
- e("feature_list", "2-0-0", o),
343
- e("session", "1-0-4", i),
344
- a ? e("step", "1-0-0", a) : void 0,
345
- s ? e("experience", "1-0-1", s) : void 0
346
- ],
347
- n
348
- );
349
- }
350
- const Gn = p(ut, Zt), ft = "app_initialize";
351
- function te(t, n) {
352
- const o = u(t), i = f(t), s = x(t), a = d(t);
353
- return l(
354
- ft,
355
- [
356
- e("feature_list", "2-0-0", o),
357
- e("session", "1-0-4", i),
358
- a ? e("step", "1-0-0", a) : void 0,
359
- s ? e("experience", "1-0-1", s) : void 0
360
- ],
361
- n
362
- );
363
- }
364
- const Kn = p(ft, te), dt = "app_load";
365
- function ee(t, n) {
366
- const o = u(t), i = f(t), s = x(t), a = d(t);
367
- return l(
368
- dt,
369
- [
370
- e("feature_list", "2-0-0", o),
371
- e("session", "1-0-4", i),
372
- a ? e("step", "1-0-0", a) : void 0,
373
- s ? e("experience", "1-0-1", s) : void 0
374
- ],
375
- n
376
- );
377
- }
378
- const Mn = p(dt, ee), xt = "app_open";
379
- function ne(t, n) {
380
- const o = u(t), i = f(t), s = x(t), a = d(t);
381
- return l(
382
- xt,
383
- [
384
- e("feature_list", "2-0-0", o),
385
- e("session", "1-0-4", i),
386
- a ? e("step", "1-0-0", a) : void 0,
387
- s ? e("experience", "1-0-1", s) : void 0
388
- ],
389
- n
390
- );
391
- }
392
- const Xn = p(xt, ne), pt = "experience_load";
393
- function oe(t, n) {
394
- const o = u(t), i = f(t), s = x(t, !0), a = d(t);
395
- return l(
396
- pt,
397
- [
398
- e("feature_list", "2-0-0", o),
399
- e("session", "1-0-4", i),
400
- e("experience", "1-0-1", s),
401
- a ? e("step", "1-0-0", a) : void 0
402
- ],
403
- n
404
- );
405
- }
406
- const Jn = p(pt, oe), mt = "feature_decide";
407
- function se(t, n) {
408
- const o = u(t), i = f(t), s = x(t), a = d(t);
409
- return l(
410
- mt,
411
- [
412
- e("feature_list", "2-0-0", o),
413
- e("session", "1-0-4", i),
414
- a ? e("step", "1-0-0", a) : void 0,
415
- s ? e("experience", "1-0-1", s) : void 0
416
- ],
417
- n
418
- );
419
- }
420
- const Qn = p(mt, se), Ct = "step_enter";
421
- function ae(t, n) {
422
- const o = u(t), i = f(t), s = x(t), a = d(t, !0), r = B(t);
423
- return l(
424
- Ct,
425
- [
426
- e("feature_list", "2-0-0", o),
427
- e("session", "1-0-4", i),
428
- e("step", "1-0-0", a),
429
- r && e("field_list", "1-0-0", r),
430
- s && e("experience", "1-0-1", s)
431
- ],
432
- n
433
- );
434
- }
435
- const Zn = p(Ct, ae), Et = "step_submit";
436
- function ie(t, n) {
437
- const o = u(t), i = f(t), s = x(t), a = d(t, !0), r = j(t), c = B(t);
438
- return l(
439
- Et,
440
- [
441
- e("feature_list", "2-0-0", o),
442
- e("session", "1-0-4", i),
443
- e("step", "1-0-0", a),
444
- c && e("field_list", "1-0-0", c),
445
- r && e("response_list", "1-0-0", r),
446
- s && e("experience", "1-0-1", s)
447
- ],
448
- n
449
- );
450
- }
451
- const to = p(Et, ie), vt = "step_submit_success";
452
- function re(t, n) {
453
- const o = u(t), i = f(t), s = x(t), a = d(t, !0), r = B(t), c = j(t);
454
- return l(
455
- vt,
456
- [
457
- e("feature_list", "2-0-0", o),
458
- e("session", "1-0-4", i),
459
- e("step", "1-0-0", a),
460
- r && e("field_list", "1-0-0", r),
461
- c && e("response_list", "1-0-0", c),
462
- s && e("experience", "1-0-1", s)
463
- ],
464
- n
465
- );
466
- }
467
- const eo = p(vt, re), Dt = "field_validation_error";
468
- function ce(t, n) {
469
- const o = u(t), i = f(t), s = Y(t), a = q(t, !0), r = x(t), c = d(t);
470
- return l(
471
- Dt,
472
- [
473
- e("feature_list", "2-0-0", o),
474
- e("session", "1-0-4", i),
475
- e("exception", "1-0-0", a),
476
- e("form", "1-0-0", s),
477
- r && e("experience", "1-0-1", r),
478
- c && e("step", "1-0-0", c)
479
- ],
480
- n
481
- );
482
- }
483
- const no = p(Dt, ce), _t = "form_submit";
484
- function le(t, n) {
485
- const o = u(t), i = f(t), s = Y(t), a = x(t), r = d(t);
486
- return l(
487
- _t,
488
- [
489
- e("feature_list", "2-0-0", o),
490
- e("session", "1-0-4", i),
491
- e("form", "1-0-0", s),
492
- a && e("experience", "1-0-1", a),
493
- r && e("step", "1-0-0", r)
494
- ],
495
- n
496
- );
497
- }
498
- const oo = p(_t, le), kt = "form_submit_error";
499
- function ue(t, n) {
500
- const o = u(t), i = f(t), s = Y(t), a = q(t, !0), r = x(t), c = d(t);
501
- return l(
502
- kt,
503
- [
504
- e("feature_list", "2-0-0", o),
505
- e("session", "1-0-4", i),
506
- e("form", "1-0-0", s),
507
- e("exception", "1-0-0", a),
508
- r && e("experience", "1-0-1", r),
509
- c && e("step", "1-0-0", c)
510
- ],
511
- n
512
- );
513
- }
514
- const so = p(kt, ue), bt = "form_submit_success";
515
- function fe(t, n) {
516
- const o = u(t), i = f(t), s = Y(t), a = x(t), r = d(t);
517
- return l(
518
- bt,
519
- [
520
- e("feature_list", "2-0-0", o),
521
- e("session", "1-0-4", i),
522
- e("form", "1-0-0", s),
523
- a && e("experience", "1-0-1", a),
524
- r && e("step", "1-0-0", r)
525
- ],
526
- n
527
- );
528
- }
529
- const ao = p(bt, fe);
530
- function D(t) {
531
- return t instanceof Element;
532
- }
533
- function de(t) {
534
- return `data-picked-${t.replaceAll("_", "-")}`;
535
- }
536
- function T(t) {
537
- const n = [
538
- "a",
539
- "button",
540
- "input",
541
- "select",
542
- "textarea",
543
- "details",
544
- "summary",
545
- "label",
546
- "form",
547
- "fieldset",
548
- "legend",
549
- "optgroup",
550
- "option",
551
- "output",
552
- "datalist",
553
- "dialog",
554
- "menu",
555
- "menuitem",
556
- "iframe",
557
- "audio",
558
- "video",
559
- "embed",
560
- "object",
561
- "canvas"
562
- ].join(", ");
563
- return D(t) ? t.matches(n) ? t : t.closest(n) : null;
564
- }
565
- function v(t) {
566
- if (t instanceof HTMLSelectElement) {
567
- const n = t.selectedIndex || 0;
568
- return t.options[n]?.text ?? "";
569
- }
570
- return "innerText" in t && typeof t.innerText == "string" ? t.innerText : t.textContent;
571
- }
572
- function b(t) {
573
- const n = t.getAttribute("aria-label");
574
- if (n)
575
- return n;
576
- const o = t.getAttribute("aria-labelledby");
577
- if (o) {
578
- const s = document.getElementById(o);
579
- if (s) {
580
- const a = v(s);
581
- if (a)
582
- return a;
583
- }
584
- }
585
- if ("id" in t && t.id) {
586
- const s = document.querySelector(`label[for="${t.id}"]`);
587
- if (s) {
588
- const a = v(s);
589
- if (a)
590
- return a;
591
- }
592
- }
593
- let i = t.parentElement;
594
- for (; i; ) {
595
- if (i.tagName.toLowerCase() === "label") {
596
- const s = v(i);
597
- if (s)
598
- return s;
599
- }
600
- i = i.parentElement;
601
- }
602
- if (t instanceof HTMLInputElement && "labels" in t && t.labels) {
603
- const s = Array.from(t.labels).map((a) => v(a)).filter(Boolean).join(" ");
604
- if (s)
605
- return s;
606
- }
607
- return "placeholder" in t && typeof t.placeholder == "string" ? t.placeholder : null;
608
- }
609
- function xe(t, n) {
610
- if (!D(t))
611
- return null;
612
- const o = de(n), i = t.closest(`[${o}]`);
613
- if (!i)
614
- return null;
615
- const s = i.getAttribute(o);
616
- return s ? { element: i, customEventName: s } : null;
617
- }
618
- const pe = 255;
619
- function C(t) {
620
- return t ? t.slice(0, pe) : null;
621
- }
622
- const R = "click";
623
- function me(t, n) {
624
- const o = u(t.analyticsContext), i = f(t.analyticsContext), s = x(t.analyticsContext), a = d(t.analyticsContext), r = t.event.target || document.activeElement || t.event.currentTarget;
625
- if (!D(r)) {
626
- const E = {
627
- node_type: "unknown"
628
- };
629
- return l(
630
- R,
631
- [
632
- e("feature_list", "2-0-0", o),
633
- e("session", "1-0-4", i),
634
- e("element", "1-0-0", E),
635
- a ? e("step", "1-0-0", a) : void 0,
636
- s ? e("experience", "1-0-1", s) : void 0
637
- ],
638
- n
639
- );
640
- }
641
- const c = T(r) || r, m = {
642
- id: c.id || null,
643
- node_type: c.nodeName.toLowerCase(),
644
- label: C(b(c)),
645
- text: C(v(c))
646
- };
647
- return l(
648
- R,
649
- [
650
- e("feature_list", "2-0-0", o),
651
- e("session", "1-0-4", i),
652
- e("element", "1-0-0", m),
653
- a ? e("step", "1-0-0", a) : void 0,
654
- s ? e("experience", "1-0-1", s) : void 0
655
- ],
656
- n
657
- );
658
- }
659
- const Ce = p(R, me);
660
- function Ee(t, n, o, i) {
661
- const s = q(o.analyticsContext), a = x(o.analyticsContext), r = u(o.analyticsContext), c = B(o.analyticsContext), m = Y(o.analyticsContext), E = lt(o.analyticsContext), $ = ct(o.analyticsContext), g = rt(o.analyticsContext), N = j(o.analyticsContext), w = f(o.analyticsContext), P = d(o.analyticsContext), A = {
662
- id: n.id || null,
663
- node_type: n.nodeName.toLowerCase(),
664
- label: C(b(n)),
665
- text: C(v(n))
666
- };
667
- return l(
668
- t,
669
- [
670
- e("app", "1-0-0", {
671
- organization_id: o.analyticsContext.organizationId,
672
- project_id: o.analyticsContext.projectId
673
- }),
674
- e("session", "1-0-4", w),
675
- e("element", "1-0-0", A),
676
- s ? e("exception", "1-0-0", s) : void 0,
677
- a ? e("experience", "1-0-1", a) : void 0,
678
- r ? e("feature_list", "2-0-0", r) : void 0,
679
- c ? e("field_list", "1-0-0", c) : void 0,
680
- m ? e("form", "1-0-0", m) : void 0,
681
- E ? e("modal", "1-0-0", E) : void 0,
682
- $ ? e("order", "1-0-0", $) : void 0,
683
- g ? e("product_list", "2-0-1", g) : void 0,
684
- N ? e("response_list", "1-0-0", N) : void 0,
685
- P ? e("step", "1-0-0", P) : void 0
686
- ],
687
- i
688
- );
689
- }
690
- function y(t, n, o) {
691
- const i = xe(n.event.target, t);
692
- if (!i)
693
- return;
694
- const { element: s, customEventName: a } = i, r = Ee(a, s, n, o);
695
- Q(r);
696
- }
697
- function io(t, n, o) {
698
- const i = q(t), s = x(t), a = u(t), r = B(t), c = t.form ? Y(t) : void 0, m = t.modal ? lt(t) : void 0, E = ct(t), $ = rt(t), g = j(t), N = f(t), w = d(t), P = l(
699
- n,
700
- [
701
- e("app", "1-0-0", {
702
- organization_id: t.organizationId,
703
- project_id: t.projectId
704
- }),
705
- e("session", "1-0-4", N),
706
- i ? e("exception", "1-0-0", i) : void 0,
707
- s ? e("experience", "1-0-1", s) : void 0,
708
- e("feature_list", "2-0-0", a),
709
- r ? e("field_list", "1-0-0", r) : void 0,
710
- c ? e("form", "1-0-0", c) : void 0,
711
- m ? e("modal", "1-0-0", m) : void 0,
712
- E ? e("order", "1-0-0", E) : void 0,
713
- $ ? e("product_list", "2-0-1", $) : void 0,
714
- g ? e("response_list", "1-0-0", g) : void 0,
715
- w ? e("step", "1-0-0", w) : void 0
716
- ],
717
- o
718
- );
719
- Q(P);
720
- }
721
- const W = "rapid_scroll";
722
- function ve(t, n) {
723
- const o = u(t.analyticsContext), i = f(t.analyticsContext), s = x(t.analyticsContext), a = d(t.analyticsContext), r = t.event.target || document.activeElement || t.event.currentTarget;
724
- if (!D(r)) {
725
- const E = {
726
- node_type: "unknown"
727
- };
728
- return l(
729
- W,
730
- [
731
- e("feature_list", "2-0-0", o),
732
- e("session", "1-0-4", i),
733
- a ? e("step", "1-0-0", a) : void 0,
734
- s ? e("experience", "1-0-1", s) : void 0,
735
- e("element", "1-0-0", E)
736
- ],
737
- n
738
- );
739
- }
740
- const c = T(r) || r, m = {
741
- id: c.id || null,
742
- node_type: c.nodeName.toLowerCase(),
743
- label: C(b(c)),
744
- text: C(v(c))
745
- };
746
- return l(
747
- W,
748
- [
749
- e("feature_list", "2-0-0", o),
750
- e("session", "1-0-4", i),
751
- a ? e("step", "1-0-0", a) : void 0,
752
- s ? e("experience", "1-0-1", s) : void 0,
753
- e("element", "1-0-0", m)
754
- ],
755
- n
756
- );
757
- }
758
- const De = p(W, ve), _e = 100, ke = 100, be = 300;
759
- let Z = 0, tt = 0;
760
- const Te = F(
761
- (t, n) => {
762
- De(t, n), y("rapid_scroll", t, n);
763
- },
764
- be
765
- );
766
- function Le(t, n) {
767
- const o = t.event.target || document.documentElement;
768
- if (!(o instanceof HTMLElement))
769
- return;
770
- const i = o.scrollTop, s = Date.now() - tt;
771
- Math.abs(i - Z) > _e && s < ke && Te(t, n), Z = i, tt = Date.now();
772
- }
773
- const $e = k("scroll", Le, !0), z = "rapid_click";
774
- function ge(t, n) {
775
- const o = u(t.analyticsContext), i = f(t.analyticsContext), s = x(t.analyticsContext), a = d(t.analyticsContext), r = t.event.target || document.activeElement || t.event.currentTarget;
776
- if (!D(r)) {
777
- const E = {
778
- node_type: "unknown"
779
- };
780
- return l(
781
- z,
782
- [
783
- e("feature_list", "2-0-0", o),
784
- e("session", "1-0-4", i),
785
- e("element", "1-0-0", E),
786
- a ? e("step", "1-0-0", a) : void 0,
787
- s ? e("experience", "1-0-1", s) : void 0
788
- ],
789
- n
790
- );
791
- }
792
- const c = T(r) || r, m = {
793
- id: c.id || null,
794
- node_type: c.nodeName.toLowerCase(),
795
- label: C(b(c)),
796
- text: C(v(c))
797
- };
798
- return l(
799
- z,
800
- [
801
- e("feature_list", "2-0-0", o),
802
- e("session", "1-0-4", i),
803
- e("element", "1-0-0", m),
804
- a ? e("step", "1-0-0", a) : void 0,
805
- s ? e("experience", "1-0-1", s) : void 0
806
- ],
807
- n
808
- );
809
- }
810
- const he = p(z, ge);
811
- let O = 0, et = 0;
812
- const ye = 3, Ne = 500;
813
- function we(t, n) {
814
- const o = (/* @__PURE__ */ new Date()).getTime();
815
- o - et < Ne ? O++ : O = 1, et = o, O >= ye && (he(t, n), y("rapid_click", t, n), O = 0);
816
- }
817
- const Pe = k("click", we), U = "right_click";
818
- function Ve(t, n) {
819
- const o = u(t.analyticsContext), i = f(t.analyticsContext), s = x(t.analyticsContext), a = d(t.analyticsContext), r = t.event.target || document.activeElement || t.event.currentTarget;
820
- if (!D(r)) {
821
- const E = {
822
- node_type: "unknown"
823
- };
824
- return l(U, [
825
- e("feature_list", "2-0-0", o),
826
- e("session", "1-0-4", i),
827
- e("element", "1-0-0", E),
828
- a ? e("step", "1-0-0", a) : void 0,
829
- s ? e("experience", "1-0-1", s) : void 0
830
- ]);
831
- }
832
- const c = T(r) || r, m = {
833
- id: c.id || null,
834
- node_type: c.nodeName.toLowerCase(),
835
- label: C(b(c)),
836
- text: C(v(c))
837
- };
838
- return l(
839
- U,
840
- [
841
- e("feature_list", "2-0-0", o),
842
- e("session", "1-0-4", i),
843
- e("element", "1-0-0", m),
844
- a ? e("step", "1-0-0", a) : void 0,
845
- s ? e("experience", "1-0-1", s) : void 0
846
- ],
847
- n
848
- );
849
- }
850
- const Se = p(U, Ve);
851
- function Ye(t, n) {
852
- Se(t, n), y("right_click", t, n);
853
- }
854
- const Be = k("contextmenu", Ye), Tt = "mouse_shake";
855
- function Ae(t, n) {
856
- const o = u(t.analyticsContext), i = f(t.analyticsContext), s = x(t.analyticsContext), a = d(t.analyticsContext);
857
- return l(
858
- Tt,
859
- [
860
- e("feature_list", "2-0-0", o),
861
- e("session", "1-0-4", i),
862
- a ? e("step", "1-0-0", a) : void 0,
863
- s ? e("experience", "1-0-1", s) : void 0
864
- ],
865
- n
866
- );
867
- }
868
- const He = p(Tt, Ae), Oe = 5, je = 500, qe = 500;
869
- let nt = { x: 0 }, V = [], ot = 0;
870
- const Fe = F(
871
- (t, n) => {
872
- He(t, n), y("mouse_shake", t, n);
873
- },
874
- je
875
- );
876
- function Ie(t, n) {
877
- const o = Date.now(), i = t.event.clientX - nt.x, s = Math.sign(i);
878
- o - ot > qe && (V = []), s !== 0 && (V.length === 0 || V.at(-1) !== s) && V.push(s), nt = { x: t.event.clientX, y: t.event.clientY }, V.length >= Oe && (Fe(t, n), V = []), ot = o;
879
- }
880
- const Re = k("mousemove", Ie), Lt = "page_visible";
881
- function We(t, n) {
882
- const o = u(t.analyticsContext), i = f(t.analyticsContext), s = x(t.analyticsContext), a = d(t.analyticsContext);
883
- return l(
884
- Lt,
885
- [
886
- e("feature_list", "2-0-0", o),
887
- e("session", "1-0-4", i),
888
- a ? e("step", "1-0-0", a) : void 0,
889
- s ? e("experience", "1-0-1", s) : void 0
890
- ],
891
- n
892
- );
893
- }
894
- const ze = p(Lt, We), $t = "page_hidden";
895
- function Ue(t, n) {
896
- const o = u(t.analyticsContext), i = f(t.analyticsContext), s = x(t.analyticsContext), a = d(t.analyticsContext);
897
- return l(
898
- $t,
899
- [
900
- e("feature_list", "2-0-0", o),
901
- e("session", "1-0-4", i),
902
- a ? e("step", "1-0-0", a) : void 0,
903
- s ? e("experience", "1-0-1", s) : void 0
904
- ],
905
- n
906
- );
907
- }
908
- const Ge = p($t, Ue);
909
- function Ke(t, n) {
910
- if (document.visibilityState === "visible") {
911
- ze(t, n);
912
- return;
913
- }
914
- Ge(t, n);
915
- }
916
- const Me = Kt("visibilitychange", Ke), G = "backspace";
917
- function Xe(t, n) {
918
- const o = u(t.analyticsContext), i = f(t.analyticsContext), s = x(t.analyticsContext), a = d(t.analyticsContext), r = t.event.target || document.activeElement || t.event.currentTarget;
919
- if (!D(r)) {
920
- const E = {
921
- node_type: "unknown"
922
- };
923
- return l(
924
- G,
925
- [
926
- e("feature_list", "2-0-0", o),
927
- e("session", "1-0-4", i),
928
- e("element", "1-0-0", E),
929
- a ? e("step", "1-0-0", a) : void 0,
930
- s ? e("experience", "1-0-1", s) : void 0
931
- ],
932
- n
933
- );
934
- }
935
- const c = T(r) || r, m = {
936
- id: c.id || null,
937
- node_type: c.nodeName.toLowerCase(),
938
- label: C(b(c)),
939
- text: C(v(c))
940
- };
941
- return l(
942
- G,
943
- [
944
- e("feature_list", "2-0-0", o),
945
- e("session", "1-0-4", i),
946
- e("element", "1-0-0", m),
947
- a ? e("step", "1-0-0", a) : void 0,
948
- s ? e("experience", "1-0-1", s) : void 0
949
- ],
950
- n
951
- );
952
- }
953
- const Je = p(G, Xe);
954
- function Qe(t, n) {
955
- t.event.key === "Backspace" && Je(t, n);
956
- }
957
- const Ze = k("keydown", Qe), gt = "page_hide";
958
- function tn(t, n) {
959
- const o = u(t.analyticsContext), i = f(t.analyticsContext), s = x(t.analyticsContext), a = d(t.analyticsContext);
960
- return l(
961
- gt,
962
- [
963
- e("feature_list", "2-0-0", o),
964
- e("session", "1-0-4", i),
965
- a ? e("step", "1-0-0", a) : void 0,
966
- s ? e("experience", "1-0-1", s) : void 0
967
- ],
968
- n
969
- );
970
- }
971
- const en = p(gt, tn);
972
- function nn(t, n) {
973
- en(t, n);
974
- }
975
- const on = S("pagehide", nn), ht = "page_show";
976
- function sn(t, n) {
977
- const o = u(t.analyticsContext), i = f(t.analyticsContext), s = x(t.analyticsContext), a = d(t.analyticsContext);
978
- return l(
979
- ht,
980
- [
981
- e("feature_list", "2-0-0", o),
982
- e("session", "1-0-4", i),
983
- a ? e("step", "1-0-0", a) : void 0,
984
- s ? e("experience", "1-0-1", s) : void 0
985
- ],
986
- n
987
- );
988
- }
989
- const an = p(ht, sn);
990
- function rn(t, n) {
991
- an(t, n);
992
- }
993
- const cn = S("pageshow", rn), yt = "offline";
994
- function ln(t, n) {
995
- const o = u(t.analyticsContext), i = f(t.analyticsContext), s = x(t.analyticsContext), a = d(t.analyticsContext);
996
- return l(
997
- yt,
998
- [
999
- e("feature_list", "2-0-0", o),
1000
- e("session", "1-0-4", i),
1001
- a ? e("step", "1-0-0", a) : void 0,
1002
- s ? e("experience", "1-0-1", s) : void 0
1003
- ],
1004
- n
1005
- );
1006
- }
1007
- const un = p(yt, ln);
1008
- function fn(t, n) {
1009
- un(t, n);
1010
- }
1011
- const dn = S("offline", fn), K = "scroll";
1012
- function xn(t, n) {
1013
- const o = u(t.analyticsContext), i = f(t.analyticsContext), s = x(t.analyticsContext), a = d(t.analyticsContext), r = t.event.target || document.activeElement || t.event.currentTarget;
1014
- if (!D(r))
1015
- return l(
1016
- K,
1017
- [
1018
- e("feature_list", "2-0-0", o),
1019
- e("session", "1-0-4", i),
1020
- a ? e("step", "1-0-0", a) : void 0,
1021
- s ? e("experience", "1-0-1", s) : void 0
1022
- ],
1023
- n
1024
- );
1025
- const c = T(r) || r, m = {
1026
- id: c.id || null,
1027
- node_type: c.nodeName.toLowerCase(),
1028
- label: C(b(c)),
1029
- text: C(v(c))
1030
- };
1031
- return l(
1032
- K,
1033
- [
1034
- e("feature_list", "2-0-0", o),
1035
- e("session", "1-0-4", i),
1036
- a ? e("step", "1-0-0", a) : void 0,
1037
- s ? e("experience", "1-0-1", s) : void 0,
1038
- e("element", "1-0-0", m)
1039
- ],
1040
- n
1041
- );
1042
- }
1043
- const pn = p(K, xn), mn = F(
1044
- (t, n) => {
1045
- pn(t, n), y("scroll", t, n);
1046
- },
1047
- 500
1048
- ), Cn = k("scroll", mn, !0), Nt = "online";
1049
- function En(t, n) {
1050
- const o = u(t.analyticsContext), i = f(t.analyticsContext), s = x(t.analyticsContext), a = d(t.analyticsContext);
1051
- return l(
1052
- Nt,
1053
- [
1054
- e("feature_list", "2-0-0", o),
1055
- e("session", "1-0-4", i),
1056
- a ? e("step", "1-0-0", a) : void 0,
1057
- s ? e("experience", "1-0-1", s) : void 0
1058
- ],
1059
- n
1060
- );
1061
- }
1062
- const vn = p(Nt, En);
1063
- function Dn(t, n) {
1064
- vn(t, n);
1065
- }
1066
- const _n = S("online", Dn), wt = "resize";
1067
- function kn(t, n) {
1068
- const o = u(t.analyticsContext), i = f(t.analyticsContext), s = x(t.analyticsContext), a = d(t.analyticsContext);
1069
- return l(
1070
- wt,
1071
- [
1072
- e("feature_list", "2-0-0", o),
1073
- e("session", "1-0-4", i),
1074
- a ? e("step", "1-0-0", a) : void 0,
1075
- s ? e("experience", "1-0-1", s) : void 0
1076
- ],
1077
- n
1078
- );
1079
- }
1080
- const st = p(wt, kn);
1081
- let I = 0;
1082
- const bn = F(
1083
- (t, n) => {
1084
- const o = window.innerWidth;
1085
- o !== I ? (st(t, n), I = o) : "ontouchstart" in window || st(t, n), I = o;
1086
- },
1087
- 300
1088
- ), Tn = S("resize", bn), Pt = "unload";
1089
- function Ln(t, n) {
1090
- const o = u(t.analyticsContext), i = f(t.analyticsContext), s = x(t.analyticsContext), a = d(t.analyticsContext);
1091
- return l(
1092
- Pt,
1093
- [
1094
- e("feature_list", "2-0-0", o),
1095
- e("session", "1-0-4", i),
1096
- a ? e("step", "1-0-0", a) : void 0,
1097
- s ? e("experience", "1-0-1", s) : void 0
1098
- ],
1099
- n
1100
- );
1101
- }
1102
- const $n = p(Pt, Ln);
1103
- function gn(t, n) {
1104
- $n(t, n);
1105
- }
1106
- const hn = S("unload", gn);
1107
- function yn(t, n) {
1108
- Ce(t, n), y("click", t, n);
1109
- }
1110
- const Nn = k("click", yn), M = "paste";
1111
- function wn(t, n) {
1112
- const o = u(t.analyticsContext), i = f(t.analyticsContext), s = x(t.analyticsContext), a = d(t.analyticsContext), r = t.event.target || document.activeElement || t.event.currentTarget;
1113
- if (!D(r))
1114
- return l(
1115
- M,
1116
- [
1117
- e("feature_list", "2-0-0", o),
1118
- e("session", "1-0-4", i),
1119
- a ? e("step", "1-0-0", a) : void 0,
1120
- s ? e("experience", "1-0-1", s) : void 0
1121
- ],
1122
- n
1123
- );
1124
- const c = T(r) || r, m = {
1125
- id: c.id || null,
1126
- node_type: c.nodeName.toLowerCase(),
1127
- label: C(b(c)),
1128
- text: C(v(c))
1129
- };
1130
- return l(
1131
- M,
1132
- [
1133
- e("feature_list", "2-0-0", o),
1134
- e("session", "1-0-4", i),
1135
- a ? e("step", "1-0-0", a) : void 0,
1136
- s ? e("experience", "1-0-1", s) : void 0,
1137
- e("element", "1-0-0", m)
1138
- ],
1139
- n
1140
- );
1141
- }
1142
- const Pn = p(M, wn);
1143
- function Vn(t, n) {
1144
- Pn(t, n);
1145
- }
1146
- const Sn = k("paste", Vn), X = "copy";
1147
- function Yn(t, n) {
1148
- const o = u(t.analyticsContext), i = f(t.analyticsContext), s = x(t.analyticsContext), a = d(t.analyticsContext), r = t.event.target || document.activeElement || t.event.currentTarget;
1149
- if (!D(r))
1150
- return l(
1151
- X,
1152
- [
1153
- e("feature_list", "2-0-0", o),
1154
- e("session", "1-0-4", i),
1155
- a ? e("step", "1-0-0", a) : void 0,
1156
- s ? e("experience", "1-0-1", s) : void 0
1157
- ],
1158
- n
1159
- );
1160
- const c = T(r) || r, m = {
1161
- id: c.id || null,
1162
- node_type: c.nodeName.toLowerCase(),
1163
- label: C(b(c)),
1164
- text: C(v(c))
1165
- };
1166
- return l(
1167
- X,
1168
- [
1169
- e("feature_list", "2-0-0", o),
1170
- e("session", "1-0-4", i),
1171
- a ? e("step", "1-0-0", a) : void 0,
1172
- s ? e("experience", "1-0-1", s) : void 0,
1173
- e("element", "1-0-0", m)
1174
- ],
1175
- n
1176
- );
1177
- }
1178
- const Bn = p(X, Yn);
1179
- function An(t, n) {
1180
- Bn(t, n);
1181
- }
1182
- const Hn = k("copy", An), J = "drag";
1183
- function On(t, n) {
1184
- const o = u(t.analyticsContext), i = f(t.analyticsContext), s = x(t.analyticsContext), a = d(t.analyticsContext), r = t.event.target || document.activeElement || t.event.currentTarget;
1185
- if (!D(r))
1186
- return l(
1187
- J,
1188
- [
1189
- e("feature_list", "2-0-0", o),
1190
- e("session", "1-0-4", i),
1191
- a ? e("step", "1-0-0", a) : void 0,
1192
- s ? e("experience", "1-0-1", s) : void 0
1193
- ],
1194
- n
1195
- );
1196
- const c = T(r) || r, m = {
1197
- id: c.id || null,
1198
- node_type: c.nodeName.toLowerCase(),
1199
- label: C(b(c)),
1200
- text: C(v(c))
1201
- };
1202
- return l(
1203
- J,
1204
- [
1205
- e("feature_list", "2-0-0", o),
1206
- e("session", "1-0-4", i),
1207
- a ? e("step", "1-0-0", a) : void 0,
1208
- s ? e("experience", "1-0-1", s) : void 0,
1209
- e("element", "1-0-0", m)
1210
- ],
1211
- n
1212
- );
1213
- }
1214
- const jn = p(J, On);
1215
- function Vt(t, n) {
1216
- const o = t.event.currentTarget;
1217
- if (!o || !(o instanceof HTMLElement))
1218
- return;
1219
- function i(s) {
1220
- Vt({ event: s, analyticsContext: t.analyticsContext });
1221
- }
1222
- o.removeEventListener("drag", i), o.addEventListener(
1223
- "dragend",
1224
- () => St(o, () => t.analyticsContext)
1225
- ), jn(t, n), y("drag", t, n);
1226
- }
1227
- const St = k("drag", Vt);
1228
- function ro(t, n) {
1229
- n && (Nn(n, t), Pe(n, t), Be(n, t), Hn(n, t), Sn(n, t), St(n, t), Ze(n, t), Cn(n, t), $e(n, t), Re(n, t));
1230
- }
1231
- function co(t) {
1232
- Me(t), on(t), cn(t), dn(t), _n(t), Tn(t), hn(t);
1233
- }
1234
- export {
1235
- oo as A,
1236
- ao as B,
1237
- io as C,
1238
- Zn as D,
1239
- to as E,
1240
- eo as F,
1241
- f as a,
1242
- x as b,
1243
- p as c,
1244
- d,
1245
- j as e,
1246
- u as f,
1247
- B as g,
1248
- l as h,
1249
- e as i,
1250
- q as j,
1251
- rt as k,
1252
- ct as l,
1253
- lt as m,
1254
- co as n,
1255
- ro as o,
1256
- Un as p,
1257
- Kn as q,
1258
- Mn as r,
1259
- Xn as s,
1260
- Gn as t,
1261
- y as u,
1262
- Ce as v,
1263
- Jn as w,
1264
- Qn as x,
1265
- no as y,
1266
- so as z
1267
- };