@braze/web-sdk 6.10.2 → 6.12.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 (109) hide show
  1. package/index.d.ts +61 -6
  2. package/package.json +1 -1
  3. package/shared-lib/encoding-utils.js +3 -3
  4. package/shared-lib/event-types.js +12 -12
  5. package/shared-lib/indexed-db-adapter.js +52 -52
  6. package/shared-lib/logger.js +7 -7
  7. package/shared-lib/supported-options.js +10 -10
  8. package/src/Core/logout.js +2 -2
  9. package/src/DUST/dust-config-store.js +89 -0
  10. package/src/DUST/dust-connection-core.js +7 -21
  11. package/src/DUST/dust-message-dedup.js +33 -0
  12. package/src/DUST/dust-provider.js +367 -397
  13. package/src/DUST/dust-tab-identity.js +30 -0
  14. package/src/DUST/index.js +7 -9
  15. package/src/DUST/subscribe-to-dust.js +5 -5
  16. package/src/FeatureFlags/feature-flag-factory.js +4 -4
  17. package/src/FeatureFlags/feature-flag.js +5 -5
  18. package/src/FeatureFlags/feature-flags-provider-factory.js +8 -1
  19. package/src/FeatureFlags/feature-flags-provider.js +74 -74
  20. package/src/FeatureFlags/get-all-feature-flags.js +2 -2
  21. package/src/FeatureFlags/get-feature-flag.js +2 -2
  22. package/src/FeatureFlags/log-feature-flag-impression.js +3 -3
  23. package/src/FeatureFlags/subscribe-to-feature-flags-updates.js +1 -1
  24. package/src/InAppMessage/constants.js +39 -47
  25. package/src/InAppMessage/defer-in-app-message.js +2 -2
  26. package/src/InAppMessage/display/get-animation-effect.js +1 -1
  27. package/src/InAppMessage/display/html-message-display-utils.js +4 -4
  28. package/src/InAppMessage/display/html-message-to-html.js +10 -10
  29. package/src/InAppMessage/display/in-app-message-to-html.js +68 -66
  30. package/src/InAppMessage/display/modal-utils.js +14 -14
  31. package/src/InAppMessage/get-deferred-in-app-message.js +2 -2
  32. package/src/InAppMessage/in-app-message-factory.js +6 -6
  33. package/src/InAppMessage/in-app-message-manager-factory.js +5 -5
  34. package/src/InAppMessage/in-app-message-manager.js +101 -80
  35. package/src/InAppMessage/log-in-app-message-button-click.js +2 -2
  36. package/src/InAppMessage/log-in-app-message-click.js +2 -2
  37. package/src/InAppMessage/log-in-app-message-html-click.js +4 -4
  38. package/src/InAppMessage/log-in-app-message-impression.js +3 -3
  39. package/src/InAppMessage/models/full-screen-message.js +25 -25
  40. package/src/InAppMessage/models/html-message.js +14 -14
  41. package/src/InAppMessage/models/in-app-message-button.js +4 -4
  42. package/src/InAppMessage/models/in-app-message.js +100 -98
  43. package/src/InAppMessage/models/modal-message.js +23 -23
  44. package/src/InAppMessage/models/slide-up-message.js +29 -29
  45. package/src/InAppMessage/models/templated-in-app-message.js +8 -8
  46. package/src/InAppMessage/subscribe-to-in-app-message.js +2 -2
  47. package/src/InAppMessage/ui/automatically-show-in-app-messages.js +2 -2
  48. package/src/InAppMessage/ui/show-in-app-message.js +42 -40
  49. package/src/Push/index.js +1 -0
  50. package/src/Push/is-push-blocked.js +2 -2
  51. package/src/Push/is-push-permission-granted.js +2 -2
  52. package/src/Push/is-push-supported.js +2 -2
  53. package/src/Push/push-manager-factory.js +6 -6
  54. package/src/Push/push-manager.js +228 -185
  55. package/src/Push/register-push.js +9 -0
  56. package/src/Push/unregister-push-token-on-server.js +4 -4
  57. package/src/Push/utils/push-utils.js +16 -16
  58. package/src/User/user-manager.js +19 -19
  59. package/src/User/user.js +36 -36
  60. package/src/common/constants.js +1 -1
  61. package/src/common/content-cards-display.js +21 -21
  62. package/src/common/event-logger.js +2 -2
  63. package/src/l10n/l10n-manager-factory.js +7 -7
  64. package/src/l10n/l10n-manager.js +5 -5
  65. package/src/managers/auth-manager.js +1 -1
  66. package/src/managers/braze-instance.js +70 -66
  67. package/src/managers/device-manager.js +12 -12
  68. package/src/managers/network-manager.js +118 -118
  69. package/src/managers/server-config-manager.js +84 -84
  70. package/src/managers/session-manager.js +10 -10
  71. package/src/managers/storage-manager-factory.js +4 -4
  72. package/src/managers/storage-manager.js +138 -136
  73. package/src/managers/subscription-manager.js +1 -1
  74. package/src/managers/utils.js +1 -1
  75. package/src/models/backend-errors.js +5 -5
  76. package/src/models/braze-event.js +7 -7
  77. package/src/models/device.js +2 -2
  78. package/src/models/identifier.js +6 -6
  79. package/src/models/push-token.js +6 -6
  80. package/src/models/server-config.js +31 -31
  81. package/src/request-controller.js +91 -91
  82. package/src/triggers/models/filter.js +58 -58
  83. package/src/triggers/models/in-app-message-click-data.js +4 -4
  84. package/src/triggers/models/push-click-data.js +2 -2
  85. package/src/triggers/models/trigger-condition.js +35 -35
  86. package/src/triggers/models/trigger.js +37 -37
  87. package/src/triggers/triggers-provider-factory.js +3 -3
  88. package/src/triggers/triggers-provider.js +61 -53
  89. package/src/types.js +1 -1
  90. package/src/ui/js/attach-css.js +1 -1
  91. package/src/ui/js/feed-css.js +2 -2
  92. package/src/ui/js/iam-css.js +2 -2
  93. package/src/util/base-device-parser.js +1 -1
  94. package/src/util/braze-actions.js +4 -4
  95. package/src/util/browser-detector.js +13 -13
  96. package/src/util/client-hints-parser.js +4 -4
  97. package/src/util/component-utils.js +4 -4
  98. package/src/util/dom-utils.js +5 -5
  99. package/src/util/ecommerce-event-validation.js +77 -48
  100. package/src/util/key-codes.js +1 -1
  101. package/src/util/net.js +4 -4
  102. package/src/util/request-header-utils.js +20 -20
  103. package/src/util/string-utils.js +5 -0
  104. package/src/util/user-agent-parser.js +15 -15
  105. package/src/util/validation-utils.js +9 -9
  106. package/src/util/window-utils.js +2 -2
  107. package/src/DUST/dust-shared-worker-code.js +0 -2
  108. package/src/DUST/dust-shared-worker-impl.js +0 -234
  109. package/src/DUST/dust-worker-bridge.js +0 -151
@@ -1,15 +1,15 @@
1
- import Ie from "../models/braze-event.js";
1
+ import ve from "../models/braze-event.js";
2
2
  import _t from "../models/identifier.js";
3
3
  import {
4
4
  isArray as g,
5
5
  keys as C,
6
6
  validateValueIsFromEnum as ta,
7
- values as Wt,
7
+ values as Yt,
8
8
  } from "../util/code-utils.js";
9
9
  import { logger as b, EventTypes as p } from "../../shared-lib/index.js";
10
10
  import { User } from "../User/index.js";
11
11
  import ro from "../util/browser-detector.js";
12
- import { getErrorMessage as hi } from "../util/error-utils.js";
12
+ import { getErrorMessage as ci } from "../util/error-utils.js";
13
13
  export const STORAGE_KEYS = {
14
14
  Ou: {
15
15
  Cu: "ab.storage.userId",
@@ -18,72 +18,74 @@ export const STORAGE_KEYS = {
18
18
  },
19
19
  It: {
20
20
  ac: "ab.test",
21
- ZE: "ab.storage.events",
22
- $E: "ab.storage.attributes",
23
- tS: "ab.storage.attributes.anonymous_user",
24
- Ha: "ab.storage.device",
25
- Pa: "ab.storage.sdk_metadata",
26
- Ua: "ab.storage.session_id_for_cached_metadata",
27
- Uu: "ab.storage.pushToken",
28
- eS: "ab.storage.cardImpressions",
29
- nd: "ab.storage.serverConfig",
30
- sS: "ab.storage.triggers",
31
- rS: "ab.storage.triggers.ts",
21
+ tS: "ab.storage.events",
22
+ eS: "ab.storage.attributes",
23
+ sS: "ab.storage.attributes.anonymous_user",
24
+ Aa: "ab.storage.device",
25
+ Ka: "ab.storage.sdk_metadata",
26
+ Pa: "ab.storage.session_id_for_cached_metadata",
27
+ xu: "ab.storage.pushToken",
28
+ rS: "ab.storage.cardImpressions",
29
+ Zl: "ab.storage.serverConfig",
30
+ oS: "ab.storage.triggers",
31
+ nS: "ab.storage.triggers.ts",
32
32
  dm: "ab.storage.messagingSessionStart",
33
33
  bi: "ab.storage.cc",
34
34
  ji: "ab.storage.ccLastFullSync",
35
35
  yi: "ab.storage.ccLastCardUpdated",
36
- Xl: "ab.storage.globalRateLimitCurrentTokenCount",
37
- El: "ab.storage.dynamicRateLimitCurrentTokenCount",
36
+ zl: "ab.storage.globalRateLimitCurrentTokenCount",
37
+ Xl: "ab.storage.dynamicRateLimitCurrentTokenCount",
38
38
  Zt: "ab.storage.ccClicks",
39
39
  ps: "ab.storage.ccImpressions",
40
40
  fs: "ab.storage.ccDismissals",
41
- oS: "ab.storage.lastDisplayedTriggerTimesById",
42
- nS: "ab.storage.lastDisplayedTriggerTime",
43
- aS: "ab.storage.triggerFireInstancesById",
41
+ aS: "ab.storage.lastDisplayedTriggerTimesById",
42
+ iS: "ab.storage.lastDisplayedTriggerTime",
43
+ SS: "ab.storage.triggerFireInstancesById",
44
44
  fh: "ab.storage.signature",
45
- iS: "ab.storage.brazeSyncRetryCount",
45
+ ES: "ab.storage.brazeSyncRetryCount",
46
46
  zi: "ab.storage.sdkVersion",
47
- Fo: "ab.storage.ff",
48
- jo: "ab.storage.ffImpressions",
49
- qo: "ab.storage.ffLastRefreshAt",
50
- Do: "ab.storage.ff.sessionId",
51
- ES: "ab.storage.lastReqToEndpoint",
52
- SS: "ab.storage.requestAttempts",
53
- pa: "ab.storage.deferredIam",
54
- Sl: "ab.storage.lastSdkReq",
55
- lS: "ab.storage.alias",
47
+ Vr: "ab.storage.ff",
48
+ Zr: "ab.storage.ffImpressions",
49
+ bo: "ab.storage.ffLastRefreshAt",
50
+ jo: "ab.storage.ff.sessionId",
51
+ lS: "ab.storage.lastReqToEndpoint",
52
+ _S: "ab.storage.requestAttempts",
53
+ la: "ab.storage.deferredIam",
54
+ wl: "ab.storage.lastSdkReq",
55
+ uS: "ab.storage.alias",
56
56
  Tt: "ab.storage.banners",
57
57
  At: "ab.storage.banners.impressions",
58
58
  Xt: "ab.storage.banners.dismissals",
59
59
  kt: "ab.storage.banners.sessionId",
60
60
  Ht: "ab.storage.banners.lastRequestedTime",
61
- Xe: "ab.storage.dust.mite",
62
- Ye: "ab.storage.dust.host",
63
- Ze: "ab.storage.dust.auth",
64
- sn: "ab.storage.dust.expiration",
61
+ _i: "ab.storage.dust.mite",
62
+ Oi: "ab.storage.dust.host",
63
+ Gi: "ab.storage.dust.auth",
64
+ Hi: "ab.storage.dust.expiration",
65
+ Zi: "ab.storage.dust.refreshLock",
66
+ _r: "ab.storage.dust.msgClaims",
65
67
  },
66
68
  ce: "ab.optOut",
67
69
  };
68
70
  export default class ne {
69
71
  constructor(t, e) {
70
- (this._S = t), (this.uS = e), (this._S = t), (this.uS = e);
72
+ (this.cS = t), (this.TS = e), (this.cS = t), (this.TS = e);
71
73
  }
72
74
  hl(t) {
73
75
  const e = C(STORAGE_KEYS.Ou),
74
76
  s = new ne.le(t);
75
77
  for (const t of e) s.remove(STORAGE_KEYS.Ou[t]);
76
78
  }
77
- Iu(t, e) {
79
+ Ju(t, e) {
78
80
  let s = null;
79
- null != e && e instanceof _t && (s = e.qt()), this._S.store(t, s);
81
+ null != e && e instanceof _t && (s = e.qt()), this.cS.store(t, s);
80
82
  }
81
- cS(t) {
83
+ hS(t) {
82
84
  const e = this.$u(t);
83
- null != e && ((e.pm = new Date().valueOf()), this.Iu(t, e));
85
+ null != e && ((e.pm = new Date().valueOf()), this.Ju(t, e));
84
86
  }
85
87
  $u(t) {
86
- const e = this._S.wr(t),
88
+ const e = this.cS.wr(t),
87
89
  s = ((t) => {
88
90
  let e;
89
91
  try {
@@ -94,44 +96,44 @@ export default class ne {
94
96
  return e;
95
97
  })(e);
96
98
  let r;
97
- if (s) (r = _t._u(s) || null), r && this.Iu(t, r);
99
+ if (s) (r = _t._u(s) || null), r && this.Ju(t, r);
98
100
  else {
99
- const s = _t.TS(e);
100
- (r = _t._u(s) || null), s !== e && r && this.Iu(t, r);
101
+ const s = _t.AS(e);
102
+ (r = _t._u(s) || null), s !== e && r && this.Ju(t, r);
101
103
  }
102
104
  return r;
103
105
  }
104
106
  jm(t) {
105
- this._S.remove(t);
107
+ this.cS.remove(t);
106
108
  }
107
109
  ll() {
108
110
  const t = C(STORAGE_KEYS.Ou);
109
111
  let e;
110
112
  for (const s of t)
111
113
  (e = this.$u(STORAGE_KEYS.Ou[s])),
112
- null != e && this.Iu(STORAGE_KEYS.Ou[s], e);
114
+ null != e && this.Ju(STORAGE_KEYS.Ou[s], e);
113
115
  }
114
116
  ol(t) {
115
117
  let e;
116
118
  if (null == t || 0 === t.length) return !1;
117
119
  e = g(t) ? t : [t];
118
- let s = this.uS.wr(STORAGE_KEYS.It.ZE);
120
+ let s = this.TS.wr(STORAGE_KEYS.It.tS);
119
121
  (null != s && g(s)) || (s = []);
120
122
  for (let t = 0; t < e.length; t++) s.push(e[t].qt());
121
- return this.uS.store(STORAGE_KEYS.It.ZE, s);
123
+ return this.TS.store(STORAGE_KEYS.It.tS, s);
122
124
  }
123
125
  gm(t) {
124
126
  return null != t && this.ol([t]);
125
127
  }
126
- hS() {
127
- let t = this.uS.wr(STORAGE_KEYS.It.ZE);
128
- this.uS.remove(STORAGE_KEYS.It.ZE), null == t && (t = []);
128
+ gS() {
129
+ let t = this.TS.wr(STORAGE_KEYS.It.tS);
130
+ this.TS.remove(STORAGE_KEYS.It.tS), null == t && (t = []);
129
131
  const e = [];
130
132
  let s = !1,
131
133
  r = null;
132
134
  if (g(t))
133
135
  for (let s = 0; s < t.length; s++)
134
- Ie.AS(t[s]) ? e.push(Ie._u(t[s])) : (r = s);
136
+ ve.RS(t[s]) ? e.push(ve._u(t[s])) : (r = s);
135
137
  else s = !0;
136
138
  if (s || null != r) {
137
139
  let o = "Stored events could not be deserialized as Events";
@@ -144,7 +146,7 @@ export default class ne {
144
146
  typeof t +
145
147
  ": " +
146
148
  JSON.stringify(t)),
147
- e.push(new Ie(null, p.Qa, new Date().valueOf(), null, { e: o }));
149
+ e.push(new ve(null, p._a, new Date().valueOf(), null, { e: o }));
148
150
  }
149
151
  return e;
150
152
  }
@@ -155,7 +157,7 @@ export default class ne {
155
157
  t,
156
158
  "StorageManager cannot store object.",
157
159
  "STORAGE_KEYS.OBJECTS",
158
- ) && this.uS.store(t, e)
160
+ ) && this.TS.store(t, e)
159
161
  );
160
162
  }
161
163
  St(t) {
@@ -165,7 +167,7 @@ export default class ne {
165
167
  t,
166
168
  "StorageManager cannot retrieve object.",
167
169
  "STORAGE_KEYS.OBJECTS",
168
- ) && this.uS.wr(t)
170
+ ) && this.TS.wr(t)
169
171
  );
170
172
  }
171
173
  Vt(t) {
@@ -175,7 +177,7 @@ export default class ne {
175
177
  t,
176
178
  "StorageManager cannot remove object.",
177
179
  "STORAGE_KEYS.OBJECTS",
178
- ) && (this.uS.remove(t), !0)
180
+ ) && (this.TS.remove(t), !0)
179
181
  );
180
182
  }
181
183
  clearData() {
@@ -183,121 +185,121 @@ export default class ne {
183
185
  e = C(STORAGE_KEYS.It);
184
186
  for (let e = 0; e < t.length; e++) {
185
187
  const s = t[e];
186
- this._S.remove(STORAGE_KEYS.Ou[s]);
188
+ this.cS.remove(STORAGE_KEYS.Ou[s]);
187
189
  }
188
190
  for (let t = 0; t < e.length; t++) {
189
191
  const s = e[t];
190
- this.uS.remove(STORAGE_KEYS.It[s]);
192
+ this.TS.remove(STORAGE_KEYS.It[s]);
191
193
  }
192
194
  }
193
- gS(t) {
194
- return t || STORAGE_KEYS.It.tS;
195
+ dS(t) {
196
+ return t || STORAGE_KEYS.It.sS;
195
197
  }
196
- Rl(t) {
197
- let e = this.uS.wr(STORAGE_KEYS.It.$E);
198
+ fl(t) {
199
+ let e = this.TS.wr(STORAGE_KEYS.It.eS);
198
200
  null == e && (e = {});
199
- const s = this.gS(t[User.Sa]),
201
+ const s = this.dS(t[User.Sa]),
200
202
  r = e[s];
201
203
  for (const o in t)
202
204
  o !== User.Sa &&
203
205
  (null == e[s] || (r && null == r[o])) &&
204
- this.Eu(t[User.Sa], o, t[o]);
206
+ this.Fu(t[User.Sa], o, t[o]);
205
207
  }
206
- Eu(t, e, s) {
207
- let r = this.uS.wr(STORAGE_KEYS.It.$E);
208
+ Fu(t, e, s) {
209
+ let r = this.TS.wr(STORAGE_KEYS.It.eS);
208
210
  null == r && (r = {});
209
- const o = this.gS(t);
211
+ const o = this.dS(t);
210
212
  let n = r[o];
211
213
  if (
212
- (null == n && ((n = {}), null != t && (n[User.Sa] = t)), e === User.Bu)
214
+ (null == n && ((n = {}), null != t && (n[User.Sa] = t)), e === User.Eu)
213
215
  ) {
214
216
  null == n[e] && (n[e] = {});
215
217
  for (const t in s) n[e][t] = s[t];
216
218
  } else n[e] = s;
217
- return (r[o] = n), this.uS.store(STORAGE_KEYS.It.$E, r);
219
+ return (r[o] = n), this.TS.store(STORAGE_KEYS.It.eS, r);
218
220
  }
219
- RS() {
220
- const t = this.uS.wr(STORAGE_KEYS.It.$E);
221
- this.uS.remove(STORAGE_KEYS.It.$E);
221
+ IS() {
222
+ const t = this.TS.wr(STORAGE_KEYS.It.eS);
223
+ this.TS.remove(STORAGE_KEYS.It.eS);
222
224
  const e = [];
223
225
  for (const s in t) null != t[s] && e.push(t[s]);
224
226
  return e;
225
227
  }
226
- Lu(t) {
227
- const e = this.uS.wr(STORAGE_KEYS.It.$E);
228
+ qu(t) {
229
+ const e = this.TS.wr(STORAGE_KEYS.It.eS);
228
230
  if (null != e) {
229
- const s = this.gS(null),
231
+ const s = this.dS(null),
230
232
  r = e[s];
231
233
  null != r &&
232
234
  ((e[s] = void 0),
233
- this.uS.store(STORAGE_KEYS.It.$E, e),
235
+ this.TS.store(STORAGE_KEYS.It.eS, e),
234
236
  (r[User.Sa] = t),
235
- this.Rl(r));
237
+ this.fl(r));
236
238
  }
237
239
  const s = this.$u(STORAGE_KEYS.Ou.um);
238
240
  let r = null;
239
- null != s && (r = s.Tu);
240
- const o = this.hS();
241
+ null != s && (r = s.Iu);
242
+ const o = this.gS();
241
243
  if (null != o)
242
244
  for (let e = 0; e < o.length; e++) {
243
245
  const s = o[e];
244
246
  null == s.userId && s.sessionId == r && (s.userId = t), this.gm(s);
245
247
  }
246
248
  }
247
- dS() {
248
- return this.uS.IS;
249
+ bS() {
250
+ return this.TS.fS;
249
251
  }
250
252
  }
251
253
  (ne.ec = class {
252
254
  constructor(t) {
253
- (this.tu = t), (this.tu = t), (this.IS = ro.bS() ? 3 : 10);
255
+ (this.eu = t), (this.eu = t), (this.fS = ro.mS() ? 3 : 10);
254
256
  }
255
- fS(t) {
256
- return t + "." + this.tu;
257
+ KS(t) {
258
+ return t + "." + this.eu;
257
259
  }
258
260
  store(t, e) {
259
261
  const s = { v: e };
260
262
  try {
261
- return localStorage.setItem(this.fS(t), JSON.stringify(s)), !0;
263
+ return localStorage.setItem(this.KS(t), JSON.stringify(s)), !0;
262
264
  } catch (t) {
263
- return b.info("Storage failure: " + hi(t)), !1;
265
+ return b.info("Storage failure: " + ci(t)), !1;
264
266
  }
265
267
  }
266
268
  wr(t) {
267
269
  try {
268
270
  let e = null;
269
- const s = localStorage.getItem(this.fS(t));
271
+ const s = localStorage.getItem(this.KS(t));
270
272
  return null != s && (e = JSON.parse(s)), null == e ? null : e.v;
271
273
  } catch (t) {
272
- return b.info("Storage retrieval failure: " + hi(t)), null;
274
+ return b.info("Storage retrieval failure: " + ci(t)), null;
273
275
  }
274
276
  }
275
277
  remove(t) {
276
278
  try {
277
- localStorage.removeItem(this.fS(t));
279
+ localStorage.removeItem(this.KS(t));
278
280
  } catch (t) {
279
- return b.info("Storage removal failure: " + hi(t)), !1;
281
+ return b.info("Storage removal failure: " + ci(t)), !1;
280
282
  }
281
283
  }
282
284
  }),
283
285
  (ne.rc = class {
284
286
  constructor() {
285
- (this.mS = {}), (this.KS = 5242880), (this.IS = 3);
287
+ (this.NS = {}), (this.YS = 5242880), (this.fS = 3);
286
288
  }
287
289
  store(t, e) {
288
290
  const s = { value: e },
289
- r = this.YS(e);
290
- return r > this.KS
291
+ r = this.DS(e);
292
+ return r > this.YS
291
293
  ? (b.info(
292
294
  "Storage failure: object is ≈" +
293
295
  r +
294
296
  " bytes which is greater than the max of " +
295
- this.KS,
297
+ this.YS,
296
298
  ),
297
299
  !1)
298
- : ((this.mS[t] = s), !0);
300
+ : ((this.NS[t] = s), !0);
299
301
  }
300
- YS(t) {
302
+ DS(t) {
301
303
  const e = [],
302
304
  s = [t];
303
305
  let r = 0;
@@ -315,23 +317,23 @@ export default class ne {
315
317
  return r;
316
318
  }
317
319
  wr(t) {
318
- const e = this.mS[t];
320
+ const e = this.NS[t];
319
321
  return null == e ? null : e.value;
320
322
  }
321
323
  remove(t) {
322
- this.mS[t] = null;
324
+ this.NS[t] = null;
323
325
  }
324
326
  }),
325
327
  (ne.le = class {
326
328
  constructor(t, e, s) {
327
- (this.tu = t), (this.NS = e), (this.tu = t), (this.DS = this.GS());
329
+ (this.eu = t), (this.CS = e), (this.eu = t), (this.GS = this.MS());
328
330
  const r = "number" == typeof s && s > 0 ? s : 400;
329
- (this.CS = 24 * r * 60), (this.MS = {}), (this.NS = !!e);
331
+ (this.US = 24 * r * 60), (this.pS = {}), (this.CS = !!e);
330
332
  }
331
- fS(t) {
332
- return null != this.tu ? t + "." + this.tu : t;
333
+ KS(t) {
334
+ return null != this.eu ? t + "." + this.eu : t;
333
335
  }
334
- GS() {
336
+ MS() {
335
337
  let t = 0,
336
338
  e = document.location.hostname;
337
339
  const s = e.split("."),
@@ -348,10 +350,10 @@ export default class ne {
348
350
  }
349
351
  me() {
350
352
  const t = new Date();
351
- return t.setTime(t.getTime() + 60 * this.CS * 1e3), t.getFullYear();
353
+ return t.setTime(t.getTime() + 60 * this.US * 1e3), t.getFullYear();
352
354
  }
353
- pS() {
354
- const t = Wt(STORAGE_KEYS.Ou),
355
+ vS() {
356
+ const t = Yt(STORAGE_KEYS.Ou),
355
357
  e = document.cookie.split(";");
356
358
  for (let s = 0; s < e.length; s++) {
357
359
  let r = e[s];
@@ -364,19 +366,19 @@ export default class ne {
364
366
  }
365
367
  if (o) {
366
368
  const t = r.split("=")[0];
367
- -1 === t.indexOf("." + this.tu) && this.vS(t);
369
+ -1 === t.indexOf("." + this.eu) && this.yS(t);
368
370
  }
369
371
  }
370
372
  }
371
373
  store(t, e) {
372
- this.pS();
373
- const s = this.fS(t),
374
+ this.vS();
375
+ const s = this.KS(t),
374
376
  r = new Date();
375
- r.setTime(r.getTime() + 60 * this.CS * 1e3);
377
+ r.setTime(r.getTime() + 60 * this.US * 1e3);
376
378
  const o = "expires=" + r.toUTCString(),
377
- n = "domain=" + this.DS;
379
+ n = "domain=" + this.GS;
378
380
  let a;
379
- a = this.NS ? e : encodeURIComponent(e);
381
+ a = this.CS ? e : encodeURIComponent(e);
380
382
  const i = s + "=" + a + ";" + o + ";" + n + ";path=/";
381
383
  if (i.length >= 4093)
382
384
  return (
@@ -385,30 +387,30 @@ export default class ne {
385
387
  i.length +
386
388
  " chars which is too large to store as a cookie.",
387
389
  ),
388
- (this.MS[s] = !0),
389
- this.vS(s),
390
+ (this.pS[s] = !0),
391
+ this.yS(s),
390
392
  !1
391
393
  );
392
394
  try {
393
395
  document.cookie = i;
394
396
  } catch (t) {
395
- return b.info("Storage failure: " + hi(t)), (this.MS[s] = !0), !1;
397
+ return b.info("Storage failure: " + ci(t)), (this.pS[s] = !0), !1;
396
398
  }
397
- const E = this.NS ? String(a) : decodeURIComponent(a);
398
- return this.US(s) !== E
399
+ const S = this.CS ? String(a) : decodeURIComponent(a);
400
+ return this.LS(s) !== S
399
401
  ? (b.info(
400
402
  `Storage failure: unable to verify cookie write for "${s}". Falling back to other storage.`,
401
403
  ),
402
- (this.MS[s] = !0),
403
- this.vS(s),
404
+ (this.pS[s] = !0),
405
+ this.yS(s),
404
406
  !1)
405
- : (delete this.MS[s], !0);
407
+ : (delete this.pS[s], !0);
406
408
  }
407
409
  wr(t) {
408
- const e = this.fS(t);
409
- return this.MS[e] ? null : this.US(e);
410
+ const e = this.KS(t);
411
+ return this.pS[e] ? null : this.LS(e);
410
412
  }
411
- US(t) {
413
+ LS(t) {
412
414
  const e = [],
413
415
  s = t + "=",
414
416
  r = document.cookie.split(";");
@@ -418,50 +420,50 @@ export default class ne {
418
420
  if (0 === n.indexOf(s))
419
421
  try {
420
422
  let t;
421
- (t = this.NS
423
+ (t = this.CS
422
424
  ? n.substring(s.length, n.length)
423
425
  : decodeURIComponent(n.substring(s.length, n.length))),
424
426
  e.push(t);
425
427
  } catch (e) {
426
428
  return (
427
- b.info("Storage retrieval failure: " + hi(e)), this.vS(t), null
429
+ b.info("Storage retrieval failure: " + ci(e)), this.yS(t), null
428
430
  );
429
431
  }
430
432
  }
431
433
  return e.length > 0 ? e[e.length - 1] : null;
432
434
  }
433
435
  remove(t) {
434
- this.vS(this.fS(t));
436
+ this.yS(this.KS(t));
435
437
  }
436
- vS(t) {
438
+ yS(t) {
437
439
  const e = t + "=;expires=" + new Date(0).toUTCString();
438
440
  (document.cookie = e), (document.cookie = e + ";path=/");
439
- const s = e + ";domain=" + this.DS;
441
+ const s = e + ";domain=" + this.GS;
440
442
  (document.cookie = s), (document.cookie = s + ";path=/");
441
443
  }
442
444
  }),
443
445
  (ne.tc = class {
444
446
  constructor(t, e, s, r) {
445
- (this.tu = t),
446
- (this.yS = []),
447
- e && this.yS.push(new ne.le(t, void 0, r)),
448
- s && this.yS.push(new ne.ec(t)),
449
- this.yS.push(new ne.rc());
447
+ (this.eu = t),
448
+ (this.BS = []),
449
+ e && this.BS.push(new ne.le(t, void 0, r)),
450
+ s && this.BS.push(new ne.ec(t)),
451
+ this.BS.push(new ne.rc());
450
452
  }
451
453
  store(t, e) {
452
454
  let s = !0;
453
- for (let r = 0; r < this.yS.length; r++) s = this.yS[r].store(t, e) && s;
455
+ for (let r = 0; r < this.BS.length; r++) s = this.BS[r].store(t, e) && s;
454
456
  return s;
455
457
  }
456
458
  wr(t) {
457
- for (let e = 0; e < this.yS.length; e++) {
458
- const s = this.yS[e].wr(t);
459
+ for (let e = 0; e < this.BS.length; e++) {
460
+ const s = this.BS[e].wr(t);
459
461
  if (null != s) return s;
460
462
  }
461
463
  return null;
462
464
  }
463
465
  remove(t) {
464
- new ne.le(this.tu).remove(t);
465
- for (let e = 0; e < this.yS.length; e++) this.yS[e].remove(t);
466
+ new ne.le(this.eu).remove(t);
467
+ for (let e = 0; e < this.BS.length; e++) this.BS[e].remove(t);
466
468
  }
467
469
  });
@@ -14,7 +14,7 @@ export default class f {
14
14
  removeAllSubscriptions() {
15
15
  this.In = {};
16
16
  }
17
- Ve() {
17
+ an() {
18
18
  return Object.keys(this.In).length;
19
19
  }
20
20
  A(t) {
@@ -1,6 +1,6 @@
1
1
  import { STORAGE_KEYS as s } from "./storage-manager.js";
2
2
  export function getAlias(e) {
3
- const t = null == e ? void 0 : e.St(s.It.lS);
3
+ const t = null == e ? void 0 : e.St(s.It.uS);
4
4
  let n;
5
5
  return t && (n = { label: t.l, name: t.a }), n;
6
6
  }
@@ -1,8 +1,8 @@
1
1
  export default {
2
- Za: "invalid_api_key",
3
- dl: "blacklisted",
4
- fl: "no_device_identifier",
5
- Va: "invalid_json_response",
6
- Ya: "empty_response",
2
+ Ya: "invalid_api_key",
3
+ Qa: "blacklisted",
4
+ Va: "no_device_identifier",
5
+ Wa: "invalid_json_response",
6
+ Ha: "empty_response",
7
7
  __: "sdk_auth_error",
8
8
  };
@@ -1,11 +1,11 @@
1
1
  import r from "../managers/braze-instance.js";
2
- import { getAlias as He } from "../managers/utils.js";
2
+ import { getAlias as Te } from "../managers/utils.js";
3
3
  import { isObject as Ct } from "../util/code-utils.js";
4
4
  import {
5
5
  convertMsToSeconds as X,
6
6
  timestampOrNow as is,
7
7
  } from "../util/date-utils.js";
8
- export default class Ie {
8
+ export default class ve {
9
9
  constructor(t, s, i, r, e) {
10
10
  (this.userId = t),
11
11
  (this.type = s),
@@ -18,7 +18,7 @@ export default class Ie {
18
18
  (this.sessionId = r),
19
19
  (this.data = e);
20
20
  }
21
- ta() {
21
+ Uo() {
22
22
  var t;
23
23
  const s = {
24
24
  name: this.type,
@@ -29,7 +29,7 @@ export default class Ie {
29
29
  null != this.userId && (s.user_id = this.userId);
30
30
  const i = (null === (t = r.Er()) || void 0 === t ? void 0 : t.Fh()) || !1;
31
31
  if (!s.user_id && !i) {
32
- const t = He(r.p());
32
+ const t = Te(r.p());
33
33
  t && (s.alias = t);
34
34
  }
35
35
  return s;
@@ -44,12 +44,12 @@ export default class Ie {
44
44
  };
45
45
  }
46
46
  static fromJson(t) {
47
- return new Ie(t.user_id, t.name, t.time, t.session_id, t.data);
47
+ return new ve(t.user_id, t.name, t.time, t.session_id, t.data);
48
48
  }
49
- static AS(t) {
49
+ static RS(t) {
50
50
  return null != t && Ct(t) && null != t.t && "" !== t.t;
51
51
  }
52
52
  static _u(t) {
53
- return new Ie(t.u, t.t, t.ts, t.s, t.d);
53
+ return new ve(t.u, t.t, t.ts, t.s, t.d);
54
54
  }
55
55
  }
@@ -1,8 +1,8 @@
1
- export default class Se {
1
+ export default class ke {
2
2
  constructor(s) {
3
3
  (this.id = s), (this.id = s);
4
4
  }
5
- ta() {
5
+ Uo() {
6
6
  const s = {};
7
7
  return (
8
8
  null != this.browser && (s.browser = this.browser),