@picked/analytics 0.0.50-next.3 → 0.0.50-next.4

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