@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
@@ -1,4 +1,4 @@
1
- import { IamStrings as mr } from "../constants.js";
1
+ import { IamStrings as pr } from "../constants.js";
2
2
  export function removeAllVisibleInAppMessages() {
3
3
  const o = document.querySelectorAll(".ab-iam-root");
4
4
  for (let t = 0; t < o.length; t++) {
@@ -10,9 +10,9 @@ export function removeAllVisibleInAppMessages() {
10
10
  }
11
11
  s.parentNode && s.parentNode.removeChild(s);
12
12
  }
13
- const t = document.getElementsByClassName(mr.TE);
13
+ const t = document.getElementsByClassName(pr.TE);
14
14
  for (let o = 0; o < t.length; o++) {
15
15
  const s = t[o].classList;
16
- s.contains(mr.TE) && s.remove(mr.TE);
16
+ s.contains(pr.TE) && s.remove(pr.TE);
17
17
  }
18
18
  }
@@ -15,12 +15,12 @@ import { KeyCodes as le } from "../../util/key-codes.js";
15
15
  import { setupInAppMessageUI as rs } from "../../ui/js/index.js";
16
16
  import { logger as b } from "../../../shared-lib/index.js";
17
17
  import { toRgba as ae } from "../../util/color-utils.js";
18
- import { isIFrame as xt } from "../utils/in-app-message-utils.js";
18
+ import { isIFrame as Pt } from "../utils/in-app-message-utils.js";
19
19
  import he from "../../l10n/l10n-manager-factory.js";
20
20
  import {
21
- IamTiming as kt,
21
+ IamTiming as qt,
22
22
  IamClickAction as ce,
23
- IamDismissType as pr,
23
+ IamDismissType as cr,
24
24
  IamOrientation as be,
25
25
  IamSlideFrom as fe,
26
26
  IAM_SHOWING_CLASS as we,
@@ -38,7 +38,7 @@ export function showInAppMessage(e, t, s) {
38
38
  );
39
39
  if (!(e instanceof InAppMessage)) return !1;
40
40
  if (e.constructor === InAppMessage) return !1;
41
- e.uh();
41
+ e._h();
42
42
  const o = e instanceof HtmlMessage;
43
43
  if (o && !e.trusted && !r.dr())
44
44
  return (
@@ -56,8 +56,8 @@ export function showInAppMessage(e, t, s) {
56
56
  !1
57
57
  );
58
58
  }
59
- if (no.pa()) {
60
- const t = no.fa();
59
+ if (no.$a()) {
60
+ const t = no.Ua();
61
61
  if (
62
62
  (t === je.PORTRAIT && e.orientation === be.LANDSCAPE) ||
63
63
  (t === je.LANDSCAPE && e.orientation === be.PORTRAIT)
@@ -79,7 +79,10 @@ export function showInAppMessage(e, t, s) {
79
79
  for (let e = 0; e < s.length; e++)
80
80
  if (s[e].clickAction === ce.URI) {
81
81
  const o = s[e].uri;
82
- t = tt(o);
82
+ if (tt(o)) {
83
+ t = !0;
84
+ break;
85
+ }
83
86
  }
84
87
  } else e.clickAction === ce.URI && (t = tt(e.uri));
85
88
  if (t)
@@ -96,14 +99,14 @@ export function showInAppMessage(e, t, s) {
96
99
  e.zo() && (i.className += ` ${we}`),
97
100
  (i.className += me(e)),
98
101
  e.language && !o && (i.lang = e.language),
99
- e.ko() && (i.id = e.htmlId),
100
- r.er(U.ca) && (i.style.zIndex = (r.er(U.ca) + 1).toString()),
102
+ e.Eo() && (i.id = e.htmlId),
103
+ r.er(U.Ee) && (i.style.zIndex = (r.er(U.Ee) + 1).toString()),
101
104
  t.appendChild(i),
102
- e.Mo())
105
+ e.Oo())
103
106
  ) {
104
107
  const t = document.createElement("style");
105
108
  (t.innerHTML = e.css),
106
- (t.id = e.Co()),
109
+ (t.id = e.ko()),
107
110
  null != r.er(U.sr) && t.setAttribute("nonce", r.er(U.sr)),
108
111
  document.getElementsByTagName("head")[0].appendChild(t);
109
112
  }
@@ -115,18 +118,18 @@ export function showInAppMessage(e, t, s) {
115
118
  const s = document.createElement("div");
116
119
  if (
117
120
  ((s.className = "ab-page-blocker"),
118
- e.Mo() || (s.style.backgroundColor = ae(e.frameColor)),
119
- r.er(U.ca) && (s.style.zIndex = r.er(U.ca).toString()),
121
+ e.Oo() || (s.style.backgroundColor = ae(e.frameColor)),
122
+ r.er(U.Ee) && (s.style.zIndex = r.er(U.Ee).toString()),
120
123
  i.appendChild(s),
121
- !r.er(U.lh))
124
+ !r.er(U.Zh))
122
125
  ) {
123
126
  const o = new Date().valueOf();
124
127
  s.onclick = (s) => {
125
- new Date().valueOf() - o > kt.sE &&
128
+ new Date().valueOf() - o > qt.sE &&
126
129
  (e.tl(t), s.stopPropagation());
127
130
  };
128
131
  }
129
- i.appendChild(t), t.focus(), e.nh(i);
132
+ i.appendChild(t), t.focus(), e.Wh(i);
130
133
  } else if (n) {
131
134
  const s = document.querySelectorAll(".ab-slideup");
132
135
  let o = null;
@@ -147,16 +150,16 @@ export function showInAppMessage(e, t, s) {
147
150
  o.offsetTop),
148
151
  (t.style.bottom = Math.max(e, 0) + "px");
149
152
  }
150
- } else if (o && !r.er(U.lh)) {
153
+ } else if (o && !r.er(U.Zh)) {
151
154
  const s = e;
152
- xt(t) &&
155
+ Pt(t) &&
153
156
  t.contentWindow &&
154
157
  t.contentWindow.addEventListener("keydown", function (e) {
155
- e.keyCode === le.oh && s.closeMessage();
158
+ e.keyCode === le.Yh && s.closeMessage();
156
159
  });
157
160
  }
158
161
  logInAppMessageImpression(e),
159
- e.dismissType === pr.AUTO_DISMISS &&
162
+ e.dismissType === cr.AUTO_DISMISS &&
160
163
  setTimeout(() => {
161
164
  i.contains(t) && e.tl(t);
162
165
  }, e.duration),
@@ -165,11 +168,11 @@ export function showInAppMessage(e, t, s) {
165
168
  (e) => {
166
169
  b.info(e), i.parentNode && i.parentNode.removeChild(i);
167
170
  },
168
- r.er(U.da),
169
- r.er(U.ca),
171
+ r.er(U.Ja),
172
+ r.er(U.Ee),
170
173
  r.er(U.sr),
171
174
  t,
172
- he.ra().ga(),
175
+ he.ra().Ca(),
173
176
  );
174
- return (o || n) && (i.appendChild(a), e.nh(i)), !0;
177
+ return (o || n) && (i.appendChild(a), e.Wh(i)), !0;
175
178
  }
@@ -1,5 +1,5 @@
1
1
  import r from "../managers/braze-instance.js";
2
- import Dt from "./utils/push-utils.js";
2
+ import _t from "./utils/push-utils.js";
3
3
  export function isPushBlocked() {
4
- if (r.rr()) return Dt.isPushBlocked();
4
+ if (r.rr()) return _t.isPushBlocked();
5
5
  }
@@ -1,5 +1,5 @@
1
1
  import r from "../managers/braze-instance.js";
2
- import Dt from "./utils/push-utils.js";
2
+ import _t from "./utils/push-utils.js";
3
3
  export function isPushPermissionGranted() {
4
- if (r.rr()) return Dt.isPushPermissionGranted();
4
+ if (r.rr()) return _t.isPushPermissionGranted();
5
5
  }
@@ -1,5 +1,5 @@
1
1
  import r from "../managers/braze-instance.js";
2
- import Dt from "./utils/push-utils.js";
2
+ import _t from "./utils/push-utils.js";
3
3
  export function isPushSupported() {
4
- if (r.rr()) return Dt.isPushSupported();
4
+ if (r.rr()) return _t.isPushSupported();
5
5
  }
@@ -1,31 +1,31 @@
1
1
  import r, { OPTIONS as U } from "../managers/braze-instance.js";
2
2
  import na from "./push-manager.js";
3
- const ra = {
3
+ const ia = {
4
4
  i: !1,
5
5
  na: null,
6
6
  ra: () => (
7
- ra.t(),
8
- ra.na ||
9
- (ra.na = new na(
7
+ ia.t(),
8
+ ia.na ||
9
+ (ia.na = new na(
10
10
  r.zr(),
11
- r.ja(),
12
- r.ue(),
11
+ r.Fa(),
12
+ r.Ie(),
13
13
  r.ht(),
14
- r.er(U.za),
15
- r.er(U.ba),
16
- r.er(U.ha),
14
+ r.er(U.Ha),
15
+ r.er(U.Ka),
16
+ r.er(U.La),
17
17
  r.l(),
18
- r.er(U.wa),
19
- r.er(U.xa),
18
+ r.er(U.Na),
19
+ r.er(U.Oa),
20
20
  r.p(),
21
21
  )),
22
- ra.na
22
+ ia.na
23
23
  ),
24
24
  t: () => {
25
- ra.i || (r.g(ra), (ra.i = !0));
25
+ ia.i || (r.g(ia), (ia.i = !0));
26
26
  },
27
27
  destroy: () => {
28
- (ra.na = null), (ra.i = !1);
28
+ (ia.na = null), (ia.i = !1);
29
29
  },
30
30
  };
31
- export default ra;
31
+ export default ia;
@@ -4,7 +4,7 @@ import ui from "../models/push-token.js";
4
4
  import { User } from "../User/index.js";
5
5
  import { isArray as g, isEqual as hi } from "../util/code-utils.js";
6
6
  import { getErrorMessage as ci } from "../util/error-utils.js";
7
- import Dt from "./utils/push-utils.js";
7
+ import _t from "./utils/push-utils.js";
8
8
  export default class na {
9
9
  constructor(i, e, t, s, r, o, n, u, h, a, c) {
10
10
  (this.iu = i),
@@ -27,8 +27,8 @@ export default class na {
27
27
  (this.nu = h || !1),
28
28
  (this.uu = a || !1),
29
29
  (this.j = c),
30
- (this.au = Dt.cu()),
31
- (this.fu = Dt.du());
30
+ (this.au = _t.cu()),
31
+ (this.fu = _t.du());
32
32
  }
33
33
  lu() {
34
34
  return this.uu;
@@ -107,7 +107,7 @@ export default class na {
107
107
  {
108
108
  api_key: this.eu,
109
109
  device_id:
110
- (null === (r = this.tu) || void 0 === r ? void 0 : r.ve().id) ||
110
+ (null === (r = this.tu) || void 0 === r ? void 0 : r.Ye().id) ||
111
111
  "",
112
112
  },
113
113
  (e) => {
@@ -169,7 +169,7 @@ export default class na {
169
169
  this.mu(i, new Date(), t);
170
170
  })
171
171
  .catch((i) => {
172
- Dt.isPushBlocked()
172
+ _t.isPushBlocked()
173
173
  ? (b.info("Permission for push notifications was denied."),
174
174
  "function" == typeof s && s(!1))
175
175
  : (b.error("Push subscription failed: " + i),
@@ -197,7 +197,7 @@ export default class na {
197
197
  (i.unregister(), b.info("Service worker successfully unregistered."));
198
198
  }
199
199
  subscribe(i, e) {
200
- if (!Dt.isPushSupported())
200
+ if (!_t.isPushSupported())
201
201
  return b.info(na.Au), void ("function" == typeof e && e(!1));
202
202
  if (this.au) {
203
203
  if (!this.nu && null != window.location) {
@@ -207,7 +207,7 @@ export default class na {
207
207
  -1 === i.indexOf(window.location.protocol) &&
208
208
  (i = window.location.protocol + "//" + i);
209
209
  }
210
- if (Dt.isPushBlocked())
210
+ if (_t.isPushBlocked())
211
211
  return void this.Pu(
212
212
  "Notifications from this site are blocked. This may be a temporary embargo or a permanent denial.",
213
213
  e,
@@ -227,13 +227,13 @@ export default class na {
227
227
  },
228
228
  s = () => {
229
229
  let i = "Permission for push notifications was ignored.";
230
- Dt.isPushBlocked() &&
230
+ _t.isPushBlocked() &&
231
231
  (i +=
232
232
  " The browser has automatically blocked further permission requests for a period (probably 1 week)."),
233
233
  b.info(i),
234
234
  "function" == typeof e && e(!0);
235
235
  },
236
- r = Dt.isPushPermissionGranted(),
236
+ r = _t.isPushPermissionGranted(),
237
237
  o = () => {
238
238
  !r &&
239
239
  this.iu &&
@@ -256,10 +256,10 @@ export default class na {
256
256
  }
257
257
  }
258
258
  registerPush(i, e) {
259
- if (!Dt.isPushSupported())
259
+ if (!_t.isPushSupported())
260
260
  return b.info(na.Au), void ("function" == typeof e && e(!1));
261
261
  if (this.au) {
262
- if (Dt.isPushBlocked())
262
+ if (_t.isPushBlocked())
263
263
  return void this.Pu(
264
264
  "Notifications from this site are blocked. This may be a temporary embargo or a permanent denial.",
265
265
  e,
@@ -273,7 +273,7 @@ export default class na {
273
273
  this.registerPush(i, e);
274
274
  })
275
275
  );
276
- if (!Dt.isPushPermissionGranted())
276
+ if (!_t.isPushPermissionGranted())
277
277
  return void b.info(
278
278
  "Push permission has not been granted, so registerPush is a no-op. Call requestPushPermission to prompt the user for permission.",
279
279
  );
@@ -382,7 +382,7 @@ export default class na {
382
382
  });
383
383
  }
384
384
  unsubscribe(i, e) {
385
- if (!Dt.isPushSupported())
385
+ if (!_t.isPushSupported())
386
386
  return b.info(na.Au), void ("function" == typeof i && i());
387
387
  this.au
388
388
  ? navigator.serviceWorker.getRegistration(this.su).then((t) => {
@@ -1,8 +1,8 @@
1
1
  import r from "../managers/braze-instance.js";
2
- import ra from "./push-manager-factory.js";
2
+ import ia from "./push-manager-factory.js";
3
3
  export function registerPush(t, n) {
4
4
  if (r.rr())
5
- return ra.ra().registerPush((n, o, e) => {
5
+ return ia.ra().registerPush((n, o, e) => {
6
6
  const s = r.nn();
7
7
  s && s.requestImmediateDataFlush(), "function" == typeof t && t(n, o, e);
8
8
  }, n);
@@ -1,8 +1,8 @@
1
1
  import r from "../managers/braze-instance.js";
2
- import ra from "./push-manager-factory.js";
2
+ import ia from "./push-manager-factory.js";
3
3
  export function requestPushPermission(n, o) {
4
4
  if (r.rr())
5
- return ra.ra().subscribe((o, t, e) => {
5
+ return ia.ra().subscribe((o, t, e) => {
6
6
  const s = r.nn();
7
7
  s && s.requestImmediateDataFlush(), "function" == typeof n && n(o, t, e);
8
8
  }, o);
@@ -14,12 +14,12 @@ export function unregisterPushTokenOnServer() {
14
14
  if (!o.endpoint) return;
15
15
  const i = e.Z({}, !0);
16
16
  i.push_token = o.endpoint;
17
- const a = e.tt(i, h.it.ka);
17
+ const a = e.tt(i, h.it.Xa);
18
18
  e.et(
19
19
  i,
20
20
  (n = -1) => {
21
21
  r.rr() &&
22
- (h.nt(t, h.it.ka, new Date().valueOf()),
22
+ (h.nt(t, h.it.Xa, new Date().valueOf()),
23
23
  -1 !== n && a.push(["X-Braze-Req-Tokens-Remaining", n.toString()]),
24
24
  l.ot({
25
25
  url: `${e.ht()}/push/unregister`,
@@ -30,6 +30,6 @@ export function unregisterPushTokenOnServer() {
30
30
  },
31
31
  }));
32
32
  },
33
- h.it.ka,
33
+ h.it.Xa,
34
34
  );
35
35
  }
@@ -1,6 +1,6 @@
1
1
  import r from "../managers/braze-instance.js";
2
- import ra from "./push-manager-factory.js";
3
- import { unregisterPushTokenOnServer as gr } from "./unregister-push-token-on-server.js";
2
+ import ia from "./push-manager-factory.js";
3
+ import { unregisterPushTokenOnServer as hr } from "./unregister-push-token-on-server.js";
4
4
  export function unregisterPush(e, n) {
5
- if (r.rr()) return gr(), ra.ra().unsubscribe(e, n);
5
+ if (r.rr()) return hr(), ia.ra().unsubscribe(e, n);
6
6
  }
@@ -1,4 +1,4 @@
1
- const Dt = {
1
+ const _t = {
2
2
  cu: () =>
3
3
  "serviceWorker" in navigator &&
4
4
  "undefined" != typeof ServiceWorkerRegistration &&
@@ -9,38 +9,38 @@ const Dt = {
9
9
  "pushNotification" in window.safari &&
10
10
  "function" == typeof window.safari.pushNotification.permission &&
11
11
  "function" == typeof window.safari.pushNotification.requestPermission,
12
- isPushSupported: () => Dt.cu() || Dt.du(),
12
+ isPushSupported: () => _t.cu() || _t.du(),
13
13
  isPushBlocked: () => {
14
14
  const o =
15
- Dt.isPushSupported() &&
15
+ _t.isPushSupported() &&
16
16
  "Notification" in window &&
17
17
  null != window.Notification &&
18
18
  null != window.Notification.permission &&
19
19
  "denied" === window.Notification.permission,
20
20
  i =
21
- Dt.isPushSupported() &&
21
+ _t.isPushSupported() &&
22
22
  (!("Notification" in window) || null == window.Notification);
23
23
  return o || i;
24
24
  },
25
25
  isPushPermissionGranted: () =>
26
- Dt.isPushSupported() &&
26
+ _t.isPushSupported() &&
27
27
  "Notification" in window &&
28
28
  null != window.Notification &&
29
29
  null != window.Notification.permission &&
30
30
  "granted" === window.Notification.permission,
31
- Yn: () =>
32
- Dt.isPushBlocked()
33
- ? { Zn: !1, reason: "blocked" }
34
- : Dt.isPushSupported()
35
- ? Dt.isPushPermissionGranted()
36
- ? { Zn: !1, reason: "permissionGranted" }
37
- : { Zn: !0 }
38
- : { Zn: !1, reason: "unsupported" },
39
- So: (o, i) =>
31
+ va: () =>
32
+ _t.isPushBlocked()
33
+ ? { ba: !1, reason: "blocked" }
34
+ : _t.isPushSupported()
35
+ ? _t.isPushPermissionGranted()
36
+ ? { ba: !1, reason: "permissionGranted" }
37
+ : { ba: !0 }
38
+ : { ba: !1, reason: "unsupported" },
39
+ Ia: (o, i) =>
40
40
  "blocked" === o
41
41
  ? `${i} containing a push prompt is not being shown because the user has already declined push permission prompt.`
42
42
  : "unsupported" === o
43
43
  ? `${i} containing a push prompt is not being shown because the browser doesn't support push notifications.`
44
44
  : `${i} containing a push prompt is not being shown because the user has already accepted the permission prompt.`,
45
45
  };
46
- export default Dt;
46
+ export default _t;
@@ -1,10 +1,10 @@
1
- import _t from "../models/identifier.js";
2
- import { getByteLength as er } from "../util/string-utils.js";
1
+ import Ut from "../models/identifier.js";
2
+ import { getByteLength as sr } from "../util/string-utils.js";
3
3
  import ui from "../models/push-token.js";
4
4
  import { logger as b, IndexedDBAdapter as et } from "../../shared-lib/index.js";
5
5
  import { STORAGE_KEYS as s } from "../managers/storage-manager.js";
6
6
  import { User } from "../User/index.js";
7
- export default class Ut {
7
+ export default class Nt {
8
8
  constructor(t, s) {
9
9
  (this.h = t), (this.j = s), (this.h = t), (this.j = s);
10
10
  }
@@ -12,16 +12,16 @@ export default class Ut {
12
12
  const t = this.j.$u(s.Ou.Cu);
13
13
  if (null == t) return null;
14
14
  let i = t.Iu,
15
- e = er(i);
16
- if (e > User.br) {
17
- for (; e > User.br; ) (i = i.slice(0, i.length - 1)), (e = er(i));
15
+ e = sr(i);
16
+ if (e > User.Ur) {
17
+ for (; e > User.Ur; ) (i = i.slice(0, i.length - 1)), (e = sr(i));
18
18
  (t.Iu = i), this.j.Ju(s.Ou.Cu, t);
19
19
  }
20
20
  return i;
21
21
  }
22
22
  Lu(t) {
23
23
  const i = null == this.getUserId();
24
- this.j.Ju(s.Ou.Cu, new _t(t)), i && this.j.qu(t);
24
+ this.j.Ju(s.Ou.Cu, new Ut(t)), i && this.j.qu(t);
25
25
  }
26
26
  setCustomUserAttribute(t, s) {
27
27
  if (this.h.zu(t))
@@ -55,7 +55,7 @@ export default class Ut {
55
55
  const r = et._s.Xs,
56
56
  h = new et(r, b),
57
57
  n = new ui(t, i, e, u, o);
58
- this.j.Pt(s.It.xu, n.qt()), h.setItem(r.Ws.Gu, r.be, !0);
58
+ this.j.Pt(s.It.xu, n.qt()), h.setItem(r.Ws.Gu, r.ze, !0);
59
59
  }
60
60
  wu(t) {
61
61
  if (
@@ -67,7 +67,7 @@ export default class Ut {
67
67
  ) {
68
68
  const t = et._s.Xs,
69
69
  i = new et(t, b);
70
- this.j.Pt(s.It.xu, !1), i.setItem(t.Ws.Gu, t.be, !1);
70
+ this.j.Pt(s.It.xu, !1), i.setItem(t.Ws.Gu, t.ze, !1);
71
71
  }
72
72
  }
73
73
  }