@braze/web-sdk 4.7.2 → 4.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 (161) hide show
  1. package/index.d.ts +27 -24
  2. package/package.json +1 -1
  3. package/shared-lib/braze-shared-lib.js +5 -5
  4. package/shared-lib/encoding-utils.js +1 -1
  5. package/shared-lib/event-types.js +24 -24
  6. package/shared-lib/guid.js +3 -3
  7. package/shared-lib/indexed-db-adapter.js +17 -17
  8. package/shared-lib/logger.js +18 -18
  9. package/shared-lib/supported-options.js +18 -18
  10. package/src/Card/card-manager-factory.js +2 -2
  11. package/src/Card/card-manager.js +47 -41
  12. package/src/Card/display/card-display.js +70 -67
  13. package/src/Card/log-card-click.js +1 -1
  14. package/src/Card/log-card-dismissal.js +1 -1
  15. package/src/Card/log-card-impressions.js +3 -3
  16. package/src/Card/models/banner.js +3 -2
  17. package/src/Card/models/captioned-image.js +6 -5
  18. package/src/Card/models/card.js +107 -87
  19. package/src/Card/models/classic-card.js +5 -5
  20. package/src/Card/models/control-card.js +5 -21
  21. package/src/Card/types.js +1 -0
  22. package/src/Card/util/card-factory.js +32 -32
  23. package/src/ContentCards/content-cards-provider-factory.js +3 -3
  24. package/src/ContentCards/content-cards-provider.js +283 -175
  25. package/src/ContentCards/content-cards.js +2 -2
  26. package/src/ContentCards/get-cached-content-cards.js +1 -1
  27. package/src/ContentCards/log-content-cards-displayed.js +2 -2
  28. package/src/ContentCards/request-content-cards-refresh.js +1 -1
  29. package/src/ContentCards/subscribe-to-content-cards-updates.js +9 -6
  30. package/src/ContentCards/types.js +1 -0
  31. package/src/ContentCards/ui/hide-content-cards.js +2 -2
  32. package/src/ContentCards/ui/show-content-cards.js +35 -33
  33. package/src/Core/add-sdk-metadata.js +17 -18
  34. package/src/Core/change-user.js +12 -14
  35. package/src/Core/destroy.js +1 -1
  36. package/src/Core/disable-sdk.js +7 -6
  37. package/src/Core/enable-sdk.js +4 -4
  38. package/src/Core/get-device-id.js +7 -6
  39. package/src/Core/get-user.js +1 -1
  40. package/src/Core/handle-braze-action.js +57 -40
  41. package/src/Core/is-disabled.js +2 -2
  42. package/src/Core/log-custom-event.js +22 -15
  43. package/src/Core/log-purchase.js +33 -33
  44. package/src/Core/open-session.js +17 -15
  45. package/src/Core/request-immediate-data-flush.js +4 -2
  46. package/src/Core/set-logger.js +1 -1
  47. package/src/Core/set-sdk-authentication-signature.js +5 -6
  48. package/src/Core/subscribe-to-sdk-authentication-failures.js +3 -1
  49. package/src/Core/toggle-logging.js +1 -1
  50. package/src/Core/types.js +1 -0
  51. package/src/Core/wipe-data.js +11 -10
  52. package/src/FeatureFlags/feature-flag-factory.js +6 -6
  53. package/src/FeatureFlags/feature-flag.js +17 -17
  54. package/src/FeatureFlags/feature-flags-provider-factory.js +2 -2
  55. package/src/FeatureFlags/feature-flags-provider.js +67 -65
  56. package/src/FeatureFlags/get-all-feature-flags.js +3 -3
  57. package/src/FeatureFlags/get-feature-flag.js +4 -4
  58. package/src/FeatureFlags/subscribe-to-feature-flags-updates.js +4 -1
  59. package/src/Feed/feed-provider-factory.js +8 -8
  60. package/src/Feed/feed-provider.js +57 -46
  61. package/src/Feed/feed.js +1 -1
  62. package/src/Feed/get-cached-feed.js +2 -2
  63. package/src/Feed/log-feed-displayed.js +3 -1
  64. package/src/Feed/request-feed-refresh.js +2 -2
  65. package/src/Feed/subscribe-to-feed-updates.js +2 -2
  66. package/src/Feed/types.js +1 -0
  67. package/src/Feed/ui/hide-feed.js +2 -2
  68. package/src/Feed/ui/show-feed.js +40 -36
  69. package/src/InAppMessage/display/html-message-to-html.js +125 -119
  70. package/src/InAppMessage/display/in-app-message-to-html.js +72 -69
  71. package/src/InAppMessage/display/modal-utils.js +18 -13
  72. package/src/InAppMessage/in-app-message-factory.js +9 -8
  73. package/src/InAppMessage/in-app-message-manager-factory.js +7 -7
  74. package/src/InAppMessage/in-app-message-manager.js +122 -108
  75. package/src/InAppMessage/log-in-app-message-button-click.js +10 -10
  76. package/src/InAppMessage/log-in-app-message-click.js +9 -9
  77. package/src/InAppMessage/log-in-app-message-html-click.js +10 -10
  78. package/src/InAppMessage/log-in-app-message-impression.js +5 -5
  79. package/src/InAppMessage/models/control-message.js +4 -1
  80. package/src/InAppMessage/models/full-screen-message.js +35 -37
  81. package/src/InAppMessage/models/html-message.js +34 -33
  82. package/src/InAppMessage/models/in-app-message-button.js +23 -16
  83. package/src/InAppMessage/models/in-app-message.js +147 -105
  84. package/src/InAppMessage/models/modal-message.js +34 -36
  85. package/src/InAppMessage/models/slide-up-message.js +25 -27
  86. package/src/InAppMessage/models/templated-in-app-message.js +12 -7
  87. package/src/InAppMessage/subscribe-to-in-app-message.js +2 -2
  88. package/src/InAppMessage/types.js +1 -0
  89. package/src/InAppMessage/ui/automatically-show-in-app-messages.js +4 -4
  90. package/src/InAppMessage/ui/show-in-app-message.js +95 -89
  91. package/src/InAppMessage/utils/in-app-message-utils.js +1 -0
  92. package/src/Push/is-push-blocked.js +2 -2
  93. package/src/Push/is-push-permission-granted.js +2 -2
  94. package/src/Push/is-push-supported.js +2 -2
  95. package/src/Push/push-manager-factory.js +20 -20
  96. package/src/Push/push-manager.js +192 -174
  97. package/src/Push/request-push-permission.js +4 -3
  98. package/src/Push/types.js +1 -0
  99. package/src/Push/unregister-push.js +2 -2
  100. package/src/Push/utils/push-utils.js +10 -10
  101. package/src/User/types.js +1 -0
  102. package/src/User/user-manager.js +24 -24
  103. package/src/User/user.js +117 -105
  104. package/src/common/base-feed.js +7 -7
  105. package/src/common/base-provider.js +2 -2
  106. package/src/common/constants.js +6 -0
  107. package/src/common/event-logger.js +6 -6
  108. package/src/common/feed-display.js +18 -18
  109. package/src/common/types.js +1 -0
  110. package/src/l10n/l10n-manager-factory.js +5 -5
  111. package/src/l10n/l10n-manager.js +1 -1
  112. package/src/managers/auth-manager.js +32 -32
  113. package/src/managers/braze-instance.js +202 -202
  114. package/src/managers/device-manager.js +23 -23
  115. package/src/managers/network-manager.js +96 -82
  116. package/src/managers/server-config-manager.js +60 -42
  117. package/src/managers/session-manager.js +41 -41
  118. package/src/managers/storage-manager-factory.js +15 -15
  119. package/src/managers/storage-manager.js +163 -160
  120. package/src/managers/subscription-manager.js +11 -11
  121. package/src/models/backend-errors.js +5 -5
  122. package/src/models/braze-event.js +7 -7
  123. package/src/models/device.js +2 -2
  124. package/src/models/identifier.js +7 -7
  125. package/src/models/push-token.js +7 -7
  126. package/src/models/request-result.js +3 -3
  127. package/src/models/server-config.js +20 -20
  128. package/src/request-controller.js +176 -174
  129. package/src/triggers/models/custom-event-data.js +6 -6
  130. package/src/triggers/models/custom-event-property-data.js +9 -9
  131. package/src/triggers/models/filter-set.js +9 -9
  132. package/src/triggers/models/filter.js +64 -64
  133. package/src/triggers/models/in-app-message-click-data.js +12 -12
  134. package/src/triggers/models/purchase-data.js +3 -3
  135. package/src/triggers/models/purchase-property-data.js +9 -9
  136. package/src/triggers/models/push-click-data.js +5 -5
  137. package/src/triggers/models/trigger-condition.js +52 -52
  138. package/src/triggers/models/trigger-events.js +2 -2
  139. package/src/triggers/models/trigger.js +36 -36
  140. package/src/triggers/triggers-provider-factory.js +8 -8
  141. package/src/triggers/triggers-provider.js +165 -162
  142. package/src/types.js +1 -0
  143. package/src/ui/js/attach-css.js +3 -3
  144. package/src/ui/js/load-font-awesome.js +2 -2
  145. package/src/util/base-device-parser.js +1 -1
  146. package/src/util/braze-actions.js +20 -20
  147. package/src/util/browser-detector.js +22 -22
  148. package/src/util/client-hints-parser.js +6 -6
  149. package/src/util/code-utils.js +1 -1
  150. package/src/util/color-utils.js +2 -2
  151. package/src/util/component-utils.js +2 -2
  152. package/src/util/deprecation-utils.js +1 -1
  153. package/src/util/device-constants.js +5 -5
  154. package/src/util/dom-utils.js +2 -2
  155. package/src/util/key-codes.js +1 -1
  156. package/src/util/net.js +11 -11
  157. package/src/util/request-header-utils.js +23 -0
  158. package/src/util/string-utils.js +1 -1
  159. package/src/util/user-agent-parser.js +20 -20
  160. package/src/util/validation-utils.js +44 -44
  161. package/src/util/window-utils.js +3 -3
package/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Type definitions for @braze/web-sdk v4.7.2
2
+ * Type definitions for @braze/web-sdk v4.8.0
3
3
  * Project: https://github.com/braze-inc/braze-web-sdk
4
4
  * (c) Braze, Inc. 2023 - http://braze.com
5
5
  * License available at https://github.com/braze-inc/braze-web-sdk/blob/master/LICENSE
@@ -88,9 +88,9 @@
88
88
  * no arguments when this card records a click.
89
89
  *
90
90
  * @returns The identifier of the subscription created. This can be passed to `Card.removeSubscription`
91
- * to cancel the subscription.
91
+ * to cancel the subscription. Returns null if the subscriber passed is not a function.
92
92
  */
93
- subscribeToClickedEvent(subscriber: () => void): string;
93
+ subscribeToClickedEvent(subscriber: () => void): string | null;
94
94
 
95
95
  /**
96
96
  * Subscribe to receive dismissed events. The subscriber callback will be called whenever this card is dismissed by the
@@ -100,9 +100,9 @@
100
100
  * no arguments when this card records a dismissal.
101
101
  *
102
102
  * @returns The identifier of the subscription created. This can be passed to `Card.removeSubscription`
103
- * to cancel the subscription.
103
+ * to cancel the subscription. Returns null if the subscriber passed is not a function.
104
104
  */
105
- subscribeToDismissedEvent(subscriber: () => void): string;
105
+ subscribeToDismissedEvent(subscriber: () => void): string | null;
106
106
 
107
107
  /** The id of the card. This will be reported back to Braze with events for analytics purposes. */
108
108
  id?: string;
@@ -473,7 +473,7 @@
473
473
  triggerId?: string;
474
474
 
475
475
  /** Object of string/string key/value pairs. */
476
- extras: Record<string, any>;
476
+ extras: Record<string, string>;
477
477
 
478
478
  /** Whether this message is a ControlMessage. */
479
479
  isControl: boolean;
@@ -562,7 +562,7 @@
562
562
  message?: string;
563
563
 
564
564
  /** Object of string/string key/value pairs. */
565
- extras: Record<string, any>;
565
+ extras: Record<string, string>;
566
566
 
567
567
  /**
568
568
  * The id of the trigger that created this message. The SDK will report back this to
@@ -625,9 +625,9 @@
625
625
  * no arguments when this message records a click.
626
626
  *
627
627
  * @returns The identifier of the subscription created. This can be passed to `removeSubscription`
628
- * to cancel the subscription.
628
+ * to cancel the subscription. Returns null if the subscriber passed is not a function.
629
629
  */
630
- subscribeToClickedEvent(subscriber: () => void): string;
630
+ subscribeToClickedEvent(subscriber: () => void): string | null;
631
631
 
632
632
  /**
633
633
  * Subscribe to receive dismissed events. The subscriber callback will be called whenever this message is closed
@@ -637,9 +637,9 @@
637
637
  * no arguments when this message records a dismissal.
638
638
  *
639
639
  * @returns The identifier of the subscription created. This can be passed to `removeSubscription`
640
- * to cancel the subscription.
640
+ * to cancel the subscription. Returns null if the subscriber passed is not a function.
641
641
  */
642
- subscribeToDismissedEvent(subscriber: () => void): string;
642
+ subscribeToDismissedEvent(subscriber: () => void): string | null;
643
643
 
644
644
 
645
645
  }
@@ -698,7 +698,7 @@
698
698
  constructor(
699
699
  message?: string,
700
700
  messageAlignment?: TextAlignment,
701
- extras?: Record<string, any>,
701
+ extras?: Record<string, string>,
702
702
  triggerId?: string,
703
703
  clickAction?: ClickAction,
704
704
  uri?: string,
@@ -857,7 +857,7 @@
857
857
  constructor(
858
858
  message?: string,
859
859
  messageAlignment?: TextAlignment,
860
- extras?: Record<string, any>,
860
+ extras?: Record<string, string>,
861
861
  triggerId?: string,
862
862
  clickAction?: ClickAction,
863
863
  uri?: string,
@@ -980,7 +980,7 @@
980
980
  */
981
981
  constructor(
982
982
  message: string,
983
- extras?: Record<string, any>,
983
+ extras?: Record<string, string>,
984
984
  triggerId?: string,
985
985
  dismissType?: DismissType,
986
986
  duration?: number,
@@ -1047,7 +1047,7 @@
1047
1047
  message: string,
1048
1048
  messageAlignment?: TextAlignment,
1049
1049
  slideFrom?: SlideFrom,
1050
- extras?: Record<string, any>,
1050
+ extras?: Record<string, string>,
1051
1051
  triggerId?: string,
1052
1052
  clickAction?: ClickAction,
1053
1053
  uri?: string,
@@ -1496,9 +1496,9 @@
1496
1496
  * no arguments when this button records a click.
1497
1497
  *
1498
1498
  * @returns The identifier of the subscription created. This can be passed to `removeSubscription`
1499
- * to cancel the subscription.
1499
+ * to cancel the subscription. Returns null if the subscriber passed is not a function.
1500
1500
  */
1501
- subscribeToClickedEvent(subscriber: () => void): string;
1501
+ subscribeToClickedEvent(subscriber: () => void): string | null;
1502
1502
  }
1503
1503
 
1504
1504
  export interface FeatureFlagStringProperty {
@@ -1842,7 +1842,7 @@
1842
1842
  ): boolean;
1843
1843
 
1844
1844
  /**
1845
- * A convenience method to log that the user saw the given Content Cards. This method is equivalent to
1845
+ * A convenient method to log that the user saw the given Content Cards. This method is equivalent to
1846
1846
  * calling [`logCardImpressions` method with `forContentCards` param set to true.
1847
1847
  * This is done automatically when you use Braze's display module and should only be called
1848
1848
  * if you're bypassing that and manually building the DOM for displaying content cards in
@@ -2005,7 +2005,7 @@
2005
2005
  * - Create a `service-worker.js` file with the content below and place it in the root directory of your website:
2006
2006
  *
2007
2007
  * ```
2008
- * self.importScripts('https://js.appboycdn.com/web-sdk-develop/4.7/service-worker.js');
2008
+ * self.importScripts('https://js.appboycdn.com/web-sdk-develop/4.8/service-worker.js');
2009
2009
  * ```
2010
2010
  *
2011
2011
  * For more details, see [Our Product Documentation](https://www.braze.com/docs/developer_guide/platform_integration_guides/web/push_notifications/integration).
@@ -2138,10 +2138,11 @@
2138
2138
  * regardless of whether new cards are available, you should use the `successCallback` of `requestContentCardsRefresh`.
2139
2139
  *
2140
2140
  * @returns The identifier of the subscription created. This can be passed to `removeSubscription` to cancel the subscription.
2141
+ * Returns undefined if the SDK has not been initialized.
2141
2142
  */
2142
2143
  export function subscribeToContentCardsUpdates(
2143
2144
  subscriber: (cards: ContentCards) => void
2144
- ): string;
2145
+ ): string | undefined;
2145
2146
 
2146
2147
  /**
2147
2148
  * Subscribe to news feed updates. The subscriber callback will be called whenever the news feed is updated.
@@ -2245,15 +2246,17 @@
2245
2246
  * Subscribe to feature flag updates. The subscriber callback will be called whenever feature flags are updated. This method
2246
2247
  * should be called before calling `openSession`.
2247
2248
  *
2248
- * @param subscriber - The callback function to handle new feature flags. This function will be called with a list of `FeatureFlag`
2249
- * objects, including all feature flags currently available. If you want to be notified when a refresh has completed
2249
+ * @param subscriber - The callback function to handle new feature flags. This function is always called first with the
2250
+ * available cached list of `FeatureFlag` objects, and will also be called when feature flag updates are available.
2251
+ * If you want to be notified when a refresh has completed
2250
2252
  * regardless of whether new feature flags are available, you should use the `successCallback` of `refreshFeatureFlags`.
2251
2253
  *
2252
2254
  * @returns The identifier of the subscription created. This can be passed to `removeSubscription` to cancel the subscription.
2255
+ * Returns undefined if the SDK has not been initialized.
2253
2256
  */
2254
2257
  export function subscribeToFeatureFlagsUpdates(
2255
2258
  subscriber: (featureFlags: FeatureFlag[]) => void
2256
- ): string;
2259
+ ): string | undefined;
2257
2260
 
2258
2261
  /**
2259
2262
  * Gets all available feature flags.
@@ -2358,7 +2361,7 @@
2358
2361
  * lifecycle of, set this option to true and the Braze SDK will not register or unregister a service worker. If you set this
2359
2362
  * option to true, in order for push to function correctly you must register the service worker yourself BEFORE calling
2360
2363
  * `requestPushPermission`, and ensure that it contains Braze's service worker code, either with
2361
- * `self.importScripts('https://js.appboycdn.com/web-sdk-develop/4.7/service-worker.js');` or by including the content
2364
+ * `self.importScripts('https://js.appboycdn.com/web-sdk-develop/4.8/service-worker.js');` or by including the content
2362
2365
  * of that file directly. When this option is true, the `serviceWorkerLocation` option is irrelevant and is ignored.
2363
2366
  */
2364
2367
  manageServiceWorkerExternally?: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@braze/web-sdk",
3
- "version": "4.7.2",
3
+ "version": "4.8.0",
4
4
  "description": "Braze SDK for web sites and other JS platforms.",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -1,8 +1,8 @@
1
1
  import je from "./encoding-utils.js";
2
2
  import { EventTypes as ve, InternalEventTypes as De } from "./event-types.js";
3
- import Be from "./guid.js";
4
- import Ae from "./indexed-db-adapter.js";
5
- import Ge from "./logger.js";
6
- import Ue from "./supported-options.js";
7
- const r = { yn: je, A: ve, Ar: De, it: Be, qt: Ae, xt: Ae.ep, D: Ge, Fo: Ue };
3
+ import Ie from "./guid.js";
4
+ import Be from "./indexed-db-adapter.js";
5
+ import Ae from "./logger.js";
6
+ import Ge from "./supported-options.js";
7
+ const r = { _n: je, q: ve, Cr: De, Z: Ie, xt: Be, zt: Be.ep, j: Ae, Jo: Ge };
8
8
  export default r;
@@ -1,5 +1,5 @@
1
1
  const je = {
2
- wn: function(t) {
2
+ Wn: function(t) {
3
3
  const r = (t + "=".repeat((4 - (t.length % 4)) % 4))
4
4
  .replace(/\-/g, "+")
5
5
  .replace(/_/g, "/"),
@@ -1,33 +1,33 @@
1
1
  const ve = {
2
2
  CustomEvent: "ce",
3
3
  Pr: "p",
4
- Ol: "pc",
4
+ Rl: "pc",
5
5
  cc: "ca",
6
- Aa: "i",
7
- qs: "ie",
8
- T: "cci",
9
- W: "ccic",
10
- _: "ccc",
11
- L: "ccd",
12
- yh: "ss",
13
- wh: "se",
14
- Mi: "si",
6
+ ya: "i",
7
+ Is: "ie",
8
+ P: "cci",
9
+ T: "ccic",
10
+ $: "ccc",
11
+ H: "ccd",
12
+ Vh: "ss",
13
+ Fh: "se",
14
+ _i: "si",
15
15
  Ii: "sc",
16
- Ai: "sbc",
16
+ Mi: "sbc",
17
17
  Ze: "sfe",
18
18
  ro: "iec",
19
- Nl: "lr",
20
- Ml: "uae",
21
- U: "ci",
22
- F: "cc",
23
- xl: "lcaa",
24
- Ul: "lcar",
25
- Fn: "inc",
26
- Un: "add",
27
- En: "rem",
28
- Sn: "set",
29
- An: "ncam",
30
- Jl: "sgu"
19
+ Pl: "lr",
20
+ Ll: "uae",
21
+ R: "ci",
22
+ B: "cc",
23
+ Nl: "lcaa",
24
+ Ml: "lcar",
25
+ Rn: "inc",
26
+ Bn: "add",
27
+ Ln: "rem",
28
+ Fn: "set",
29
+ $n: "ncam",
30
+ Ol: "sgu"
31
31
  },
32
- De = { qr: "feed_displayed", dc: "content_cards_displayed" };
32
+ De = { Ar: "feed_displayed", dc: "content_cards_displayed" };
33
33
  export { ve as EventTypes, De as InternalEventTypes };
@@ -1,5 +1,5 @@
1
- const Be = {
2
- nt: () => {
1
+ const Ie = {
2
+ Y: () => {
3
3
  const t = t => {
4
4
  const e = (Math.random().toString(16) + "000000000").substr(2, 8);
5
5
  return t ? "-" + e.substr(0, 4) + "-" + e.substr(4, 4) : e;
@@ -7,4 +7,4 @@ const Be = {
7
7
  return t() + t(!0) + t(!0) + t();
8
8
  }
9
9
  };
10
- export default Be;
10
+ export default Ie;
@@ -1,4 +1,4 @@
1
- export default class Ae {
1
+ export default class Be {
2
2
  constructor(t, e) {
3
3
  (this.td = "undefined" == typeof window ? self : window),
4
4
  (this.ed = t),
@@ -47,10 +47,10 @@ export default class Ae {
47
47
  "Upgrading indexedDB " + o.ed.dd + " to v" + o.ed.VERSION + "..."
48
48
  );
49
49
  const e = t.target.result;
50
- for (const t in o.ed.$t)
51
- o.ed.$t.hasOwnProperty(t) &&
52
- !e.objectStoreNames.contains(o.ed.$t[t]) &&
53
- e.createObjectStore(o.ed.$t[t]);
50
+ for (const t in o.ed.Jt)
51
+ o.ed.Jt.hasOwnProperty(t) &&
52
+ !e.objectStoreNames.contains(o.ed.Jt[t]) &&
53
+ e.createObjectStore(o.ed.Jt[t]);
54
54
  }),
55
55
  (n.onsuccess = n => {
56
56
  const i = n.target.result;
@@ -223,7 +223,7 @@ export default class Ae {
223
223
  };
224
224
  });
225
225
  }
226
- Jt(t, e) {
226
+ Mt(t, e) {
227
227
  if (!this.rd()) return !1;
228
228
  const n = this;
229
229
  return this.sd(o => {
@@ -274,10 +274,10 @@ export default class Ae {
274
274
  clearData() {
275
275
  if (!this.rd()) return !1;
276
276
  const t = [];
277
- for (const e in this.ed.$t)
278
- this.ed.$t.hasOwnProperty(e) &&
279
- this.ed.$t[e] !== this.ed.$t.oe &&
280
- t.push(this.ed.$t[e]);
277
+ for (const e in this.ed.Jt)
278
+ this.ed.Jt.hasOwnProperty(e) &&
279
+ this.ed.Jt[e] !== this.ed.Jt.oe &&
280
+ t.push(this.ed.Jt[e]);
281
281
  const e = this;
282
282
  return this.sd(function(n) {
283
283
  const o = n.transaction(t, "readwrite");
@@ -296,19 +296,19 @@ export default class Ae {
296
296
  });
297
297
  }
298
298
  }
299
- Ae.ep = {
299
+ Be.ep = {
300
300
  Ft: {
301
301
  dd: "AppboyServiceWorkerAsyncStorage",
302
302
  VERSION: 6,
303
- $t: {
304
- Il: "data",
305
- jr: "pushClicks",
303
+ Jt: {
304
+ Xa: "data",
305
+ kr: "pushClicks",
306
306
  cu: "pushSubscribed",
307
307
  ud: "fallbackDevice",
308
- Mt: "cardUpdates",
308
+ qt: "cardUpdates",
309
309
  oe: "optOut",
310
- $r: "pendingData",
311
- Mn: "sdkAuthenticationSignature"
310
+ yr: "pendingData",
311
+ gu: "sdkAuthenticationSignature"
312
312
  },
313
313
  se: 1
314
314
  }
@@ -1,38 +1,38 @@
1
- const Ge = {
1
+ const Ae = {
2
2
  init: function(n) {
3
- (void 0 === n && void 0 !== Ge.zg) || (Ge.zg = !!n), Ge.Eg || (Ge.Eg = !0);
3
+ (void 0 === n && void 0 !== Ae.zg) || (Ae.zg = !!n), Ae.Eg || (Ae.Eg = !0);
4
4
  },
5
5
  destroy: function() {
6
- (Ge.Eg = !1), (Ge.zg = void 0), (Ge.nd = void 0);
6
+ (Ae.Eg = !1), (Ae.zg = void 0), (Ae.nd = void 0);
7
7
  },
8
8
  setLogger: function(n) {
9
9
  "function" == typeof n
10
- ? (Ge.init(), (Ge.nd = n))
11
- : Ge.info("Ignoring setLogger call since logger is not a function");
10
+ ? (Ae.init(), (Ae.nd = n))
11
+ : Ae.info("Ignoring setLogger call since logger is not a function");
12
12
  },
13
13
  toggleLogging: function() {
14
- Ge.init(),
15
- Ge.zg
16
- ? (console.log("Disabling Braze logging"), (Ge.zg = !1))
17
- : (console.log("Enabled Braze logging"), (Ge.zg = !0));
14
+ Ae.init(),
15
+ Ae.zg
16
+ ? (console.log("Disabling Braze logging"), (Ae.zg = !1))
17
+ : (console.log("Enabled Braze logging"), (Ae.zg = !0));
18
18
  },
19
19
  info: function(n) {
20
- if (Ge.zg) {
20
+ if (Ae.zg) {
21
21
  const o = "Braze: " + n;
22
- null != Ge.nd ? Ge.nd(o) : console.log(o);
22
+ null != Ae.nd ? Ae.nd(o) : console.log(o);
23
23
  }
24
24
  },
25
25
  warn: function(n) {
26
- if (Ge.zg) {
27
- const o = "Braze SDK Warning: " + n + " (v4.7.2)";
28
- null != Ge.nd ? Ge.nd(o) : console.warn(o);
26
+ if (Ae.zg) {
27
+ const o = "Braze SDK Warning: " + n + " (v4.8.0)";
28
+ null != Ae.nd ? Ae.nd(o) : console.warn(o);
29
29
  }
30
30
  },
31
31
  error: function(n) {
32
- if (Ge.zg) {
33
- const o = "Braze SDK Error: " + n + " (v4.7.2)";
34
- null != Ge.nd ? Ge.nd(o) : console.error(o);
32
+ if (Ae.zg) {
33
+ const o = "Braze SDK Error: " + n + " (v4.8.0)";
34
+ null != Ae.nd ? Ae.nd(o) : console.error(o);
35
35
  }
36
36
  }
37
37
  };
38
- export default Ge;
38
+ export default Ae;
@@ -1,26 +1,26 @@
1
1
  export default {
2
- Yn: "allowCrawlerActivity",
3
- Xn: "baseUrl",
4
- Zn: "noCookies",
5
- ho: "devicePropertyAllowlist",
2
+ ho: "allowCrawlerActivity",
3
+ Eo: "baseUrl",
4
+ _o: "noCookies",
5
+ Io: "devicePropertyAllowlist",
6
6
  ia: "disablePushTokenMaintenance",
7
- po: "enableLogging",
8
- Eo: "enableSdkAuthentication",
7
+ Ao: "enableLogging",
8
+ So: "enableSdkAuthentication",
9
9
  ta: "manageServiceWorkerExternally",
10
- _o: "minimumIntervalBetweenTriggerActionsInSeconds",
11
- Io: "sessionTimeoutInSeconds",
12
- Ao: "appVersion",
10
+ No: "minimumIntervalBetweenTriggerActionsInSeconds",
11
+ wo: "sessionTimeoutInSeconds",
12
+ To: "appVersion",
13
13
  na: "serviceWorkerLocation",
14
14
  ra: "safariWebsitePushId",
15
- jn: "localization",
16
- ao: "contentSecurityNonce",
17
- So: "enableHtmlInAppMessages",
18
- No: "allowUserSuppliedJavascript",
19
- no: "inAppMessageZIndex",
20
- lo: "openInAppMessagesInNewTab",
15
+ Mn: "localization",
16
+ lo: "contentSecurityNonce",
17
+ Oo: "enableHtmlInAppMessages",
18
+ Co: "allowUserSuppliedJavascript",
19
+ mo: "inAppMessageZIndex",
20
+ po: "openInAppMessagesInNewTab",
21
21
  en: "openNewsFeedCardsInNewTab",
22
- Ih: "requireExplicitInAppMessageDismissal",
23
- wo: "doNotLoadFontAwesome",
24
- To: "sdkFlavor",
22
+ Lh: "requireExplicitInAppMessageDismissal",
23
+ Lo: "doNotLoadFontAwesome",
24
+ Po: "sdkFlavor",
25
25
  tn: "openCardsInNewTab"
26
26
  };
@@ -3,9 +3,9 @@ import e from "../managers/braze-instance.js";
3
3
  const n = {
4
4
  t: !1,
5
5
  i: null,
6
- m: () => (n.o(), n.i || (n.i = new a(e.l(), e.g(), e.p())), n.i),
6
+ m: () => (n.o(), n.i || (n.i = new a(e.l())), n.i),
7
7
  o: () => {
8
- n.t || (e.u(n), (n.t = !0));
8
+ n.t || (e.g(n), (n.t = !0));
9
9
  },
10
10
  destroy: () => {
11
11
  (n.i = null), (n.t = !1);
@@ -2,71 +2,77 @@ import { ControlCard } from "./models/index.js";
2
2
  import s from "../common/event-logger.js";
3
3
  import t from "../models/request-result.js";
4
4
  import r from "../../shared-lib/braze-shared-lib.js";
5
- import { STORAGE_KEYS as o } from "../managers/storage-manager.js";
5
+ import { STORAGE_KEYS as i } from "../managers/storage-manager.js";
6
6
  export default class a {
7
- constructor(s, t, r) {
8
- (this.h = s), (this.j = t), (this.v = r);
7
+ constructor(s) {
8
+ (this.u = s), (this.u = s);
9
9
  }
10
- C(n, i) {
10
+ h(n, o) {
11
11
  const e = new t();
12
- if ((n.k(), null == n.url || "" === n.url))
12
+ if ((n.p(), null == n.url || "" === n.url))
13
13
  return (
14
- r.D.info(
14
+ r.j.info(
15
15
  `Card ${n.id} has no url. Not logging click to Braze servers.`
16
16
  ),
17
17
  e
18
18
  );
19
- if (i) {
20
- const s = this.h.I(o.q.$) || {};
21
- (s[n.id] = !0), this.h.B(o.q.$, s);
19
+ if (o && n.id && this.u) {
20
+ const s = this.u.v(i.k.C) || {};
21
+ (s[n.id] = !0), this.u.D(i.k.C, s);
22
22
  }
23
- const l = this.N([n]);
23
+ const l = this.I([n]);
24
24
  if (null == l) return e;
25
- const u = i ? r.A._ : r.A.F;
26
- return s.G(u, l);
25
+ const u = o ? r.q.$ : r.q.B;
26
+ return s.N(u, l);
27
27
  }
28
- H(n) {
29
- const i = new t();
30
- if (!n.J())
28
+ A(n) {
29
+ const o = new t();
30
+ if (!n.F())
31
31
  return (
32
- r.D.info(
32
+ r.j.info(
33
33
  `Card ${n.id} refused this dismissal. Ignoring analytics event.`
34
34
  ),
35
- i
35
+ o
36
36
  );
37
- const e = this.h.I(o.q.K) || {};
38
- (e[n.id] = !0), this.h.B(o.q.K, e);
39
- const l = this.N([n]);
40
- return null == l ? i : s.G(r.A.L, l);
37
+ if (n.id && this.u) {
38
+ const s = this.u.v(i.k.G) || {};
39
+ (s[n.id] = !0), this.u.D(i.k.G, s);
40
+ }
41
+ const e = this.I([n]);
42
+ return null == e ? o : s.N(r.q.H, e);
41
43
  }
42
- M(n, i) {
44
+ J(n, o) {
43
45
  const e = new t(!0),
44
46
  l = [],
45
47
  u = [];
46
48
  let a;
47
- a = i ? this.h.I(o.q.O) || {} : this.h.I(o.q.P) || {};
49
+ this.u && (a = o ? this.u.v(i.k.K) || {} : this.u.v(i.k.L) || {});
48
50
  for (const s of n)
49
- s.R(), s instanceof ControlCard ? u.push(s) : l.push(s), (a[s.id] = !0);
50
- const c = this.N(l),
51
- h = this.N(u);
52
- if (null == c && null == h) return (e.S = !1), e;
53
- if ((i ? this.h.B(o.q.O, a) : this.h.B(o.q.P, a), null != c)) {
54
- const t = i ? r.A.T : r.A.U,
55
- n = s.G(t, c);
56
- e.V(n);
51
+ s.M(),
52
+ s instanceof ControlCard ? u.push(s) : l.push(s),
53
+ s.id && (a[s.id] = !0);
54
+ const h = this.I(l),
55
+ c = this.I(u);
56
+ if (null == h && null == c) return (e.O = !1), e;
57
+ if ((this.u && (o ? this.u.D(i.k.K, a) : this.u.D(i.k.L, a)), null != h)) {
58
+ const t = o ? r.q.P : r.q.R,
59
+ n = s.N(t, h);
60
+ e.S(n);
57
61
  }
58
- if (null != h && i) {
59
- const t = s.G(r.A.W, h);
60
- e.V(t);
62
+ if (null != c && o) {
63
+ const t = s.N(r.q.T, c);
64
+ e.S(t);
61
65
  }
62
66
  return e;
63
67
  }
64
- N(s) {
65
- let t = null;
66
- for (let r = 0; r < s.length; r++)
67
- null != s[r].id &&
68
- "" !== s[r].id &&
69
- ((t = t || {}), (t.ids = t.ids || []), t.ids.push(s[r].id));
70
- return t;
68
+ I(s) {
69
+ let t,
70
+ r = null;
71
+ for (let n = 0; n < s.length; n++)
72
+ (t = s[n].id),
73
+ null != t &&
74
+ "" !== t &&
75
+ ((r = r || {}), (r.ids = r.ids || []), r.ids.push(t));
76
+ return r;
71
77
  }
72
78
  }