@braze/web-sdk 6.3.1 → 6.5.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 (159) hide show
  1. package/README.md +1 -1
  2. package/index.d.ts +38 -5
  3. package/package.json +1 -1
  4. package/shared-lib/encoding-utils.js +3 -3
  5. package/shared-lib/event-types.js +30 -30
  6. package/shared-lib/guid.js +1 -1
  7. package/shared-lib/indexed-db-adapter.js +60 -60
  8. package/shared-lib/logger.js +7 -7
  9. package/shared-lib/supported-options.js +24 -23
  10. package/src/Banner/banner-provider.js +95 -81
  11. package/src/Banner/banner.js +9 -9
  12. package/src/Banner/constants.js +4 -0
  13. package/src/Banner/display/banner-to-html.js +3 -3
  14. package/src/Banner/display/destroy-banner-html.js +3 -3
  15. package/src/Banner/display/detect-banner-impressions.js +16 -16
  16. package/src/Banner/get-all-banners.js +4 -4
  17. package/src/Banner/get-banner.js +5 -4
  18. package/src/Banner/index.js +2 -0
  19. package/src/Banner/log-banner-click.js +2 -2
  20. package/src/Banner/log-banner-impressions.js +6 -6
  21. package/src/Banner/request-banners-refresh.js +18 -20
  22. package/src/Banner/subscribe-to-banners-updates.js +5 -5
  23. package/src/Banner/ui/insert-banner.js +17 -14
  24. package/src/Card/card-manager-factory.js +6 -6
  25. package/src/Card/card-manager.js +28 -28
  26. package/src/Card/constants.js +1 -0
  27. package/src/Card/display/card-display.js +7 -7
  28. package/src/Card/log-card-dismissal.js +3 -3
  29. package/src/Card/log-content-card-click.js +3 -3
  30. package/src/Card/log-content-card-impressions.js +6 -6
  31. package/src/Card/models/captioned-image.js +3 -3
  32. package/src/Card/models/card.js +9 -9
  33. package/src/Card/models/classic-card.js +3 -3
  34. package/src/Card/models/control-card.js +3 -3
  35. package/src/Card/models/image-only.js +3 -3
  36. package/src/ContentCards/content-cards-provider-factory.js +6 -2
  37. package/src/ContentCards/content-cards-provider.js +101 -87
  38. package/src/ContentCards/content-cards.js +4 -4
  39. package/src/ContentCards/request-content-cards-refresh.js +1 -1
  40. package/src/ContentCards/subscribe-to-content-cards-updates.js +4 -4
  41. package/src/ContentCards/ui/show-content-cards.js +5 -5
  42. package/src/Core/add-sdk-metadata.js +2 -2
  43. package/src/Core/change-user.js +1 -1
  44. package/src/Core/disable-sdk.js +5 -5
  45. package/src/Core/enable-sdk.js +3 -3
  46. package/src/Core/get-device-id.js +2 -2
  47. package/src/Core/get-user.js +1 -1
  48. package/src/Core/handle-braze-action.js +3 -3
  49. package/src/Core/is-disabled.js +1 -1
  50. package/src/Core/log-custom-event.js +7 -7
  51. package/src/Core/log-purchase.js +4 -4
  52. package/src/Core/open-session.js +6 -6
  53. package/src/Core/wipe-data.js +3 -3
  54. package/src/DUST/dust-connection-core.js +23 -0
  55. package/src/DUST/dust-provider-factory.js +22 -0
  56. package/src/DUST/dust-provider.js +520 -0
  57. package/src/DUST/dust-shared-worker-code.js +2 -0
  58. package/src/DUST/dust-shared-worker-impl.js +240 -0
  59. package/src/DUST/dust-worker-bridge.js +136 -0
  60. package/src/DUST/index.js +13 -0
  61. package/src/DUST/subscribe-to-dust.js +24 -0
  62. package/src/DUST/types.js +1 -0
  63. package/src/FeatureFlags/feature-flag-factory.js +8 -8
  64. package/src/FeatureFlags/feature-flag.js +6 -6
  65. package/src/FeatureFlags/feature-flags-provider-factory.js +9 -9
  66. package/src/FeatureFlags/feature-flags-provider.js +98 -84
  67. package/src/FeatureFlags/get-all-feature-flags.js +3 -3
  68. package/src/FeatureFlags/get-feature-flag.js +3 -3
  69. package/src/FeatureFlags/log-feature-flag-impression.js +7 -7
  70. package/src/FeatureFlags/refresh-feature-flags.js +5 -5
  71. package/src/FeatureFlags/subscribe-to-feature-flags-updates.js +4 -4
  72. package/src/InAppMessage/constants.js +4 -0
  73. package/src/InAppMessage/defer-in-app-message.js +2 -2
  74. package/src/InAppMessage/display/get-animation-effect.js +1 -1
  75. package/src/InAppMessage/display/html-message-to-html.js +6 -6
  76. package/src/InAppMessage/display/in-app-message-to-html.js +34 -34
  77. package/src/InAppMessage/display/modal-utils.js +14 -14
  78. package/src/InAppMessage/get-deferred-in-app-message.js +2 -2
  79. package/src/InAppMessage/in-app-message-factory.js +4 -4
  80. package/src/InAppMessage/in-app-message-manager-factory.js +7 -7
  81. package/src/InAppMessage/in-app-message-manager.js +98 -98
  82. package/src/InAppMessage/log-in-app-message-button-click.js +12 -12
  83. package/src/InAppMessage/log-in-app-message-click.js +11 -11
  84. package/src/InAppMessage/log-in-app-message-html-click.js +9 -9
  85. package/src/InAppMessage/log-in-app-message-impression.js +8 -8
  86. package/src/InAppMessage/models/control-message.js +5 -5
  87. package/src/InAppMessage/models/full-screen-message.js +21 -21
  88. package/src/InAppMessage/models/html-message.js +18 -18
  89. package/src/InAppMessage/models/in-app-message-button.js +7 -7
  90. package/src/InAppMessage/models/in-app-message.js +145 -145
  91. package/src/InAppMessage/models/modal-message.js +21 -21
  92. package/src/InAppMessage/models/slide-up-message.js +27 -27
  93. package/src/InAppMessage/models/templated-in-app-message.js +8 -8
  94. package/src/InAppMessage/subscribe-to-in-app-message.js +2 -2
  95. package/src/InAppMessage/ui/automatically-show-in-app-messages.js +5 -5
  96. package/src/InAppMessage/ui/remove-all-visible-in-app-messages.js +18 -0
  97. package/src/InAppMessage/ui/show-in-app-message.js +36 -36
  98. package/src/Push/is-push-blocked.js +2 -2
  99. package/src/Push/is-push-permission-granted.js +2 -2
  100. package/src/Push/is-push-supported.js +2 -2
  101. package/src/Push/push-manager-factory.js +15 -15
  102. package/src/Push/push-manager.js +97 -97
  103. package/src/Push/request-push-permission.js +1 -1
  104. package/src/Push/unregister-push.js +1 -1
  105. package/src/Push/utils/push-utils.js +17 -17
  106. package/src/User/user-manager.js +24 -24
  107. package/src/User/user.js +55 -55
  108. package/src/common/constants.js +8 -10
  109. package/src/common/content-cards-display.js +40 -40
  110. package/src/common/event-logger.js +8 -8
  111. package/src/common/properties-base.js +16 -16
  112. package/src/l10n/l10n-manager-factory.js +11 -11
  113. package/src/l10n/l10n-manager.js +2 -2
  114. package/src/managers/auth-manager.js +30 -30
  115. package/src/managers/braze-instance.js +170 -162
  116. package/src/managers/device-manager.js +24 -24
  117. package/src/managers/network-manager.js +149 -149
  118. package/src/managers/server-config-manager.js +140 -95
  119. package/src/managers/session-manager.js +39 -39
  120. package/src/managers/storage-manager-factory.js +10 -10
  121. package/src/managers/storage-manager.js +145 -141
  122. package/src/managers/subscription-manager.js +11 -11
  123. package/src/managers/utils.js +1 -1
  124. package/src/models/backend-errors.js +5 -5
  125. package/src/models/braze-event.js +11 -11
  126. package/src/models/device.js +3 -3
  127. package/src/models/identifier.js +16 -16
  128. package/src/models/push-token.js +13 -13
  129. package/src/models/request-result.js +3 -3
  130. package/src/models/server-config.js +45 -37
  131. package/src/request-controller.js +163 -158
  132. package/src/triggers/models/custom-event-data.js +5 -5
  133. package/src/triggers/models/custom-event-property-data.js +6 -6
  134. package/src/triggers/models/filter-set.js +10 -10
  135. package/src/triggers/models/filter.js +27 -27
  136. package/src/triggers/models/in-app-message-click-data.js +13 -13
  137. package/src/triggers/models/purchase-data.js +2 -2
  138. package/src/triggers/models/purchase-property-data.js +6 -6
  139. package/src/triggers/models/push-click-data.js +6 -6
  140. package/src/triggers/models/trigger-condition.js +47 -47
  141. package/src/triggers/models/trigger-events.js +3 -3
  142. package/src/triggers/models/trigger.js +36 -36
  143. package/src/triggers/triggers-provider-factory.js +5 -5
  144. package/src/triggers/triggers-provider.js +63 -63
  145. package/src/ui/js/attach-css.js +3 -3
  146. package/src/ui/js/load-font-awesome.js +2 -2
  147. package/src/util/base-device-parser.js +9 -9
  148. package/src/util/braze-actions.js +5 -5
  149. package/src/util/browser-detector.js +37 -37
  150. package/src/util/client-hints-parser.js +11 -11
  151. package/src/util/component-utils.js +5 -5
  152. package/src/util/dom-utils.js +13 -13
  153. package/src/util/html-display-utils.js +7 -7
  154. package/src/util/key-codes.js +1 -1
  155. package/src/util/net.js +5 -5
  156. package/src/util/request-header-utils.js +27 -27
  157. package/src/util/user-agent-parser.js +21 -21
  158. package/src/util/validation-utils.js +17 -17
  159. package/src/util/window-utils.js +3 -3
@@ -1,92 +1,93 @@
1
- import a from "./util/net.js";
2
- import ue from "./models/braze-event.js";
3
- import c from "./common/event-logger.js";
4
- import { randomInclusive as l } from "./util/math.js";
1
+ import l from "./util/net.js";
2
+ import De from "./models/braze-event.js";
3
+ import v from "./common/event-logger.js";
4
+ import { randomInclusive as a } from "./util/math.js";
5
5
  import H from "./models/request-result.js";
6
6
  import {
7
7
  logger as E,
8
8
  IndexedDBAdapter as et,
9
9
  Guid as P,
10
- EventTypes as m,
10
+ EventTypes as f,
11
11
  } from "../shared-lib/index.js";
12
12
  import { STORAGE_KEYS as s } from "./managers/storage-manager.js";
13
- import u from "./managers/subscription-manager.js";
14
- import yt from "./Push/utils/push-utils.js";
13
+ import m from "./managers/subscription-manager.js";
14
+ import vt from "./Push/utils/push-utils.js";
15
15
  import h from "./util/request-header-utils.js";
16
+ import { removeAllVisibleInAppMessages as di } from "./InAppMessage/ui/remove-all-visible-in-app-messages.js";
16
17
  export default class Wt {
17
- constructor(t, i, s, e, h, n, o, r, l, a) {
18
- (this.sn = t),
18
+ constructor(t, i, s, e, h, n, o, r, l, u) {
19
+ (this.tu = t),
19
20
  (this.baseUrl = i),
20
21
  (this.C = s),
21
- (this.on = e),
22
- (this.Cs = h),
22
+ (this.eu = e),
23
+ (this.vs = h),
23
24
  (this.h = n),
24
- (this.j = o),
25
- (this.$l = r),
26
- (this.Qh = l),
27
- (this.B = a),
28
- (this.sn = t),
25
+ (this.B = o),
26
+ (this.$c = r),
27
+ (this.hl = l),
28
+ (this.j = u),
29
+ (this.tu = t),
29
30
  (this.baseUrl = i),
30
- (this.Tl = 0),
31
- (this.fE = o.dE() || 0),
32
- (this.Ll = null),
31
+ (this.Zc = 0),
32
+ (this.bE = o.dE() || 0),
33
+ (this.sd = null),
33
34
  (this.C = s),
34
- (this.on = e),
35
- (this.Cs = h),
35
+ (this.eu = e),
36
+ (this.vs = h),
36
37
  (this.h = n),
37
- (this.j = o),
38
- (this.Qh = l),
39
- (this.B = a),
40
- (this.$l = r),
41
- (this.Ml = new u()),
42
- (this.Pl = null),
43
- (this.Il = 50),
44
- (this.Ol = !1),
45
- (this.Ul = !1);
38
+ (this.B = o),
39
+ (this.hl = l),
40
+ (this.j = u),
41
+ (this.$c = r),
42
+ (this.hd = new m()),
43
+ (this.nd = null),
44
+ (this.rd = 50),
45
+ (this.ld = !1),
46
+ (this.ud = !1);
46
47
  }
47
- _l(t, i) {
48
- return !t && !i && this.Qh.Hh() >= this.Il;
48
+ ad(t, i) {
49
+ return !t && !i && this.hl.Jh() >= this.rd;
49
50
  }
50
- Jl(t) {
51
- let i = this.C.zl();
51
+ md(t) {
52
+ let i = this.C.am();
52
53
  if (t.length > 0) {
53
- const s = this.Cs.getUserId();
54
+ const s = this.vs.getUserId();
54
55
  for (const e of t) {
55
56
  const t = (!e.userId && !s) || e.userId === s;
56
- e.type === m.Al && t && (i = !0);
57
+ e.type === f.Sm && t && (i = !0);
57
58
  }
58
59
  }
59
60
  return i;
60
61
  }
61
- Kl(t = !1, i = !0, e, n, o, r = !1, u = !1) {
62
- i && this.Xl();
63
- const c = this.j.RE(),
64
- d = this.j.IE();
62
+ fd(t = !1, i = !0, e, n, o, r = !1, u = !1) {
63
+ i && this.gd();
64
+ const c = this.B.RE(),
65
+ d = this.B.IE();
65
66
  let m = !1;
66
67
  const f = (t, r, u = -1) => {
67
68
  const c = new Date().valueOf();
68
- h.K(this.j, h.H.Tu, c),
69
+ h.K(this.B, h.H.Ze, c),
69
70
  -1 !== u && r.push(["X-Braze-Req-Tokens-Remaining", u.toString()]);
70
71
  let d = !1;
71
- a.O({
72
+ l.O({
72
73
  url: this.baseUrl + "/data/",
73
74
  data: t,
74
75
  headers: r,
75
76
  W: (i) => {
76
77
  null != t.respond_with &&
77
78
  t.respond_with.triggers &&
78
- (this.Tl = Math.max(this.Tl - 1, 0)),
79
- this.B.Y(t, i, r)
80
- ? (this.Qh.Z(),
81
- this.h.cl(i),
79
+ (this.Zc = Math.max(this.Zc - 1, 0)),
80
+ this.j.Y(t, i, r)
81
+ ? (this.hl.Z(),
82
+ this.h.Sc(i),
82
83
  (null != t.respond_with &&
83
- t.respond_with.user_id != this.Cs.getUserId()) ||
84
- (null != t.device && this.j.ft(s.ct.Qa, t.device),
84
+ t.respond_with.user_id != this.vs.getUserId()) ||
85
+ (null != t.device && this.B.bt(s.ft.ac, t.device),
85
86
  null != t.sdk_metadata &&
86
- (this.j.ft(s.ct.au, t.sdk_metadata),
87
- this.j.ft(s.ct.du, this.C.bt())),
88
- this.$l(i),
89
- h.Bu(this.j, h.H.Tu, 1),
87
+ (this.B.bt(s.ft.Dl, t.sdk_metadata),
88
+ this.B.bt(s.ft.Tl, this.C.yt())),
89
+ this.$c(i),
90
+ h.xl(this.B, h.H.Ze, 1),
90
91
  "function" == typeof e && e()))
91
92
  : i.auth_error && (d = !0);
92
93
  },
@@ -94,13 +95,13 @@ export default class Wt {
94
95
  (d = !0),
95
96
  null != t.respond_with &&
96
97
  t.respond_with.triggers &&
97
- (this.Tl = Math.max(this.Tl - 1, 0)),
98
- this.B.fu(t.events, t.attributes),
98
+ (this.Zc = Math.max(this.Zc - 1, 0)),
99
+ this.j.kl(t.events, t.attributes),
99
100
  "function" == typeof n && n();
100
101
  },
101
102
  tt: (t, s) => {
102
103
  "function" == typeof o && o(!d);
103
- const e = this.B.Fu(s);
104
+ const e = this.j.Vl(s);
104
105
  let n = 0;
105
106
  if (e)
106
107
  switch (e.type) {
@@ -112,97 +113,100 @@ export default class Wt {
112
113
  }
113
114
  if (i && !m) {
114
115
  if (d) {
115
- h.Ku(this.j, h.H.Tu);
116
- let t = this.Ll;
117
- (null == t || t < 1e3 * this.fE) && (t = 1e3 * this.fE);
118
- const i = Math.min(3e5, l(1e3 * this.fE, 3 * t)) + n;
119
- this.Ql(i);
120
- } else this.Ql(Math.max(1e3 * this.fE, n));
116
+ h.Zl(this.B, h.H.Ze);
117
+ const t = this.h.st(),
118
+ i = this.h.it(),
119
+ s = this.h.nt();
120
+ let e = this.sd;
121
+ (null == e || e < t) && (e = t);
122
+ const o = Math.min(s, a(t, e * i)) + n;
123
+ this.pd(o);
124
+ } else this.pd(Math.max(1e3 * this.bE, n));
121
125
  m = !0;
122
126
  }
123
127
  },
124
128
  });
125
129
  },
126
- g = this.Jl(c),
127
- v = t || g;
128
- if (this._l(r, g))
130
+ g = this.md(c),
131
+ p = t || g;
132
+ if (this.ad(r, g))
129
133
  return void E.info(
130
134
  "Declining to flush data due to 50 consecutive authentication failures",
131
135
  );
132
- if (i && !this.B.Au(c, d, v))
133
- return this.Ql(), void ("function" == typeof o && o(!0));
134
- const p = this.B.Du(v, c, d, u);
135
- v && this.Tl++;
136
+ if (i && !this.j.Ml(c, d, p))
137
+ return this.pd(), void ("function" == typeof o && o(!0));
138
+ const v = this.j.$l(p, c, d, u);
139
+ p && this.Zc++;
136
140
  let b = !1;
137
- if (p)
138
- for (const t of p)
139
- this.B.J(
141
+ if (v)
142
+ for (const t of v)
143
+ this.j.J(
140
144
  t.requestData,
141
145
  (i) => f(t.requestData, t.headers, i),
142
- h.H.Tu,
146
+ h.H.Ze,
143
147
  n,
144
148
  ),
145
149
  (b = !0);
146
- this.Qh.fh() && i && !b
147
- ? this.Ql()
150
+ this.hl.wh() && i && !b
151
+ ? this.pd()
148
152
  : g &&
149
153
  (E.info("Invoking new session subscriptions"),
150
- this.Ml.L(),
151
- (this.Ul = !0));
154
+ this.hd.L(),
155
+ (this.ud = !0));
152
156
  }
153
- Yl() {
154
- return this.Tl > 0;
157
+ vd() {
158
+ return this.Zc > 0;
155
159
  }
156
- Ql(t = 1e3 * this.fE) {
157
- this.Ol ||
158
- (this.Xl(),
159
- (this.Pl = window.setTimeout(() => {
160
+ pd(t = 1e3 * this.bE) {
161
+ this.ld ||
162
+ (this.gd(),
163
+ (this.nd = window.setTimeout(() => {
160
164
  if (document.hidden) {
161
165
  const t = "visibilitychange",
162
166
  i = () => {
163
167
  document.hidden ||
164
- (document.removeEventListener(t, i, !1), this.Kl());
168
+ (document.removeEventListener(t, i, !1), this.fd());
165
169
  };
166
170
  document.addEventListener(t, i, !1);
167
- } else this.Kl();
171
+ } else this.fd();
168
172
  }, t)),
169
- (this.Ll = t));
173
+ (this.sd = t));
170
174
  }
171
- Xl() {
172
- null != this.Pl && (clearTimeout(this.Pl), (this.Pl = null));
175
+ gd() {
176
+ null != this.nd && (clearTimeout(this.nd), (this.nd = null));
173
177
  }
174
178
  initialize() {
175
- (this.Ol = !1), this.Ql();
179
+ (this.ld = !1), this.pd();
176
180
  }
177
181
  destroy() {
178
- this.Ml.removeAllSubscriptions(),
179
- this.Qh.Bh(),
180
- this.Xl(),
181
- (this.Ol = !0),
182
- this.Kl(void 0, !1, void 0, void 0, void 0, void 0, !0),
183
- (this.Pl = null),
184
- (this.Ul = !1);
182
+ this.hd.removeAllSubscriptions(),
183
+ this.hl.Gh(),
184
+ this.gd(),
185
+ (this.ld = !0),
186
+ this.fd(void 0, !1, void 0, void 0, void 0, void 0, !0),
187
+ (this.nd = null),
188
+ (this.ud = !1);
185
189
  }
186
190
  rn(t) {
187
- return this.Ul ? (t(), null) : this.Ml.wt(t);
191
+ return this.ud ? (t(), null) : this.hd.Rt(t);
188
192
  }
189
193
  openSession() {
190
- const t = this.C.bt() !== this.C.qo();
191
- t && (this.j.hE(s.iu.Jh), this.j.hE(s.iu.su)),
192
- this.Kl(!1, void 0, () => {
193
- t && (this.j.Nt(s.ct.qe), this.j.Nt(s.ct.It));
194
+ const t = this.C.yt() !== this.C.el();
195
+ t && (this.B.hE(s.Ou.tl), this.B.hE(s.Ou.Cu)),
196
+ this.fd(!1, void 0, () => {
197
+ t && (this.B.zt(s.ft.vo), this.B.zt(s.ft.Dt));
194
198
  }),
195
- this.zn(),
199
+ this.Ya(),
196
200
  t &&
197
201
  import("./Push/push-manager-factory.js").then((t) => {
198
- if (this.Ol) return;
199
- const i = t.default.ea();
202
+ if (this.ld) return;
203
+ const i = t.default.ra();
200
204
  if (
201
205
  null != i &&
202
- (yt.isPushPermissionGranted() || yt.isPushBlocked())
206
+ (vt.isPushPermissionGranted() || vt.isPushBlocked())
203
207
  ) {
204
208
  const t = () => {
205
- i.mn()
209
+ i.du()
206
210
  ? E.info(
207
211
  "Push token maintenance is disabled, not refreshing token for backend.",
208
212
  )
@@ -212,55 +216,56 @@ export default class Wt {
212
216
  s && t();
213
217
  },
214
218
  h = () => {
215
- const i = this.j.lt(s.ct.In);
219
+ const i = this.B.dt(s.ft.Uu);
216
220
  (null == i || i) && t();
217
221
  },
218
222
  n = et.Us.Rs;
219
- new et(n, E).jr(n.Fs.cu, e, h);
223
+ new et(n, E).kr(n.Fs.Fu, e, h);
220
224
  }
221
225
  });
222
226
  }
223
- Zl() {
224
- this.j.Nt(s.ct.Ie), this.j.Nt(s.ct.Ps), this.j.Nt(s.ct.Nr);
227
+ bd() {
228
+ this.B.zt(s.ft.lo), this.B.zt(s.ft.Ps), this.B.zt(s.ft.Wn);
225
229
  }
226
- hc() {
230
+ wd() {
227
231
  var t, i;
228
- this.j.Nt(s.ct.Lu), this.j.Nt(s.ct.SE);
232
+ this.B.zt(s.ft.Jl), this.B.zt(s.ft.lE);
229
233
  const e = h.H;
230
234
  for (const i in e) {
231
235
  const s = e[i];
232
- this.B.Uu(s, null === (t = this.h) || void 0 === t ? void 0 : t.Vu(s));
236
+ this.j.lc(s, null === (t = this.h) || void 0 === t ? void 0 : t.Dc(s));
233
237
  }
234
- this.B.Iu(null === (i = this.h) || void 0 === i ? void 0 : i.Ju());
238
+ this.j.hc(null === (i = this.h) || void 0 === i ? void 0 : i.qc());
235
239
  }
236
240
  changeUser(t, i, e) {
237
- const h = this.Cs.getUserId();
241
+ const h = this.vs.getUserId();
238
242
  if (h !== t) {
239
- this.C.Bl(),
240
- this.Zl(),
241
- null != h && this.Kl(void 0, !1, void 0, void 0, void 0),
242
- this.Cs.ou(t),
243
- e ? this.Qh.setSdkAuthenticationSignature(e) : this.Qh.qh();
243
+ this.C.jm(),
244
+ this.bd(),
245
+ di(),
246
+ null != h && this.fd(void 0, !1, void 0, void 0, void 0),
247
+ this.vs.Ju(t),
248
+ e ? this.hl.setSdkAuthenticationSignature(e) : this.hl.yh();
244
249
  for (let t = 0; t < i.length; t++) i[t].changeUser(null == h);
245
- this.B.fo(),
246
- null != h && this.j.Nt(s.ct.rE),
247
- this.j.Nt(s.ct.Qa),
248
- this.j.Nt(s.ct.uE),
249
- this.hc(),
250
+ this.j.fo(),
251
+ null != h && this.B.zt(s.ft.rE),
252
+ this.B.zt(s.ft.ac),
253
+ this.B.zt(s.ft.uE),
254
+ this.wd(),
250
255
  this.openSession(),
251
256
  E.info('Changed user to "' + t + '".');
252
257
  } else {
253
258
  let i = "Doing nothing.";
254
259
  e &&
255
- this.Qh.wh() !== e &&
256
- (this.Qh.setSdkAuthenticationSignature(e),
260
+ this.hl.jh() !== e &&
261
+ (this.hl.setSdkAuthenticationSignature(e),
257
262
  (i = "Updated SDK authentication signature")),
258
263
  E.info(`Current user is already ${t}. ${i}`);
259
264
  }
260
265
  }
261
266
  requestImmediateDataFlush(t) {
262
- this.Xl(), this.C.qo();
263
- this.Kl(
267
+ this.gd(), this.C.el();
268
+ this.fd(
264
269
  void 0,
265
270
  void 0,
266
271
  void 0,
@@ -271,27 +276,27 @@ export default class Wt {
271
276
  !0,
272
277
  );
273
278
  }
274
- $r(t, i) {
275
- this.C.qo(),
279
+ yr(t, i) {
280
+ this.C.el(),
276
281
  E.info("Requesting explicit trigger refresh."),
277
- this.Kl(!0, void 0, t, i);
282
+ this.fd(!0, void 0, t, i);
278
283
  }
279
- En(t, i) {
280
- const e = m.nc,
284
+ Gu(t, i) {
285
+ const e = f.kd,
281
286
  h = { a: t, l: i },
282
- n = c.rt(e, h);
287
+ n = v.lt(e, h);
283
288
  return (
284
- n && (E.info(`Logged alias ${t} with label ${i}`), this.j.ft(s.ct.uE, h)),
289
+ n && (E.info(`Logged alias ${t} with label ${i}`), this.B.bt(s.ft.uE, h)),
285
290
  n
286
291
  );
287
292
  }
288
- Ln(t, i, s) {
289
- if (this.h.hu(i))
293
+ Mu(t, i, s) {
294
+ if (this.h.qu(i))
290
295
  return (
291
296
  E.info(`Custom Attribute "${i}" is blocklisted, ignoring.`), new H()
292
297
  );
293
298
  const e = { key: i, value: s },
294
- h = c.rt(t, e);
299
+ h = v.lt(t, e);
295
300
  if (h) {
296
301
  const t = "object" == typeof s ? JSON.stringify(s, null, 2) : s;
297
302
  E.info(`Logged custom attribute: ${i} with value: ${t}`);
@@ -303,52 +308,52 @@ export default class Wt {
303
308
  null != e && (o.altitude = e),
304
309
  null != h && (o.ll_accuracy = h),
305
310
  null != n && (o.alt_accuracy = n);
306
- const r = c.rt(m.lc, o, t || void 0);
311
+ const r = v.lt(f.yd, o, t || void 0);
307
312
  return (
308
313
  r &&
309
314
  E.info(`Set user last known location as ${JSON.stringify(o, null, 2)}`),
310
315
  r
311
316
  );
312
317
  }
313
- kr(t, i) {
314
- const s = this.C.qo();
315
- return new ue(this.Cs.getUserId(), m.uc, t, s, { cid: i });
318
+ $r(t, i) {
319
+ const s = this.C.el();
320
+ return new De(this.vs.getUserId(), f.jd, t, s, { cid: i });
316
321
  }
317
- cc(t, i) {
322
+ Sd(t, i) {
318
323
  return new et(t, i);
319
324
  }
320
- zn() {
325
+ Ya() {
321
326
  const t = et.Us.Rs;
322
- this.cc(t, E).setItem(t.Fs.Tu, 1, {
327
+ this.Sd(t, E).setItem(t.Fs.Ze, 1, {
323
328
  baseUrl: this.baseUrl,
324
- data: { api_key: this.sn, device_id: this.on.fe().id },
325
- userId: this.Cs.getUserId(),
326
- sdkAuthEnabled: this.Qh.fh(),
329
+ data: { api_key: this.tu, device_id: this.eu.ve().id },
330
+ userId: this.vs.getUserId(),
331
+ sdkAuthEnabled: this.hl.wh(),
327
332
  });
328
333
  }
329
- yr(t) {
334
+ Fr(t) {
330
335
  for (const i of t)
331
- if (i.api_key === this.sn) this.B.fu(i.events, i.attributes);
336
+ if (i.api_key === this.tu) this.j.kl(i.events, i.attributes);
332
337
  else {
333
338
  const t = et.Us.Rs;
334
- new et(t, E).setItem(t.Fs.wr, P.oe(), i);
339
+ new et(t, E).setItem(t.Fs.zr, P.se(), i);
335
340
  }
336
341
  }
337
- Hn(t, i, s) {
338
- if (this.h.hu(t))
342
+ Na(t, i, s) {
343
+ if (this.h.qu(t))
339
344
  return (
340
345
  E.info(`Custom Attribute "${t}" is blocklisted, ignoring.`), new H()
341
346
  );
342
347
  let e, h;
343
348
  return (
344
349
  null === i && null === s
345
- ? ((e = m.dc), (h = { key: t }))
346
- : ((e = m.mc), (h = { key: t, latitude: i, longitude: s })),
347
- c.rt(e, h)
350
+ ? ((e = f.Ad), (h = { key: t }))
351
+ : ((e = f.Dd), (h = { key: t, latitude: i, longitude: s })),
352
+ v.lt(e, h)
348
353
  );
349
354
  }
350
- Kn(t, i) {
355
+ Ra(t, i) {
351
356
  const s = { group_id: t, status: i };
352
- return c.rt(m.fc, s);
357
+ return v.lt(f.$d, s);
353
358
  }
354
359
  }
@@ -1,14 +1,14 @@
1
1
  export default class rs {
2
2
  constructor(t) {
3
- (this.wc = t), (this.wc = t);
3
+ (this.tf = t), (this.tf = t);
4
4
  }
5
- xc(t) {
6
- return null == this.wc || this.wc === t[0];
5
+ sf(t) {
6
+ return null == this.tf || this.tf === t[0];
7
7
  }
8
8
  static fromJson(t) {
9
9
  return new rs(t ? t.event_name : null);
10
10
  }
11
- dt() {
12
- return this.wc;
11
+ gt() {
12
+ return this.tf;
13
13
  }
14
14
  }
@@ -1,13 +1,13 @@
1
1
  import is from "./filter-set.js";
2
2
  export default class ls {
3
3
  constructor(t, s) {
4
- (this.wc = t), (this.tf = s), (this.wc = t), (this.tf = s);
4
+ (this.tf = t), (this.if = s), (this.tf = t), (this.if = s);
5
5
  }
6
- xc(t) {
7
- if (null == this.wc || null == this.tf) return !1;
6
+ sf(t) {
7
+ if (null == this.tf || null == this.if) return !1;
8
8
  const s = t[0],
9
9
  i = t[1];
10
- return s === this.wc && this.tf.xc(i);
10
+ return s === this.tf && this.if.sf(i);
11
11
  }
12
12
  static fromJson(t) {
13
13
  return new ls(
@@ -15,7 +15,7 @@ export default class ls {
15
15
  t ? is.fromJson(t.property_filters) : null,
16
16
  );
17
17
  }
18
- dt() {
19
- return { e: this.wc, pf: this.tf ? this.tf.dt() : null };
18
+ gt() {
19
+ return { e: this.tf, pf: this.if ? this.if.gt() : null };
20
20
  }
21
21
  }
@@ -1,16 +1,16 @@
1
- import fr from "./filter.js";
2
- import { isArray as D } from "../../util/code-utils.js";
1
+ import cr from "./filter.js";
2
+ import { isArray as R } from "../../util/code-utils.js";
3
3
  export default class is {
4
4
  constructor(t) {
5
5
  (this.filters = t), (this.filters = t);
6
6
  }
7
- xc(t) {
7
+ sf(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].xc(t)) {
13
+ if (o[r].sf(t)) {
14
14
  s = !0;
15
15
  break;
16
16
  }
@@ -22,32 +22,32 @@ export default class is {
22
22
  return r;
23
23
  }
24
24
  static fromJson(t) {
25
- if (null == t || !D(t)) return null;
25
+ if (null == t || !R(t)) return null;
26
26
  const r = [];
27
27
  for (let e = 0; e < t.length; e++) {
28
28
  const o = [],
29
29
  s = t[e];
30
- for (let t = 0; t < s.length; t++) o.push(fr.fromJson(s[t]));
30
+ for (let t = 0; t < s.length; t++) o.push(cr.fromJson(s[t]));
31
31
  r.push(o);
32
32
  }
33
33
  return new is(r);
34
34
  }
35
- dt() {
35
+ gt() {
36
36
  const t = [];
37
37
  for (let r = 0; r < this.filters.length; r++) {
38
38
  const e = this.filters[r],
39
39
  o = [];
40
- for (let t = 0; t < e.length; t++) o.push(e[t].dt());
40
+ for (let t = 0; t < e.length; t++) o.push(e[t].gt());
41
41
  t.push(o);
42
42
  }
43
43
  return t;
44
44
  }
45
- static qn(t) {
45
+ static _u(t) {
46
46
  const r = [];
47
47
  for (let e = 0; e < t.length; e++) {
48
48
  const o = [],
49
49
  s = t[e];
50
- for (let t = 0; t < s.length; t++) o.push(fr.qn(s[t]));
50
+ for (let t = 0; t < s.length; t++) o.push(cr._u(s[t]));
51
51
  r.push(o);
52
52
  }
53
53
  return new is(r);