@picked/analytics 0.0.1-dev.1773807602703 → 0.0.1-dev.1774224866171

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