@braze/web-sdk 6.12.0 → 6.13.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 (149) hide show
  1. package/index.d.ts +240 -3
  2. package/package.json +1 -1
  3. package/shared-lib/event-types.js +18 -18
  4. package/shared-lib/indexed-db-adapter.js +58 -58
  5. package/shared-lib/logger.js +7 -7
  6. package/shared-lib/supported-options.js +25 -24
  7. package/src/ConversationalChat/automatically-manage-chat.js +5 -0
  8. package/src/ConversationalChat/chat-message-factory.js +25 -0
  9. package/src/ConversationalChat/chat-message.js +33 -0
  10. package/src/ConversationalChat/constants.js +1 -0
  11. package/src/ConversationalChat/conversational-chat-provider-factory.js +26 -0
  12. package/src/ConversationalChat/conversational-chat-provider.js +372 -0
  13. package/src/ConversationalChat/display/chat-widget-manager.js +113 -0
  14. package/src/ConversationalChat/display/chat-widget-to-html.js +58 -0
  15. package/src/ConversationalChat/get-chat-messages.js +7 -0
  16. package/src/ConversationalChat/index.js +12 -0
  17. package/src/ConversationalChat/is-chat-conversation-ended.js +7 -0
  18. package/src/ConversationalChat/is-chat-turn-errored.js +7 -0
  19. package/src/ConversationalChat/is-chat-turn-in-progress.js +7 -0
  20. package/src/ConversationalChat/register-chat-action-handler.js +10 -0
  21. package/src/ConversationalChat/reset-chat-conversation.js +5 -0
  22. package/src/ConversationalChat/retrieve-chat-config.js +7 -0
  23. package/src/ConversationalChat/send-chat-message.js +17 -0
  24. package/src/ConversationalChat/subscribe-to-chat-action.js +5 -0
  25. package/src/ConversationalChat/subscribe-to-chat-conversation-updated.js +5 -0
  26. package/src/ConversationalChat/subscribe-to-chat-message-received.js +5 -0
  27. package/src/ConversationalChat/trigger-chat-action.js +11 -0
  28. package/src/ConversationalChat/types.js +1 -0
  29. package/src/Core/add-sdk-metadata.js +5 -5
  30. package/src/Core/change-user.js +6 -6
  31. package/src/Core/disable-sdk.js +6 -6
  32. package/src/Core/enable-sdk.js +3 -3
  33. package/src/Core/get-device-id.js +2 -2
  34. package/src/Core/handle-braze-action.js +20 -13
  35. package/src/Core/is-disabled.js +1 -1
  36. package/src/Core/is-initialized.js +1 -1
  37. package/src/Core/log-custom-event.js +9 -9
  38. package/src/Core/log-ecommerce-event.js +4 -4
  39. package/src/Core/log-purchase.js +14 -14
  40. package/src/Core/open-session.js +8 -8
  41. package/src/Core/set-sdk-authentication-signature.js +3 -3
  42. package/src/Core/subscribe-to-sdk-authentication-failures.js +1 -1
  43. package/src/Core/wipe-data.js +1 -1
  44. package/src/DUST/dust-config-store.js +35 -35
  45. package/src/DUST/dust-message-dedup.js +3 -3
  46. package/src/DUST/dust-provider-factory.js +10 -10
  47. package/src/DUST/dust-provider.js +234 -234
  48. package/src/DUST/subscribe-to-dust.js +7 -7
  49. package/src/FeatureFlags/feature-flag-factory.js +2 -2
  50. package/src/FeatureFlags/feature-flag.js +4 -4
  51. package/src/FeatureFlags/feature-flags-provider-factory.js +11 -11
  52. package/src/FeatureFlags/feature-flags-provider.js +38 -38
  53. package/src/FeatureFlags/get-all-feature-flags.js +3 -3
  54. package/src/FeatureFlags/get-feature-flag.js +3 -3
  55. package/src/FeatureFlags/log-feature-flag-impression.js +4 -4
  56. package/src/FeatureFlags/refresh-feature-flags.js +5 -5
  57. package/src/FeatureFlags/subscribe-to-feature-flags-updates.js +3 -3
  58. package/src/InAppMessage/defer-in-app-message.js +1 -1
  59. package/src/InAppMessage/display/html-message-display-utils.js +4 -4
  60. package/src/InAppMessage/display/html-message-to-html.js +13 -13
  61. package/src/InAppMessage/display/in-app-message-to-html.js +20 -20
  62. package/src/InAppMessage/display/modal-utils.js +7 -7
  63. package/src/InAppMessage/in-app-message-factory.js +6 -6
  64. package/src/InAppMessage/in-app-message-manager.js +92 -92
  65. package/src/InAppMessage/log-in-app-message-button-click.js +9 -9
  66. package/src/InAppMessage/log-in-app-message-click.js +7 -7
  67. package/src/InAppMessage/log-in-app-message-html-click.js +6 -6
  68. package/src/InAppMessage/log-in-app-message-impression.js +3 -3
  69. package/src/InAppMessage/models/full-screen-message.js +39 -39
  70. package/src/InAppMessage/models/html-message.js +20 -20
  71. package/src/InAppMessage/models/in-app-message-button.js +2 -2
  72. package/src/InAppMessage/models/in-app-message.js +102 -102
  73. package/src/InAppMessage/models/modal-message.js +38 -38
  74. package/src/InAppMessage/models/slide-up-message.js +34 -34
  75. package/src/InAppMessage/models/templated-in-app-message.js +8 -8
  76. package/src/InAppMessage/subscribe-to-in-app-message.js +1 -1
  77. package/src/InAppMessage/ui/automatically-show-in-app-messages.js +3 -3
  78. package/src/InAppMessage/ui/remove-all-visible-in-app-messages.js +3 -3
  79. package/src/InAppMessage/ui/show-in-app-message.js +27 -24
  80. package/src/Push/is-push-blocked.js +2 -2
  81. package/src/Push/is-push-permission-granted.js +2 -2
  82. package/src/Push/is-push-supported.js +2 -2
  83. package/src/Push/push-manager-factory.js +15 -15
  84. package/src/Push/push-manager.js +13 -13
  85. package/src/Push/register-push.js +2 -2
  86. package/src/Push/request-push-permission.js +2 -2
  87. package/src/Push/unregister-push-token-on-server.js +3 -3
  88. package/src/Push/unregister-push.js +3 -3
  89. package/src/Push/utils/push-utils.js +15 -15
  90. package/src/User/user-manager.js +9 -9
  91. package/src/User/user.js +50 -50
  92. package/src/common/constants.js +1 -1
  93. package/src/common/content-cards-display.js +22 -22
  94. package/src/common/event-logger.js +3 -3
  95. package/src/index.js +2 -9
  96. package/src/l10n/l10n-manager-factory.js +4 -4
  97. package/src/l10n/l10n-manager.js +6 -6
  98. package/src/managers/auth-manager.js +28 -28
  99. package/src/managers/braze-action-manager.js +14 -0
  100. package/src/managers/braze-instance.js +159 -151
  101. package/src/managers/device-manager.js +26 -26
  102. package/src/managers/network-manager.js +120 -120
  103. package/src/managers/server-config-manager.js +95 -86
  104. package/src/managers/session-manager.js +25 -25
  105. package/src/managers/storage-manager-factory.js +12 -12
  106. package/src/managers/storage-manager.js +129 -124
  107. package/src/managers/subscription-manager.js +8 -8
  108. package/src/models/backend-errors.js +5 -5
  109. package/src/models/braze-event.js +5 -5
  110. package/src/models/device.js +2 -2
  111. package/src/models/identifier.js +8 -8
  112. package/src/models/push-token.js +6 -6
  113. package/src/models/request-result.js +2 -2
  114. package/src/models/server-config.js +27 -27
  115. package/src/request-controller.js +117 -117
  116. package/src/standard-index.js +9 -0
  117. package/src/triggers/models/custom-event-data.js +4 -4
  118. package/src/triggers/models/custom-event-property-data.js +5 -5
  119. package/src/triggers/models/filter-set.js +5 -5
  120. package/src/triggers/models/filter.js +31 -31
  121. package/src/triggers/models/in-app-message-click-data.js +9 -9
  122. package/src/triggers/models/purchase-data.js +1 -1
  123. package/src/triggers/models/purchase-property-data.js +5 -5
  124. package/src/triggers/models/push-click-data.js +4 -4
  125. package/src/triggers/models/trigger-condition.js +35 -35
  126. package/src/triggers/models/trigger-events.js +3 -3
  127. package/src/triggers/models/trigger.js +36 -36
  128. package/src/triggers/triggers-provider-factory.js +5 -5
  129. package/src/triggers/triggers-provider.js +128 -128
  130. package/src/types.js +2 -2
  131. package/src/ui/js/attach-css.js +1 -1
  132. package/src/ui/js/chat-widget-css.js +11 -0
  133. package/src/ui/js/load-font-awesome.js +1 -1
  134. package/src/util/base-device-parser.js +7 -7
  135. package/src/util/braze-actions.js +5 -5
  136. package/src/util/browser-detector.js +41 -41
  137. package/src/util/client-hints-parser.js +10 -10
  138. package/src/util/component-utils.js +1 -1
  139. package/src/util/date-utils.js +2 -2
  140. package/src/util/device-constants.js +5 -5
  141. package/src/util/dom-utils.js +8 -8
  142. package/src/util/ecommerce-event-validation.js +13 -13
  143. package/src/util/html-display-utils.js +6 -6
  144. package/src/util/key-codes.js +1 -1
  145. package/src/util/net.js +82 -44
  146. package/src/util/request-header-utils.js +26 -24
  147. package/src/util/user-agent-parser.js +21 -21
  148. package/src/util/validation-utils.js +29 -21
  149. package/src/util/window-utils.js +3 -3
package/src/User/user.js CHANGED
@@ -1,21 +1,21 @@
1
1
  import {
2
2
  isArray as g,
3
- isDate as Nt,
4
- isObject as Ct,
5
- validateValueIsFromEnum as ta,
3
+ isDate as Kt,
4
+ isObject as Yt,
5
+ validateValueIsFromEnum as ra,
6
6
  } from "../util/code-utils.js";
7
7
  import { logger as b, EventTypes as p } from "../../shared-lib/index.js";
8
8
  import {
9
- isValidEmail as Ft,
10
- validateCustomAttributeArrayType as Lt,
11
- validateCustomAttributeKey as $t,
12
- validateCustomProperties as nt,
13
- validateCustomString as mt,
14
- validatePropertyType as Bt,
15
- validateStandardString as tr,
9
+ isValidEmail as Vt,
10
+ validateCustomAttributeArrayType as Wt,
11
+ validateCustomAttributeKey as Qt,
12
+ validateCustomProperties as vt,
13
+ validateCustomString as jt,
14
+ validatePropertyType as Xt,
15
+ validateStandardString as or,
16
16
  } from "../util/validation-utils.js";
17
17
  import { CoreStrings as R } from "../common/constants.js";
18
- import { toValidBackendTimeString as Rt } from "../util/date-utils.js";
18
+ import { toValidBackendTimeString as Zt } from "../util/date-utils.js";
19
19
  export default class User {
20
20
  constructor(t, e) {
21
21
  (this.Ss = t), (this.Ru = e), (this.Ss = t), (this.Ru = e);
@@ -29,25 +29,25 @@ export default class User {
29
29
  t(e);
30
30
  }
31
31
  addAlias(t, e) {
32
- return !tr(t, "add alias", "the alias", !1) || t.length <= 0
32
+ return !or(t, "add alias", "the alias", !1) || t.length <= 0
33
33
  ? (b.error("addAlias requires a non-empty alias"), !1)
34
- : !tr(e, "add alias", "the label", !1) || e.length <= 0
34
+ : !or(e, "add alias", "the label", !1) || e.length <= 0
35
35
  ? (b.error("addAlias requires a non-empty label"), !1)
36
36
  : this.Ru.Hu(t, e).lt;
37
37
  }
38
38
  setFirstName(t) {
39
39
  return (
40
- !!tr(t, "set first name", "the firstName", !0) &&
40
+ !!or(t, "set first name", "the firstName", !0) &&
41
41
  this.Ss.Bu("first_name", t)
42
42
  );
43
43
  }
44
44
  setLastName(t) {
45
45
  return (
46
- !!tr(t, "set last name", "the lastName", !0) && this.Ss.Bu("last_name", t)
46
+ !!or(t, "set last name", "the lastName", !0) && this.Ss.Bu("last_name", t)
47
47
  );
48
48
  }
49
49
  setEmail(t) {
50
- return null === t || Ft(t)
50
+ return null === t || Vt(t)
51
51
  ? this.Ss.Bu("email", t)
52
52
  : (b.error(
53
53
  `Cannot set email address - "${t}" did not pass RFC-5322 validation.`,
@@ -59,7 +59,7 @@ export default class User {
59
59
  "string" == typeof t && (t = t.toLowerCase()),
60
60
  !(
61
61
  null !== t &&
62
- !ta(
62
+ !ra(
63
63
  User.Genders,
64
64
  t,
65
65
  `Gender "${t}" is not a valid gender.`,
@@ -92,22 +92,22 @@ export default class User {
92
92
  }
93
93
  setCountry(t) {
94
94
  return (
95
- !!tr(t, "set country", "the country", !0) && this.Ss.Bu("country", t)
95
+ !!or(t, "set country", "the country", !0) && this.Ss.Bu("country", t)
96
96
  );
97
97
  }
98
98
  setHomeCity(t) {
99
99
  return (
100
- !!tr(t, "set home city", "the homeCity", !0) && this.Ss.Bu("home_city", t)
100
+ !!or(t, "set home city", "the homeCity", !0) && this.Ss.Bu("home_city", t)
101
101
  );
102
102
  }
103
103
  setLanguage(t) {
104
104
  return (
105
- !!tr(t, "set language", "the language", !0) && this.Ss.Bu("language", t)
105
+ !!or(t, "set language", "the language", !0) && this.Ss.Bu("language", t)
106
106
  );
107
107
  }
108
108
  setEmailNotificationSubscriptionType(t) {
109
109
  return (
110
- !!ta(
110
+ !!ra(
111
111
  User.NotificationSubscriptionTypes,
112
112
  t,
113
113
  `Email notification setting "${t}" is not a valid subscription type.`,
@@ -117,7 +117,7 @@ export default class User {
117
117
  }
118
118
  setPushNotificationSubscriptionType(t) {
119
119
  return (
120
- !!ta(
120
+ !!ra(
121
121
  User.NotificationSubscriptionTypes,
122
122
  t,
123
123
  `Push notification setting "${t}" is not a valid subscription type.`,
@@ -127,7 +127,7 @@ export default class User {
127
127
  }
128
128
  setPhoneNumber(t) {
129
129
  return (
130
- !!tr(t, "set phone number", "the phoneNumber", !0) &&
130
+ !!or(t, "set phone number", "the phoneNumber", !0) &&
131
131
  (null === t || t.match(User.Ku)
132
132
  ? this.Ss.Bu("phone", t)
133
133
  : (b.error(`Cannot set phone number - "${t}" did not pass validation.`),
@@ -168,9 +168,9 @@ export default class User {
168
168
  .lt);
169
169
  }
170
170
  setCustomUserAttribute(t, e, r) {
171
- if (!$t(t)) return !1;
171
+ if (!Qt(t)) return !1;
172
172
  const s = (e) => {
173
- const [r] = nt(
173
+ const [r] = vt(
174
174
  e,
175
175
  R.Mu,
176
176
  "attribute value",
@@ -180,19 +180,19 @@ export default class User {
180
180
  return r;
181
181
  };
182
182
  if (g(e)) {
183
- const [r, n] = Lt(t, e);
183
+ const [r, n] = Wt(t, e);
184
184
  if (!r && !n && 0 !== e.length) return !1;
185
185
  if (r || 0 === e.length) return this.Ru.Yu(p.Vu, t, e).lt;
186
186
  for (const t of e) if (!s(t)) return !1;
187
- } else if (Ct(e)) {
187
+ } else if (Yt(e)) {
188
188
  if (!s(e)) return !1;
189
189
  if (r) return this.Ru.Yu(p.Qu, t, e).lt;
190
190
  } else {
191
- if (!(void 0 !== e && Bt(e))) return !1;
191
+ if (!(void 0 !== e && Xt(e))) return !1;
192
192
  if (
193
- (Nt(e) && (e = Rt(e)),
193
+ (Kt(e) && (e = Zt(e)),
194
194
  "string" == typeof e &&
195
- !mt(
195
+ !jt(
196
196
  e,
197
197
  `set custom user attribute "${t}"`,
198
198
  "the element in the given array",
@@ -204,26 +204,26 @@ export default class User {
204
204
  }
205
205
  addToCustomAttributeArray(t, e) {
206
206
  return (
207
- !!mt(t, "add to custom user attribute array", "the given key") &&
207
+ !!jt(t, "add to custom user attribute array", "the given key") &&
208
208
  !(
209
209
  null != e &&
210
- !mt(e, "add to custom user attribute array", "the given value")
210
+ !jt(e, "add to custom user attribute array", "the given value")
211
211
  ) &&
212
212
  this.Ru.Yu(p.Xu, t, e).lt
213
213
  );
214
214
  }
215
215
  removeFromCustomAttributeArray(t, e) {
216
216
  return (
217
- !!mt(t, "remove from custom user attribute array", "the given key") &&
217
+ !!jt(t, "remove from custom user attribute array", "the given key") &&
218
218
  !(
219
219
  null != e &&
220
- !mt(e, "remove from custom user attribute array", "the given value")
220
+ !jt(e, "remove from custom user attribute array", "the given value")
221
221
  ) &&
222
222
  this.Ru.Yu(p.Zu, t, e).lt
223
223
  );
224
224
  }
225
225
  incrementCustomUserAttribute(t, e) {
226
- if (!mt(t, "increment custom user attribute", "the given key")) return !1;
226
+ if (!jt(t, "increment custom user attribute", "the given key")) return !1;
227
227
  null == e && (e = 1);
228
228
  const r = parseInt(e.toString());
229
229
  return isNaN(r) || r !== parseFloat(e.toString())
@@ -231,11 +231,11 @@ export default class User {
231
231
  `Cannot increment custom user attribute because the given incrementValue "${e}" is not an integer.`,
232
232
  ),
233
233
  !1)
234
- : this.Ru.Yu(p.Na, t, r).lt;
234
+ : this.Ru.Yu(p.Ya, t, r).lt;
235
235
  }
236
236
  setCustomLocationAttribute(t, e, r) {
237
237
  return (
238
- !!mt(t, "set custom location attribute", "the given key") &&
238
+ !!jt(t, "set custom location attribute", "the given key") &&
239
239
  ((null !== e || null !== r) &&
240
240
  ((e = null != e ? parseFloat(e.toString()) : null),
241
241
  (r = null != r ? parseFloat(r.toString()) : null),
@@ -247,11 +247,11 @@ export default class User {
247
247
  "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.",
248
248
  ),
249
249
  !1)
250
- : this.Ru.ya(t, e, r).lt)
250
+ : this.Ru.Va(t, e, r).lt)
251
251
  );
252
252
  }
253
253
  addToSubscriptionGroup(t) {
254
- return !tr(
254
+ return !or(
255
255
  t,
256
256
  "add user to subscription group",
257
257
  "subscription group ID",
@@ -261,10 +261,10 @@ export default class User {
261
261
  "addToSubscriptionGroup requires a non-empty subscription group ID",
262
262
  ),
263
263
  !1)
264
- : this.Ru.va(t, User.Ia.SUBSCRIBED).lt;
264
+ : this.Ru.Wa(t, User.Qa.SUBSCRIBED).lt;
265
265
  }
266
266
  removeFromSubscriptionGroup(t) {
267
- return !tr(
267
+ return !or(
268
268
  t,
269
269
  "remove user from subscription group",
270
270
  "subscription group ID",
@@ -274,21 +274,21 @@ export default class User {
274
274
  "removeFromSubscriptionGroup requires a non-empty subscription group ID",
275
275
  ),
276
276
  !1)
277
- : this.Ru.va(t, User.Ia.UNSUBSCRIBED).lt;
277
+ : this.Ru.Wa(t, User.Qa.UNSUBSCRIBED).lt;
278
278
  }
279
279
  setLineId(t) {
280
- return tr(t, "set LINE user ID", "the ID", !0) &&
280
+ return or(t, "set LINE user ID", "the ID", !0) &&
281
281
  0 !== (null == t ? void 0 : t.length)
282
- ? t && t.length > User.Ca
282
+ ? t && t.length > User.Za
283
283
  ? (b.error(
284
- `Rejected LINE user ID ${t} because it is longer than ${User.Ca} characters.`,
284
+ `Rejected LINE user ID ${t} because it is longer than ${User.Za} characters.`,
285
285
  ),
286
286
  !1)
287
287
  : this.Ss.Bu("native_line_id", t)
288
288
  : (b.error("setLineId requires a non-empty ID"), !1);
289
289
  }
290
290
  yu(t, e, r, s, n) {
291
- this.Ss.yu(t, e, r, s, n), this.Ru.Ea();
291
+ this.Ss.yu(t, e, r, s, n), this.Ru.el();
292
292
  }
293
293
  wu(t) {
294
294
  this.Ss.wu(t);
@@ -308,8 +308,8 @@ export default class User {
308
308
  UNSUBSCRIBED: "unsubscribed",
309
309
  }),
310
310
  (User.Ku = /^[0-9 .\\(\\)\\+\\-]+$/),
311
- (User.Ia = { SUBSCRIBED: "subscribed", UNSUBSCRIBED: "unsubscribed" }),
312
- (User.Sa = "user_id"),
311
+ (User.Qa = { SUBSCRIBED: "subscribed", UNSUBSCRIBED: "unsubscribed" }),
312
+ (User.rl = "user_id"),
313
313
  (User.Eu = "custom"),
314
- (User.br = 997),
315
- (User.Ca = 33);
314
+ (User.Ur = 997),
315
+ (User.Za = 33);
@@ -11,7 +11,7 @@ export const REQUEST_BACKOFF_SCALE_FACTOR_DEFAULT = 3;
11
11
  export const REQUEST_BACKOFF_MAX_SLEEP_MS_DEFAULT = 3e5;
12
12
  export const CoreStrings = {
13
13
  ee: "Braze must be initialized before calling methods.",
14
- je: "logCustomEvent",
14
+ $e: "logCustomEvent",
15
15
  QE: "logEcommerceEvent",
16
16
  Mu: "setCustomUserAttribute",
17
17
  };
@@ -1,10 +1,10 @@
1
1
  import {
2
- getCardId as qt,
3
- markCardAsRead as Ot,
2
+ getCardId as Ce,
3
+ markCardAsRead as ye,
4
4
  } from "../Card/display/card-display.js";
5
5
  import { bottomIsInView as q, topIsInView as k } from "../util/dom-utils.js";
6
6
  import { Card, ControlCard } from "../Card/index.js";
7
- import { cardToHtml as Gt } from "../Card/display/card-display.js";
7
+ import { cardToHtml as xe } from "../Card/display/card-display.js";
8
8
  import { isArray as g } from "../util/code-utils.js";
9
9
  import { KeyCodes as le } from "../util/key-codes.js";
10
10
  import he from "../l10n/l10n-manager-factory.js";
@@ -12,16 +12,16 @@ import { removeSubscription } from "../Core/remove-subscription.js";
12
12
  import { logger as b, Guid as V } from "../../shared-lib/index.js";
13
13
  import { BRAZE_ACTION_URI_REGEX as to } from "../util/validation-utils.js";
14
14
  import {
15
- INELIGIBLE_BRAZE_ACTION_URL_ERROR_TYPES as Tt,
16
- ineligibleBrazeActionURLErrorMessage as Mt,
17
- getDecodedBrazeAction as eo,
18
- containsUnknownBrazeAction as At,
15
+ INELIGIBLE_BRAZE_ACTION_URL_ERROR_TYPES as Rt,
16
+ ineligibleBrazeActionURLErrorMessage as zt,
17
+ getDecodedBrazeAction as ro,
18
+ containsUnknownBrazeAction as St,
19
19
  } from "../util/braze-actions.js";
20
20
  import {
21
- bottomHadImpression as Qt,
21
+ bottomHadImpression as Ee,
22
22
  impressOnBottom as $,
23
23
  impressOnTop as B,
24
- topHadImpression as Kt,
24
+ topHadImpression as Ie,
25
25
  } from "./detect-impression.js";
26
26
  import { BannerStrings as x } from "../Banner/constants.js";
27
27
  import ContentCards from "../ContentCards/content-cards.js";
@@ -63,7 +63,7 @@ export function generateContentCardsUI(t, e) {
63
63
  for (const a of t.cards) {
64
64
  const i = a instanceof ControlCard;
65
65
  !i || t.hr()
66
- ? (o.appendChild(Gt(a, r, e, n.ga())), (s = s || !i))
66
+ ? (o.appendChild(xe(a, r, e, n.Ca())), (s = s || !i))
67
67
  : b.error(
68
68
  "Received a control card for a legacy news feed. Control cards are only supported with content cards.",
69
69
  );
@@ -82,17 +82,17 @@ export function detectContentCardsImpressions(t, e) {
82
82
  if (null != t && null != e) {
83
83
  const n = [],
84
84
  o = e.querySelectorAll(".ab-card");
85
- t.Ta || (t.Ta = {});
85
+ t.nl || (t.nl = {});
86
86
  for (let e = 0; e < o.length; e++) {
87
- const s = qt(o[e]),
87
+ const s = Ce(o[e]),
88
88
  r = k(o[e]),
89
89
  a = q(o[e]);
90
- if (t.Ta[s]) {
91
- r || a || Ot(o[e]);
90
+ if (t.nl[s]) {
91
+ r || a || ye(o[e]);
92
92
  continue;
93
93
  }
94
- let i = Kt(o[e]),
95
- l = Qt(o[e]);
94
+ let i = Ie(o[e]),
95
+ l = Ee(o[e]);
96
96
  const d = i,
97
97
  c = l;
98
98
  if (
@@ -101,7 +101,7 @@ export function detectContentCardsImpressions(t, e) {
101
101
  if (d && c) continue;
102
102
  for (const e of t.cards)
103
103
  if (e.id === s) {
104
- (t.Ta[e.id] = !0), n.push(e);
104
+ (t.nl[e.id] = !0), n.push(e);
105
105
  break;
106
106
  }
107
107
  }
@@ -153,7 +153,7 @@ export function contentCardsToHtml(t, e, n) {
153
153
  destroyContentCardsHtml(o), t.stopPropagation();
154
154
  };
155
155
  r.addEventListener("keydown", (t) => {
156
- (t.keyCode !== le.To && t.keyCode !== le.Lo) || a(t);
156
+ (t.keyCode !== le.qo && t.keyCode !== le.Lo) || a(t);
157
157
  }),
158
158
  (r.onclick = a);
159
159
  const i = document.createElement("i");
@@ -166,7 +166,7 @@ export function contentCardsToHtml(t, e, n) {
166
166
  refreshContentCardsUI(t, o), e.stopPropagation();
167
167
  };
168
168
  i.addEventListener("keydown", (t) => {
169
- (t.keyCode !== le.To && t.keyCode !== le.Lo) || l(t);
169
+ (t.keyCode !== le.qo && t.keyCode !== le.Lo) || l(t);
170
170
  }),
171
171
  (i.onclick = l),
172
172
  s.appendChild(i),
@@ -186,9 +186,9 @@ export function updateContentCards(t, e, n, o, s) {
186
186
  for (const t of e)
187
187
  if (t instanceof Card) {
188
188
  if (t.url && to.test(t.url)) {
189
- const e = eo(t.url);
190
- if (At(e)) {
191
- b.error(Mt(Tt.Wn, "Content Card"));
189
+ const e = ro(t.url);
190
+ if (St(e)) {
191
+ b.error(zt(Rt.ya, "Content Card"));
192
192
  continue;
193
193
  }
194
194
  }
@@ -14,9 +14,9 @@ const v = {
14
14
  ),
15
15
  i
16
16
  );
17
- const d = l.el();
17
+ const d = l.ol();
18
18
  return (
19
- i.Ce.push(
19
+ i.Ne.push(
20
20
  new ve(
21
21
  t || (null === (n = r.ir()) || void 0 === n ? void 0 : n.getUserId()),
22
22
  e,
@@ -26,7 +26,7 @@ const v = {
26
26
  ),
27
27
  ),
28
28
  (i.lt =
29
- (null === (s = r.p()) || void 0 === s ? void 0 : s.ol(i.Ce)) || !1),
29
+ (null === (s = r.p()) || void 0 === s ? void 0 : s.ll(i.Ne)) || !1),
30
30
  i
31
31
  );
32
32
  },
package/src/index.js CHANGED
@@ -1,9 +1,2 @@
1
- export * from "./Card/index.js";
2
- export * from "./ContentCards/index.js";
3
- export * from "./Core/index.js";
4
- export * from "./InAppMessage/index.js";
5
- export * from "./Push/index.js";
6
- export * from "./User/index.js";
7
- export * from "./FeatureFlags/index.js";
8
- export * from "./Banner/index.js";
9
- export { WindowUtils } from "./util/window-utils.js";
1
+ export * from "./standard-index.js";
2
+ export * from "./ConversationalChat/index.js";
@@ -1,14 +1,14 @@
1
1
  import r, { OPTIONS as U } from "../managers/braze-instance.js";
2
- import ro from "../util/browser-detector.js";
3
- import jr from "./l10n-manager.js";
2
+ import eo from "../util/browser-detector.js";
3
+ import br from "./l10n-manager.js";
4
4
  const he = {
5
5
  i: !1,
6
6
  na: null,
7
7
  ra: () => {
8
8
  if ((he.t(), !he.na)) {
9
- let e = ro.language,
9
+ let e = eo.language,
10
10
  t = !1;
11
- r.er(U.Ma) && ((e = r.er(U.Ma)), (t = !0)), (he.na = new jr(e, t));
11
+ r.er(U.al) && ((e = r.er(U.al)), (t = !0)), (he.na = new br(e, t));
12
12
  }
13
13
  return he.na;
14
14
  },
@@ -1,16 +1,16 @@
1
1
  import { logger as b } from "../../shared-lib/index.js";
2
- import Pt from "../common/translations.js";
3
- export default class jr {
2
+ import ze from "../common/translations.js";
3
+ export default class br {
4
4
  constructor(t, e = !1) {
5
5
  if (
6
6
  ((this.language = t),
7
7
  null != t && (t = t.toLowerCase()),
8
- null != t && null == Pt[t])
8
+ null != t && null == ze[t])
9
9
  ) {
10
10
  const e = t.indexOf("-");
11
11
  e > 0 && (t = t.substring(0, e));
12
12
  }
13
- if (null == Pt[t]) {
13
+ if (null == ze[t]) {
14
14
  const a =
15
15
  "Braze does not yet have a localization for language " +
16
16
  t +
@@ -20,9 +20,9 @@ export default class jr {
20
20
  this.language = t;
21
21
  }
22
22
  get(t) {
23
- return Pt[this.language][t];
23
+ return ze[this.language][t];
24
24
  }
25
- ga() {
25
+ Ca() {
26
26
  switch (this.language) {
27
27
  case "ar":
28
28
  case "he":
@@ -1,51 +1,51 @@
1
1
  import { STORAGE_KEYS as s } from "./storage-manager.js";
2
2
  import f from "./subscription-manager.js";
3
3
  import { logger as b, IndexedDBAdapter as et } from "../../shared-lib/index.js";
4
- export default class Vt {
4
+ export default class mi {
5
5
  constructor(t, i, s) {
6
6
  (this.j = t),
7
- (this.gh = i),
8
- (this.bh = s),
7
+ (this.tc = i),
8
+ (this.sc = s),
9
9
  (this.j = t),
10
- (this.gh = i || !1),
11
- (this.bh = s),
12
- (this.Sh = new f()),
13
- (this.Ah = 0),
14
- (this.ph = 1);
10
+ (this.tc = i || !1),
11
+ (this.sc = s),
12
+ (this.ec = new f()),
13
+ (this.rc = 0),
14
+ (this.nc = 1);
15
15
  }
16
- Fh() {
17
- return this.gh;
16
+ hc() {
17
+ return this.tc;
18
18
  }
19
- kh() {
20
- return this.j.St(s.It.fh);
19
+ uc() {
20
+ return this.j.St(s.It.oc);
21
21
  }
22
22
  setSdkAuthenticationSignature(t) {
23
- const i = this.kh();
24
- this.j.Pt(s.It.fh, t);
23
+ const i = this.uc();
24
+ this.j.Pt(s.It.oc, t);
25
25
  const e = et._s.Xs;
26
- new et(e, b).setItem(e.Ws.wh, this.ph, t), i !== t && this.ct();
26
+ new et(e, b).setItem(e.Ws.ac, this.nc, t), i !== t && this.ct();
27
27
  }
28
- jh() {
29
- this.j.Vt(s.It.fh);
28
+ cc() {
29
+ this.j.Vt(s.It.oc);
30
30
  const t = et._s.Xs;
31
- new et(t, b).ge(t.Ws.wh, this.ph);
31
+ new et(t, b).Ae(t.Ws.ac, this.nc);
32
32
  }
33
33
  subscribeToSdkAuthenticationFailures(t) {
34
- return this.bh.Ut(t);
34
+ return this.sc.Ut(t);
35
35
  }
36
- Ch(t) {
37
- this.bh.A(t);
36
+ mc(t) {
37
+ this.sc.A(t);
38
38
  }
39
- xh() {
40
- this.Sh.removeAllSubscriptions();
39
+ gc() {
40
+ this.ec.removeAllSubscriptions();
41
41
  }
42
- Eh() {
43
- this.Ah += 1;
42
+ lc() {
43
+ this.rc += 1;
44
44
  }
45
- Ih() {
46
- return this.Ah;
45
+ bc() {
46
+ return this.rc;
47
47
  }
48
48
  ct() {
49
- this.Ah = 0;
49
+ this.rc = 0;
50
50
  }
51
51
  }
@@ -0,0 +1,14 @@
1
+ export default class He {
2
+ constructor() {
3
+ this.ul = {};
4
+ }
5
+ yr(e, t) {
6
+ this.ul[e] = t;
7
+ }
8
+ lo(e) {
9
+ return this.ul[e] || null;
10
+ }
11
+ dl(e) {
12
+ return null != this.lo(e);
13
+ }
14
+ }