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