@picked/analytics 0.0.1-dev.1772493269328 → 0.0.1-dev.1773364848747

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,10 +1,10 @@
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) {
1
+ import { trackSelfDescribingEvent as Q, newTracker as Ht, addGlobalContexts as Ot, enableActivityTracking as jt, enableActivityTrackingCallback as qt } from "@snowplow/browser-tracker";
2
+ import { ButtonClickTrackingPlugin as Ft, enableButtonClickTracking as It } from "@snowplow/browser-plugin-button-click-tracking";
3
+ import { PerformanceNavigationTimingPlugin as Wt } from "@snowplow/browser-plugin-performance-navigation-timing";
4
+ import { ErrorTrackingPlugin as Rt, enableErrorTracking as zt } from "@snowplow/browser-plugin-error-tracking";
5
+ import { WebVitalsPlugin as Ut } from "@snowplow/browser-plugin-web-vitals";
6
+ import { supportsDocument as it, supportsWindow as Gt, supportsCookies as Kt } from "@picked/client";
7
+ function rt(t, n) {
8
8
  return `iglu:dev.pckd/${t}/jsonschema/${n}`;
9
9
  }
10
10
  function L(t, ...n) {
@@ -14,7 +14,7 @@ function h(t, ...n) {
14
14
  function l(t, n, o = {}) {
15
15
  return {
16
16
  event: {
17
- schema: it("event", "1-0-0"),
17
+ schema: rt("event", "1-0-0"),
18
18
  data: {
19
19
  type: t,
20
20
  meta: o
@@ -27,7 +27,7 @@ function l(t, n, o = {}) {
27
27
  }
28
28
  function e(t, n, o) {
29
29
  return {
30
- schema: it(t, n),
30
+ schema: rt(t, n),
31
31
  data: o
32
32
  };
33
33
  }
@@ -37,41 +37,36 @@ function p(t, n) {
37
37
  Q(s);
38
38
  };
39
39
  }
40
+ function Z(t, n) {
41
+ return function(i) {
42
+ const s = {
43
+ event: i,
44
+ analyticsContext: n()
45
+ };
46
+ t(s);
47
+ };
48
+ }
40
49
  function k(t, n, o = { passive: !0 }) {
41
50
  const i = /* @__PURE__ */ new WeakMap();
42
51
  return (s, a) => {
43
52
  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);
53
+ r || (r = /* @__PURE__ */ new Set(), i.set(s, r)), !r.has(t) && (s.addEventListener(t, Z(n, a), o), r.add(t));
51
54
  };
52
55
  }
53
- function Kt(t, n) {
56
+ function Mt(t, n) {
54
57
  const o = /* @__PURE__ */ new Set();
55
58
  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);
59
+ o.has(t) || it() && (document.addEventListener(t, Z(n, i), {
60
+ passive: !0
61
+ }), o.add(t));
63
62
  };
64
63
  }
65
64
  function S(t, n) {
66
65
  const o = /* @__PURE__ */ new Set();
67
66
  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);
67
+ o.has(t) || Gt() && (window.addEventListener(t, Z(n, i), {
68
+ passive: !0
69
+ }), o.add(t));
75
70
  };
76
71
  }
77
72
  function u(t) {
@@ -84,7 +79,7 @@ function u(t) {
84
79
  }
85
80
  const _ = "unknown";
86
81
  function f(t) {
87
- const n = Mt(), o = {
82
+ const n = Xt(), o = {
88
83
  id: t.sessionId || null
89
84
  };
90
85
  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;
@@ -103,12 +98,10 @@ function B(t) {
103
98
  function j(t) {
104
99
  if (t.responses)
105
100
  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
- )
101
+ items: t.responses.map(({ fieldId: n, value: o }) => ({
102
+ field_id: n,
103
+ values: Array.isArray(o) ? o.map((i) => ({ value: i })) : [{ value: o }]
104
+ }))
112
105
  };
113
106
  }
114
107
  function d(t, n = !1) {
@@ -116,7 +109,7 @@ function d(t, n = !1) {
116
109
  if (o)
117
110
  return {
118
111
  id: o.id,
119
- title: o.label
112
+ title: o.name
120
113
  };
121
114
  if (n)
122
115
  return h('"step" is required for this event', t), {
@@ -124,7 +117,7 @@ function d(t, n = !1) {
124
117
  title: _
125
118
  };
126
119
  }
127
- function rt(t, n = !1) {
120
+ function ct(t, n = !1) {
128
121
  const { productList: o } = t;
129
122
  if (o) {
130
123
  const i = {};
@@ -164,7 +157,7 @@ function rt(t, n = !1) {
164
157
  items: []
165
158
  };
166
159
  }
167
- function ct(t, n = !1) {
160
+ function lt(t, n = !1) {
168
161
  const { order: o } = t;
169
162
  if (o) {
170
163
  const i = {
@@ -211,7 +204,7 @@ function Y(t) {
211
204
  title: _
212
205
  });
213
206
  }
214
- function lt(t) {
207
+ function ut(t) {
215
208
  const { modal: n } = t;
216
209
  return n ? {
217
210
  id: n.id,
@@ -223,8 +216,8 @@ function lt(t) {
223
216
  }
224
217
  function F(t, n = 300) {
225
218
  let o;
226
- return function(...i) {
227
- clearTimeout(o), o = setTimeout(() => t.apply(this, i), n);
219
+ return function(...s) {
220
+ clearTimeout(o), o = setTimeout(() => t.apply(this, s), n);
228
221
  };
229
222
  }
230
223
  function H(t) {
@@ -236,8 +229,8 @@ function H(t) {
236
229
  if (!isNaN(n))
237
230
  return n;
238
231
  }
239
- function Mt() {
240
- if (!at() || !Gt())
232
+ function Xt() {
233
+ if (!it() || !Kt())
241
234
  return null;
242
235
  const t = "_ga=", n = document.cookie ? document.cookie.split(";") : [];
243
236
  for (const o of n) {
@@ -249,25 +242,25 @@ function Mt() {
249
242
  }
250
243
  }
251
244
  }
252
- function Xt(t) {
245
+ function Jt(t) {
253
246
  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;
247
+ return t.trackErrors && (L(), n.push(Rt())), t.trackVitals && (L(), n.push(Ut())), t.trackPerformance && (L(), n.push(Wt())), (t.trackButtonClickAllowList || t.trackButtonClickFilter) && n.push(Ft()), n;
255
248
  }
256
- function Jt(t) {
257
- t.trackActivity && !t.trackActivityCallback && (L(), Ot({
249
+ function Qt(t) {
250
+ t.trackActivity && !t.trackActivityCallback && (L(), jt({
258
251
  minimumVisitLength: 30,
259
252
  heartbeatDelay: 10
260
- })), t.trackActivity && t.trackActivityCallback && (L(), jt({
253
+ })), t.trackActivity && t.trackActivityCallback && (L(), qt({
261
254
  minimumVisitLength: 30,
262
255
  heartbeatDelay: 10,
263
256
  callback: t.trackActivityCallback
264
- })), (t.trackButtonClickAllowList || t.trackButtonClickFilter) && (L(), Ft({
257
+ })), (t.trackButtonClickAllowList || t.trackButtonClickFilter) && (L(), It({
265
258
  filter: t.trackButtonClickAllowList ? {
266
259
  allowlist: t.trackButtonClickAllowList
267
260
  } : t.trackButtonClickFilter
268
- })), t.trackErrors && (L(), Wt());
261
+ })), t.trackErrors && (L(), zt());
269
262
  }
270
- function Un({
263
+ function Gn({
271
264
  organizationId: t,
272
265
  projectId: n,
273
266
  cvlyX: o,
@@ -292,7 +285,7 @@ function Un({
292
285
  trackPerformance: c,
293
286
  trackActivityCallback: w,
294
287
  trackButtonClickAllowList: P
295
- }, Yt = {
288
+ }, Bt = {
296
289
  appId: a,
297
290
  platform: "web",
298
291
  keepalive: !0,
@@ -301,16 +294,16 @@ function Un({
301
294
  session: E,
302
295
  browser: $ || !1
303
296
  },
304
- plugins: Xt(A)
305
- }, Bt = At(a, s, Yt);
306
- return Qt({
297
+ plugins: Jt(A)
298
+ }, At = Ht(a, s, Bt);
299
+ return Zt({
307
300
  organizationId: t,
308
301
  projectId: n,
309
302
  cvlyX: o,
310
303
  deployment: i
311
- }), Jt(A), Bt;
304
+ }), Qt(A), At;
312
305
  }
313
- function Qt({ organizationId: t, projectId: n, cvlyX: o, deployment: i }) {
306
+ function Zt({ organizationId: t, projectId: n, cvlyX: o, deployment: i }) {
314
307
  if (!t || !n)
315
308
  throw new Error("bindGlobalContext: Both organizationId and projectId are required");
316
309
  const s = [];
@@ -331,13 +324,13 @@ function Qt({ organizationId: t, projectId: n, cvlyX: o, deployment: i }) {
331
324
  vercel_env: o.vercelEnv,
332
325
  vercel_url: o.vercelUrl
333
326
  })
334
- ), Ht(s);
327
+ ), Ot(s);
335
328
  }
336
- const ut = "app_close";
337
- function Zt(t, n) {
329
+ const ft = "app_close";
330
+ function te(t, n) {
338
331
  const o = u(t), i = f(t), s = x(t), a = d(t);
339
332
  return l(
340
- ut,
333
+ ft,
341
334
  [
342
335
  e("feature_list", "2-0-0", o),
343
336
  e("session", "1-0-4", i),
@@ -347,11 +340,11 @@ function Zt(t, n) {
347
340
  n
348
341
  );
349
342
  }
350
- const Gn = p(ut, Zt), ft = "app_initialize";
351
- function te(t, n) {
343
+ const Kn = p(ft, te), dt = "app_initialize";
344
+ function ee(t, n) {
352
345
  const o = u(t), i = f(t), s = x(t), a = d(t);
353
346
  return l(
354
- ft,
347
+ dt,
355
348
  [
356
349
  e("feature_list", "2-0-0", o),
357
350
  e("session", "1-0-4", i),
@@ -361,11 +354,11 @@ function te(t, n) {
361
354
  n
362
355
  );
363
356
  }
364
- const Kn = p(ft, te), dt = "app_load";
365
- function ee(t, n) {
357
+ const Mn = p(dt, ee), xt = "app_load";
358
+ function ne(t, n) {
366
359
  const o = u(t), i = f(t), s = x(t), a = d(t);
367
360
  return l(
368
- dt,
361
+ xt,
369
362
  [
370
363
  e("feature_list", "2-0-0", o),
371
364
  e("session", "1-0-4", i),
@@ -375,11 +368,11 @@ function ee(t, n) {
375
368
  n
376
369
  );
377
370
  }
378
- const Mn = p(dt, ee), xt = "app_open";
379
- function ne(t, n) {
371
+ const Xn = p(xt, ne), pt = "app_open";
372
+ function oe(t, n) {
380
373
  const o = u(t), i = f(t), s = x(t), a = d(t);
381
374
  return l(
382
- xt,
375
+ pt,
383
376
  [
384
377
  e("feature_list", "2-0-0", o),
385
378
  e("session", "1-0-4", i),
@@ -389,11 +382,11 @@ function ne(t, n) {
389
382
  n
390
383
  );
391
384
  }
392
- const Xn = p(xt, ne), pt = "experience_load";
393
- function oe(t, n) {
385
+ const Jn = p(pt, oe), mt = "experience_load";
386
+ function se(t, n) {
394
387
  const o = u(t), i = f(t), s = x(t, !0), a = d(t);
395
388
  return l(
396
- pt,
389
+ mt,
397
390
  [
398
391
  e("feature_list", "2-0-0", o),
399
392
  e("session", "1-0-4", i),
@@ -403,11 +396,11 @@ function oe(t, n) {
403
396
  n
404
397
  );
405
398
  }
406
- const Jn = p(pt, oe), mt = "feature_decide";
407
- function se(t, n) {
399
+ const Qn = p(mt, se), Ct = "feature_decide";
400
+ function ae(t, n) {
408
401
  const o = u(t), i = f(t), s = x(t), a = d(t);
409
402
  return l(
410
- mt,
403
+ Ct,
411
404
  [
412
405
  e("feature_list", "2-0-0", o),
413
406
  e("session", "1-0-4", i),
@@ -417,11 +410,11 @@ function se(t, n) {
417
410
  n
418
411
  );
419
412
  }
420
- const Qn = p(mt, se), Ct = "step_enter";
421
- function ae(t, n) {
413
+ const Zn = p(Ct, ae), Et = "step_enter";
414
+ function ie(t, n) {
422
415
  const o = u(t), i = f(t), s = x(t), a = d(t, !0), r = B(t);
423
416
  return l(
424
- Ct,
417
+ Et,
425
418
  [
426
419
  e("feature_list", "2-0-0", o),
427
420
  e("session", "1-0-4", i),
@@ -432,11 +425,11 @@ function ae(t, n) {
432
425
  n
433
426
  );
434
427
  }
435
- const Zn = p(Ct, ae), Et = "step_submit";
436
- function ie(t, n) {
428
+ const to = p(Et, ie), vt = "step_submit";
429
+ function re(t, n) {
437
430
  const o = u(t), i = f(t), s = x(t), a = d(t, !0), r = j(t), c = B(t);
438
431
  return l(
439
- Et,
432
+ vt,
440
433
  [
441
434
  e("feature_list", "2-0-0", o),
442
435
  e("session", "1-0-4", i),
@@ -448,11 +441,11 @@ function ie(t, n) {
448
441
  n
449
442
  );
450
443
  }
451
- const to = p(Et, ie), vt = "step_submit_success";
452
- function re(t, n) {
444
+ const eo = p(vt, re), Dt = "step_submit_success";
445
+ function ce(t, n) {
453
446
  const o = u(t), i = f(t), s = x(t), a = d(t, !0), r = B(t), c = j(t);
454
447
  return l(
455
- vt,
448
+ Dt,
456
449
  [
457
450
  e("feature_list", "2-0-0", o),
458
451
  e("session", "1-0-4", i),
@@ -464,11 +457,11 @@ function re(t, n) {
464
457
  n
465
458
  );
466
459
  }
467
- const eo = p(vt, re), Dt = "field_validation_error";
468
- function ce(t, n) {
460
+ const no = p(Dt, ce), _t = "field_validation_error";
461
+ function le(t, n) {
469
462
  const o = u(t), i = f(t), s = Y(t), a = q(t, !0), r = x(t), c = d(t);
470
463
  return l(
471
- Dt,
464
+ _t,
472
465
  [
473
466
  e("feature_list", "2-0-0", o),
474
467
  e("session", "1-0-4", i),
@@ -480,11 +473,11 @@ function ce(t, n) {
480
473
  n
481
474
  );
482
475
  }
483
- const no = p(Dt, ce), _t = "form_submit";
484
- function le(t, n) {
476
+ const oo = p(_t, le), kt = "form_submit";
477
+ function ue(t, n) {
485
478
  const o = u(t), i = f(t), s = Y(t), a = x(t), r = d(t);
486
479
  return l(
487
- _t,
480
+ kt,
488
481
  [
489
482
  e("feature_list", "2-0-0", o),
490
483
  e("session", "1-0-4", i),
@@ -495,11 +488,11 @@ function le(t, n) {
495
488
  n
496
489
  );
497
490
  }
498
- const oo = p(_t, le), kt = "form_submit_error";
499
- function ue(t, n) {
491
+ const so = p(kt, ue), bt = "form_submit_error";
492
+ function fe(t, n) {
500
493
  const o = u(t), i = f(t), s = Y(t), a = q(t, !0), r = x(t), c = d(t);
501
494
  return l(
502
- kt,
495
+ bt,
503
496
  [
504
497
  e("feature_list", "2-0-0", o),
505
498
  e("session", "1-0-4", i),
@@ -511,11 +504,11 @@ function ue(t, n) {
511
504
  n
512
505
  );
513
506
  }
514
- const so = p(kt, ue), bt = "form_submit_success";
515
- function fe(t, n) {
507
+ const ao = p(bt, fe), Tt = "form_submit_success";
508
+ function de(t, n) {
516
509
  const o = u(t), i = f(t), s = Y(t), a = x(t), r = d(t);
517
510
  return l(
518
- bt,
511
+ Tt,
519
512
  [
520
513
  e("feature_list", "2-0-0", o),
521
514
  e("session", "1-0-4", i),
@@ -526,11 +519,11 @@ function fe(t, n) {
526
519
  n
527
520
  );
528
521
  }
529
- const ao = p(bt, fe);
522
+ const io = p(Tt, de);
530
523
  function D(t) {
531
524
  return t instanceof Element;
532
525
  }
533
- function de(t) {
526
+ function xe(t) {
534
527
  return `data-picked-${t.replaceAll("_", "-")}`;
535
528
  }
536
529
  function T(t) {
@@ -606,28 +599,28 @@ function b(t) {
606
599
  }
607
600
  return "placeholder" in t && typeof t.placeholder == "string" ? t.placeholder : null;
608
601
  }
609
- function xe(t, n) {
602
+ function pe(t, n) {
610
603
  if (!D(t))
611
604
  return null;
612
- const o = de(n), i = t.closest(`[${o}]`);
605
+ const o = xe(n), i = t.closest(`[${o}]`);
613
606
  if (!i)
614
607
  return null;
615
608
  const s = i.getAttribute(o);
616
609
  return s ? { element: i, customEventName: s } : null;
617
610
  }
618
- const pe = 255;
611
+ const me = 255;
619
612
  function C(t) {
620
- return t ? t.slice(0, pe) : null;
613
+ return t ? t.slice(0, me) : null;
621
614
  }
622
- const R = "click";
623
- function me(t, n) {
615
+ const W = "click";
616
+ function Ce(t, n) {
624
617
  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
618
  if (!D(r)) {
626
619
  const E = {
627
620
  node_type: "unknown"
628
621
  };
629
622
  return l(
630
- R,
623
+ W,
631
624
  [
632
625
  e("feature_list", "2-0-0", o),
633
626
  e("session", "1-0-4", i),
@@ -645,7 +638,7 @@ function me(t, n) {
645
638
  text: C(v(c))
646
639
  };
647
640
  return l(
648
- R,
641
+ W,
649
642
  [
650
643
  e("feature_list", "2-0-0", o),
651
644
  e("session", "1-0-4", i),
@@ -656,9 +649,9 @@ function me(t, n) {
656
649
  n
657
650
  );
658
651
  }
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 = {
652
+ const Ee = p(W, Ce);
653
+ function ve(t, n, o, i) {
654
+ const s = q(o.analyticsContext), a = x(o.analyticsContext), r = u(o.analyticsContext), c = B(o.analyticsContext), m = Y(o.analyticsContext), E = ut(o.analyticsContext), $ = lt(o.analyticsContext), g = ct(o.analyticsContext), N = j(o.analyticsContext), w = f(o.analyticsContext), P = d(o.analyticsContext), A = {
662
655
  id: n.id || null,
663
656
  node_type: n.nodeName.toLowerCase(),
664
657
  label: C(b(n)),
@@ -688,14 +681,14 @@ function Ee(t, n, o, i) {
688
681
  );
689
682
  }
690
683
  function y(t, n, o) {
691
- const i = xe(n.event.target, t);
684
+ const i = pe(n.event.target, t);
692
685
  if (!i)
693
686
  return;
694
- const { element: s, customEventName: a } = i, r = Ee(a, s, n, o);
687
+ const { element: s, customEventName: a } = i, r = ve(a, s, n, o);
695
688
  Q(r);
696
689
  }
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(
690
+ function ro(t, n, o) {
691
+ const i = q(t), s = x(t), a = u(t), r = B(t), c = t.form ? Y(t) : void 0, m = t.modal ? ut(t) : void 0, E = lt(t), $ = ct(t), g = j(t), N = f(t), w = d(t), P = l(
699
692
  n,
700
693
  [
701
694
  e("app", "1-0-0", {
@@ -718,15 +711,15 @@ function io(t, n, o) {
718
711
  );
719
712
  Q(P);
720
713
  }
721
- const W = "rapid_scroll";
722
- function ve(t, n) {
714
+ const R = "rapid_scroll";
715
+ function De(t, n) {
723
716
  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
717
  if (!D(r)) {
725
718
  const E = {
726
719
  node_type: "unknown"
727
720
  };
728
721
  return l(
729
- W,
722
+ R,
730
723
  [
731
724
  e("feature_list", "2-0-0", o),
732
725
  e("session", "1-0-4", i),
@@ -744,7 +737,7 @@ function ve(t, n) {
744
737
  text: C(v(c))
745
738
  };
746
739
  return l(
747
- W,
740
+ R,
748
741
  [
749
742
  e("feature_list", "2-0-0", o),
750
743
  e("session", "1-0-4", i),
@@ -755,23 +748,23 @@ function ve(t, n) {
755
748
  n
756
749
  );
757
750
  }
758
- const De = p(W, ve), _e = 100, ke = 100, be = 300;
759
- let Z = 0, tt = 0;
760
- const Te = F(
751
+ const _e = p(R, De), ke = 100, be = 100, Te = 300;
752
+ let tt = 0, et = 0;
753
+ const Le = F(
761
754
  (t, n) => {
762
- De(t, n), y("rapid_scroll", t, n);
755
+ _e(t, n), y("rapid_scroll", t, n);
763
756
  },
764
- be
757
+ Te
765
758
  );
766
- function Le(t, n) {
759
+ function $e(t, n) {
767
760
  const o = t.event.target || document.documentElement;
768
761
  if (!(o instanceof HTMLElement))
769
762
  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();
763
+ const i = o.scrollTop, s = Date.now() - et;
764
+ Math.abs(i - tt) > ke && s < be && Le(t, n), tt = i, et = Date.now();
772
765
  }
773
- const $e = k("scroll", Le, !0), z = "rapid_click";
774
- function ge(t, n) {
766
+ const ge = k("scroll", $e, !0), z = "rapid_click";
767
+ function he(t, n) {
775
768
  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
769
  if (!D(r)) {
777
770
  const E = {
@@ -807,15 +800,15 @@ function ge(t, n) {
807
800
  n
808
801
  );
809
802
  }
810
- const he = p(z, ge);
811
- let O = 0, et = 0;
812
- const ye = 3, Ne = 500;
813
- function we(t, n) {
803
+ const ye = p(z, he);
804
+ let O = 0, nt = 0;
805
+ const Ne = 3, we = 500;
806
+ function Pe(t, n) {
814
807
  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);
808
+ o - nt < we ? O++ : O = 1, nt = o, O >= Ne && (ye(t, n), y("rapid_click", t, n), O = 0);
816
809
  }
817
- const Pe = k("click", we), U = "right_click";
818
- function Ve(t, n) {
810
+ const Ve = k("click", Pe), U = "right_click";
811
+ function Se(t, n) {
819
812
  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
813
  if (!D(r)) {
821
814
  const E = {
@@ -847,15 +840,15 @@ function Ve(t, n) {
847
840
  n
848
841
  );
849
842
  }
850
- const Se = p(U, Ve);
851
- function Ye(t, n) {
852
- Se(t, n), y("right_click", t, n);
843
+ const Ye = p(U, Se);
844
+ function Be(t, n) {
845
+ Ye(t, n), y("right_click", t, n);
853
846
  }
854
- const Be = k("contextmenu", Ye), Tt = "mouse_shake";
855
- function Ae(t, n) {
847
+ const Ae = k("contextmenu", Be), Lt = "mouse_shake";
848
+ function He(t, n) {
856
849
  const o = u(t.analyticsContext), i = f(t.analyticsContext), s = x(t.analyticsContext), a = d(t.analyticsContext);
857
850
  return l(
858
- Tt,
851
+ Lt,
859
852
  [
860
853
  e("feature_list", "2-0-0", o),
861
854
  e("session", "1-0-4", i),
@@ -865,23 +858,23 @@ function Ae(t, n) {
865
858
  n
866
859
  );
867
860
  }
868
- const He = p(Tt, Ae), Oe = 5, je = 500, qe = 500;
869
- let nt = { x: 0 }, V = [], ot = 0;
870
- const Fe = F(
861
+ const Oe = p(Lt, He), je = 5, qe = 500, Fe = 500;
862
+ let ot = { x: 0 }, V = [], st = 0;
863
+ const Ie = F(
871
864
  (t, n) => {
872
- He(t, n), y("mouse_shake", t, n);
865
+ Oe(t, n), y("mouse_shake", t, n);
873
866
  },
874
- je
867
+ qe
875
868
  );
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
869
  function We(t, n) {
870
+ const o = Date.now(), i = t.event.clientX - ot.x, s = Math.sign(i);
871
+ o - st > Fe && (V = []), s !== 0 && (V.length === 0 || V.at(-1) !== s) && V.push(s), ot = { x: t.event.clientX, y: t.event.clientY }, V.length >= je && (Ie(t, n), V = []), st = o;
872
+ }
873
+ const Re = k("mousemove", We), $t = "page_visible";
874
+ function ze(t, n) {
882
875
  const o = u(t.analyticsContext), i = f(t.analyticsContext), s = x(t.analyticsContext), a = d(t.analyticsContext);
883
876
  return l(
884
- Lt,
877
+ $t,
885
878
  [
886
879
  e("feature_list", "2-0-0", o),
887
880
  e("session", "1-0-4", i),
@@ -891,11 +884,11 @@ function We(t, n) {
891
884
  n
892
885
  );
893
886
  }
894
- const ze = p(Lt, We), $t = "page_hidden";
895
- function Ue(t, n) {
887
+ const Ue = p($t, ze), gt = "page_hidden";
888
+ function Ge(t, n) {
896
889
  const o = u(t.analyticsContext), i = f(t.analyticsContext), s = x(t.analyticsContext), a = d(t.analyticsContext);
897
890
  return l(
898
- $t,
891
+ gt,
899
892
  [
900
893
  e("feature_list", "2-0-0", o),
901
894
  e("session", "1-0-4", i),
@@ -905,16 +898,16 @@ function Ue(t, n) {
905
898
  n
906
899
  );
907
900
  }
908
- const Ge = p($t, Ue);
909
- function Ke(t, n) {
901
+ const Ke = p(gt, Ge);
902
+ function Me(t, n) {
910
903
  if (document.visibilityState === "visible") {
911
- ze(t, n);
904
+ Ue(t, n);
912
905
  return;
913
906
  }
914
- Ge(t, n);
907
+ Ke(t, n);
915
908
  }
916
- const Me = Kt("visibilitychange", Ke), G = "backspace";
917
- function Xe(t, n) {
909
+ const Xe = Mt("visibilitychange", Me), G = "backspace";
910
+ function Je(t, n) {
918
911
  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
912
  if (!D(r)) {
920
913
  const E = {
@@ -950,15 +943,15 @@ function Xe(t, n) {
950
943
  n
951
944
  );
952
945
  }
953
- const Je = p(G, Xe);
954
- function Qe(t, n) {
955
- t.event.key === "Backspace" && Je(t, n);
946
+ const Qe = p(G, Je);
947
+ function Ze(t, n) {
948
+ t.event.key === "Backspace" && Qe(t, n);
956
949
  }
957
- const Ze = k("keydown", Qe), gt = "page_hide";
958
- function tn(t, n) {
950
+ const tn = k("keydown", Ze), ht = "page_hide";
951
+ function en(t, n) {
959
952
  const o = u(t.analyticsContext), i = f(t.analyticsContext), s = x(t.analyticsContext), a = d(t.analyticsContext);
960
953
  return l(
961
- gt,
954
+ ht,
962
955
  [
963
956
  e("feature_list", "2-0-0", o),
964
957
  e("session", "1-0-4", i),
@@ -968,15 +961,15 @@ function tn(t, n) {
968
961
  n
969
962
  );
970
963
  }
971
- const en = p(gt, tn);
972
- function nn(t, n) {
973
- en(t, n);
964
+ const nn = p(ht, en);
965
+ function on(t, n) {
966
+ nn(t, n);
974
967
  }
975
- const on = S("pagehide", nn), ht = "page_show";
976
- function sn(t, n) {
968
+ const sn = S("pagehide", on), yt = "page_show";
969
+ function an(t, n) {
977
970
  const o = u(t.analyticsContext), i = f(t.analyticsContext), s = x(t.analyticsContext), a = d(t.analyticsContext);
978
971
  return l(
979
- ht,
972
+ yt,
980
973
  [
981
974
  e("feature_list", "2-0-0", o),
982
975
  e("session", "1-0-4", i),
@@ -986,15 +979,15 @@ function sn(t, n) {
986
979
  n
987
980
  );
988
981
  }
989
- const an = p(ht, sn);
990
- function rn(t, n) {
991
- an(t, n);
982
+ const rn = p(yt, an);
983
+ function cn(t, n) {
984
+ rn(t, n);
992
985
  }
993
- const cn = S("pageshow", rn), yt = "offline";
994
- function ln(t, n) {
986
+ const ln = S("pageshow", cn), Nt = "offline";
987
+ function un(t, n) {
995
988
  const o = u(t.analyticsContext), i = f(t.analyticsContext), s = x(t.analyticsContext), a = d(t.analyticsContext);
996
989
  return l(
997
- yt,
990
+ Nt,
998
991
  [
999
992
  e("feature_list", "2-0-0", o),
1000
993
  e("session", "1-0-4", i),
@@ -1004,12 +997,12 @@ function ln(t, n) {
1004
997
  n
1005
998
  );
1006
999
  }
1007
- const un = p(yt, ln);
1008
- function fn(t, n) {
1009
- un(t, n);
1000
+ const fn = p(Nt, un);
1001
+ function dn(t, n) {
1002
+ fn(t, n);
1010
1003
  }
1011
- const dn = S("offline", fn), K = "scroll";
1012
- function xn(t, n) {
1004
+ const xn = S("offline", dn), K = "scroll";
1005
+ function pn(t, n) {
1013
1006
  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
1007
  if (!D(r))
1015
1008
  return l(
@@ -1040,16 +1033,16 @@ function xn(t, n) {
1040
1033
  n
1041
1034
  );
1042
1035
  }
1043
- const pn = p(K, xn), mn = F(
1036
+ const mn = p(K, pn), Cn = F(
1044
1037
  (t, n) => {
1045
- pn(t, n), y("scroll", t, n);
1038
+ mn(t, n), y("scroll", t, n);
1046
1039
  },
1047
1040
  500
1048
- ), Cn = k("scroll", mn, !0), Nt = "online";
1049
- function En(t, n) {
1041
+ ), En = k("scroll", Cn, !0), wt = "online";
1042
+ function vn(t, n) {
1050
1043
  const o = u(t.analyticsContext), i = f(t.analyticsContext), s = x(t.analyticsContext), a = d(t.analyticsContext);
1051
1044
  return l(
1052
- Nt,
1045
+ wt,
1053
1046
  [
1054
1047
  e("feature_list", "2-0-0", o),
1055
1048
  e("session", "1-0-4", i),
@@ -1059,15 +1052,15 @@ function En(t, n) {
1059
1052
  n
1060
1053
  );
1061
1054
  }
1062
- const vn = p(Nt, En);
1063
- function Dn(t, n) {
1064
- vn(t, n);
1055
+ const Dn = p(wt, vn);
1056
+ function _n(t, n) {
1057
+ Dn(t, n);
1065
1058
  }
1066
- const _n = S("online", Dn), wt = "resize";
1067
- function kn(t, n) {
1059
+ const kn = S("online", _n), Pt = "resize";
1060
+ function bn(t, n) {
1068
1061
  const o = u(t.analyticsContext), i = f(t.analyticsContext), s = x(t.analyticsContext), a = d(t.analyticsContext);
1069
1062
  return l(
1070
- wt,
1063
+ Pt,
1071
1064
  [
1072
1065
  e("feature_list", "2-0-0", o),
1073
1066
  e("session", "1-0-4", i),
@@ -1077,19 +1070,19 @@ function kn(t, n) {
1077
1070
  n
1078
1071
  );
1079
1072
  }
1080
- const st = p(wt, kn);
1073
+ const at = p(Pt, bn);
1081
1074
  let I = 0;
1082
- const bn = F(
1075
+ const Tn = F(
1083
1076
  (t, n) => {
1084
1077
  const o = window.innerWidth;
1085
- o !== I ? (st(t, n), I = o) : "ontouchstart" in window || st(t, n), I = o;
1078
+ o !== I ? (at(t, n), I = o) : "ontouchstart" in window || at(t, n), I = o;
1086
1079
  },
1087
1080
  300
1088
- ), Tn = S("resize", bn), Pt = "unload";
1089
- function Ln(t, n) {
1081
+ ), Ln = S("resize", Tn), Vt = "unload";
1082
+ function $n(t, n) {
1090
1083
  const o = u(t.analyticsContext), i = f(t.analyticsContext), s = x(t.analyticsContext), a = d(t.analyticsContext);
1091
1084
  return l(
1092
- Pt,
1085
+ Vt,
1093
1086
  [
1094
1087
  e("feature_list", "2-0-0", o),
1095
1088
  e("session", "1-0-4", i),
@@ -1099,16 +1092,16 @@ function Ln(t, n) {
1099
1092
  n
1100
1093
  );
1101
1094
  }
1102
- const $n = p(Pt, Ln);
1103
- function gn(t, n) {
1104
- $n(t, n);
1095
+ const gn = p(Vt, $n);
1096
+ function hn(t, n) {
1097
+ gn(t, n);
1105
1098
  }
1106
- const hn = S("unload", gn);
1107
- function yn(t, n) {
1108
- Ce(t, n), y("click", t, n);
1099
+ const yn = S("unload", hn);
1100
+ function Nn(t, n) {
1101
+ Ee(t, n), y("click", t, n);
1109
1102
  }
1110
- const Nn = k("click", yn), M = "paste";
1111
- function wn(t, n) {
1103
+ const wn = k("click", Nn), M = "paste";
1104
+ function Pn(t, n) {
1112
1105
  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
1106
  if (!D(r))
1114
1107
  return l(
@@ -1139,12 +1132,12 @@ function wn(t, n) {
1139
1132
  n
1140
1133
  );
1141
1134
  }
1142
- const Pn = p(M, wn);
1143
- function Vn(t, n) {
1144
- Pn(t, n);
1135
+ const Vn = p(M, Pn);
1136
+ function Sn(t, n) {
1137
+ Vn(t, n);
1145
1138
  }
1146
- const Sn = k("paste", Vn), X = "copy";
1147
- function Yn(t, n) {
1139
+ const Yn = k("paste", Sn), X = "copy";
1140
+ function Bn(t, n) {
1148
1141
  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
1142
  if (!D(r))
1150
1143
  return l(
@@ -1175,12 +1168,12 @@ function Yn(t, n) {
1175
1168
  n
1176
1169
  );
1177
1170
  }
1178
- const Bn = p(X, Yn);
1179
- function An(t, n) {
1180
- Bn(t, n);
1171
+ const An = p(X, Bn);
1172
+ function Hn(t, n) {
1173
+ An(t, n);
1181
1174
  }
1182
- const Hn = k("copy", An), J = "drag";
1183
- function On(t, n) {
1175
+ const On = k("copy", Hn), J = "drag";
1176
+ function jn(t, n) {
1184
1177
  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
1178
  if (!D(r))
1186
1179
  return l(
@@ -1211,33 +1204,33 @@ function On(t, n) {
1211
1204
  n
1212
1205
  );
1213
1206
  }
1214
- const jn = p(J, On);
1215
- function Vt(t, n) {
1207
+ const qn = p(J, jn);
1208
+ function St(t, n) {
1216
1209
  const o = t.event.currentTarget;
1217
1210
  if (!o || !(o instanceof HTMLElement))
1218
1211
  return;
1219
1212
  function i(s) {
1220
- Vt({ event: s, analyticsContext: t.analyticsContext });
1213
+ St({ event: s, analyticsContext: t.analyticsContext });
1221
1214
  }
1222
1215
  o.removeEventListener("drag", i), o.addEventListener(
1223
1216
  "dragend",
1224
- () => St(o, () => t.analyticsContext)
1225
- ), jn(t, n), y("drag", t, n);
1217
+ () => Yt(o, () => t.analyticsContext)
1218
+ ), qn(t, n), y("drag", t, n);
1226
1219
  }
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));
1220
+ const Yt = k("drag", St);
1221
+ function co(t, n) {
1222
+ n && (wn(n, t), Ve(n, t), Ae(n, t), On(n, t), Yn(n, t), Yt(n, t), tn(n, t), En(n, t), ge(n, t), Re(n, t));
1230
1223
  }
1231
- function co(t) {
1232
- Me(t), on(t), cn(t), dn(t), _n(t), Tn(t), hn(t);
1224
+ function lo(t) {
1225
+ Xe(t), sn(t), ln(t), xn(t), kn(t), Ln(t), yn(t);
1233
1226
  }
1234
1227
  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,
1228
+ so as A,
1229
+ io as B,
1230
+ ro as C,
1231
+ to as D,
1232
+ eo as E,
1233
+ no as F,
1241
1234
  f as a,
1242
1235
  x as b,
1243
1236
  p as c,
@@ -1248,20 +1241,20 @@ export {
1248
1241
  l as h,
1249
1242
  e as i,
1250
1243
  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,
1244
+ ct as k,
1245
+ lt as l,
1246
+ ut as m,
1247
+ lo as n,
1248
+ co as o,
1249
+ Gn as p,
1250
+ Mn as q,
1251
+ Xn as r,
1252
+ Jn as s,
1253
+ Kn as t,
1261
1254
  y as u,
1262
- Ce as v,
1263
- Jn as w,
1264
- Qn as x,
1265
- no as y,
1266
- so as z
1255
+ Ee as v,
1256
+ Qn as w,
1257
+ Zn as x,
1258
+ oo as y,
1259
+ ao as z
1267
1260
  };