@braze/web-sdk 6.7.1 → 6.9.0

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 (138) hide show
  1. package/index.d.ts +165 -38
  2. package/package.json +1 -1
  3. package/shared-lib/encoding-utils.js +2 -2
  4. package/shared-lib/event-types.js +16 -16
  5. package/shared-lib/indexed-db-adapter.js +65 -65
  6. package/shared-lib/logger.js +18 -18
  7. package/shared-lib/supported-options.js +1 -1
  8. package/src/Banner/banner-provider.js +67 -59
  9. package/src/Banner/banner.js +40 -19
  10. package/src/Banner/dismiss-banner.js +4 -0
  11. package/src/Banner/display/banner-to-html.js +10 -10
  12. package/src/Banner/display/destroy-banner-html.js +2 -2
  13. package/src/Banner/get-all-banners.js +6 -6
  14. package/src/Banner/get-banner.js +6 -6
  15. package/src/Banner/index.js +1 -0
  16. package/src/Banner/log-banner-click.js +7 -7
  17. package/src/Banner/log-banner-dismissal.js +7 -7
  18. package/src/Banner/log-banner-impressions.js +27 -18
  19. package/src/Banner/request-banners-refresh.js +8 -8
  20. package/src/Banner/subscribe-to-banners-updates.js +5 -5
  21. package/src/Banner/ui/insert-banner.js +8 -8
  22. package/src/Card/card-manager.js +31 -31
  23. package/src/Card/log-card-dismissal.js +2 -2
  24. package/src/Card/log-content-card-click.js +2 -2
  25. package/src/Card/log-content-card-impressions.js +4 -4
  26. package/src/Card/models/captioned-image.js +15 -15
  27. package/src/Card/models/card.js +89 -89
  28. package/src/Card/models/classic-card.js +16 -16
  29. package/src/Card/models/control-card.js +7 -7
  30. package/src/Card/models/image-only.js +13 -13
  31. package/src/Card/util/card-factory.js +32 -32
  32. package/src/ContentCards/content-cards-provider-factory.js +13 -11
  33. package/src/ContentCards/content-cards-provider.js +105 -105
  34. package/src/ContentCards/get-cached-content-cards.js +2 -2
  35. package/src/ContentCards/request-content-cards-refresh.js +2 -2
  36. package/src/ContentCards/subscribe-to-content-cards-updates.js +10 -10
  37. package/src/ContentCards/ui/show-content-cards.js +7 -7
  38. package/src/Core/add-sdk-metadata.js +2 -2
  39. package/src/Core/change-user.js +5 -5
  40. package/src/Core/destroy.js +2 -2
  41. package/src/Core/disable-sdk.js +4 -4
  42. package/src/Core/enable-sdk.js +4 -4
  43. package/src/Core/get-device-id.js +2 -2
  44. package/src/Core/handle-braze-action.js +5 -5
  45. package/src/Core/index.js +1 -0
  46. package/src/Core/log-custom-event.js +5 -5
  47. package/src/Core/log-ecommerce-event.js +29 -0
  48. package/src/Core/log-purchase.js +23 -198
  49. package/src/Core/open-session.js +10 -10
  50. package/src/Core/set-logger.js +2 -2
  51. package/src/Core/set-sdk-authentication-signature.js +1 -1
  52. package/src/Core/subscribe-to-sdk-authentication-failures.js +1 -1
  53. package/src/Core/toggle-logging.js +2 -2
  54. package/src/Core/wipe-data.js +6 -6
  55. package/src/DUST/dust-connection-core.js +1 -0
  56. package/src/DUST/dust-provider-factory.js +10 -10
  57. package/src/DUST/dust-provider.js +258 -226
  58. package/src/DUST/dust-shared-worker-code.js +1 -1
  59. package/src/DUST/dust-shared-worker-impl.js +97 -103
  60. package/src/DUST/dust-worker-bridge.js +55 -40
  61. package/src/DUST/subscribe-to-dust.js +7 -7
  62. package/src/FeatureFlags/feature-flag-factory.js +8 -8
  63. package/src/FeatureFlags/feature-flag.js +3 -3
  64. package/src/FeatureFlags/feature-flags-provider.js +21 -21
  65. package/src/FeatureFlags/log-feature-flag-impression.js +5 -5
  66. package/src/FeatureFlags/subscribe-to-feature-flags-updates.js +1 -1
  67. package/src/InAppMessage/constants.js +3 -3
  68. package/src/InAppMessage/defer-in-app-message.js +3 -3
  69. package/src/InAppMessage/display/html-message-to-html.js +4 -4
  70. package/src/InAppMessage/display/in-app-message-to-html.js +32 -32
  71. package/src/InAppMessage/display/modal-utils.js +2 -2
  72. package/src/InAppMessage/in-app-message-factory.js +36 -36
  73. package/src/InAppMessage/in-app-message-manager.js +35 -35
  74. package/src/InAppMessage/log-in-app-message-button-click.js +3 -3
  75. package/src/InAppMessage/log-in-app-message-click.js +3 -3
  76. package/src/InAppMessage/log-in-app-message-html-click.js +3 -3
  77. package/src/InAppMessage/log-in-app-message-impression.js +3 -3
  78. package/src/InAppMessage/models/control-message.js +4 -4
  79. package/src/InAppMessage/models/full-screen-message.js +9 -9
  80. package/src/InAppMessage/models/html-message.js +2 -2
  81. package/src/InAppMessage/models/in-app-message-button.js +4 -4
  82. package/src/InAppMessage/models/in-app-message.js +34 -34
  83. package/src/InAppMessage/models/modal-message.js +7 -7
  84. package/src/InAppMessage/models/slide-up-message.js +8 -8
  85. package/src/InAppMessage/ui/show-in-app-message.js +20 -20
  86. package/src/Push/push-manager.js +44 -44
  87. package/src/User/user-manager.js +19 -19
  88. package/src/User/user.js +17 -17
  89. package/src/common/base-provider.js +1 -1
  90. package/src/common/constants.js +1 -0
  91. package/src/common/content-cards-display.js +6 -6
  92. package/src/common/event-logger.js +3 -3
  93. package/src/common/properties-base.js +3 -3
  94. package/src/l10n/l10n-manager.js +2 -2
  95. package/src/managers/auth-manager.js +11 -11
  96. package/src/managers/braze-instance.js +59 -59
  97. package/src/managers/device-manager.js +9 -9
  98. package/src/managers/network-manager.js +65 -63
  99. package/src/managers/server-config-manager.js +110 -93
  100. package/src/managers/session-manager.js +20 -20
  101. package/src/managers/storage-manager-factory.js +9 -9
  102. package/src/managers/storage-manager.js +137 -137
  103. package/src/managers/subscription-manager.js +2 -2
  104. package/src/managers/utils.js +1 -1
  105. package/src/models/braze-event.js +2 -2
  106. package/src/models/identifier.js +5 -5
  107. package/src/models/push-token.js +8 -8
  108. package/src/models/request-result.js +1 -1
  109. package/src/models/server-config.js +46 -28
  110. package/src/request-controller.js +124 -124
  111. package/src/triggers/models/custom-event-data.js +4 -4
  112. package/src/triggers/models/custom-event-property-data.js +5 -5
  113. package/src/triggers/models/filter-set.js +2 -2
  114. package/src/triggers/models/filter.js +1 -1
  115. package/src/triggers/models/in-app-message-click-data.js +5 -5
  116. package/src/triggers/models/purchase-data.js +1 -1
  117. package/src/triggers/models/purchase-property-data.js +2 -2
  118. package/src/triggers/models/push-click-data.js +5 -5
  119. package/src/triggers/models/trigger-condition.js +45 -45
  120. package/src/triggers/models/trigger-events.js +3 -3
  121. package/src/triggers/models/trigger.js +30 -30
  122. package/src/triggers/triggers-provider.js +63 -63
  123. package/src/types.js +5 -1
  124. package/src/ui/js/attach-css.js +1 -1
  125. package/src/util/braze-actions.js +6 -6
  126. package/src/util/browser-detector.js +13 -13
  127. package/src/util/client-hints-parser.js +5 -5
  128. package/src/util/code-utils.js +2 -2
  129. package/src/util/deprecation-utils.js +2 -2
  130. package/src/util/dom-utils.js +8 -8
  131. package/src/util/ecommerce-event-validation.js +343 -0
  132. package/src/util/html-display-utils.js +11 -11
  133. package/src/util/iso-4217-currency-codes.js +176 -0
  134. package/src/util/net.js +4 -4
  135. package/src/util/request-header-utils.js +10 -10
  136. package/src/util/string-utils.js +2 -2
  137. package/src/util/user-agent-parser.js +15 -15
  138. package/src/util/validation-utils.js +14 -14
@@ -1,60 +1,78 @@
1
1
  import {
2
- GLOBAL_RATE_LIMIT_CAPACITY_DEFAULT as di,
3
- GLOBAL_RATE_LIMIT_REFILL_RATE_DEFAULT as mi,
2
+ GLOBAL_RATE_LIMIT_CAPACITY_DEFAULT as mi,
3
+ GLOBAL_RATE_LIMIT_REFILL_RATE_DEFAULT as fi,
4
4
  } from "../common/constants.js";
5
- export default class ci {
5
+ export default class di {
6
6
  constructor(
7
7
  t = 0,
8
8
  i = [],
9
9
  s = [],
10
10
  h = [],
11
- e = null,
12
11
  l = null,
12
+ e = null,
13
13
  r = { enabled: !1 },
14
14
  n = { enabled: !1, refresh_rate_limit: void 0 },
15
- a = { enabled: !0, capacity: di, refill_rate: mi, endpoint_overrides: {} },
15
+ a = { enabled: !0, capacity: mi, refill_rate: fi, endpoint_overrides: {} },
16
16
  o = null,
17
17
  u = null,
18
18
  c = null,
19
19
  d = null,
20
+ m = null,
20
21
  ) {
21
- (this.ec = t),
22
- (this.uc = i),
23
- (this.oc = s),
24
- (this.ac = h),
25
- (this.cc = e),
26
- (this.rc = l),
27
- (this.lc = r),
22
+ (this.nd = t),
23
+ (this.gd = i),
24
+ (this.bd = s),
25
+ (this.fd = h),
26
+ (this.Rd = l),
27
+ (this.ad = e),
28
+ (this.hd = r),
28
29
  (this.Xr = n),
29
- (this.nc = a),
30
+ (this.ud = a),
30
31
  (this.banners = o),
31
32
  (this.dust = u),
32
- (this.vc = c),
33
- (this.fc = d);
33
+ (this.wd = c),
34
+ (this.Td = d),
35
+ (this.dd = m);
34
36
  }
35
37
  qt() {
36
38
  return {
37
- s: "6.7.1",
38
- l: this.ec,
39
- e: this.uc,
40
- a: this.oc,
41
- p: this.ac,
42
- m: this.cc,
43
- v: this.rc,
44
- c: this.lc,
39
+ s: "6.9.0",
40
+ l: this.nd,
41
+ e: this.gd,
42
+ a: this.bd,
43
+ p: this.fd,
44
+ m: this.Rd,
45
+ v: this.ad,
46
+ c: this.hd,
45
47
  f: this.Xr,
46
- grl: this.nc,
48
+ grl: this.ud,
47
49
  b: this.banners,
48
50
  d: this.dust,
49
- rb: this.vc,
50
- mst: this.fc,
51
+ rb: this.wd,
52
+ mst: this.Td,
53
+ ch: this.dd,
51
54
  };
52
55
  }
53
56
  static _u(t) {
54
57
  let i = t.l;
55
58
  return (
56
- "6.7.1" !== t.s && (i = 0),
57
- new ci(i, t.e, t.a, t.p, t.m, t.v, t.c, t.f, t.grl, t.b, t.d, t.rb, t.mst)
59
+ "6.9.0" !== t.s && (i = 0),
60
+ new di(
61
+ i,
62
+ t.e,
63
+ t.a,
64
+ t.p,
65
+ t.m,
66
+ t.v,
67
+ t.c,
68
+ t.f,
69
+ t.grl,
70
+ t.b,
71
+ t.d,
72
+ t.rb,
73
+ t.mst,
74
+ t.ch,
75
+ )
58
76
  );
59
77
  }
60
78
  }
@@ -2,10 +2,10 @@ import {
2
2
  EventTypes as p,
3
3
  Guid as V,
4
4
  IndexedDBAdapter as et,
5
- logger as E,
5
+ logger as b,
6
6
  } from "../shared-lib/index.js";
7
7
  import v from "./common/event-logger.js";
8
- import { removeAllVisibleInAppMessages as fi } from "./InAppMessage/ui/remove-all-visible-in-app-messages.js";
8
+ import { removeAllVisibleInAppMessages as gi } from "./InAppMessage/ui/remove-all-visible-in-app-messages.js";
9
9
  import { STORAGE_KEYS as s } from "./managers/storage-manager.js";
10
10
  import f from "./managers/subscription-manager.js";
11
11
  import Ie from "./models/braze-event.js";
@@ -18,38 +18,38 @@ export default class Kt {
18
18
  constructor(t, i, s, e, h, n, o, r, l, u) {
19
19
  (this.tu = t),
20
20
  (this.baseUrl = i),
21
- (this.j = s),
21
+ (this.C = s),
22
22
  (this.eu = e),
23
23
  (this.Ss = h),
24
24
  (this.h = n),
25
- (this.C = o),
26
- (this.bc = r),
25
+ (this.j = o),
26
+ (this.hc = r),
27
27
  (this.Gh = l),
28
28
  (this.B = u),
29
29
  (this.tu = t),
30
30
  (this.baseUrl = i),
31
- (this.kc = 0),
32
- (this.dS = o.RS() || 0),
33
- (this.yc = null),
34
- (this.j = s),
31
+ (this.nc = 0),
32
+ (this.IS = o.dS() || 0),
33
+ (this.lc = null),
34
+ (this.C = s),
35
35
  (this.eu = e),
36
36
  (this.Ss = h),
37
37
  (this.h = n),
38
- (this.C = o),
38
+ (this.j = o),
39
39
  (this.Gh = l),
40
40
  (this.B = u),
41
- (this.bc = r),
42
- (this.jc = new f()),
43
- (this.Ac = null),
44
- (this.Dc = 50),
45
- (this.$c = !1),
46
- (this.qc = !1);
41
+ (this.hc = r),
42
+ (this.uc = new f()),
43
+ (this.cc = null),
44
+ (this.dc = 50),
45
+ (this.mc = !1),
46
+ (this.fc = !1);
47
47
  }
48
- Cc(t, i) {
49
- return !t && !i && this.Gh.Ih() >= this.Dc;
48
+ gc(t, i) {
49
+ return !t && !i && this.Gh.Ih() >= this.dc;
50
50
  }
51
- Mc(t) {
52
- let i = this.j.am();
51
+ vc(t) {
52
+ let i = this.C.am();
53
53
  if (t.length > 0) {
54
54
  const s = this.Ss.getUserId();
55
55
  for (const e of t) {
@@ -59,14 +59,14 @@ export default class Kt {
59
59
  }
60
60
  return i;
61
61
  }
62
- Tc(t = !1, i = !0, e, n, o, r = !1, u = !1) {
63
- i && this.Lc();
64
- const c = this.C.TS(),
65
- d = this.C.gS();
62
+ bc(t = !1, i = !0, e, n, o, r = !1, u = !1) {
63
+ i && this.wc();
64
+ const c = this.j.hS(),
65
+ d = this.j.RS();
66
66
  let m = !1;
67
67
  const f = (t, r, u = -1) => {
68
68
  const c = new Date().valueOf();
69
- h.nt(this.C, h.it.pn, c),
69
+ h.nt(this.j, h.it.pn, c),
70
70
  -1 !== u && r.push(["X-Braze-Req-Tokens-Remaining", u.toString()]);
71
71
  let d = !1;
72
72
  l.ot({
@@ -76,18 +76,18 @@ export default class Kt {
76
76
  lt: (i) => {
77
77
  null != t.respond_with &&
78
78
  t.respond_with.triggers &&
79
- (this.kc = Math.max(this.kc - 1, 0)),
79
+ (this.nc = Math.max(this.nc - 1, 0)),
80
80
  this.B.ut(t, i, r)
81
81
  ? (this.Gh.ct(),
82
- this.h.sc(i),
82
+ this.h.ld(i),
83
83
  (null != t.respond_with &&
84
84
  t.respond_with.user_id != this.Ss.getUserId()) ||
85
- (null != t.device && this.C.It(s.Tt.Ba, t.device),
85
+ (null != t.device && this.j.Pt(s.It.Ba, t.device),
86
86
  null != t.sdk_metadata &&
87
- (this.C.It(s.Tt.Ka, t.sdk_metadata),
88
- this.C.It(s.Tt.Pa, this.j.kt())),
89
- this.bc(i),
90
- h.Dl(this.C, h.it.pn, 1),
87
+ (this.j.Pt(s.It.Ka, t.sdk_metadata),
88
+ this.j.Pt(s.It.Pa, this.C.$t())),
89
+ this.hc(i),
90
+ h.Dl(this.j, h.it.pn, 1),
91
91
  "function" == typeof e && e()))
92
92
  : i.auth_error && (d = !0);
93
93
  },
@@ -95,13 +95,13 @@ export default class Kt {
95
95
  (d = !0),
96
96
  null != t.respond_with &&
97
97
  t.respond_with.triggers &&
98
- (this.kc = Math.max(this.kc - 1, 0)),
98
+ (this.nc = Math.max(this.nc - 1, 0)),
99
99
  this.B.Ua(t.events, t.attributes),
100
100
  "function" == typeof n && n();
101
101
  },
102
102
  ft: (t, s) => {
103
103
  "function" == typeof o && o(!d);
104
- const e = this.B.Bl(s);
104
+ const e = this.B.Cl(s);
105
105
  let n = 0;
106
106
  if (e)
107
107
  switch (e.type) {
@@ -113,31 +113,31 @@ export default class Kt {
113
113
  }
114
114
  if (i && !m) {
115
115
  if (d) {
116
- h.zl(this.C, h.it.pn);
116
+ h.zl(this.j, h.it.pn);
117
117
  const t = this.h.vt(),
118
118
  i = this.h.gt(),
119
119
  s = this.h.bt();
120
- let e = this.yc;
120
+ let e = this.lc;
121
121
  (null == e || e < t) && (e = t);
122
122
  const o = Math.min(s, a(t, e * i)) + n;
123
- this.Fc(o);
124
- } else this.Fc(Math.max(1e3 * this.dS, n));
123
+ this.kc(o);
124
+ } else this.kc(Math.max(1e3 * this.IS, n));
125
125
  m = !0;
126
126
  }
127
127
  },
128
128
  });
129
129
  },
130
- g = this.Mc(c),
130
+ g = this.vc(c),
131
131
  p = t || g;
132
- if (this.Cc(r, g))
133
- return void E.info(
132
+ if (this.gc(r, g))
133
+ return void b.info(
134
134
  "Declining to flush data due to 50 consecutive authentication failures",
135
135
  );
136
136
  if (i && !this.B.fl(c, d, p))
137
- return this.Fc(), void ("function" == typeof o && o(!0));
137
+ return this.kc(), void ("function" == typeof o && o(!0));
138
138
  const v = this.B.ml(p, c, d, u);
139
- p && this.kc++;
140
- let b = !1;
139
+ p && this.nc++;
140
+ let w = !1;
141
141
  if (v)
142
142
  for (const t of v)
143
143
  this.B.et(
@@ -146,60 +146,60 @@ export default class Kt {
146
146
  h.it.pn,
147
147
  n,
148
148
  ),
149
- (b = !0);
150
- this.Gh.Fh() && i && !b
151
- ? this.Fc()
149
+ (w = !0);
150
+ this.Gh.Fh() && i && !w
151
+ ? this.kc()
152
152
  : g &&
153
- (E.info("Invoking new session subscriptions"),
154
- this.jc.A(),
155
- (this.qc = !0));
153
+ (b.info("Invoking new session subscriptions"),
154
+ this.uc.A(),
155
+ (this.fc = !0));
156
156
  }
157
- Ic() {
158
- return this.kc > 0;
157
+ yc() {
158
+ return this.nc > 0;
159
159
  }
160
- Fc(t = 1e3 * this.dS) {
161
- this.$c ||
162
- (this.Lc(),
163
- (this.Ac = window.setTimeout(() => {
160
+ kc(t = 1e3 * this.IS) {
161
+ this.mc ||
162
+ (this.wc(),
163
+ (this.cc = window.setTimeout(() => {
164
164
  if (document.hidden) {
165
165
  const t = "visibilitychange",
166
166
  i = () => {
167
167
  document.hidden ||
168
- (document.removeEventListener(t, i, !1), this.Tc());
168
+ (document.removeEventListener(t, i, !1), this.bc());
169
169
  };
170
170
  document.addEventListener(t, i, !1);
171
- } else this.Tc();
171
+ } else this.bc();
172
172
  }, t)),
173
- (this.yc = t));
173
+ (this.lc = t));
174
174
  }
175
- Lc() {
176
- null != this.Ac && (clearTimeout(this.Ac), (this.Ac = null));
175
+ wc() {
176
+ null != this.cc && (clearTimeout(this.cc), (this.cc = null));
177
177
  }
178
178
  initialize() {
179
- (this.$c = !1), this.Fc();
179
+ (this.mc = !1), this.kc();
180
180
  }
181
181
  destroy() {
182
- this.jc.removeAllSubscriptions(),
182
+ this.uc.removeAllSubscriptions(),
183
183
  this.Gh.xh(),
184
- this.Lc(),
185
- (this.$c = !0),
186
- this.Tc(void 0, !1, void 0, void 0, void 0, void 0, !0),
187
- (this.Ac = null),
188
- (this.qc = !1);
184
+ this.wc(),
185
+ (this.mc = !0),
186
+ this.bc(void 0, !1, void 0, void 0, void 0, void 0, !0),
187
+ (this.cc = null),
188
+ (this.fc = !1);
189
189
  }
190
190
  rn(t) {
191
- return this.qc ? (t(), null) : this.jc.Kt(t);
191
+ return this.fc ? (t(), null) : this.uc.Ut(t);
192
192
  }
193
193
  openSession() {
194
- const t = this.j.kt() !== this.j.el();
195
- t && (this.C.uS(s.Ou.Wh), this.C.uS(s.Ou.Cu)),
196
- this.Tc(!1, void 0, () => {
197
- t && (this.C.Qt(s.Tt.jo), this.C.Qt(s.Tt.Wt));
194
+ const t = this.C.$t() !== this.C.el();
195
+ t && (this.j.cS(s.Ou.Wh), this.j.cS(s.Ou.Cu)),
196
+ this.bc(!1, void 0, () => {
197
+ t && (this.j.Vt(s.It.jo), this.j.Vt(s.It.At));
198
198
  }),
199
199
  this.Ea(),
200
200
  t &&
201
201
  import("./Push/push-manager-factory.js").then((t) => {
202
- if (this.$c) return;
202
+ if (this.mc) return;
203
203
  const i = t.default.ra();
204
204
  if (
205
205
  null != i &&
@@ -207,7 +207,7 @@ export default class Kt {
207
207
  ) {
208
208
  const t = () => {
209
209
  i.du()
210
- ? E.info(
210
+ ? b.info(
211
211
  "Push token maintenance is disabled, not refreshing token for backend.",
212
212
  )
213
213
  : i.subscribe();
@@ -216,86 +216,86 @@ export default class Kt {
216
216
  s && t();
217
217
  },
218
218
  h = () => {
219
- const i = this.C.Rt(s.Tt.Uu);
219
+ const i = this.j.St(s.It.Uu);
220
220
  (null == i || i) && t();
221
221
  },
222
- n = et.Ps.$s;
223
- new et(n, E).kr(n.Os.Fu, e, h);
222
+ n = et._s.Xs;
223
+ new et(n, b).kr(n.Ws.Fu, e, h);
224
224
  }
225
225
  });
226
226
  }
227
- Pc() {
228
- this.C.Qt(s.Tt.Fo), this.C.Qt(s.Tt.Ci), this.C.Qt(s.Tt.pa);
227
+ jc() {
228
+ this.j.Vt(s.It.Fo), this.j.Vt(s.It.bi), this.j.Vt(s.It.pa);
229
229
  }
230
- xc() {
231
- this.C.Qt(s.Tt.Cl),
232
- this.C.Qt(s.Tt.iS),
233
- this.C.Qt(s.Tt.Ml),
234
- this.C.Qt(s.Tt.Ll);
230
+ Sc() {
231
+ this.j.Vt(s.It.Bl),
232
+ this.j.Vt(s.It.ES),
233
+ this.j.Vt(s.It.Ml),
234
+ this.j.Vt(s.It.Ll);
235
235
  }
236
236
  changeUser(t, i, e) {
237
237
  const h = this.Ss.getUserId();
238
238
  if (h !== t) {
239
- this.j.Sm(),
240
- this.Pc(),
241
- fi(),
242
- null != h && this.Tc(void 0, !1, void 0, void 0, void 0),
239
+ this.C.Sm(),
240
+ this.jc(),
241
+ gi(),
242
+ null != h && this.bc(void 0, !1, void 0, void 0, void 0),
243
243
  this.Ss.Ju(t),
244
244
  e ? this.Gh.setSdkAuthenticationSignature(e) : this.Gh.jh();
245
245
  for (let t = 0; t < i.length; t++) i[t].changeUser(null == h);
246
246
  this.B.fo(),
247
- null != h && this.C.Qt(s.Tt.tS),
248
- this.C.Qt(s.Tt.Ba),
249
- this.C.Qt(s.Tt.SS),
250
- this.xc(),
247
+ null != h && this.j.Vt(s.It.eS),
248
+ this.j.Vt(s.It.Ba),
249
+ this.j.Vt(s.It.lS),
250
+ this.Sc(),
251
251
  this.openSession(),
252
- E.info('Changed user to "' + t + '".');
252
+ b.info('Changed user to "' + t + '".');
253
253
  } else {
254
254
  let i = "Doing nothing.";
255
255
  e &&
256
256
  this.Gh.kh() !== e &&
257
257
  (this.Gh.setSdkAuthenticationSignature(e),
258
258
  (i = "Updated SDK authentication signature")),
259
- E.info(`Current user is already ${t}. ${i}`);
259
+ b.info(`Current user is already ${t}. ${i}`);
260
260
  }
261
261
  }
262
262
  requestImmediateDataFlush(t) {
263
- this.Lc(), this.j.el();
264
- this.Tc(
263
+ this.wc(), this.C.el();
264
+ this.bc(
265
265
  void 0,
266
266
  void 0,
267
267
  void 0,
268
268
  () => {
269
- E.error("Failed to flush data, request will be retried automatically.");
269
+ b.error("Failed to flush data, request will be retried automatically.");
270
270
  },
271
271
  t,
272
272
  !0,
273
273
  );
274
274
  }
275
- Sr(t, i) {
276
- this.j.el(),
277
- E.info("Requesting explicit trigger refresh."),
278
- this.Tc(!0, void 0, t, i);
275
+ Ar(t, i) {
276
+ this.C.el(),
277
+ b.info("Requesting explicit trigger refresh."),
278
+ this.bc(!0, void 0, t, i);
279
279
  }
280
280
  Gu(t, i) {
281
- const e = p.Nc,
281
+ const e = p.Ac,
282
282
  h = { a: t, l: i },
283
- n = v.wt(e, h);
283
+ n = v.Dt(e, h);
284
284
  return (
285
- n && (E.info(`Logged alias ${t} with label ${i}`), this.C.It(s.Tt.SS, h)),
285
+ n && (b.info(`Logged alias ${t} with label ${i}`), this.j.Pt(s.It.lS, h)),
286
286
  n
287
287
  );
288
288
  }
289
289
  Mu(t, i, s) {
290
290
  if (this.h.qu(i))
291
291
  return (
292
- E.info(`Custom Attribute "${i}" is blocklisted, ignoring.`), new L()
292
+ b.info(`Custom Attribute "${i}" is blocklisted, ignoring.`), new L()
293
293
  );
294
294
  const e = { key: i, value: s },
295
- h = v.wt(t, e);
295
+ h = v.Dt(t, e);
296
296
  if (h) {
297
297
  const t = "object" == typeof s ? JSON.stringify(s, null, 2) : s;
298
- E.info(`Logged custom attribute: ${i} with value: ${t}`);
298
+ b.info(`Logged custom attribute: ${i} with value: ${t}`);
299
299
  }
300
300
  return h;
301
301
  }
@@ -304,52 +304,52 @@ export default class Kt {
304
304
  null != e && (o.altitude = e),
305
305
  null != h && (o.ll_accuracy = h),
306
306
  null != n && (o.alt_accuracy = n);
307
- const r = v.wt(p.Oc, o, t || void 0);
307
+ const r = v.Dt(p.Dc, o, t || void 0);
308
308
  return (
309
309
  r &&
310
- E.info(`Set user last known location as ${JSON.stringify(o, null, 2)}`),
310
+ b.info(`Set user last known location as ${JSON.stringify(o, null, 2)}`),
311
311
  r
312
312
  );
313
313
  }
314
- yr(t, i) {
315
- const s = this.j.el();
316
- return new Ie(this.Ss.getUserId(), p.Uc, t, s, { cid: i });
314
+ Fr(t, i) {
315
+ const s = this.C.el();
316
+ return new Ie(this.Ss.getUserId(), p.$c, t, s, { cid: i });
317
317
  }
318
- Bc(t, i) {
318
+ qc(t, i) {
319
319
  return new et(t, i);
320
320
  }
321
321
  Ea() {
322
- const t = et.Ps.$s;
323
- this.Bc(t, E).setItem(t.Os.pn, 1, {
322
+ const t = et._s.Xs;
323
+ this.qc(t, b).setItem(t.Ws.pn, 1, {
324
324
  baseUrl: this.baseUrl,
325
325
  data: { api_key: this.tu, device_id: this.eu.ve().id },
326
326
  userId: this.Ss.getUserId(),
327
327
  sdkAuthEnabled: this.Gh.Fh(),
328
328
  });
329
329
  }
330
- Ar(t) {
330
+ Dr(t) {
331
331
  for (const i of t)
332
332
  if (i.api_key === this.tu) this.B.Ua(i.events, i.attributes);
333
333
  else {
334
- const t = et.Ps.$s;
335
- new et(t, E).setItem(t.Os.qr, V.de(), i);
334
+ const t = et._s.Xs;
335
+ new et(t, b).setItem(t.Ws.Br, V.de(), i);
336
336
  }
337
337
  }
338
338
  Na(t, i, s) {
339
339
  if (this.h.qu(t))
340
340
  return (
341
- E.info(`Custom Attribute "${t}" is blocklisted, ignoring.`), new L()
341
+ b.info(`Custom Attribute "${t}" is blocklisted, ignoring.`), new L()
342
342
  );
343
343
  let e, h;
344
344
  return (
345
345
  null === i && null === s
346
- ? ((e = p.Jc), (h = { key: t }))
347
- : ((e = p.Kc), (h = { key: t, latitude: i, longitude: s })),
348
- v.wt(e, h)
346
+ ? ((e = p.Cc), (h = { key: t }))
347
+ : ((e = p.Mc), (h = { key: t, latitude: i, longitude: s })),
348
+ v.Dt(e, h)
349
349
  );
350
350
  }
351
351
  va(t, i) {
352
352
  const s = { group_id: t, status: i };
353
- return v.wt(p.Wc, s);
353
+ return v.Dt(p.Tc, s);
354
354
  }
355
355
  }
@@ -1,14 +1,14 @@
1
1
  export default class es {
2
2
  constructor(t) {
3
- (this.Gc = t), (this.Gc = t);
3
+ (this.xc = t), (this.xc = t);
4
4
  }
5
- Hc(t) {
6
- return null == this.Gc || this.Gc === t[0];
5
+ zc(t) {
6
+ return null == this.xc || this.xc === t[0];
7
7
  }
8
8
  static fromJson(t) {
9
9
  return new es(t ? t.event_name : null);
10
10
  }
11
11
  qt() {
12
- return this.Gc;
12
+ return this.xc;
13
13
  }
14
14
  }
@@ -1,13 +1,13 @@
1
1
  import ls from "./filter-set.js";
2
2
  export default class ns {
3
3
  constructor(t, s) {
4
- (this.Gc = t), (this.tf = s), (this.Gc = t), (this.tf = s);
4
+ (this.xc = t), (this.tf = s), (this.xc = t), (this.tf = s);
5
5
  }
6
- Hc(t) {
7
- if (null == this.Gc || null == this.tf) return !1;
6
+ zc(t) {
7
+ if (null == this.xc || null == this.tf) return !1;
8
8
  const s = t[0],
9
9
  i = t[1];
10
- return s === this.Gc && this.tf.Hc(i);
10
+ return s === this.xc && this.tf.zc(i);
11
11
  }
12
12
  static fromJson(t) {
13
13
  return new ns(
@@ -16,6 +16,6 @@ export default class ns {
16
16
  );
17
17
  }
18
18
  qt() {
19
- return { e: this.Gc, pf: this.tf ? this.tf.qt() : null };
19
+ return { e: this.xc, pf: this.tf ? this.tf.qt() : null };
20
20
  }
21
21
  }
@@ -4,13 +4,13 @@ export default class ls {
4
4
  constructor(t) {
5
5
  (this.filters = t), (this.filters = t);
6
6
  }
7
- Hc(t) {
7
+ zc(t) {
8
8
  let r = !0;
9
9
  for (let e = 0; e < this.filters.length; e++) {
10
10
  const o = this.filters[e];
11
11
  let s = !1;
12
12
  for (let r = 0; r < o.length; r++)
13
- if (o[r].Hc(t)) {
13
+ if (o[r].zc(t)) {
14
14
  s = !0;
15
15
  break;
16
16
  }
@@ -22,7 +22,7 @@ export default class hr {
22
22
  this.comparator !== hr.hT.oT &&
23
23
  (this.eT = Y(this.eT));
24
24
  }
25
- Hc(t) {
25
+ zc(t) {
26
26
  let s = null;
27
27
  switch ((null != t && (s = t[this.tT]), this.comparator)) {
28
28
  case hr.hT.ET:
@@ -1,11 +1,11 @@
1
- import gi from "./trigger-condition.js";
2
- export default class pi {
1
+ import pi from "./trigger-condition.js";
2
+ export default class bi {
3
3
  constructor(t, i) {
4
4
  (this.if = t), (this.rf = i), (this.if = t), (this.rf = i);
5
5
  }
6
- Hc(t) {
6
+ zc(t) {
7
7
  if (null == this.if) return !1;
8
- const i = gi.sf(t[0], this.if);
8
+ const i = pi.sf(t[0], this.if);
9
9
  if (!i) return !1;
10
10
  let r = null == this.rf || 0 === this.rf.length;
11
11
  if (null != this.rf)
@@ -17,7 +17,7 @@ export default class pi {
17
17
  return i && r;
18
18
  }
19
19
  static fromJson(t) {
20
- return new pi(t ? t.id : null, t ? t.buttons : null);
20
+ return new bi(t ? t.id : null, t ? t.buttons : null);
21
21
  }
22
22
  qt() {
23
23
  return this.if;
@@ -2,7 +2,7 @@ export default class os {
2
2
  constructor(t) {
3
3
  (this.productId = t), (this.productId = t);
4
4
  }
5
- Hc(t) {
5
+ zc(t) {
6
6
  return null == this.productId || t[0] === this.productId;
7
7
  }
8
8
  static fromJson(t) {