@picked/analytics 0.0.1-dev.1756875690387 → 0.0.1-dev.1762908210565

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