@braze/web-sdk 5.4.0 → 5.6.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 (183) hide show
  1. package/index.d.ts +109 -7
  2. package/package.json +1 -1
  3. package/shared-lib/encoding-utils.js +1 -1
  4. package/shared-lib/event-types.js +33 -31
  5. package/shared-lib/guid.js +3 -3
  6. package/shared-lib/indexed-db-adapter.js +20 -20
  7. package/shared-lib/logger.js +18 -18
  8. package/shared-lib/supported-options.js +24 -24
  9. package/src/Banner/banner-factory.js +14 -0
  10. package/src/Banner/banner-provider-factory.js +19 -0
  11. package/src/Banner/banner-provider.js +198 -0
  12. package/src/Banner/banner.js +30 -0
  13. package/src/Banner/display/banner-to-html.js +57 -0
  14. package/src/Banner/display/destroy-banner-html.js +7 -0
  15. package/src/Banner/display/detect-banner-impressions.js +28 -0
  16. package/src/Banner/get-all-banners.js +13 -0
  17. package/src/Banner/get-banner.js +19 -0
  18. package/src/Banner/index.js +7 -0
  19. package/src/Banner/log-banner-click.js +22 -0
  20. package/src/Banner/log-banner-impressions.js +31 -0
  21. package/src/Banner/request-banners-refresh.js +35 -0
  22. package/src/Banner/subscribe-to-banners-updates.js +23 -0
  23. package/src/Banner/types.js +1 -0
  24. package/src/Banner/ui/insert-banner.js +24 -0
  25. package/src/Card/card-manager-factory.js +10 -10
  26. package/src/Card/card-manager.js +64 -58
  27. package/src/Card/display/card-display.js +77 -91
  28. package/src/Card/log-card-click.js +6 -6
  29. package/src/Card/log-card-dismissal.js +6 -5
  30. package/src/Card/log-card-impressions.js +11 -11
  31. package/src/Card/models/captioned-image.js +21 -21
  32. package/src/Card/models/card.js +111 -105
  33. package/src/Card/models/classic-card.js +21 -21
  34. package/src/Card/models/control-card.js +11 -11
  35. package/src/Card/models/image-only.js +19 -19
  36. package/src/Card/util/card-factory.js +58 -58
  37. package/src/ContentCards/content-cards-provider-factory.js +14 -14
  38. package/src/ContentCards/content-cards-provider.js +260 -262
  39. package/src/ContentCards/content-cards.js +5 -5
  40. package/src/ContentCards/get-cached-content-cards.js +3 -3
  41. package/src/ContentCards/request-content-cards-refresh.js +4 -4
  42. package/src/ContentCards/subscribe-to-content-cards-updates.js +13 -13
  43. package/src/ContentCards/ui/hide-content-cards.js +7 -7
  44. package/src/ContentCards/ui/show-content-cards.js +52 -52
  45. package/src/ContentCards/ui/toggle-content-cards.js +4 -4
  46. package/src/Core/add-sdk-metadata.js +9 -9
  47. package/src/Core/change-user.js +14 -14
  48. package/src/Core/destroy.js +3 -3
  49. package/src/Core/disable-sdk.js +13 -13
  50. package/src/Core/enable-sdk.js +9 -9
  51. package/src/Core/get-device-id.js +10 -10
  52. package/src/Core/get-user.js +2 -2
  53. package/src/Core/handle-braze-action.js +53 -53
  54. package/src/Core/initialize.js +2 -2
  55. package/src/Core/is-disabled.js +2 -2
  56. package/src/Core/is-initialized.js +2 -2
  57. package/src/Core/log-custom-event.js +24 -24
  58. package/src/Core/log-purchase.js +38 -38
  59. package/src/Core/open-session.js +18 -18
  60. package/src/Core/remove-all-subscriptions.js +2 -2
  61. package/src/Core/remove-subscription.js +3 -3
  62. package/src/Core/request-immediate-data-flush.js +5 -5
  63. package/src/Core/set-logger.js +2 -2
  64. package/src/Core/set-sdk-authentication-signature.js +6 -6
  65. package/src/Core/subscribe-to-sdk-authentication-failures.js +5 -5
  66. package/src/Core/toggle-logging.js +2 -2
  67. package/src/Core/wipe-data.js +10 -10
  68. package/src/FeatureFlags/feature-flag-factory.js +13 -13
  69. package/src/FeatureFlags/feature-flag.js +10 -10
  70. package/src/FeatureFlags/feature-flags-provider-factory.js +13 -14
  71. package/src/FeatureFlags/feature-flags-provider.js +118 -116
  72. package/src/FeatureFlags/get-all-feature-flags.js +10 -10
  73. package/src/FeatureFlags/get-feature-flag.js +9 -9
  74. package/src/FeatureFlags/log-feature-flag-impression.js +18 -18
  75. package/src/FeatureFlags/refresh-feature-flags.js +6 -6
  76. package/src/FeatureFlags/subscribe-to-feature-flags-updates.js +9 -9
  77. package/src/Feed/feed-provider-factory.js +12 -12
  78. package/src/Feed/feed-provider.js +59 -59
  79. package/src/Feed/feed.js +4 -4
  80. package/src/Feed/get-cached-feed.js +3 -3
  81. package/src/Feed/log-feed-displayed.js +5 -5
  82. package/src/Feed/request-feed-refresh.js +3 -3
  83. package/src/Feed/subscribe-to-feed-updates.js +4 -4
  84. package/src/Feed/ui/hide-feed.js +5 -5
  85. package/src/Feed/ui/show-feed.js +53 -53
  86. package/src/Feed/ui/toggle-feed.js +4 -4
  87. package/src/InAppMessage/defer-in-app-message.js +9 -9
  88. package/src/InAppMessage/display/html-message-display-utils.js +18 -164
  89. package/src/InAppMessage/display/html-message-to-html.js +55 -62
  90. package/src/InAppMessage/display/in-app-message-to-html.js +74 -74
  91. package/src/InAppMessage/display/modal-utils.js +17 -17
  92. package/src/InAppMessage/get-deferred-in-app-message.js +2 -2
  93. package/src/InAppMessage/in-app-message-factory.js +61 -61
  94. package/src/InAppMessage/in-app-message-manager-factory.js +9 -9
  95. package/src/InAppMessage/in-app-message-manager.js +158 -156
  96. package/src/InAppMessage/log-in-app-message-button-click.js +16 -16
  97. package/src/InAppMessage/log-in-app-message-click.js +11 -11
  98. package/src/InAppMessage/log-in-app-message-html-click.js +15 -15
  99. package/src/InAppMessage/log-in-app-message-impression.js +6 -6
  100. package/src/InAppMessage/models/control-message.js +15 -8
  101. package/src/InAppMessage/models/full-screen-message.js +34 -34
  102. package/src/InAppMessage/models/html-message.js +23 -23
  103. package/src/InAppMessage/models/in-app-message-button.js +10 -10
  104. package/src/InAppMessage/models/in-app-message.js +155 -155
  105. package/src/InAppMessage/models/modal-message.js +33 -33
  106. package/src/InAppMessage/models/slide-up-message.js +35 -35
  107. package/src/InAppMessage/models/templated-in-app-message.js +8 -8
  108. package/src/InAppMessage/subscribe-to-in-app-message.js +3 -3
  109. package/src/InAppMessage/ui/automatically-show-in-app-messages.js +6 -6
  110. package/src/InAppMessage/ui/show-in-app-message.js +103 -103
  111. package/src/Push/is-push-blocked.js +2 -2
  112. package/src/Push/is-push-permission-granted.js +2 -2
  113. package/src/Push/is-push-supported.js +2 -2
  114. package/src/Push/push-manager-factory.js +25 -25
  115. package/src/Push/push-manager.js +176 -176
  116. package/src/Push/request-push-permission.js +8 -8
  117. package/src/Push/unregister-push.js +4 -4
  118. package/src/Push/utils/push-utils.js +4 -4
  119. package/src/User/user-manager.js +38 -38
  120. package/src/User/user.js +95 -92
  121. package/src/common/base-feed.js +9 -9
  122. package/src/common/base-provider.js +2 -2
  123. package/src/common/constants.js +1 -0
  124. package/src/common/detect-impression.js +18 -0
  125. package/src/common/event-logger.js +22 -22
  126. package/src/common/feed-display.js +53 -53
  127. package/src/index.js +1 -0
  128. package/src/l10n/l10n-manager-factory.js +15 -15
  129. package/src/l10n/l10n-manager.js +4 -4
  130. package/src/managers/auth-manager.js +38 -38
  131. package/src/managers/braze-instance.js +212 -212
  132. package/src/managers/device-manager.js +30 -30
  133. package/src/managers/network-manager.js +231 -232
  134. package/src/managers/server-config-manager.js +99 -83
  135. package/src/managers/session-manager.js +46 -50
  136. package/src/managers/storage-manager-factory.js +13 -13
  137. package/src/managers/storage-manager.js +182 -180
  138. package/src/managers/subscription-manager.js +12 -12
  139. package/src/managers/utils.js +4 -4
  140. package/src/models/backend-errors.js +5 -5
  141. package/src/models/braze-event.js +9 -9
  142. package/src/models/device.js +2 -2
  143. package/src/models/identifier.js +15 -15
  144. package/src/models/push-token.js +10 -10
  145. package/src/models/request-result.js +4 -4
  146. package/src/models/server-config.js +38 -34
  147. package/src/request-controller.js +228 -228
  148. package/src/triggers/models/custom-event-data.js +5 -5
  149. package/src/triggers/models/custom-event-property-data.js +6 -6
  150. package/src/triggers/models/filter-set.js +10 -10
  151. package/src/triggers/models/filter.js +66 -66
  152. package/src/triggers/models/in-app-message-click-data.js +10 -10
  153. package/src/triggers/models/purchase-data.js +2 -2
  154. package/src/triggers/models/purchase-property-data.js +6 -6
  155. package/src/triggers/models/push-click-data.js +5 -5
  156. package/src/triggers/models/trigger-condition.js +46 -46
  157. package/src/triggers/models/trigger-events.js +4 -4
  158. package/src/triggers/models/trigger.js +33 -33
  159. package/src/triggers/triggers-provider-factory.js +16 -16
  160. package/src/triggers/triggers-provider.js +156 -154
  161. package/src/ui/js/attach-css.js +7 -7
  162. package/src/ui/js/banner-css.js +11 -0
  163. package/src/ui/js/feed-css.js +4 -4
  164. package/src/ui/js/iam-css.js +4 -4
  165. package/src/ui/js/index.js +1 -0
  166. package/src/ui/js/load-font-awesome.js +8 -8
  167. package/src/util/base-device-parser.js +9 -9
  168. package/src/util/braze-actions.js +32 -32
  169. package/src/util/browser-detector.js +27 -27
  170. package/src/util/client-hints-parser.js +9 -9
  171. package/src/util/code-utils.js +5 -5
  172. package/src/util/component-utils.js +5 -5
  173. package/src/util/deprecation-utils.js +3 -3
  174. package/src/util/device-constants.js +1 -1
  175. package/src/util/dom-utils.js +13 -13
  176. package/src/util/html-display-utils.js +158 -0
  177. package/src/util/key-codes.js +1 -1
  178. package/src/util/net.js +21 -21
  179. package/src/util/request-header-utils.js +31 -30
  180. package/src/util/string-utils.js +2 -2
  181. package/src/util/user-agent-parser.js +9 -9
  182. package/src/util/validation-utils.js +89 -85
  183. package/src/util/window-utils.js +3 -3
@@ -1,34 +1,34 @@
1
1
  import se from "../InAppMessage/in-app-message-manager-factory.js";
2
- import e, { OPTIONS as L } from "../managers/braze-instance.js";
2
+ import r, { OPTIONS as z } from "../managers/braze-instance.js";
3
3
  import gr from "./triggers-provider.js";
4
4
  export const TriggersProviderFactory = {
5
- t: !1,
5
+ l: !1,
6
6
  provider: null,
7
- rr: () => (
8
- TriggersProviderFactory.o(),
7
+ m: () => (
8
+ TriggersProviderFactory.p(),
9
9
  TriggersProviderFactory.provider || TriggersProviderFactory.rg(),
10
10
  TriggersProviderFactory.provider
11
11
  ),
12
12
  rg: () => {
13
13
  if (!TriggersProviderFactory.provider) {
14
- const r = e.nn(L.Oo);
14
+ const i = r.sr(z.Go);
15
15
  (TriggersProviderFactory.provider = new gr(
16
- null != r ? r : 30,
17
- se.m().Ze(),
18
- e.l(),
19
- e.cr(),
20
- se.m(),
16
+ null != i ? i : 30,
17
+ se.ea()._r(),
18
+ r.j(),
19
+ r.nn(),
20
+ se.ea(),
21
21
  )),
22
- e.ar(TriggersProviderFactory.provider);
22
+ r._(TriggersProviderFactory.provider);
23
23
  }
24
24
  },
25
- o: () => {
26
- TriggersProviderFactory.t ||
25
+ p: () => {
26
+ TriggersProviderFactory.l ||
27
27
  (TriggersProviderFactory.rg(),
28
- e.g(TriggersProviderFactory),
29
- (TriggersProviderFactory.t = !0));
28
+ r.h(TriggersProviderFactory),
29
+ (TriggersProviderFactory.l = !0));
30
30
  },
31
31
  destroy: () => {
32
- (TriggersProviderFactory.provider = null), (TriggersProviderFactory.t = !1);
32
+ (TriggersProviderFactory.provider = null), (TriggersProviderFactory.l = !1);
33
33
  },
34
34
  };
@@ -1,28 +1,28 @@
1
- import y from "../common/base-provider.js";
2
- import { newInAppMessageFromJson as pt } from "../InAppMessage/in-app-message-factory.js";
1
+ import s from "../common/base-provider.js";
2
+ import { newInAppMessageFromJson as ut } from "../InAppMessage/in-app-message-factory.js";
3
3
  import ve from "../models/braze-event.js";
4
4
  import {
5
- isArray as j,
5
+ isArray as w,
6
6
  isEqual as ii,
7
- validateValueIsFromEnum as J,
7
+ validateValueIsFromEnum as ta,
8
8
  } from "../util/code-utils.js";
9
- import { STORAGE_KEYS as o } from "../managers/storage-manager.js";
9
+ import { STORAGE_KEYS as t } from "../managers/storage-manager.js";
10
10
  import wt from "../InAppMessage/models/templated-in-app-message.js";
11
- import gt from "./models/trigger.js";
12
- import tt from "./models/trigger-events.js";
13
- import { logger as r } from "../../shared-lib/index.js";
14
- export default class gr extends y {
11
+ import pt from "./models/trigger.js";
12
+ import et from "./models/trigger-events.js";
13
+ import { logger as N } from "../../shared-lib/index.js";
14
+ export default class gr extends s {
15
15
  constructor(t, i, s, e, r) {
16
16
  super(),
17
17
  (this.tg = t),
18
- (this.Jt = i),
19
- (this.u = s),
20
- (this.zi = e),
18
+ (this.Ms = i),
19
+ (this.C = s),
20
+ (this.Ue = e),
21
21
  (this.ig = r),
22
22
  (this.tg = t),
23
- (this.Jt = i),
24
- (this.u = s),
25
- (this.zi = e),
23
+ (this.Ms = i),
24
+ (this.C = s),
25
+ (this.Ue = e),
26
26
  (this.ig = r),
27
27
  (this.sg = []),
28
28
  (this.eg = []),
@@ -35,10 +35,10 @@ export default class gr extends y {
35
35
  this.gg();
36
36
  }
37
37
  fg() {
38
- if (this.u) {
39
- (this.hg = this.u.j(o.C.iE) || this.hg),
40
- (this.ng = this.u.j(o.C.EE) || this.ng),
41
- (this.og = this.u.j(o.C.aE) || this.og);
38
+ if (this.C) {
39
+ (this.hg = this.C.ps(t.bs.aE) || this.hg),
40
+ (this.ng = this.C.ps(t.bs.iE) || this.ng),
41
+ (this.og = this.C.ps(t.bs.nE) || this.og);
42
42
  for (let t = 0; t < this.triggers.length; t++) {
43
43
  const i = this.triggers[t];
44
44
  i.id && null != this.og[i.id] && i.ad(this.og[i.id]);
@@ -46,232 +46,234 @@ export default class gr extends y {
46
46
  }
47
47
  }
48
48
  ag() {
49
- if (!this.u) return;
50
- this.lg = this.u.j(o.C.oE) || 0;
51
- const t = this.u.j(o.C.rE) || [],
52
- i = [];
53
- for (let s = 0; s < t.length; s++) i.push(gt.qn(t[s]));
54
- (this.triggers = i), this.fg();
49
+ if (!this.C) return;
50
+ this.lg = this.C.ps(t.bs.oE) || 0;
51
+ const i = this.C.ps(t.bs.rE) || [],
52
+ s = [];
53
+ for (let t = 0; t < i.length; t++) s.push(pt.Qn(i[t]));
54
+ (this.triggers = s), this.fg();
55
55
  }
56
56
  gg() {
57
- const t = this,
58
- i = function (i, s, e, r, h) {
57
+ const i = this,
58
+ s = function (t, s, e, r, h) {
59
59
  return function () {
60
- t.cg(i, s, e, r, h);
60
+ i.cg(t, s, e, r, h);
61
61
  };
62
62
  },
63
- s = {};
64
- for (const t of this.triggers) t.id && (s[t.id] = t);
65
- let e = !1;
63
+ e = {};
64
+ for (const t of this.triggers) t.id && (e[t.id] = t);
65
+ let r = !1;
66
66
  for (let t = 0; t < this.triggers.length; t++) {
67
- const r = this.triggers[t];
68
- if (r.id && null != this.ng[r.id]) {
69
- const t = this.ng[r.id],
67
+ const i = this.triggers[t];
68
+ if (i.id && null != this.ng[i.id]) {
69
+ const t = this.ng[i.id],
70
70
  h = [];
71
- for (let e = 0; e < t.length; e++) {
72
- const n = t[e],
73
- o = r.ud(n.Er || 0);
71
+ for (let r = 0; r < t.length; r++) {
72
+ const n = t[r],
73
+ o = i.ud(n.pn || 0);
74
74
  if (o > 0) {
75
- let t, e;
75
+ let t, r;
76
76
  h.push(n),
77
77
  null != n.ug && (t = n.ug),
78
- null != n.dg && ve.RE(n.dg) && (e = ve.qn(n.dg));
78
+ null != n.dg && ve.AE(n.dg) && (r = ve.Qn(n.dg));
79
79
  const l = [];
80
- if (n.pg && j(n.pg))
80
+ if (n.pg && w(n.pg))
81
81
  for (let t = 0; t < n.pg.length; t++) {
82
- const i = s[n.pg[t]];
82
+ const i = e[n.pg[t]];
83
83
  null != i && l.push(i);
84
84
  }
85
- this.eg.push(window.setTimeout(i(r, n.Er || 0, t, e, l), o));
85
+ this.eg.push(window.setTimeout(s(i, n.pn || 0, t, r, l), o));
86
86
  }
87
87
  }
88
- this.ng[r.id].length > h.length &&
89
- ((this.ng[r.id] = h),
90
- (e = !0),
91
- 0 === this.ng[r.id].length && delete this.ng[r.id]);
88
+ this.ng[i.id].length > h.length &&
89
+ ((this.ng[i.id] = h),
90
+ (r = !0),
91
+ 0 === this.ng[i.id].length && delete this.ng[i.id]);
92
92
  }
93
93
  }
94
- e && this.u && this.u.k(o.C.EE, this.ng);
94
+ r && this.C && this.C.js(t.bs.iE, this.ng);
95
95
  }
96
96
  mg() {
97
- if (!this.u) return;
98
- const t = [];
99
- for (let i = 0; i < this.triggers.length; i++) t.push(this.triggers[i].Y());
97
+ if (!this.C) return;
98
+ const i = [];
99
+ for (let t = 0; t < this.triggers.length; t++)
100
+ i.push(this.triggers[t].Bs());
100
101
  (this.lg = new Date().valueOf()),
101
- this.u.k(o.C.rE, t),
102
- this.u.k(o.C.oE, this.lg);
102
+ this.C.js(t.bs.rE, i),
103
+ this.C.js(t.bs.oE, this.lg);
103
104
  }
104
105
  bg() {
105
- if (!this.u) return;
106
- (this.u.j(o.C.oE) || 0) > this.lg ? this.ag() : this.fg();
106
+ if (!this.C) return;
107
+ (this.C.ps(t.bs.oE) || 0) > this.lg ? this.ag() : this.fg();
107
108
  }
108
- Ns(t) {
109
- let i = !1;
110
- if (null != t && t.triggers) {
111
- this.ig.Lr(), this.fg();
112
- const s = {},
113
- e = {};
109
+ U(i) {
110
+ let s = !1;
111
+ if (null != i && i.triggers) {
112
+ this.ig.vn(), this.fg();
113
+ const e = {},
114
+ r = {};
114
115
  this.triggers = [];
115
- for (let r = 0; r < t.triggers.length; r++) {
116
- const h = gt.fromJson(t.triggers[r]);
116
+ for (let t = 0; t < i.triggers.length; t++) {
117
+ const h = pt.fromJson(i.triggers[t]);
117
118
  if (h) {
118
119
  h.id &&
119
120
  null != this.og[h.id] &&
120
- (h.ad(this.og[h.id]), (s[h.id] = this.og[h.id])),
121
- h.id && null != this.ng[h.id] && (e[h.id] = this.ng[h.id]);
121
+ (h.ad(this.og[h.id]), (e[h.id] = this.og[h.id])),
122
+ h.id && null != this.ng[h.id] && (r[h.id] = this.ng[h.id]);
122
123
  for (let t = 0; t < h.sd.length; t++)
123
- if (h.sd[t].sc(tt.kt, null)) {
124
- i = !0;
124
+ if (h.sd[t].kc(et.Xt, null)) {
125
+ s = !0;
125
126
  break;
126
127
  }
127
128
  this.triggers.push(h);
128
129
  }
129
130
  }
130
- ii(this.og, s) || ((this.og = s), this.u && this.u.k(o.C.aE, this.og)),
131
- ii(this.ng, e) || ((this.ng = e), this.u && this.u.k(o.C.EE, this.ng)),
131
+ ii(this.og, e) || ((this.og = e), this.C && this.C.js(t.bs.nE, this.og)),
132
+ ii(this.ng, r) ||
133
+ ((this.ng = r), this.C && this.C.js(t.bs.iE, this.ng)),
132
134
  this.mg(),
133
- i &&
134
- (r.info("Trigger with test condition found, firing test."),
135
- this.fe(tt.kt)),
136
- this.fe(tt.OPEN);
135
+ s &&
136
+ (N.info("Trigger with test condition found, firing test."),
137
+ this.ue(et.Xt)),
138
+ this.ue(et.OPEN);
137
139
  const h = this.sg;
138
140
  let n;
139
141
  this.sg = [];
140
142
  for (let t = 0; t < h.length; t++)
141
- (n = Array.prototype.slice.call(h[t])), this.fe(...n);
143
+ (n = Array.prototype.slice.call(h[t])), this.ue(...n);
142
144
  }
143
145
  }
144
- cg(t, i, s, e, h) {
145
- const n = (e) => {
146
+ cg(t, i, s, e, r) {
147
+ const h = (e) => {
146
148
  this.fg();
147
- const h = new Date().valueOf();
149
+ const r = new Date().valueOf();
148
150
  t.dd(i) ||
149
- (!1 === navigator.onLine && t.type === gt.Br.Tr && e.imageUrl
150
- ? r.info(
151
+ (!1 === navigator.onLine && t.type === pt.ln.an && e.imageUrl
152
+ ? N.info(
151
153
  `Not showing ${t.type} trigger action ${t.id} due to offline state.`,
152
154
  )
153
- : t.nd(h) && this.wg(t, h, s)
154
- ? 0 === this.Jt.ic()
155
- ? r.info(
155
+ : t.nd(r) && this.wg(t, r, s)
156
+ ? 0 === this.Ms.ic()
157
+ ? N.info(
156
158
  `Not displaying trigger ${t.id} because neither automaticallyShowInAppMessages() nor subscribeToInAppMessage() were called.`,
157
159
  )
158
- : (this.Jt.Dt([e]), this.yg(t, h))
159
- : r.info(
160
+ : (this.Ms.X([e]), this.yg(t, r))
161
+ : N.info(
160
162
  `Not displaying trigger ${t.id} because display time fell outside of the acceptable time window.`,
161
163
  ));
162
164
  },
163
- o = () => {
165
+ n = () => {
164
166
  this.fg();
165
- const n = h.pop();
166
- if (null != n)
167
- if ((this.Tg(n, i, s, e, h), n.dd(i))) {
168
- let t = `Server aborted in-app message display, but the timeout on fallback trigger ${n.id} has already elapsed.`;
169
- h.length > 0 && (t += " Continuing to fall back."), r.info(t), o();
167
+ const h = r.pop();
168
+ if (null != h)
169
+ if ((this.Tg(h, i, s, e, r), h.dd(i))) {
170
+ let t = `Server aborted in-app message display, but the timeout on fallback trigger ${h.id} has already elapsed.`;
171
+ r.length > 0 && (t += " Continuing to fall back."), N.info(t), n();
170
172
  } else {
171
- r.info(
172
- `Server aborted in-app message display. Falling back to lower priority ${n.type} trigger action ${t.id}.`,
173
+ N.info(
174
+ `Server aborted in-app message display. Falling back to lower priority ${h.type} trigger action ${t.id}.`,
173
175
  );
174
- const o = 1e3 * n.ed - (new Date().valueOf() - i);
175
- o > 0
176
+ const n = 1e3 * h.ed - (new Date().valueOf() - i);
177
+ n > 0
176
178
  ? this.eg.push(
177
179
  window.setTimeout(() => {
178
- this.cg(n, i, s, e, h);
179
- }, o),
180
+ this.cg(h, i, s, e, r);
181
+ }, n),
180
182
  )
181
- : this.cg(n, i, s, e, h);
183
+ : this.cg(h, i, s, e, r);
182
184
  }
183
185
  };
184
- let l, a, g;
186
+ let o, l, a;
185
187
  switch (t.type) {
186
- case gt.Br.Tr:
187
- if (((l = pt(t.data)), null == l)) {
188
- r.error(
188
+ case pt.ln.an:
189
+ if (((o = ut(t.data)), null == o)) {
190
+ N.error(
189
191
  `Could not parse trigger data for trigger ${t.id}, ignoring.`,
190
192
  );
191
193
  break;
192
194
  }
193
- if (((a = this.ig.Ki(l)), a)) {
194
- r.error(a), o();
195
+ if (((l = this.ig.Lr(o)), l)) {
196
+ N.error(l), n();
195
197
  break;
196
198
  }
197
- n(l);
199
+ h(o);
198
200
  break;
199
- case gt.Br.md:
200
- if (((g = wt.fromJson(t.data, n, o, i, t.Gr || 0)), null == g)) {
201
- r.error(
201
+ case pt.ln.md:
202
+ if (((a = wt.fromJson(t.data, h, n, i, t.mn || 0)), null == a)) {
203
+ N.error(
202
204
  `Could not parse trigger data for trigger ${t.id}, ignoring.`,
203
205
  );
204
206
  break;
205
207
  }
206
- this.ig.Wi(g, s, e);
208
+ this.ig.Wr(a, s, e);
207
209
  break;
208
210
  default:
209
- r.error(`Trigger ${t.id} was of unexpected type ${t.type}, ignoring.`);
211
+ N.error(`Trigger ${t.id} was of unexpected type ${t.type}, ignoring.`);
210
212
  }
211
213
  }
212
- fe(t, i = null, s) {
213
- if (!J(tt, t, "Cannot fire trigger action.", "TriggerEvents")) return;
214
- if (this.zi && this.zi.zu())
214
+ ue(t, i = null, s) {
215
+ if (!ta(et, t, "Cannot fire trigger action.", "TriggerEvents")) return;
216
+ if (this.Ue && this.Ue.uc())
215
217
  return (
216
- r.info(
218
+ N.info(
217
219
  "Trigger sync is currently in progress, awaiting sync completion before firing trigger event.",
218
220
  ),
219
221
  void this.sg.push(arguments)
220
222
  );
221
223
  this.bg();
222
224
  const e = new Date().valueOf(),
223
- h = e - (this.hg || 0);
224
- let n = !0,
225
- o = !0;
226
- const l = [];
225
+ r = e - (this.hg || 0);
226
+ let h = !0,
227
+ n = !0;
228
+ const o = [];
227
229
  for (let s = 0; s < this.triggers.length; s++) {
228
230
  const r = this.triggers[s],
229
- h = e + 1e3 * r.ed;
231
+ l = e + 1e3 * r.ed;
230
232
  if (
231
- r.nd(h) &&
233
+ r.nd(l) &&
232
234
  (null == r.startTime || r.startTime.valueOf() <= e) &&
233
235
  (null == r.endTime || r.endTime.valueOf() >= e)
234
236
  ) {
235
237
  let s = !1;
236
238
  for (let e = 0; e < r.sd.length; e++)
237
- if (r.sd[e].sc(t, i)) {
239
+ if (r.sd[e].kc(t, i)) {
238
240
  s = !0;
239
241
  break;
240
242
  }
241
- s && ((n = !1), this.wg(r, h, t) && ((o = !1), l.push(r)));
243
+ s && ((h = !1), this.wg(r, l, t) && ((n = !1), o.push(r)));
242
244
  }
243
245
  }
244
- if (n)
245
- return void r.info(
246
+ if (h)
247
+ return void N.info(
246
248
  `Trigger event ${t} did not match any trigger conditions.`,
247
249
  );
248
- if (o)
249
- return void r.info(
250
+ if (n)
251
+ return void N.info(
250
252
  `Ignoring ${t} trigger event because a trigger was displayed ${
251
- h / 1e3
253
+ r / 1e3
252
254
  }s ago.`,
253
255
  );
254
- l.sort((t, i) => t.priority - i.priority);
255
- const a = l.pop();
256
- null != a &&
257
- (r.info(
258
- `Firing ${a.type} trigger action ${a.id} from trigger event ${t}.`,
256
+ o.sort((t, i) => t.priority - i.priority);
257
+ const l = o.pop();
258
+ null != l &&
259
+ (N.info(
260
+ `Firing ${l.type} trigger action ${l.id} from trigger event ${t}.`,
259
261
  ),
260
- this.Tg(a, e, t, s, l),
261
- 0 === a.ed
262
- ? this.cg(a, e, t, s, l)
262
+ this.Tg(l, e, t, s, o),
263
+ 0 === l.ed
264
+ ? this.cg(l, e, t, s, o)
263
265
  : this.eg.push(
264
266
  window.setTimeout(() => {
265
- this.cg(a, e, t, s, l);
266
- }, 1e3 * a.ed),
267
+ this.cg(l, e, t, s, o);
268
+ }, 1e3 * l.ed),
267
269
  ));
268
270
  }
269
- changeUser(t = !1) {
270
- if (((this.triggers = []), this.u && this.u.ti(o.C.rE), !t)) {
271
+ changeUser(i = !1) {
272
+ if (((this.triggers = []), this.C && this.C.Ls(t.bs.rE), !i)) {
271
273
  (this.sg = []), (this.hg = null), (this.og = {}), (this.ng = {});
272
274
  for (let t = 0; t < this.eg.length; t++) clearTimeout(this.eg[t]);
273
275
  (this.eg = []),
274
- this.u && (this.u.ti(o.C.iE), this.u.ti(o.C.aE), this.u.ti(o.C.EE));
276
+ this.C && (this.C.Ls(t.bs.aE), this.C.Ls(t.bs.nE), this.C.Ls(t.bs.iE));
275
277
  }
276
278
  }
277
279
  clearData() {
@@ -281,9 +283,9 @@ export default class gr extends y {
281
283
  }
282
284
  wg(t, i, s) {
283
285
  if (null == this.hg) return !0;
284
- if (s === tt.kt)
286
+ if (s === et.Xt)
285
287
  return (
286
- r.info(
288
+ N.info(
287
289
  "Ignoring minimum interval between trigger because it is a test type.",
288
290
  ),
289
291
  !0
@@ -291,22 +293,22 @@ export default class gr extends y {
291
293
  let e = t.hd;
292
294
  return null == e && (e = this.tg), i - this.hg >= 1e3 * e;
293
295
  }
294
- Tg(t, i, s, e, r) {
295
- this.fg(), t.id && (this.ng[t.id] = this.ng[t.id] || []);
296
- const h = {};
297
- let n;
298
- (h.Er = i), (h.ug = s), null != e && (n = e.Y()), (h.dg = n);
296
+ Tg(i, s, e, r, h) {
297
+ this.fg(), i.id && (this.ng[i.id] = this.ng[i.id] || []);
298
+ const n = {};
299
+ let o;
300
+ (n.pn = s), (n.ug = e), null != r && (o = r.Bs()), (n.dg = o);
299
301
  const l = [];
300
- for (const t of r) t.id && l.push(t.id);
301
- (h.pg = l),
302
- t.id && this.ng[t.id].push(h),
303
- this.u && this.u.k(o.C.EE, this.ng);
302
+ for (const t of h) t.id && l.push(t.id);
303
+ (n.pg = l),
304
+ i.id && this.ng[i.id].push(n),
305
+ this.C && this.C.js(t.bs.iE, this.ng);
304
306
  }
305
- yg(t, i) {
307
+ yg(i, s) {
306
308
  this.fg(),
307
- t.ad(i),
308
- (this.hg = i),
309
- t.id && (this.og[t.id] = i),
310
- this.u && (this.u.k(o.C.iE, i), this.u.k(o.C.aE, this.og));
309
+ i.ad(s),
310
+ (this.hg = s),
311
+ i.id && (this.og[i.id] = s),
312
+ this.C && (this.C.js(t.bs.aE, s), this.C.js(t.bs.nE, this.og));
311
313
  }
312
314
  }
@@ -1,13 +1,13 @@
1
- import e, { OPTIONS as L } from "../../managers/braze-instance.js";
1
+ import r, { OPTIONS as z } from "../../managers/braze-instance.js";
2
2
  export function attachCSS(n, t, o) {
3
3
  const c = n || document.querySelector("head"),
4
- s = `ab-${t}-css-definitions-${"5.4.0".replace(/\./g, "-")}`;
4
+ e = `ab-${t}-css-definitions-${"5.6.0".replace(/\./g, "-")}`;
5
5
  if (!c) return;
6
- const a = c.ownerDocument || document;
7
- if (null == a.getElementById(s)) {
8
- const n = a.createElement("style");
9
- (n.innerHTML = o || ""), (n.id = s);
10
- const t = e.nn(L.bo);
6
+ const s = c.ownerDocument || document;
7
+ if (null == s.getElementById(e)) {
8
+ const n = s.createElement("style");
9
+ (n.innerHTML = o || ""), (n.id = e);
10
+ const t = r.sr(z.ir);
11
11
  null != t && n.setAttribute("nonce", t), c.appendChild(n);
12
12
  }
13
13
  }
@@ -0,0 +1,11 @@
1
+ import { attachCSS as Sn } from "./attach-css.js";
2
+ export function attachBannerCSS(n) {
3
+ Sn(
4
+ n,
5
+ "banner",
6
+ ".ab-html-banner{width:100%;height:100%;border:none}.ab-html-control-banner{width:0;height:0;margin:0;border:none}",
7
+ );
8
+ }
9
+ export function setupBannerUI() {
10
+ attachBannerCSS();
11
+ }
@@ -1,12 +1,12 @@
1
- import { attachCSS as Ce } from "./attach-css.js";
2
- import { loadFontAwesome as Ie } from "./load-font-awesome.js";
1
+ import { attachCSS as Sn } from "./attach-css.js";
2
+ import { loadFontAwesome as Se } from "./load-font-awesome.js";
3
3
  export function attachFeedCSS(t) {
4
- Ce(
4
+ Sn(
5
5
  t,
6
6
  "feed",
7
7
  "body>.ab-feed{position:fixed;top:0;right:0;bottom:0;width:421px;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}body>.ab-feed .ab-feed-body{position:absolute;top:0;left:0;right:0;border:none;border-left:1px solid #d0d0d0;padding-top:70px;min-height:100%}body>.ab-feed .ab-initial-spinner{float:none}body>.ab-feed .ab-no-cards-message{position:absolute;width:100%;margin-left:-20px;top:40%}.ab-feed{-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;-webkit-box-shadow:0 1px 7px 1px rgba(66,82,113,.15);-moz-box-shadow:0 1px 7px 1px rgba(66,82,113,.15);box-shadow:0 1px 7px 1px rgba(66,82,113,.15);width:402px;background-color:#eee;font-family:'Helvetica Neue Light','Helvetica Neue',Helvetica,Arial,'Lucida Grande',sans-serif;font-size:13px;line-height:130%;letter-spacing:normal;overflow-y:auto;overflow-x:visible;z-index:9011;-webkit-overflow-scrolling:touch}.ab-feed :focus,.ab-feed:focus{outline:0}.ab-feed .ab-feed-body{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;border:1px solid #d0d0d0;border-top:none;padding:20px 20px 0 20px}.ab-feed.ab-effect-slide{-webkit-transform:translateX(450px);-moz-transform:translateX(450px);-ms-transform:translateX(450px);transform:translateX(450px);-webkit-transition:transform .5s ease-in-out;-moz-transition:transform .5s ease-in-out;-o-transition:transform .5s ease-in-out;transition:transform .5s ease-in-out}.ab-feed.ab-effect-slide.ab-show{-webkit-transform:translateX(0);-moz-transform:translateX(0);-ms-transform:translateX(0);transform:translateX(0)}.ab-feed.ab-effect-slide.ab-hide{-webkit-transform:translateX(450px);-moz-transform:translateX(450px);-ms-transform:translateX(450px);transform:translateX(450px)}.ab-feed .ab-card{position:relative;-webkit-box-shadow:0 2px 3px 0 rgba(178,178,178,.5);-moz-box-shadow:0 2px 3px 0 rgba(178,178,178,.5);box-shadow:0 2px 3px 0 rgba(178,178,178,.5);-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;width:100%;border:1px solid #d0d0d0;margin-bottom:20px;overflow:hidden;background-color:#fff;-webkit-transition:height .4s ease-in-out,margin .4s ease-in-out;-moz-transition:height .4s ease-in-out,margin .4s ease-in-out;-o-transition:height .4s ease-in-out,margin .4s ease-in-out;transition:height .4s ease-in-out,margin .4s ease-in-out}.ab-feed .ab-card .ab-pinned-indicator{position:absolute;right:0;top:0;margin-right:-1px;width:0;height:0;border-style:solid;border-width:0 24px 24px 0;border-color:transparent #1676d0 transparent transparent}.ab-feed .ab-card .ab-pinned-indicator .fa-star{position:absolute;right:-21px;top:2px;font-size:9px;color:#fff}.ab-feed .ab-card.ab-effect-card.ab-hide{-webkit-transition:all .5s ease-in-out;-moz-transition:all .5s ease-in-out;-o-transition:all .5s ease-in-out;transition:all .5s ease-in-out}.ab-feed .ab-card.ab-effect-card.ab-hide.ab-swiped-left{-webkit-transform:translateX(-450px);-moz-transform:translateX(-450px);-ms-transform:translateX(-450px);transform:translateX(-450px)}.ab-feed .ab-card.ab-effect-card.ab-hide.ab-swiped-right{-webkit-transform:translateX(450px);-moz-transform:translateX(450px);-ms-transform:translateX(450px);transform:translateX(450px)}.ab-feed .ab-card.ab-effect-card.ab-hide:not(.ab-swiped-left):not(.ab-swiped-right){opacity:0}.ab-feed .ab-card .ab-close-button{-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;background-color:transparent;background-size:15px;border:none;width:15px;min-width:15px;height:15px;cursor:pointer;display:block;font-size:15px;line-height:0;padding-top:15px;padding-right:15px;padding-left:15px;padding-bottom:15px;position:absolute;top:0;z-index:9021;opacity:0;-webkit-transition:.5s;-moz-transition:.5s;-o-transition:.5s;transition:.5s}.ab-feed .ab-card .ab-close-button[dir=rtl]{left:0}.ab-feed .ab-card .ab-close-button[dir=ltr]{right:0}.ab-feed .ab-card .ab-close-button svg{-webkit-transition:.2s ease;-moz-transition:.2s ease;-o-transition:.2s ease;transition:.2s ease;fill:#9b9b9b;height:auto;width:100%}.ab-feed .ab-card .ab-close-button svg.ab-chevron{display:none}.ab-feed .ab-card .ab-close-button:active{background-color:transparent}.ab-feed .ab-card .ab-close-button:focus{background-color:transparent}.ab-feed .ab-card .ab-close-button:hover{background-color:transparent}.ab-feed .ab-card .ab-close-button:hover svg{fill-opacity:.8}.ab-feed .ab-card .ab-close-button:hover{opacity:1}.ab-feed .ab-card .ab-close-button:focus{opacity:1}.ab-feed .ab-card a{float:none;color:inherit;text-decoration:none}.ab-feed .ab-card a:hover{text-decoration:underline}.ab-feed .ab-card .ab-image-area{float:none;display:inline-block;vertical-align:top;line-height:0;overflow:hidden;width:100%;-webkit-box-sizing:initial;-moz-box-sizing:initial;box-sizing:initial}.ab-feed .ab-card .ab-image-area img{float:none;height:auto;width:100%}.ab-feed .ab-card.ab-image-only .ab-card-body{display:none}.ab-feed .ab-card .ab-card-body{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;display:inline-block;width:100%;position:relative}.ab-feed .ab-card .ab-unread-indicator{position:absolute;bottom:0;margin-right:-1px;width:100%;height:5px;background-color:#1676d0}.ab-feed .ab-card .ab-unread-indicator.read{background-color:transparent}.ab-feed .ab-card .ab-title{float:none;letter-spacing:0;margin:0;font-weight:700;font-family:'Helvetica Neue Light','Helvetica Neue',Helvetica,Arial,'Lucida Grande',sans-serif;display:block;overflow:hidden;word-wrap:break-word;text-overflow:ellipsis;font-size:18px;line-height:130%;padding:20px 25px 0 25px}.ab-feed .ab-card .ab-description{float:none;color:#545454;padding:15px 25px 20px 25px;word-wrap:break-word;white-space:pre-wrap}.ab-feed .ab-card .ab-description.ab-no-title{padding-top:20px}.ab-feed .ab-card .ab-url-area{float:none;color:#1676d0;margin-top:12px;font-family:'Helvetica Neue Light','Helvetica Neue',Helvetica,Arial,'Lucida Grande',sans-serif}.ab-feed .ab-card.ab-classic-card .ab-card-body{min-height:40px;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.ab-feed .ab-card.ab-classic-card.with-image .ab-card-body{min-height:100px}.ab-feed .ab-card.ab-classic-card.with-image .ab-card-body[dir=ltr]{padding-left:72px}.ab-feed .ab-card.ab-classic-card.with-image .ab-card-body[dir=rtl]{padding-right:72px}.ab-feed .ab-card.ab-classic-card.with-image .ab-image-area{width:60px;height:60px;padding:20px 0 25px 25px;position:absolute}.ab-feed .ab-card.ab-classic-card.with-image .ab-image-area[dir=rtl]{padding:20px 25px 25px 0}.ab-feed .ab-card.ab-classic-card.with-image .ab-image-area img{-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;max-width:100%;max-height:100%;width:auto;height:auto}.ab-feed .ab-card.ab-classic-card.with-image .ab-title{background-color:transparent;font-size:16px}.ab-feed .ab-card.ab-classic-card.with-image .ab-description{padding-top:10px}.ab-feed .ab-card.ab-control-card{height:0;width:0;margin:0;border:0}.ab-feed .ab-feed-buttons-wrapper{float:none;position:relative;background-color:#282828;height:50px;-webkit-box-shadow:0 2px 3px 0 rgba(178,178,178,.5);-moz-box-shadow:0 2px 3px 0 rgba(178,178,178,.5);box-shadow:0 2px 3px 0 rgba(178,178,178,.5);z-index:1}.ab-feed .ab-feed-buttons-wrapper .ab-close-button,.ab-feed .ab-feed-buttons-wrapper .ab-refresh-button{float:none;cursor:pointer;color:#fff;font-size:18px;padding:16px;-webkit-transition:.2s;-moz-transition:.2s;-o-transition:.2s;transition:.2s}.ab-feed .ab-feed-buttons-wrapper .ab-close-button:hover,.ab-feed .ab-feed-buttons-wrapper .ab-refresh-button:hover{font-size:22px}.ab-feed .ab-feed-buttons-wrapper .ab-close-button{float:right}.ab-feed .ab-feed-buttons-wrapper .ab-close-button:hover{padding-top:12px;padding-right:14px}.ab-feed .ab-feed-buttons-wrapper .ab-refresh-button{padding-left:17px}.ab-feed .ab-feed-buttons-wrapper .ab-refresh-button:hover{padding-top:13px;padding-left:14px}.ab-feed .ab-no-cards-message{text-align:center;margin-bottom:20px}@media (max-width:600px){body>.ab-feed{width:100%}}",
8
8
  );
9
9
  }
10
10
  export function setupFeedUI() {
11
- attachFeedCSS(), Ie();
11
+ attachFeedCSS(), Se();
12
12
  }