@braze/web-sdk 5.1.1 → 5.2.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 (76) hide show
  1. package/index.d.ts +14 -8
  2. package/package.json +1 -1
  3. package/shared-lib/encoding-utils.js +1 -1
  4. package/shared-lib/event-types.js +18 -18
  5. package/shared-lib/indexed-db-adapter.js +32 -32
  6. package/shared-lib/logger.js +2 -2
  7. package/shared-lib/supported-options.js +22 -21
  8. package/src/InAppMessage/display/html-message-to-html.js +38 -35
  9. package/src/InAppMessage/display/in-app-message-to-html.js +2 -2
  10. package/src/InAppMessage/display/modal-utils.js +2 -2
  11. package/src/InAppMessage/in-app-message-factory.js +21 -19
  12. package/src/InAppMessage/in-app-message-manager.js +58 -78
  13. package/src/InAppMessage/log-in-app-message-button-click.js +2 -2
  14. package/src/InAppMessage/log-in-app-message-click.js +3 -3
  15. package/src/InAppMessage/log-in-app-message-html-click.js +3 -3
  16. package/src/InAppMessage/log-in-app-message-impression.js +1 -1
  17. package/src/InAppMessage/models/control-message.js +4 -2
  18. package/src/InAppMessage/models/full-screen-message.js +5 -2
  19. package/src/InAppMessage/models/html-message.js +6 -4
  20. package/src/InAppMessage/models/in-app-message-button.js +2 -2
  21. package/src/InAppMessage/models/in-app-message.js +51 -46
  22. package/src/InAppMessage/models/modal-message.js +5 -2
  23. package/src/InAppMessage/models/slide-up-message.js +33 -8
  24. package/src/InAppMessage/models/templated-in-app-message.js +8 -8
  25. package/src/InAppMessage/ui/show-in-app-message.js +28 -34
  26. package/src/InAppMessage/utils/in-app-message-utils.js +18 -1
  27. package/src/Push/push-manager-factory.js +3 -3
  28. package/src/Push/push-manager.js +118 -110
  29. package/src/Push/utils/push-utils.js +4 -4
  30. package/src/User/user-manager.js +4 -4
  31. package/src/User/user.js +17 -17
  32. package/src/common/base-feed.js +1 -1
  33. package/src/common/feed-display.js +12 -12
  34. package/src/l10n/l10n-manager-factory.js +1 -1
  35. package/src/l10n/l10n-manager.js +4 -4
  36. package/src/managers/auth-manager.js +26 -26
  37. package/src/managers/braze-instance.js +59 -52
  38. package/src/managers/device-manager.js +15 -15
  39. package/src/managers/network-manager.js +98 -93
  40. package/src/managers/server-config-manager.js +9 -9
  41. package/src/managers/storage-manager.js +99 -96
  42. package/src/managers/utils.js +6 -0
  43. package/src/models/backend-errors.js +5 -5
  44. package/src/models/braze-event.js +20 -12
  45. package/src/models/device.js +3 -3
  46. package/src/models/identifier.js +33 -19
  47. package/src/models/push-token.js +4 -4
  48. package/src/models/server-config.js +6 -6
  49. package/src/request-controller.js +76 -73
  50. package/src/triggers/models/custom-event-data.js +2 -2
  51. package/src/triggers/models/custom-event-property-data.js +4 -4
  52. package/src/triggers/models/filter-set.js +5 -5
  53. package/src/triggers/models/filter.js +6 -6
  54. package/src/triggers/models/in-app-message-click-data.js +1 -1
  55. package/src/triggers/models/purchase-data.js +2 -2
  56. package/src/triggers/models/purchase-property-data.js +4 -4
  57. package/src/triggers/models/push-click-data.js +1 -1
  58. package/src/triggers/models/trigger-condition.js +41 -41
  59. package/src/triggers/models/trigger-events.js +1 -1
  60. package/src/triggers/models/trigger.js +36 -36
  61. package/src/triggers/triggers-provider-factory.js +1 -1
  62. package/src/triggers/triggers-provider.js +71 -82
  63. package/src/ui/js/attach-css.js +2 -2
  64. package/src/ui/js/load-font-awesome.js +1 -1
  65. package/src/util/base-device-parser.js +1 -1
  66. package/src/util/braze-actions.js +4 -4
  67. package/src/util/browser-detector.js +9 -8
  68. package/src/util/client-hints-parser.js +1 -1
  69. package/src/util/component-utils.js +2 -2
  70. package/src/util/device-constants.js +2 -2
  71. package/src/util/key-codes.js +1 -1
  72. package/src/util/net.js +1 -1
  73. package/src/util/request-header-utils.js +6 -6
  74. package/src/util/user-agent-parser.js +5 -5
  75. package/src/util/validation-utils.js +2 -0
  76. package/src/util/window-utils.js +3 -3
@@ -7,37 +7,37 @@ import { WindowUtils as eo } from "../util/window-utils.js";
7
7
  import vt from "./utils/push-utils.js";
8
8
  import { getErrorMessage as si } from "../util/error-utils.js";
9
9
  export default class ea {
10
- constructor(i, t, e, s, r, n, o, u, a, h) {
11
- (this.un = i),
12
- (this.an = t),
13
- (this.hn = e),
14
- (this.cn = r),
15
- (this.fn = n),
10
+ constructor(i, t, e, s, r, n, o, u, a, c) {
11
+ (this.sn = i),
12
+ (this.rn = t),
13
+ (this.on = e),
14
+ (this.un = r),
15
+ (this.an = n),
16
16
  (this.yt = o),
17
- (this.ln = u),
18
- (this.dn = a),
19
- (this.u = h),
20
- (this.un = i),
21
- (this.an = t),
22
- (this.hn = e),
23
- (this.pn = s + "/safari/" + t),
24
- (this.cn = r || "/service-worker.js"),
25
- (this.fn = n),
17
+ (this.cn = u),
18
+ (this.hn = a),
19
+ (this.u = c),
20
+ (this.sn = i),
21
+ (this.rn = t),
22
+ (this.on = e),
23
+ (this.fn = s + "/safari/" + t),
24
+ (this.un = r || "/service-worker.js"),
25
+ (this.an = n),
26
26
  (this.yt = o),
27
- (this.ln = u || !1),
28
- (this.dn = a || !1),
29
- (this.u = h),
30
- (this.bn = vt.mn()),
31
- (this.yn = vt.gn());
27
+ (this.cn = u || !1),
28
+ (this.hn = a || !1),
29
+ (this.u = c),
30
+ (this.ln = vt.dn()),
31
+ (this.pn = vt.bn());
32
32
  }
33
- vn() {
34
- return this.dn;
33
+ mn() {
34
+ return this.hn;
35
35
  }
36
- wn(i, t, e, s, n) {
36
+ yn(i, t, e, s, n) {
37
37
  i.unsubscribe()
38
38
  .then((i) => {
39
39
  i
40
- ? this.kn(t, e, s, n)
40
+ ? this.vn(t, e, s, n)
41
41
  : (r.error("Failed to unsubscribe device from push."),
42
42
  "function" == typeof n && n(!1));
43
43
  })
@@ -46,7 +46,7 @@ export default class ea {
46
46
  "function" == typeof n && n(!1);
47
47
  });
48
48
  }
49
- Pn(i, t, e) {
49
+ gn(i, t, e) {
50
50
  var s;
51
51
  const n = ((i) => {
52
52
  if ("string" == typeof i) return i;
@@ -55,9 +55,9 @@ export default class ea {
55
55
  let t = i.endpoint;
56
56
  const e = i;
57
57
  return (
58
- e.Dn &&
59
- -1 === i.endpoint.indexOf(e.Dn) &&
60
- (t = i.endpoint + "/" + e.Dn),
58
+ e.wn &&
59
+ -1 === i.endpoint.indexOf(e.wn) &&
60
+ (t = i.endpoint + "/" + e.wn),
61
61
  t
62
62
  );
63
63
  })(i);
@@ -73,7 +73,7 @@ export default class ea {
73
73
  } catch (i) {
74
74
  r.error(si(i));
75
75
  }
76
- const h = ((i) => {
76
+ const c = ((i) => {
77
77
  let t;
78
78
  return i.options &&
79
79
  (t = i.options.applicationServerKey) &&
@@ -84,53 +84,53 @@ export default class ea {
84
84
  .replace(/\//g, "_")
85
85
  : null;
86
86
  })(a);
87
- null === (s = this.un) || void 0 === s || s.Sn(n, t, o, u, h),
87
+ null === (s = this.sn) || void 0 === s || s.kn(n, t, o, u, c),
88
88
  n && "function" == typeof e && e(n, o, u);
89
89
  }
90
- An() {
90
+ Pn() {
91
91
  var i;
92
- null === (i = this.un) || void 0 === i || i.jn(!0);
92
+ null === (i = this.sn) || void 0 === i || i.Dn(!0);
93
93
  }
94
- xn(i, t) {
94
+ Sn(i, t) {
95
95
  var e;
96
- null === (e = this.un) || void 0 === e || e.jn(!1),
96
+ null === (e = this.sn) || void 0 === e || e.Dn(!1),
97
97
  r.info(i),
98
98
  "function" == typeof t && t(!1);
99
99
  }
100
- Un(i, t, e, s) {
100
+ An(i, t, e, s) {
101
101
  var n;
102
102
  if ("default" === t.permission)
103
103
  try {
104
104
  window.safari.pushNotification.requestPermission(
105
- this.pn,
105
+ this.fn,
106
106
  i,
107
107
  {
108
- api_key: this.an,
108
+ api_key: this.rn,
109
109
  device_id:
110
- (null === (n = this.hn) || void 0 === n ? void 0 : n.ce().id) ||
110
+ (null === (n = this.on) || void 0 === n ? void 0 : n.ce().id) ||
111
111
  "",
112
112
  },
113
113
  (t) => {
114
114
  "granted" === t.permission &&
115
- this.un &&
116
- this.un.setPushNotificationSubscriptionType(
115
+ this.sn &&
116
+ this.sn.setPushNotificationSubscriptionType(
117
117
  User.NotificationSubscriptionTypes.OPTED_IN,
118
118
  ),
119
- this.Un(i, t, e, s);
119
+ this.An(i, t, e, s);
120
120
  },
121
121
  );
122
122
  } catch (i) {
123
- this.xn("Could not request permission for push: " + i, s);
123
+ this.Sn("Could not request permission for push: " + i, s);
124
124
  }
125
125
  else
126
126
  "denied" === t.permission
127
- ? this.xn(
127
+ ? this.Sn(
128
128
  "The user has blocked notifications from this site, or Safari push is not configured in the Braze dashboard.",
129
129
  s,
130
130
  )
131
131
  : "granted" === t.permission &&
132
132
  (r.info("Device successfully subscribed to push."),
133
- this.Pn(t.deviceToken, new Date(), e));
133
+ this.gn(t.deviceToken, new Date(), e));
134
134
  }
135
135
  requestPermission(i, t, e) {
136
136
  const s = (s) => {
@@ -146,23 +146,27 @@ export default class ea {
146
146
  }
147
147
  };
148
148
  let n = !1;
149
- const o = window.Notification.requestPermission((i) => {
150
- n && s(i);
151
- });
152
- o
153
- ? o.then((i) => {
154
- s(i);
155
- })
156
- : (n = !0);
149
+ if ("default" !== window.Notification.permission)
150
+ s(Notification.permission);
151
+ else {
152
+ const i = window.Notification.requestPermission((i) => {
153
+ n && s(i);
154
+ });
155
+ i
156
+ ? i.then((i) => {
157
+ s(i);
158
+ })
159
+ : (n = !0);
160
+ }
157
161
  }
158
- kn(i, t, e, s) {
162
+ vn(i, t, e, s) {
159
163
  const n = { userVisibleOnly: !0 };
160
164
  null != t && (n.applicationServerKey = t),
161
165
  i.pushManager
162
166
  .subscribe(n)
163
167
  .then((i) => {
164
168
  r.info("Device successfully subscribed to push."),
165
- this.Pn(i, new Date(), e);
169
+ this.gn(i, new Date(), e);
166
170
  })
167
171
  .catch((i) => {
168
172
  vt.isPushBlocked()
@@ -172,10 +176,10 @@ export default class ea {
172
176
  "function" == typeof s && s(!0));
173
177
  });
174
178
  }
175
- Wn() {
176
- return this.ln
177
- ? navigator.serviceWorker.getRegistration(this.cn)
178
- : navigator.serviceWorker.register(this.cn).then(() =>
179
+ jn() {
180
+ return this.cn
181
+ ? navigator.serviceWorker.getRegistration(this.un)
182
+ : navigator.serviceWorker.register(this.un).then(() =>
179
183
  navigator.serviceWorker.ready.then(
180
184
  (i) => (
181
185
  i &&
@@ -188,22 +192,22 @@ export default class ea {
188
192
  ),
189
193
  );
190
194
  }
191
- _n(i) {
192
- this.ln ||
195
+ xn(i) {
196
+ this.cn ||
193
197
  (i.unregister(), r.info("Service worker successfully unregistered."));
194
198
  }
195
199
  subscribe(i, t) {
196
200
  if (!vt.isPushSupported())
197
201
  return r.info(ea.Nn), void ("function" == typeof t && t(!1));
198
- if (this.bn) {
199
- if (!this.ln && null != window.location) {
200
- let i = this.cn;
202
+ if (this.ln) {
203
+ if (!this.cn && null != window.location) {
204
+ let i = this.un;
201
205
  -1 === i.indexOf(window.location.host) &&
202
206
  (i = window.location.host + i),
203
207
  -1 === i.indexOf(window.location.protocol) &&
204
208
  (i = window.location.protocol + "//" + i);
205
209
  const e = i.substr(0, i.lastIndexOf("/") + 1);
206
- if (0 !== eo.Tn().indexOf(e))
210
+ if (0 !== eo.Un().indexOf(e))
207
211
  return (
208
212
  r.error(
209
213
  "Cannot subscribe to push from a path higher than the service worker location (tried to subscribe from " +
@@ -216,16 +220,16 @@ export default class ea {
216
220
  );
217
221
  }
218
222
  if (vt.isPushBlocked())
219
- return void this.xn(
223
+ return void this.Sn(
220
224
  "Notifications from this site are blocked. This may be a temporary embargo or a permanent denial.",
221
225
  t,
222
226
  );
223
- if (this.yt && !this.yt.In() && 0 === this.yt.ni())
227
+ if (this.yt && !this.yt.Wn() && 0 === this.yt.ni())
224
228
  return (
225
229
  r.info(
226
230
  "Waiting for VAPID key from server config before subscribing to push.",
227
231
  ),
228
- void this.yt.Vn(() => {
232
+ void this.yt._n(() => {
229
233
  this.subscribe(i, t);
230
234
  })
231
235
  );
@@ -244,11 +248,11 @@ export default class ea {
244
248
  n = vt.isPushPermissionGranted(),
245
249
  u = () => {
246
250
  !n &&
247
- this.un &&
248
- this.un.setPushNotificationSubscriptionType(
251
+ this.sn &&
252
+ this.sn.setPushNotificationSubscriptionType(
249
253
  User.NotificationSubscriptionTypes.OPTED_IN,
250
254
  ),
251
- this.Wn()
255
+ this.jn()
252
256
  .then((e) => {
253
257
  if (null == e)
254
258
  return (
@@ -266,16 +270,16 @@ export default class ea {
266
270
  (null !=
267
271
  (null === (n = this.yt) || void 0 === n
268
272
  ? void 0
269
- : n.In()) && (u = ei.qn(this.yt.In())),
273
+ : n.Wn()) && (u = ei.Tn(this.yt.Wn())),
270
274
  s)
271
275
  ) {
272
276
  let n,
273
277
  a = null,
274
- h = null;
275
- if ((this.u && (n = this.u.j(o.C.zn)), n && !j(n))) {
278
+ c = null;
279
+ if ((this.u && (n = this.u.j(o.C.In)), n && !j(n))) {
276
280
  let i;
277
281
  try {
278
- i = ti.En(n).Cn;
282
+ i = ti.qn(n).Vn;
279
283
  } catch (t) {
280
284
  i = null;
281
285
  }
@@ -283,8 +287,8 @@ export default class ea {
283
287
  isNaN(i.getTime()) ||
284
288
  0 === i.getTime() ||
285
289
  ((a = i),
286
- (h = new Date(a)),
287
- h.setMonth(a.getMonth() + 6));
290
+ (c = new Date(a)),
291
+ c.setMonth(a.getMonth() + 6));
288
292
  }
289
293
  null != u &&
290
294
  s.options &&
@@ -299,31 +303,31 @@ export default class ea {
299
303
  : r.info(
300
304
  "Attempting to upgrade a gcm_sender_id-based push registration to VAPID - depending on the browser this may or may not result in the same gcm_sender_id-based subscription.",
301
305
  ),
302
- this.wn(s, e, u, i, t))
306
+ this.yn(s, e, u, i, t))
303
307
  : s.expirationTime &&
304
308
  new Date(s.expirationTime).valueOf() <=
305
309
  new Date().valueOf()
306
310
  ? (r.info(
307
311
  "Push subscription is expired, creating new subscription.",
308
312
  ),
309
- this.wn(s, e, u, i, t))
313
+ this.yn(s, e, u, i, t))
310
314
  : n && j(n)
311
- ? this.wn(s, e, u, i, t)
312
- : null == h
315
+ ? this.yn(s, e, u, i, t)
316
+ : null == c
313
317
  ? (r.info(
314
318
  "No push subscription creation date found, creating new subscription.",
315
319
  ),
316
- this.wn(s, e, u, i, t))
317
- : h.valueOf() <= new Date().valueOf()
320
+ this.yn(s, e, u, i, t))
321
+ : c.valueOf() <= new Date().valueOf()
318
322
  ? (r.info(
319
323
  "Push subscription older than 6 months, creating new subscription.",
320
324
  ),
321
- this.wn(s, e, u, i, t))
325
+ this.yn(s, e, u, i, t))
322
326
  : (r.info(
323
327
  "Device already subscribed to push, sending existing subscription to backend.",
324
328
  ),
325
- this.Pn(s, a, i));
326
- } else this.kn(e, u, i, t);
329
+ this.gn(s, a, i));
330
+ } else this.vn(e, u, i, t);
327
331
  })
328
332
  .catch((i) => {
329
333
  r.error("Error checking current push subscriptions: " + i);
@@ -334,45 +338,49 @@ export default class ea {
334
338
  });
335
339
  };
336
340
  this.requestPermission(u, s, e);
337
- } else if (this.yn) {
338
- if (null == this.fn || "" === this.fn)
341
+ } else if (this.pn) {
342
+ if (null == this.an || "" === this.an)
339
343
  return (
340
344
  r.error(
341
345
  "You must supply the safariWebsitePushId initialization option in order to use registerPush on Safari",
342
346
  ),
343
347
  void ("function" == typeof t && t(!0))
344
348
  );
345
- const e = window.safari.pushNotification.permission(this.fn);
346
- this.Un(this.fn, e, i, t);
349
+ const e = window.safari.pushNotification.permission(this.an);
350
+ this.An(this.an, e, i, t);
347
351
  }
348
352
  }
349
353
  unsubscribe(i, t) {
350
354
  if (!vt.isPushSupported())
351
355
  return r.info(ea.Nn), void ("function" == typeof t && t());
352
- this.bn
356
+ this.ln
353
357
  ? navigator.serviceWorker.getRegistration().then((e) => {
354
358
  e
355
359
  ? e.pushManager
356
360
  .getSubscription()
357
361
  .then((s) => {
358
- s &&
359
- (this.An(),
360
- s
361
- .unsubscribe()
362
- .then((s) => {
363
- s
364
- ? (r.info(
365
- "Device successfully unsubscribed from push.",
366
- ),
367
- "function" == typeof i && i())
368
- : (r.error("Failed to unsubscribe device from push."),
369
- "function" == typeof t && t()),
370
- this._n(e);
371
- })
372
- .catch((i) => {
373
- r.error("Push unsubscription error: " + i),
374
- "function" == typeof t && t();
375
- }));
362
+ s
363
+ ? (this.Pn(),
364
+ s
365
+ .unsubscribe()
366
+ .then((s) => {
367
+ s
368
+ ? (r.info(
369
+ "Device successfully unsubscribed from push.",
370
+ ),
371
+ "function" == typeof i && i())
372
+ : (r.error(
373
+ "Failed to unsubscribe device from push.",
374
+ ),
375
+ "function" == typeof t && t()),
376
+ this.xn(e);
377
+ })
378
+ .catch((i) => {
379
+ r.error("Push unsubscription error: " + i),
380
+ "function" == typeof t && t();
381
+ }))
382
+ : (r.info("Device already unsubscribed from push."),
383
+ "function" == typeof i && i());
376
384
  })
377
385
  .catch((i) => {
378
386
  r.error("Error unsubscribing from push: " + i),
@@ -381,8 +389,8 @@ export default class ea {
381
389
  : (r.info("Device already unsubscribed from push."),
382
390
  "function" == typeof i && i());
383
391
  })
384
- : this.yn &&
385
- (this.An(),
392
+ : this.pn &&
393
+ (this.Pn(),
386
394
  r.info("Device unsubscribed from push."),
387
395
  "function" == typeof i && i());
388
396
  }
@@ -1,15 +1,15 @@
1
1
  const vt = {
2
- mn: () =>
2
+ dn: () =>
3
3
  "serviceWorker" in navigator &&
4
4
  "undefined" != typeof ServiceWorkerRegistration &&
5
5
  "showNotification" in ServiceWorkerRegistration.prototype &&
6
6
  "PushManager" in window,
7
- gn: () =>
7
+ bn: () =>
8
8
  "safari" in window &&
9
9
  "pushNotification" in window.safari &&
10
10
  "function" == typeof window.safari.pushNotification.permission &&
11
11
  "function" == typeof window.safari.pushNotification.requestPermission,
12
- isPushSupported: () => vt.mn() || vt.gn(),
12
+ isPushSupported: () => vt.dn() || vt.bn(),
13
13
  isPushBlocked: () => {
14
14
  const i =
15
15
  vt.isPushSupported() &&
@@ -28,7 +28,7 @@ const vt = {
28
28
  null != window.Notification &&
29
29
  null != window.Notification.permission &&
30
30
  "granted" === window.Notification.permission,
31
- Yi: () =>
31
+ Wi: () =>
32
32
  !vt.isPushBlocked() &&
33
33
  vt.isPushSupported() &&
34
34
  !vt.isPushPermissionGranted(),
@@ -47,7 +47,7 @@ export default class bt {
47
47
  u
48
48
  );
49
49
  }
50
- Sn(t, s, i, e, u) {
50
+ kn(t, s, i, e, u) {
51
51
  this.nu("push_token", t, !1, !0),
52
52
  this.nu("custom_push_public_key", i, !1, !0),
53
53
  this.nu("custom_push_user_auth", e, !1, !0),
@@ -55,9 +55,9 @@ export default class bt {
55
55
  const h = A.Yt.Qt,
56
56
  n = new A(h, r),
57
57
  l = new ti(t, s, i, e, u);
58
- this.u.k(o.C.zn, l.Y()), n.setItem(h.ss.cu, h.ie, !0);
58
+ this.u.k(o.C.In, l.Y()), n.setItem(h.ss.cu, h.ie, !0);
59
59
  }
60
- jn(t) {
60
+ Dn(t) {
61
61
  if (
62
62
  (this.nu("push_token", null, !1, !0),
63
63
  this.nu("custom_push_public_key", null, !1, !0),
@@ -67,7 +67,7 @@ export default class bt {
67
67
  ) {
68
68
  const t = A.Yt.Qt,
69
69
  s = new A(t, r);
70
- this.u.k(o.C.zn, !1), s.setItem(t.ss.cu, t.ie, !1);
70
+ this.u.k(o.C.In, !1), s.setItem(t.ss.cu, t.ie, !1);
71
71
  }
72
72
  }
73
73
  }
package/src/User/user.js CHANGED
@@ -33,7 +33,7 @@ export default class User {
33
33
  ? (r.error("addAlias requires a non-empty alias"), !1)
34
34
  : !P(e, "add alias", "the label", !1) || e.length <= 0
35
35
  ? (r.error("addAlias requires a non-empty label"), !1)
36
- : this.Ei.Fn(t, e).L;
36
+ : this.Ei.Cn(t, e).L;
37
37
  }
38
38
  setFirstName(t) {
39
39
  return (
@@ -126,7 +126,7 @@ export default class User {
126
126
  setPhoneNumber(t) {
127
127
  return (
128
128
  !!P(t, "set phone number", "the phoneNumber", !0) &&
129
- (null === t || t.match(User.$n)
129
+ (null === t || t.match(User.En)
130
130
  ? this.wt.nu("phone", t)
131
131
  : (r.error(`Cannot set phone number - "${t}" did not pass validation.`),
132
132
  !1))
@@ -179,11 +179,11 @@ export default class User {
179
179
  if (j(e)) {
180
180
  const [r, n] = St(t, e);
181
181
  if (!r && !n && 0 !== e.length) return !1;
182
- if (r || 0 === e.length) return this.Ei.Bn(i.Ln, t, e).L;
182
+ if (r || 0 === e.length) return this.Ei.Fn(i.$n, t, e).L;
183
183
  for (const t of e) if (!s(t)) return !1;
184
184
  } else if (Nt(e)) {
185
185
  if (!s(e)) return !1;
186
- if (r) return this.Ei.Bn(i.Rn, t, e).L;
186
+ if (r) return this.Ei.Fn(i.Bn, t, e).L;
187
187
  } else {
188
188
  if (!(void 0 !== e && Ut(e))) return !1;
189
189
  if (
@@ -206,7 +206,7 @@ export default class User {
206
206
  null != e &&
207
207
  !rt(e, "add to custom user attribute array", "the given value")
208
208
  ) &&
209
- this.Ei.Bn(i.On, t, e).L
209
+ this.Ei.Fn(i.Ln, t, e).L
210
210
  );
211
211
  }
212
212
  removeFromCustomAttributeArray(t, e) {
@@ -216,7 +216,7 @@ export default class User {
216
216
  null != e &&
217
217
  !rt(e, "remove from custom user attribute array", "the given value")
218
218
  ) &&
219
- this.Ei.Bn(i.Gn, t, e).L
219
+ this.Ei.Fn(i.Rn, t, e).L
220
220
  );
221
221
  }
222
222
  incrementCustomUserAttribute(t, e) {
@@ -228,7 +228,7 @@ export default class User {
228
228
  `Cannot increment custom user attribute because the given incrementValue "${e}" is not an integer.`,
229
229
  ),
230
230
  !1)
231
- : this.Ei.Bn(i.Hn, t, s).L;
231
+ : this.Ei.Fn(i.On, t, s).L;
232
232
  }
233
233
  setCustomLocationAttribute(t, e, s) {
234
234
  return (
@@ -244,7 +244,7 @@ export default class User {
244
244
  "Received invalid values for latitude and/or longitude. Latitude and longitude are bounded by ±90 and ±180 respectively, or must both be null for removal.",
245
245
  ),
246
246
  !1)
247
- : this.Ei.Kn(t, e, s).L)
247
+ : this.Ei.Gn(t, e, s).L)
248
248
  );
249
249
  }
250
250
  addToSubscriptionGroup(t) {
@@ -258,7 +258,7 @@ export default class User {
258
258
  "addToSubscriptionGroup requires a non-empty subscription group ID",
259
259
  ),
260
260
  !1)
261
- : this.Ei.Mn(t, User.Yn.SUBSCRIBED).L;
261
+ : this.Ei.Hn(t, User.Kn.SUBSCRIBED).L;
262
262
  }
263
263
  removeFromSubscriptionGroup(t) {
264
264
  return !P(
@@ -271,13 +271,13 @@ export default class User {
271
271
  "removeFromSubscriptionGroup requires a non-empty subscription group ID",
272
272
  ),
273
273
  !1)
274
- : this.Ei.Mn(t, User.Yn.UNSUBSCRIBED).L;
274
+ : this.Ei.Hn(t, User.Kn.UNSUBSCRIBED).L;
275
275
  }
276
- Sn(t, e, r, s, n) {
277
- this.wt.Sn(t, e, r, s, n), this.Ei.Jn();
276
+ kn(t, e, r, s, n) {
277
+ this.wt.kn(t, e, r, s, n), this.Ei.Mn();
278
278
  }
279
- jn(t) {
280
- this.wt.jn(t);
279
+ Dn(t) {
280
+ this.wt.Dn(t);
281
281
  }
282
282
  }
283
283
  (User.Genders = {
@@ -293,8 +293,8 @@ export default class User {
293
293
  SUBSCRIBED: "subscribed",
294
294
  UNSUBSCRIBED: "unsubscribed",
295
295
  }),
296
- (User.$n = /^[0-9 .\\(\\)\\+\\-]+$/),
297
- (User.Yn = { SUBSCRIBED: "subscribed", UNSUBSCRIBED: "unsubscribed" }),
298
- (User.Qn = "user_id"),
296
+ (User.En = /^[0-9 .\\(\\)\\+\\-]+$/),
297
+ (User.Kn = { SUBSCRIBED: "subscribed", UNSUBSCRIBED: "unsubscribed" }),
298
+ (User.Yn = "user_id"),
299
299
  (User.lu = "custom"),
300
300
  (User.lr = 997);
@@ -26,4 +26,4 @@ export default class x {
26
26
  r.error("Must be implemented in a subclass");
27
27
  }
28
28
  }
29
- (x.ur = 6e4), (x.Oh = 500), (x.Co = 1e4);
29
+ (x.ur = 6e4), (x.Ah = 500), (x.Co = 1e4);