@braze/web-sdk 6.5.0 → 6.7.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 (153) hide show
  1. package/index.d.ts +258 -5
  2. package/package.json +1 -1
  3. package/shared-lib/event-types.js +21 -20
  4. package/shared-lib/guid.js +3 -3
  5. package/shared-lib/indexed-db-adapter.js +70 -70
  6. package/shared-lib/logger.js +7 -7
  7. package/shared-lib/supported-options.js +26 -25
  8. package/src/Banner/banner-factory.js +11 -1
  9. package/src/Banner/banner-provider.js +244 -120
  10. package/src/Banner/banner.js +14 -12
  11. package/src/Banner/display/banner-to-html.js +23 -16
  12. package/src/Banner/display/detect-banner-impressions.js +13 -13
  13. package/src/Banner/get-all-banners.js +5 -5
  14. package/src/Banner/get-banner.js +4 -4
  15. package/src/Banner/log-banner-click.js +4 -4
  16. package/src/Banner/log-banner-dismissal.js +23 -0
  17. package/src/Banner/log-banner-impressions.js +7 -7
  18. package/src/Banner/request-banners-refresh.js +12 -16
  19. package/src/Banner/subscribe-to-banners-updates.js +6 -6
  20. package/src/Banner/ui/insert-banner.js +12 -12
  21. package/src/Card/card-manager-factory.js +5 -5
  22. package/src/Card/card-manager.js +33 -33
  23. package/src/Card/constants.js +1 -1
  24. package/src/Card/display/card-display.js +11 -11
  25. package/src/Card/log-card-dismissal.js +3 -3
  26. package/src/Card/log-content-card-click.js +3 -3
  27. package/src/Card/log-content-card-impressions.js +6 -6
  28. package/src/Card/models/captioned-image.js +21 -21
  29. package/src/Card/models/card.js +73 -73
  30. package/src/Card/models/classic-card.js +21 -21
  31. package/src/Card/models/control-card.js +11 -11
  32. package/src/Card/models/image-only.js +18 -18
  33. package/src/Card/util/card-factory.js +41 -41
  34. package/src/ContentCards/content-cards-provider-factory.js +12 -12
  35. package/src/ContentCards/content-cards-provider.js +151 -151
  36. package/src/ContentCards/content-cards.js +5 -5
  37. package/src/ContentCards/get-cached-content-cards.js +2 -2
  38. package/src/ContentCards/request-content-cards-refresh.js +2 -2
  39. package/src/ContentCards/subscribe-to-content-cards-updates.js +6 -6
  40. package/src/ContentCards/ui/show-content-cards.js +10 -10
  41. package/src/Core/add-sdk-metadata.js +2 -2
  42. package/src/Core/change-user.js +6 -6
  43. package/src/Core/disable-sdk.js +9 -8
  44. package/src/Core/enable-sdk.js +5 -5
  45. package/src/Core/get-user.js +1 -1
  46. package/src/Core/handle-braze-action.js +3 -3
  47. package/src/Core/is-disabled.js +2 -2
  48. package/src/Core/log-custom-event.js +8 -8
  49. package/src/Core/log-purchase.js +5 -5
  50. package/src/Core/open-session.js +7 -7
  51. package/src/Core/set-sdk-authentication-signature.js +3 -3
  52. package/src/Core/subscribe-to-sdk-authentication-failures.js +1 -1
  53. package/src/Core/wipe-data.js +6 -6
  54. package/src/DUST/dust-provider-factory.js +11 -11
  55. package/src/DUST/dust-provider.js +255 -255
  56. package/src/DUST/dust-shared-worker-impl.js +100 -100
  57. package/src/DUST/dust-worker-bridge.js +27 -27
  58. package/src/DUST/subscribe-to-dust.js +9 -9
  59. package/src/FeatureFlags/feature-flag-factory.js +8 -8
  60. package/src/FeatureFlags/feature-flag.js +9 -9
  61. package/src/FeatureFlags/feature-flags-provider.js +86 -86
  62. package/src/FeatureFlags/get-all-feature-flags.js +2 -2
  63. package/src/FeatureFlags/get-feature-flag.js +2 -2
  64. package/src/FeatureFlags/log-feature-flag-impression.js +5 -5
  65. package/src/FeatureFlags/subscribe-to-feature-flags-updates.js +2 -2
  66. package/src/InAppMessage/constants.js +83 -2
  67. package/src/InAppMessage/defer-in-app-message.js +1 -1
  68. package/src/InAppMessage/display/html-message-display-utils.js +15 -15
  69. package/src/InAppMessage/display/html-message-to-html.js +36 -37
  70. package/src/InAppMessage/display/in-app-message-to-html.js +44 -44
  71. package/src/InAppMessage/display/modal-utils.js +10 -14
  72. package/src/InAppMessage/in-app-message-factory.js +16 -20
  73. package/src/InAppMessage/in-app-message-manager.js +116 -117
  74. package/src/InAppMessage/log-in-app-message-button-click.js +8 -8
  75. package/src/InAppMessage/log-in-app-message-click.js +7 -7
  76. package/src/InAppMessage/log-in-app-message-html-click.js +8 -8
  77. package/src/InAppMessage/log-in-app-message-impression.js +5 -5
  78. package/src/InAppMessage/models/control-message.js +4 -4
  79. package/src/InAppMessage/models/full-screen-message.js +56 -49
  80. package/src/InAppMessage/models/html-message.js +31 -27
  81. package/src/InAppMessage/models/in-app-message-button.js +12 -12
  82. package/src/InAppMessage/models/in-app-message.js +202 -256
  83. package/src/InAppMessage/models/modal-message.js +55 -49
  84. package/src/InAppMessage/models/slide-up-message.js +57 -51
  85. package/src/InAppMessage/models/templated-in-app-message.js +10 -10
  86. package/src/InAppMessage/shared-types.js +1 -0
  87. package/src/InAppMessage/subscribe-to-in-app-message.js +1 -1
  88. package/src/InAppMessage/ui/automatically-show-in-app-messages.js +5 -5
  89. package/src/InAppMessage/ui/remove-all-visible-in-app-messages.js +3 -3
  90. package/src/InAppMessage/ui/show-in-app-message.js +43 -41
  91. package/src/Push/is-push-blocked.js +2 -2
  92. package/src/Push/is-push-permission-granted.js +2 -2
  93. package/src/Push/is-push-supported.js +2 -2
  94. package/src/Push/push-manager-factory.js +9 -9
  95. package/src/Push/push-manager.js +15 -15
  96. package/src/Push/utils/push-utils.js +15 -15
  97. package/src/User/user-manager.js +14 -14
  98. package/src/User/user.js +60 -59
  99. package/src/common/base-provider.js +1 -1
  100. package/src/common/constants.js +2 -1
  101. package/src/common/content-cards-display.js +38 -38
  102. package/src/common/event-logger.js +8 -8
  103. package/src/l10n/l10n-manager-factory.js +9 -9
  104. package/src/l10n/l10n-manager.js +2 -2
  105. package/src/managers/auth-manager.js +31 -31
  106. package/src/managers/braze-instance.js +197 -182
  107. package/src/managers/constants.js +1 -0
  108. package/src/managers/device-manager.js +25 -25
  109. package/src/managers/network-manager.js +155 -155
  110. package/src/managers/server-config-manager.js +106 -93
  111. package/src/managers/session-manager.js +37 -33
  112. package/src/managers/storage-manager-factory.js +33 -28
  113. package/src/managers/storage-manager.js +194 -175
  114. package/src/managers/subscription-manager.js +13 -13
  115. package/src/managers/utils.js +1 -1
  116. package/src/models/backend-errors.js +5 -5
  117. package/src/models/braze-event.js +13 -13
  118. package/src/models/device.js +3 -3
  119. package/src/models/identifier.js +12 -12
  120. package/src/models/push-token.js +9 -9
  121. package/src/models/request-result.js +4 -4
  122. package/src/models/server-config.js +29 -38
  123. package/src/request-controller.js +159 -163
  124. package/src/triggers/models/custom-event-data.js +7 -7
  125. package/src/triggers/models/custom-event-property-data.js +10 -10
  126. package/src/triggers/models/filter-set.js +12 -12
  127. package/src/triggers/models/filter.js +66 -66
  128. package/src/triggers/models/in-app-message-click-data.js +13 -13
  129. package/src/triggers/models/purchase-data.js +4 -4
  130. package/src/triggers/models/purchase-property-data.js +10 -10
  131. package/src/triggers/models/push-click-data.js +8 -8
  132. package/src/triggers/models/trigger-condition.js +58 -58
  133. package/src/triggers/models/trigger-events.js +3 -3
  134. package/src/triggers/models/trigger.js +44 -44
  135. package/src/triggers/triggers-provider-factory.js +5 -5
  136. package/src/triggers/triggers-provider.js +70 -70
  137. package/src/ui/js/attach-css.js +3 -3
  138. package/src/ui/js/feed-css.js +2 -2
  139. package/src/ui/js/iam-css.js +2 -2
  140. package/src/ui/js/load-font-awesome.js +2 -2
  141. package/src/util/base-device-parser.js +9 -9
  142. package/src/util/braze-actions.js +3 -3
  143. package/src/util/browser-detector.js +37 -37
  144. package/src/util/client-hints-parser.js +9 -9
  145. package/src/util/component-utils.js +3 -3
  146. package/src/util/dom-utils.js +2 -2
  147. package/src/util/html-display-utils.js +11 -11
  148. package/src/util/key-codes.js +1 -1
  149. package/src/util/net.js +8 -8
  150. package/src/util/request-header-utils.js +25 -25
  151. package/src/util/user-agent-parser.js +20 -20
  152. package/src/util/validation-utils.js +21 -21
  153. package/src/util/window-utils.js +3 -3
@@ -2,12 +2,12 @@ import { logger as E } from "../../shared-lib/index.js";
2
2
  import t from "../common/base-provider.js";
3
3
  import r from "../managers/braze-instance.js";
4
4
  import { STORAGE_KEYS as s } from "../managers/storage-manager.js";
5
- import m from "../managers/subscription-manager.js";
5
+ import f from "../managers/subscription-manager.js";
6
6
  import { randomInclusive as a } from "../util/math.js";
7
7
  import {
8
- REQUEST_BACKOFF_MAX_SLEEP_MS_DEFAULT as u,
9
- REQUEST_BACKOFF_MIN_SLEEP_MS_DEFAULT as c,
10
- REQUEST_BACKOFF_SCALE_FACTOR_DEFAULT as d,
8
+ REQUEST_BACKOFF_MAX_SLEEP_MS_DEFAULT as c,
9
+ REQUEST_BACKOFF_MIN_SLEEP_MS_DEFAULT as d,
10
+ REQUEST_BACKOFF_SCALE_FACTOR_DEFAULT as m,
11
11
  } from "../common/constants.js";
12
12
  import l from "../util/net.js";
13
13
  import {
@@ -19,26 +19,26 @@ export default class ar extends t {
19
19
  constructor(t, s, i, e) {
20
20
  super(),
21
21
  (this.h = t),
22
- (this.j = s),
23
- (this.B = i),
24
- (this.C = e),
22
+ (this.B = s),
23
+ (this.C = i),
24
+ (this.j = e),
25
25
  (this.Xr = []),
26
- (this.Gr = 0),
26
+ (this.Yr = 0),
27
27
  (this.h = t),
28
- (this.j = s),
29
- (this.B = i),
30
- (this.C = e),
31
- (this.Kr = null),
32
- (this.Qr = new m()),
33
- (this.S = 10),
34
- (this.T = null),
35
- (this.I = null),
36
- r.q(this.Qr);
37
- }
38
- N(t) {
28
+ (this.B = s),
29
+ (this.C = i),
30
+ (this.j = e),
31
+ (this.Zr = null),
32
+ (this.ho = new f()),
33
+ (this.D = 10),
34
+ (this.N = null),
35
+ (this.F = null),
36
+ r.S(this.ho);
37
+ }
38
+ I(t) {
39
39
  var s;
40
40
  if (
41
- (null === (s = this.h) || void 0 === s ? void 0 : s.Yr()) &&
41
+ (null === (s = this.h) || void 0 === s ? void 0 : s.lo()) &&
42
42
  null != t &&
43
43
  t.feature_flags
44
44
  ) {
@@ -47,12 +47,12 @@ export default class ar extends t {
47
47
  const t = at(s);
48
48
  t && this.Xr.push(t);
49
49
  }
50
- (this.Gr = new Date().getTime()), this.Zr(), this.Qr.L(this.Xr);
50
+ (this.Yr = new Date().getTime()), this.do(), this.ho.A(this.Xr);
51
51
  }
52
52
  }
53
- ho() {
53
+ vo() {
54
54
  let t = {};
55
- this.B && (t = this.B.dt(s.ft.lo));
55
+ this.C && (t = this.C.Rt(s.Tt.Fo));
56
56
  const i = {};
57
57
  for (const s in t) {
58
58
  const e = ht(t[s]);
@@ -60,143 +60,143 @@ export default class ar extends t {
60
60
  }
61
61
  return i;
62
62
  }
63
- do() {
63
+ po() {
64
64
  var t;
65
65
  return (
66
- (null === (t = this.B) || void 0 === t ? void 0 : t.dt(s.ft.vo)) || {}
66
+ (null === (t = this.C) || void 0 === t ? void 0 : t.Rt(s.Tt.jo)) || {}
67
67
  );
68
68
  }
69
- Fo(t) {
70
- this.B && this.B.bt(s.ft.vo, t);
69
+ wo(t) {
70
+ this.C && this.C.It(s.Tt.jo, t);
71
71
  }
72
- It(t) {
73
- return this.Qr.Rt(t);
72
+ zt(t) {
73
+ return this.ho.Kt(t);
74
74
  }
75
75
  refreshFeatureFlags(t, s, i = !1, e = !0) {
76
76
  const r = () => {
77
- "function" == typeof s && s(), this.Qr.L(this.Xr);
77
+ "function" == typeof s && s(), this.ho.A(this.Xr);
78
78
  };
79
- if (!this.po(i))
79
+ if (!this.yo(i))
80
80
  return (
81
- !this.Kr &&
81
+ !this.Zr &&
82
82
  this.h &&
83
- (this.Kr = this.h.jo(() => {
83
+ (this.Zr = this.h.bo(() => {
84
84
  this.refreshFeatureFlags(t, s);
85
85
  })),
86
86
  void r()
87
87
  );
88
- const o = this.j;
88
+ const o = this.B;
89
89
  if (!o) return void r();
90
- e && this.X();
91
- const n = o.$({}, !0),
92
- f = o.A(n, h.H.wo);
93
- let m = !1;
94
- o.J(
90
+ e && this.Y();
91
+ const n = o.Z({}, !0),
92
+ u = o.tt(n, h.it.Co);
93
+ let f = !1;
94
+ o.et(
95
95
  n,
96
96
  (e = -1) => {
97
- const o = this.j;
97
+ const o = this.B;
98
98
  if (!o) return void r();
99
99
  const v = new Date().valueOf();
100
- h.K(this.B, h.H.wo, v),
101
- -1 !== e && f.push(["X-Braze-Req-Tokens-Remaining", e.toString()]),
102
- l.O({
103
- url: `${o.V()}/feature_flags/sync`,
104
- headers: f,
100
+ h.nt(this.C, h.it.Co, v),
101
+ -1 !== e && u.push(["X-Braze-Req-Tokens-Remaining", e.toString()]),
102
+ l.ot({
103
+ url: `${o.ht()}/feature_flags/sync`,
104
+ headers: u,
105
105
  data: n,
106
- W: (s) => {
107
- if (!o.Y(n, s, f)) return (m = !0), void r();
108
- o.Z(), this.N(s), (m = !1), "function" == typeof t && t();
106
+ lt: (s) => {
107
+ if (!o.ut(n, s, u)) return (f = !0), void r();
108
+ o.ct(), this.I(s), (f = !1), "function" == typeof t && t();
109
109
  },
110
110
  error: (t) => {
111
- o._(t, "retrieving feature flags"), (m = !0), r();
111
+ o.dt(t, "retrieving feature flags"), (f = !0), r();
112
112
  },
113
- tt: (e, r) => {
114
- var n, l, f;
113
+ ft: (e, r) => {
114
+ var n, l, u;
115
115
  let v;
116
- if (m) {
116
+ if (f) {
117
117
  const t =
118
- (null === (n = this.h) || void 0 === n ? void 0 : n.st()) ||
119
- c,
120
- s =
121
- (null === (l = this.h) || void 0 === l ? void 0 : l.it()) ||
118
+ (null === (n = this.h) || void 0 === n ? void 0 : n.vt()) ||
122
119
  d,
120
+ s =
121
+ (null === (l = this.h) || void 0 === l ? void 0 : l.gt()) ||
122
+ m,
123
123
  i =
124
- (null === (f = this.h) || void 0 === f ? void 0 : f.nt()) ||
125
- u;
126
- let e = this.T;
124
+ (null === (u = this.h) || void 0 === u ? void 0 : u.bt()) ||
125
+ c;
126
+ let e = this.N;
127
127
  (null == e || e < t) && (e = t), (v = Math.min(i, a(t, e * s)));
128
128
  }
129
- o.et(
129
+ o.yt(
130
130
  r,
131
131
  () => {
132
132
  this.refreshFeatureFlags(t, s, i, !0);
133
133
  },
134
- h.H.wo,
135
- (t) => this.rt(t),
136
- () => this.X(),
134
+ h.it.Co,
135
+ (t) => this.Bt(t),
136
+ () => this.Y(),
137
137
  v,
138
138
  );
139
139
  },
140
140
  });
141
141
  },
142
- h.H.wo,
142
+ h.it.Co,
143
143
  s,
144
144
  );
145
145
  }
146
- X() {
147
- null != this.I && (clearTimeout(this.I), (this.I = null));
146
+ Y() {
147
+ null != this.F && (clearTimeout(this.F), (this.F = null));
148
148
  }
149
- rt(t) {
150
- this.X(), (this.I = t);
149
+ Bt(t) {
150
+ this.Y(), (this.F = t);
151
151
  }
152
- po(t) {
152
+ yo(t) {
153
153
  if (!this.h) return !1;
154
154
  if (!t) {
155
- const t = this.h.yo();
155
+ const t = this.h.Ro();
156
156
  if (null == t) return !1;
157
157
  let s = !1;
158
158
  if (!isNaN(t)) {
159
159
  if (-1 === t) return E.info("Feature flag refreshes not allowed"), !1;
160
- s = new Date().getTime() >= (this.Gr || 0) + 1e3 * t;
160
+ s = new Date().getTime() >= (this.Yr || 0) + 1e3 * t;
161
161
  }
162
162
  if (!s)
163
163
  return (
164
164
  E.info(`Feature flag refreshes were rate limited to ${t} seconds`), !1
165
165
  );
166
166
  }
167
- return this.h.Yr();
167
+ return this.h.lo();
168
168
  }
169
- bo() {
169
+ To() {
170
170
  var t;
171
171
  return (
172
- (null === (t = this.B) || void 0 === t ? void 0 : t.dt(s.ft.Co)) || null
172
+ (null === (t = this.C) || void 0 === t ? void 0 : t.Rt(s.Tt.Do)) || null
173
173
  );
174
174
  }
175
- Ro() {
175
+ Io() {
176
176
  var t, i;
177
- null === (t = this.B) ||
177
+ null === (t = this.C) ||
178
178
  void 0 === t ||
179
- t.bt(s.ft.Co, null === (i = this.C) || void 0 === i ? void 0 : i.yt());
179
+ t.It(s.Tt.Do, null === (i = this.j) || void 0 === i ? void 0 : i.kt());
180
180
  }
181
- To() {
181
+ So() {
182
182
  var t;
183
- const s = null === (t = this.C) || void 0 === t ? void 0 : t.yt(),
184
- i = this.bo();
183
+ const s = null === (t = this.j) || void 0 === t ? void 0 : t.kt(),
184
+ i = this.To();
185
185
  return null == i || s === i;
186
186
  }
187
- Zr() {
188
- if (!this.B) return;
187
+ do() {
188
+ if (!this.C) return;
189
189
  const t = {};
190
190
  for (const s of this.Xr) {
191
- const i = s.gt();
191
+ const i = s.qt();
192
192
  t[s.id] = i;
193
193
  }
194
- this.B.bt(s.ft.lo, t), this.B.bt(s.ft.Do, this.Gr), this.Ro();
194
+ this.C.It(s.Tt.Fo, t), this.C.It(s.Tt.qo, this.Yr), this.Io();
195
195
  }
196
196
  changeUser() {
197
- this.X();
197
+ this.Y();
198
198
  }
199
199
  clearData() {
200
- this.X();
200
+ this.Y();
201
201
  }
202
202
  }
@@ -4,8 +4,8 @@ export function getAllFeatureFlags() {
4
4
  if (!r.rr()) return;
5
5
  const t = [],
6
6
  e = r.l();
7
- if (e && !e.Yr()) return t;
8
- const n = lr.o().ho();
7
+ if (e && !e.lo()) return t;
8
+ const n = lr.o().vo();
9
9
  for (const r in n) t.push(n[r]);
10
10
  return t;
11
11
  }
@@ -3,7 +3,7 @@ import lr from "./feature-flags-provider-factory.js";
3
3
  export function getFeatureFlag(t) {
4
4
  if (!r.rr()) return;
5
5
  const e = r.l();
6
- if (e && !e.Yr()) return null;
7
- const n = lr.o().ho();
6
+ if (e && !e.lo()) return null;
7
+ const n = lr.o().vo();
8
8
  return n[t] ? n[t] : null;
9
9
  }
@@ -1,4 +1,4 @@
1
- import { logger as E, EventTypes as f } from "../../shared-lib/index.js";
1
+ import { logger as E, EventTypes as p } from "../../shared-lib/index.js";
2
2
  import v from "../common/event-logger.js";
3
3
  import r from "../managers/braze-instance.js";
4
4
  import lr from "./feature-flags-provider-factory.js";
@@ -7,11 +7,11 @@ export function logFeatureFlagImpression(e) {
7
7
  if (!e) return !1;
8
8
  const t =
9
9
  "Not logging a feature flag impression. The feature flag was not part of any matching experiment.",
10
- o = lr.o().ho();
10
+ o = lr.o().vo();
11
11
  if (!o[e]) return E.info(t), !1;
12
12
  const n = o[e].trackingString;
13
13
  if (!n) return E.info(t), !1;
14
- const i = lr.o().do();
14
+ const i = lr.o().po();
15
15
  if (i[n])
16
16
  return (
17
17
  E.info(
@@ -19,7 +19,7 @@ export function logFeatureFlagImpression(e) {
19
19
  ),
20
20
  !1
21
21
  );
22
- (i[n] = !0), lr.o().Fo(i);
22
+ (i[n] = !0), lr.o().wo(i);
23
23
  const s = { fid: e, fts: n };
24
- return v.lt(f.xo, s).W;
24
+ return v.wt(p.xo, s).lt;
25
25
  }
@@ -4,9 +4,9 @@ import { getAllFeatureFlags } from "./get-all-feature-flags.js";
4
4
  export function subscribeToFeatureFlagsUpdates(t) {
5
5
  if (!r.rr()) return;
6
6
  const e = lr.o();
7
- if (e.To()) {
7
+ if (e.So()) {
8
8
  const r = getAllFeatureFlags();
9
9
  r && "function" == typeof t && t(r);
10
10
  }
11
- return e.It(t);
11
+ return e.zt(t);
12
12
  }
@@ -1,4 +1,85 @@
1
1
  export const IamStrings = {
2
- sS: "inAppMessage must be an InAppMessage object",
3
- eS: "ab-pause-scrolling",
2
+ EE: "inAppMessage must be an InAppMessage object",
3
+ TE: "ab-pause-scrolling",
4
+ };
5
+ export const IamColors = {
6
+ IE: 4281545523,
7
+ AE: 4294967295,
8
+ _E: 4278219733,
9
+ OE: 4293914607,
10
+ LE: 4283782485,
11
+ SE: 3224580915,
12
+ NE: 4288387995,
13
+ };
14
+ export const IamDisplayFailures = {
15
+ RE: "hd",
16
+ tE: "ias",
17
+ ME: "of",
18
+ eE: "do",
19
+ oE: "umt",
20
+ CE: "tf",
21
+ DE: "te",
22
+ };
23
+ export const IamSlideFrom = { TOP: "TOP", BOTTOM: "BOTTOM" };
24
+ export const IamClickAction = { URI: "URI", NONE: "NONE" };
25
+ export const IamDismissType = { AUTO_DISMISS: "AUTO_DISMISS", MANUAL: "SWIPE" };
26
+ export const IamOpenTarget = { NONE: "NONE", BLANK: "BLANK" };
27
+ export const IamImageStyle = { TOP: "TOP", GRAPHIC: "GRAPHIC" };
28
+ export const IamOrientation = { PORTRAIT: "PORTRAIT", LANDSCAPE: "LANDSCAPE" };
29
+ export const IamTextAlignment = {
30
+ START: "START",
31
+ CENTER: "CENTER",
32
+ END: "END",
33
+ };
34
+ export const IamCropType = {
35
+ CENTER_CROP: "CENTER_CROP",
36
+ FIT_CENTER: "FIT_CENTER",
37
+ };
38
+ export const IamServerTypes = {
39
+ sE: "SLIDEUP",
40
+ aE: "MODAL",
41
+ UE: "MODAL_STYLED",
42
+ cE: "FULL",
43
+ iE: "WEB_HTML",
44
+ PE: "HTML",
45
+ nE: "HTML_FULL",
46
+ };
47
+ export const IamTiming = { gr: 500, pE: 200 };
48
+ export const IAM_SHOW_CLASS = "ab-show";
49
+ export const IAM_HIDE_CLASS = "ab-hide";
50
+ export const IamSerializationKeys = {
51
+ rE: "m",
52
+ mE: "ma",
53
+ GE: "sf",
54
+ Fs: "e",
55
+ FE: "ti",
56
+ HE: "ca",
57
+ URI: "u",
58
+ xE: "oa",
59
+ BE: "dt",
60
+ lE: "d",
61
+ bE: "i",
62
+ ys: "iu",
63
+ gE: "is",
64
+ YE: "ic",
65
+ KE: "ibc",
66
+ XE: "bc",
67
+ dE: "tc",
68
+ hE: "cbc",
69
+ yE: "ai",
70
+ uE: "ao",
71
+ WE: "h",
72
+ fE: "ha",
73
+ jE: "htc",
74
+ kE: "fc",
75
+ vE: "b",
76
+ wE: "ct",
77
+ zE: "o",
78
+ VE: "hi",
79
+ CSS: "css",
80
+ xs: "type",
81
+ qE: "messageFields",
82
+ JE: "me",
83
+ LANGUAGE: "l",
84
+ Ks: "ia",
4
85
  };
@@ -8,6 +8,6 @@ export function deferInAppMessage(e) {
8
8
  return e instanceof ControlMessage
9
9
  ? (E.info("Not deferring since this is a ControlMessage."), !1)
10
10
  : e instanceof InAppMessage
11
- ? je.ra().fn(e)
11
+ ? je.ra().jn(e)
12
12
  : (E.info("Not an instance of InAppMessage, ignoring."), !1);
13
13
  }
@@ -1,26 +1,26 @@
1
- import { parseQueryStringKeyValues as ll } from "../../util/url-utils.js";
1
+ import { parseQueryStringKeyValues as lt } from "../../util/url-utils.js";
2
2
  import { WindowUtils as no } from "../../util/window-utils.js";
3
+ import { IamOpenTarget as ut } from "../constants.js";
3
4
  import { logInAppMessageHtmlClick } from "../log-in-app-message-html-click.js";
4
- import InAppMessage from "../models/in-app-message.js";
5
- export const buildHtmlClickHandler = (l, t, i, o) => {
5
+ export const buildHtmlClickHandler = (t, l, i, o) => {
6
6
  const r = i.getAttribute("href"),
7
- e = i.onclick;
8
- return (n) => {
9
- if (null != e && "function" == typeof e && !1 === e.bind(i)(n)) return;
10
- let s = ll(r).abButtonId;
7
+ n = i.onclick;
8
+ return (s) => {
9
+ if (null != n && "function" == typeof n && !1 === n.bind(i)(s)) return;
10
+ let e = lt(r).abButtonId;
11
11
  if (
12
- ((null != s && "" !== s) || (s = i.getAttribute("id") || void 0),
12
+ ((null != e && "" !== e) || (e = i.getAttribute("id") || void 0),
13
13
  null != r && "" !== r && 0 !== r.indexOf("#"))
14
14
  ) {
15
- const e =
15
+ const n =
16
16
  "blank" ===
17
17
  (i.getAttribute("target") || "").toLowerCase().replace("_", ""),
18
- m = o || l.openTarget === InAppMessage.OpenTarget.BLANK || e,
19
- u = () => {
20
- logInAppMessageHtmlClick(l, s, r), no.openUri(r, m, n);
18
+ u = o || t.openTarget === ut.BLANK || n,
19
+ m = () => {
20
+ logInAppMessageHtmlClick(t, e, r), no.openUri(r, u, s);
21
21
  };
22
- m ? u() : l.ll(t, u);
23
- } else logInAppMessageHtmlClick(l, s, r || void 0);
24
- return n.stopPropagation(), !1;
22
+ u ? m() : t.tl(l, m);
23
+ } else logInAppMessageHtmlClick(t, e, r || void 0);
24
+ return s.stopPropagation(), !1;
25
25
  };
26
26
  };
@@ -1,74 +1,73 @@
1
1
  import ro from "../../util/browser-detector.js";
2
- import { InAppMessage, logInAppMessageHtmlClick } from "../index.js";
2
+ import { logInAppMessageHtmlClick } from "../index.js";
3
3
  import { OperatingSystems as so } from "../../util/device-constants.js";
4
- import { buildHtmlClickHandler as lt } from "./html-message-display-utils.js";
4
+ import { buildHtmlClickHandler as ct } from "./html-message-display-utils.js";
5
5
  import { attachHtmlToIframeWithNonce as b } from "../../util/html-display-utils.js";
6
6
  import { buildBrazeBridge as N } from "../../util/html-display-utils.js";
7
- export default function ct(t, e, o, s, n) {
7
+ import { IamServerTypes as dt } from "../constants.js";
8
+ export default function ft(t, o, s, e, n) {
8
9
  const i = document.createElement("iframe");
9
10
  i.setAttribute("title", "Modal Message"),
10
- s && (i.style.zIndex = (s + 1).toString());
11
+ e && (i.style.zIndex = (e + 1).toString());
11
12
  if (
12
13
  (b(i, t.message, n),
13
14
  (i.onload = () => {
14
- const s = i.contentWindow;
15
- s.focus();
16
- const l = s.document.getElementsByTagName("head")[0];
17
- if (null != l) {
15
+ const e = i.contentWindow;
16
+ e.focus();
17
+ const a = e.document.getElementsByTagName("head")[0];
18
+ if (null != a) {
18
19
  if (t.Mo()) {
19
- const e = document.createElement("style");
20
- (e.innerHTML = t.css || ""),
21
- (e.id = t.Oo() || ""),
22
- null != n && e.setAttribute("nonce", n),
23
- l.appendChild(e);
20
+ const o = document.createElement("style");
21
+ (o.innerHTML = t.css || ""),
22
+ (o.id = t.Oo() || ""),
23
+ null != n && o.setAttribute("nonce", n),
24
+ a.appendChild(o);
24
25
  }
25
- const e = s.document.createElement("base");
26
- null != e && (e.setAttribute("target", "_parent"), l.appendChild(e));
26
+ const o = e.document.createElement("base");
27
+ null != o && (o.setAttribute("target", "_parent"), a.appendChild(o));
27
28
  }
28
- const a = s.document.getElementsByTagName("title");
29
- a && a.length > 0 && i.setAttribute("title", a[0].textContent || "");
29
+ const l = e.document.getElementsByTagName("title");
30
+ l && l.length > 0 && i.setAttribute("title", l[0].textContent || "");
30
31
  const r = Object.assign(
31
32
  Object.assign(
32
33
  {},
33
- N(i, (e, o) => t.ll(e, o)),
34
+ N(i, (o, s) => t.tl(o, s)),
34
35
  ),
35
36
  {
36
37
  closeMessage: function () {
37
- t.ll(i);
38
+ t.tl(i);
38
39
  },
39
40
  logClick: function () {
40
41
  logInAppMessageHtmlClick(t, ...arguments);
41
42
  },
42
43
  },
43
44
  );
44
- if (
45
- ((s.appboyBridge = r), (s.brazeBridge = r), t.ko !== InAppMessage.Eo.Bo)
46
- ) {
47
- const e = s.document.getElementsByTagName("a");
48
- for (let s = 0; s < e.length; s++) e[s].onclick = lt(t, i, e[s], o);
49
- const n = s.document.getElementsByTagName("button");
50
- for (let e = 0; e < n.length; e++) n[e].onclick = lt(t, i, n[e], o);
45
+ if (((e.appboyBridge = r), (e.brazeBridge = r), t.ko !== dt.PE)) {
46
+ const o = e.document.getElementsByTagName("a");
47
+ for (let e = 0; e < o.length; e++) o[e].onclick = ct(t, i, o[e], s);
48
+ const n = e.document.getElementsByTagName("button");
49
+ for (let o = 0; o < n.length; o++) n[o].onclick = ct(t, i, n[o], s);
51
50
  }
52
- const c = s.document.body;
51
+ const c = e.document.body;
53
52
  if (null != c) {
54
- t._o() && (c.id = t.htmlId || "");
55
- const e = document.createElement("hidden");
56
- (e.onclick = r.closeMessage),
57
- (e.className = "ab-programmatic-close-button"),
58
- c.appendChild(e);
53
+ t.Bo() && (c.id = t.htmlId || "");
54
+ const o = document.createElement("hidden");
55
+ (o.onclick = r.closeMessage),
56
+ (o.className = "ab-programmatic-close-button"),
57
+ c.appendChild(o);
59
58
  }
60
- s.dispatchEvent(new CustomEvent("ab.BridgeReady")),
59
+ e.dispatchEvent(new CustomEvent("ab.BridgeReady")),
61
60
  -1 !== i.className.indexOf("ab-start-hidden") &&
62
- ((i.className = i.className.replace("ab-start-hidden", "")), e(i));
61
+ ((i.className = i.className.replace("ab-start-hidden", "")), o(i));
63
62
  }),
64
63
  (i.className =
65
64
  "ab-in-app-message ab-start-hidden ab-html-message ab-modal-interactions"),
66
65
  ro.OS === so.co)
67
66
  ) {
68
- const e = document.createElement("div");
67
+ const o = document.createElement("div");
69
68
  return (
70
- (e.className = "ab-ios-scroll-wrapper"), e.appendChild(i), (t.qo = e), e
69
+ (o.className = "ab-ios-scroll-wrapper"), o.appendChild(i), (t.Eo = o), o
71
70
  );
72
71
  }
73
- return (t.qo = i), i;
72
+ return (t.Eo = i), i;
74
73
  }