@braze/web-sdk 6.7.1 → 6.9.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 (138) hide show
  1. package/index.d.ts +165 -38
  2. package/package.json +1 -1
  3. package/shared-lib/encoding-utils.js +2 -2
  4. package/shared-lib/event-types.js +16 -16
  5. package/shared-lib/indexed-db-adapter.js +65 -65
  6. package/shared-lib/logger.js +18 -18
  7. package/shared-lib/supported-options.js +1 -1
  8. package/src/Banner/banner-provider.js +67 -59
  9. package/src/Banner/banner.js +40 -19
  10. package/src/Banner/dismiss-banner.js +4 -0
  11. package/src/Banner/display/banner-to-html.js +10 -10
  12. package/src/Banner/display/destroy-banner-html.js +2 -2
  13. package/src/Banner/get-all-banners.js +6 -6
  14. package/src/Banner/get-banner.js +6 -6
  15. package/src/Banner/index.js +1 -0
  16. package/src/Banner/log-banner-click.js +7 -7
  17. package/src/Banner/log-banner-dismissal.js +7 -7
  18. package/src/Banner/log-banner-impressions.js +27 -18
  19. package/src/Banner/request-banners-refresh.js +8 -8
  20. package/src/Banner/subscribe-to-banners-updates.js +5 -5
  21. package/src/Banner/ui/insert-banner.js +8 -8
  22. package/src/Card/card-manager.js +31 -31
  23. package/src/Card/log-card-dismissal.js +2 -2
  24. package/src/Card/log-content-card-click.js +2 -2
  25. package/src/Card/log-content-card-impressions.js +4 -4
  26. package/src/Card/models/captioned-image.js +15 -15
  27. package/src/Card/models/card.js +89 -89
  28. package/src/Card/models/classic-card.js +16 -16
  29. package/src/Card/models/control-card.js +7 -7
  30. package/src/Card/models/image-only.js +13 -13
  31. package/src/Card/util/card-factory.js +32 -32
  32. package/src/ContentCards/content-cards-provider-factory.js +13 -11
  33. package/src/ContentCards/content-cards-provider.js +105 -105
  34. package/src/ContentCards/get-cached-content-cards.js +2 -2
  35. package/src/ContentCards/request-content-cards-refresh.js +2 -2
  36. package/src/ContentCards/subscribe-to-content-cards-updates.js +10 -10
  37. package/src/ContentCards/ui/show-content-cards.js +7 -7
  38. package/src/Core/add-sdk-metadata.js +2 -2
  39. package/src/Core/change-user.js +5 -5
  40. package/src/Core/destroy.js +2 -2
  41. package/src/Core/disable-sdk.js +4 -4
  42. package/src/Core/enable-sdk.js +4 -4
  43. package/src/Core/get-device-id.js +2 -2
  44. package/src/Core/handle-braze-action.js +5 -5
  45. package/src/Core/index.js +1 -0
  46. package/src/Core/log-custom-event.js +5 -5
  47. package/src/Core/log-ecommerce-event.js +29 -0
  48. package/src/Core/log-purchase.js +23 -198
  49. package/src/Core/open-session.js +10 -10
  50. package/src/Core/set-logger.js +2 -2
  51. package/src/Core/set-sdk-authentication-signature.js +1 -1
  52. package/src/Core/subscribe-to-sdk-authentication-failures.js +1 -1
  53. package/src/Core/toggle-logging.js +2 -2
  54. package/src/Core/wipe-data.js +6 -6
  55. package/src/DUST/dust-connection-core.js +1 -0
  56. package/src/DUST/dust-provider-factory.js +10 -10
  57. package/src/DUST/dust-provider.js +258 -226
  58. package/src/DUST/dust-shared-worker-code.js +1 -1
  59. package/src/DUST/dust-shared-worker-impl.js +97 -103
  60. package/src/DUST/dust-worker-bridge.js +55 -40
  61. package/src/DUST/subscribe-to-dust.js +7 -7
  62. package/src/FeatureFlags/feature-flag-factory.js +8 -8
  63. package/src/FeatureFlags/feature-flag.js +3 -3
  64. package/src/FeatureFlags/feature-flags-provider.js +21 -21
  65. package/src/FeatureFlags/log-feature-flag-impression.js +5 -5
  66. package/src/FeatureFlags/subscribe-to-feature-flags-updates.js +1 -1
  67. package/src/InAppMessage/constants.js +3 -3
  68. package/src/InAppMessage/defer-in-app-message.js +3 -3
  69. package/src/InAppMessage/display/html-message-to-html.js +4 -4
  70. package/src/InAppMessage/display/in-app-message-to-html.js +32 -32
  71. package/src/InAppMessage/display/modal-utils.js +2 -2
  72. package/src/InAppMessage/in-app-message-factory.js +36 -36
  73. package/src/InAppMessage/in-app-message-manager.js +35 -35
  74. package/src/InAppMessage/log-in-app-message-button-click.js +3 -3
  75. package/src/InAppMessage/log-in-app-message-click.js +3 -3
  76. package/src/InAppMessage/log-in-app-message-html-click.js +3 -3
  77. package/src/InAppMessage/log-in-app-message-impression.js +3 -3
  78. package/src/InAppMessage/models/control-message.js +4 -4
  79. package/src/InAppMessage/models/full-screen-message.js +9 -9
  80. package/src/InAppMessage/models/html-message.js +2 -2
  81. package/src/InAppMessage/models/in-app-message-button.js +4 -4
  82. package/src/InAppMessage/models/in-app-message.js +34 -34
  83. package/src/InAppMessage/models/modal-message.js +7 -7
  84. package/src/InAppMessage/models/slide-up-message.js +8 -8
  85. package/src/InAppMessage/ui/show-in-app-message.js +20 -20
  86. package/src/Push/push-manager.js +44 -44
  87. package/src/User/user-manager.js +19 -19
  88. package/src/User/user.js +17 -17
  89. package/src/common/base-provider.js +1 -1
  90. package/src/common/constants.js +1 -0
  91. package/src/common/content-cards-display.js +6 -6
  92. package/src/common/event-logger.js +3 -3
  93. package/src/common/properties-base.js +3 -3
  94. package/src/l10n/l10n-manager.js +2 -2
  95. package/src/managers/auth-manager.js +11 -11
  96. package/src/managers/braze-instance.js +59 -59
  97. package/src/managers/device-manager.js +9 -9
  98. package/src/managers/network-manager.js +65 -63
  99. package/src/managers/server-config-manager.js +110 -93
  100. package/src/managers/session-manager.js +20 -20
  101. package/src/managers/storage-manager-factory.js +9 -9
  102. package/src/managers/storage-manager.js +137 -137
  103. package/src/managers/subscription-manager.js +2 -2
  104. package/src/managers/utils.js +1 -1
  105. package/src/models/braze-event.js +2 -2
  106. package/src/models/identifier.js +5 -5
  107. package/src/models/push-token.js +8 -8
  108. package/src/models/request-result.js +1 -1
  109. package/src/models/server-config.js +46 -28
  110. package/src/request-controller.js +124 -124
  111. package/src/triggers/models/custom-event-data.js +4 -4
  112. package/src/triggers/models/custom-event-property-data.js +5 -5
  113. package/src/triggers/models/filter-set.js +2 -2
  114. package/src/triggers/models/filter.js +1 -1
  115. package/src/triggers/models/in-app-message-click-data.js +5 -5
  116. package/src/triggers/models/purchase-data.js +1 -1
  117. package/src/triggers/models/purchase-property-data.js +2 -2
  118. package/src/triggers/models/push-click-data.js +5 -5
  119. package/src/triggers/models/trigger-condition.js +45 -45
  120. package/src/triggers/models/trigger-events.js +3 -3
  121. package/src/triggers/models/trigger.js +30 -30
  122. package/src/triggers/triggers-provider.js +63 -63
  123. package/src/types.js +5 -1
  124. package/src/ui/js/attach-css.js +1 -1
  125. package/src/util/braze-actions.js +6 -6
  126. package/src/util/browser-detector.js +13 -13
  127. package/src/util/client-hints-parser.js +5 -5
  128. package/src/util/code-utils.js +2 -2
  129. package/src/util/deprecation-utils.js +2 -2
  130. package/src/util/dom-utils.js +8 -8
  131. package/src/util/ecommerce-event-validation.js +343 -0
  132. package/src/util/html-display-utils.js +11 -11
  133. package/src/util/iso-4217-currency-codes.js +176 -0
  134. package/src/util/net.js +4 -4
  135. package/src/util/request-header-utils.js +10 -10
  136. package/src/util/string-utils.js +2 -2
  137. package/src/util/user-agent-parser.js +15 -15
  138. package/src/util/validation-utils.js +14 -14
@@ -8,7 +8,7 @@ import v from "../common/event-logger.js";
8
8
  import { newInAppMessageFromJson as pt } from "./in-app-message-factory.js";
9
9
  import { randomInclusive as a } from "../util/math.js";
10
10
  import L from "../models/request-result.js";
11
- import { logger as E, EventTypes as p } from "../../shared-lib/index.js";
11
+ import { logger as b, EventTypes as p } from "../../shared-lib/index.js";
12
12
  import f from "../managers/subscription-manager.js";
13
13
  import gt from "../triggers/models/trigger.js";
14
14
  import { BRAZE_ACTION_URI_REGEX as to } from "../util/validation-utils.js";
@@ -23,52 +23,52 @@ import It from "../Push/utils/push-utils.js";
23
23
  import h from "../util/request-header-utils.js";
24
24
  import { STORAGE_KEYS as s } from "../managers/storage-manager.js";
25
25
  import { FullScreenMessage, ModalMessage, SlideUpMessage } from "./index.js";
26
- import { IamClickAction as $e, IamServerTypes as dt } from "./constants.js";
26
+ import { IamClickAction as Le, IamServerTypes as dt } from "./constants.js";
27
27
  export default class ea {
28
28
  constructor(t, e, s, i) {
29
29
  (this.B = t),
30
- (this.j = e),
31
- (this.C = s),
30
+ (this.C = e),
31
+ (this.j = s),
32
32
  (this.Ss = i),
33
33
  (this.B = t),
34
- (this.j = e),
35
- (this.C = s),
34
+ (this.C = e),
35
+ (this.j = s),
36
36
  (this.Ss = i),
37
37
  (this.In = new f()),
38
38
  r.S(this.In),
39
39
  (this.An = 1e3),
40
40
  (this.Dn = 6e4),
41
- (this.Bn = null),
42
41
  (this._n = null),
43
- (this.qn = null);
42
+ (this.qn = null),
43
+ (this.xn = null);
44
44
  }
45
45
  Pn() {
46
46
  return this.In;
47
47
  }
48
48
  En(t) {
49
- return this.In.Kt(t);
49
+ return this.In.Ut(t);
50
50
  }
51
51
  Gn() {
52
- return this.Bn;
52
+ return this._n;
53
53
  }
54
54
  Nn(t) {
55
- this.Bn = t;
55
+ this._n = t;
56
56
  }
57
- wt(t, e, s, i) {
57
+ Dt(t, e, s, i) {
58
58
  const r = new L();
59
59
  let n;
60
60
  if (e === p.Fn || t instanceof ControlMessage) {
61
- if (!t.gs())
61
+ if (!t.js())
62
62
  return (
63
- E.info(
63
+ b.info(
64
64
  "This in-app message has already received an impression. Ignoring analytics event.",
65
65
  ),
66
66
  r
67
67
  );
68
68
  } else if (e === p.On || (t instanceof HtmlMessage && e === p.Xn)) {
69
- if (!t.ss(i))
69
+ if (!t.Yt(i))
70
70
  return (
71
- E.info(
71
+ b.info(
72
72
  "This in-app message has already received a click. Ignoring analytics event.",
73
73
  ),
74
74
  r
@@ -83,14 +83,14 @@ export default class ea {
83
83
  ? r
84
84
  : (t.messageExtras && (n.message_extras = t.messageExtras),
85
85
  null != s && (n.bid = s),
86
- v.wt(e, n))
86
+ v.Dt(e, n))
87
87
  );
88
88
  }
89
89
  Jn(t, e) {
90
90
  const s = new L();
91
- if (!t.ss())
91
+ if (!t.Yt())
92
92
  return (
93
- E.info(
93
+ b.info(
94
94
  "This in-app message button has already received a click. Ignoring analytics event.",
95
95
  ),
96
96
  s
@@ -99,11 +99,11 @@ export default class ea {
99
99
  return null == i
100
100
  ? s
101
101
  : t.id === InAppMessageButton.Kn
102
- ? (E.info(
102
+ ? (b.info(
103
103
  "This in-app message button does not have a tracking id. Not logging event to Braze servers.",
104
104
  ),
105
105
  s)
106
- : (null != t.id && (i.bid = t.id), v.wt(p.Xn, i));
106
+ : (null != t.id && (i.bid = t.id), v.Dt(p.Xn, i));
107
107
  }
108
108
  Ln(t) {
109
109
  const e = t.messageFields;
@@ -128,27 +128,27 @@ export default class ea {
128
128
  let i;
129
129
  for (const t of s)
130
130
  if (
131
- t.clickAction === $e.URI &&
131
+ t.clickAction === Le.URI &&
132
132
  t.uri &&
133
133
  to.test(t.uri) &&
134
134
  ((i = e(t.uri)), i)
135
135
  )
136
136
  return i;
137
- return t.clickAction === $e.URI && t.uri && to.test(t.uri)
137
+ return t.clickAction === Le.URI && t.uri && to.test(t.uri)
138
138
  ? e(t.uri)
139
139
  : void 0;
140
140
  }
141
141
  Zn(t, e) {
142
- e !== this.qn && this._o(), (this._n = t), (this.qn = e);
142
+ e !== this.xn && this._o(), (this.qn = t), (this.xn = e);
143
143
  }
144
144
  _o() {
145
- null != this._n &&
146
- (clearTimeout(this._n), (this._n = null), (this.qn = null));
145
+ null != this.qn &&
146
+ (clearTimeout(this.qn), (this.qn = null), (this.xn = null));
147
147
  }
148
148
  Xo(t, e, s, i) {
149
149
  const r = this.B;
150
150
  if (!r) return;
151
- this.qn && t.triggerId !== this.qn && (this._o(), h.Li(this.C, h.it.Yo));
151
+ this.xn && t.triggerId !== this.xn && (this._o(), h.Ji(this.j, h.it.Yo));
152
152
  const n = r.Zo(!1),
153
153
  o = r.Z(n);
154
154
  (o.template = { trigger_id: t.triggerId, trigger_event_type: e }),
@@ -160,7 +160,7 @@ export default class ea {
160
160
  const n = this.B;
161
161
  if (!n) return;
162
162
  const m = new Date().valueOf();
163
- h.nt(this.C, h.it.Yo, m),
163
+ h.nt(this.j, h.it.Yo, m),
164
164
  -1 !== r && u.push(["X-Braze-Req-Tokens-Remaining", r.toString()]);
165
165
  let c,
166
166
  p,
@@ -179,7 +179,7 @@ export default class ea {
179
179
  if (null == i) return;
180
180
  const r = this.Qn(i);
181
181
  if (r)
182
- return E.error(r), void ("function" == typeof t.ia && t.ia());
182
+ return b.error(r), void ("function" == typeof t.ia && t.ia());
183
183
  "function" == typeof t.ua && t.ua(i);
184
184
  },
185
185
  error: (e) => {
@@ -216,7 +216,7 @@ export default class ea {
216
216
  Hn(t) {
217
217
  if (null == t.triggerId)
218
218
  return (
219
- E.info(
219
+ b.info(
220
220
  "The in-app message has no analytics id. Not logging event to Braze servers.",
221
221
  ),
222
222
  null
@@ -226,17 +226,17 @@ export default class ea {
226
226
  }
227
227
  jn(t) {
228
228
  return (
229
- !!this.C &&
229
+ !!this.j &&
230
230
  !(
231
231
  !(t && t instanceof InAppMessage && t.constructor !== InAppMessage) ||
232
232
  t instanceof ControlMessage
233
233
  ) &&
234
- this.C.It(s.Tt.pa, t.qt())
234
+ this.j.Pt(s.It.pa, t.qt())
235
235
  );
236
236
  }
237
237
  sa() {
238
- if (!this.C) return null;
239
- const t = this.C.Rt(s.Tt.pa);
238
+ if (!this.j) return null;
239
+ const t = this.j.St(s.It.pa);
240
240
  if (!t) return null;
241
241
  let e;
242
242
  switch (t.type) {
@@ -258,6 +258,6 @@ export default class ea {
258
258
  return e && this.fa(), e;
259
259
  }
260
260
  fa() {
261
- this.C && this.C.Qt(s.Tt.pa);
261
+ this.j && this.j.Vt(s.It.pa);
262
262
  }
263
263
  }
@@ -3,15 +3,15 @@ import { IamStrings as mr } from "./constants.js";
3
3
  import InAppMessage from "./models/in-app-message.js";
4
4
  import InAppMessageButton from "./models/in-app-message-button.js";
5
5
  import je from "./in-app-message-manager-factory.js";
6
- import { logger as E } from "../../shared-lib/index.js";
6
+ import { logger as b } from "../../shared-lib/index.js";
7
7
  import ot from "../triggers/models/trigger-events.js";
8
8
  import { TriggersProviderFactory as rt } from "../triggers/triggers-provider-factory.js";
9
9
  export function logInAppMessageButtonClick(t, o) {
10
10
  var e;
11
11
  if (!r.rr()) return !1;
12
12
  if (!(t instanceof InAppMessageButton))
13
- return E.error("button must be an InAppMessageButton object"), !1;
14
- if (!(o instanceof InAppMessage)) return E.error(mr.EE), !1;
13
+ return b.error("button must be an InAppMessageButton object"), !1;
14
+ if (!(o instanceof InAppMessage)) return b.error(mr.EE), !1;
15
15
  const s = je.ra().Jn(t, o);
16
16
  if (s.lt)
17
17
  for (let r = 0; r < s.Ce.length; r++)
@@ -3,13 +3,13 @@ import InAppMessage from "./models/in-app-message.js";
3
3
  import je from "./in-app-message-manager-factory.js";
4
4
  import { logInAppMessageImpression } from "./log-in-app-message-impression.js";
5
5
  import { IamStrings as mr } from "./constants.js";
6
- import { logger as E, EventTypes as p } from "../../shared-lib/index.js";
6
+ import { logger as b, EventTypes as p } from "../../shared-lib/index.js";
7
7
  import ot from "../triggers/models/trigger-events.js";
8
8
  import { TriggersProviderFactory as rt } from "../triggers/triggers-provider-factory.js";
9
9
  export function logInAppMessageClick(s) {
10
10
  if (!r.rr()) return !1;
11
- if (!(s instanceof InAppMessage)) return E.error(mr.EE), !1;
12
- const e = je.ra().wt(s, p.On);
11
+ if (!(s instanceof InAppMessage)) return b.error(mr.EE), !1;
12
+ const e = je.ra().Dt(s, p.On);
13
13
  if (e) {
14
14
  s.sm() || logInAppMessageImpression(s);
15
15
  for (let r = 0; r < e.Ce.length; r++)
@@ -1,21 +1,21 @@
1
1
  import r from "../managers/braze-instance.js";
2
2
  import HtmlMessage from "./models/html-message.js";
3
3
  import je from "./in-app-message-manager-factory.js";
4
- import { logger as E, EventTypes as p } from "../../shared-lib/index.js";
4
+ import { logger as b, EventTypes as p } from "../../shared-lib/index.js";
5
5
  import ot from "../triggers/models/trigger-events.js";
6
6
  import { TriggersProviderFactory as rt } from "../triggers/triggers-provider-factory.js";
7
7
  export function logInAppMessageHtmlClick(e, t, s) {
8
8
  if (!r.rr()) return !1;
9
9
  if (!(e instanceof HtmlMessage))
10
10
  return (
11
- E.error(
11
+ b.error(
12
12
  "inAppMessage argument to logInAppMessageHtmlClick must be an HtmlMessage object.",
13
13
  ),
14
14
  !1
15
15
  );
16
16
  let o = p.On;
17
17
  null != t && (o = p.Xn);
18
- const m = je.ra().wt(e, o, t, s);
18
+ const m = je.ra().Dt(e, o, t, s);
19
19
  if (m.lt)
20
20
  for (let r = 0; r < m.Ce.length; r++)
21
21
  rt.o().Ee(ot.rm, [e.triggerId, t], m.Ce[r]);
@@ -3,11 +3,11 @@ import ControlMessage from "./models/control-message.js";
3
3
  import InAppMessage from "./models/in-app-message.js";
4
4
  import je from "./in-app-message-manager-factory.js";
5
5
  import { IamStrings as mr } from "./constants.js";
6
- import { logger as E, EventTypes as p } from "../../shared-lib/index.js";
6
+ import { logger as b, EventTypes as p } from "../../shared-lib/index.js";
7
7
  export function logInAppMessageImpression(s) {
8
8
  if (!r.rr()) return !1;
9
9
  if (!(s instanceof InAppMessage || s instanceof ControlMessage))
10
- return E.error(mr.EE), !1;
10
+ return b.error(mr.EE), !1;
11
11
  const o = s instanceof ControlMessage ? p.om : p.Fn;
12
- return je.ra().wt(s, o).lt;
12
+ return je.ra().Dt(s, o).lt;
13
13
  }
@@ -6,15 +6,15 @@ export default class ControlMessage {
6
6
  (this.messageExtras = t),
7
7
  (this.extras = {}),
8
8
  (this.isControl = !0),
9
- (this.Zt = !1);
9
+ (this.hs = !1);
10
10
  }
11
11
  static fromJson(s) {
12
12
  return new ControlMessage(s.trigger_id, s.message_extras);
13
13
  }
14
- gs() {
15
- return !this.Zt && ((this.Zt = !0), !0);
14
+ js() {
15
+ return !this.hs && ((this.hs = !0), !0);
16
16
  }
17
17
  sm() {
18
- return this.Zt;
18
+ return this.hs;
19
19
  }
20
20
  }
@@ -1,10 +1,10 @@
1
1
  import {
2
- IamCropType as Le,
2
+ IamCropType as Me,
3
3
  IamDismissType as pr,
4
- IamOrientation as Ae,
4
+ IamOrientation as De,
5
5
  IamSerializationKeys as cr,
6
6
  IamServerTypes as dt,
7
- IamTextAlignment as Ee,
7
+ IamTextAlignment as Fe,
8
8
  } from "../constants.js";
9
9
  import { buttonsFromSerializedInAppMessage as ur } from "../in-app-message-factory.js";
10
10
  import InAppMessage from "./in-app-message.js";
@@ -43,7 +43,7 @@ export default class FullScreenMessage extends InAppMessage {
43
43
  D,
44
44
  ) {
45
45
  (p = p || pr.MANUAL),
46
- (k = k || Ae.PORTRAIT),
46
+ (k = k || De.PORTRAIT),
47
47
  super(
48
48
  r,
49
49
  s,
@@ -70,7 +70,7 @@ export default class FullScreenMessage extends InAppMessage {
70
70
  w,
71
71
  y,
72
72
  S,
73
- (b = b || Le.CENTER_CROP),
73
+ (b = b || Me.CENTER_CROP),
74
74
  k,
75
75
  q,
76
76
  A,
@@ -78,7 +78,7 @@ export default class FullScreenMessage extends InAppMessage {
78
78
  C,
79
79
  D,
80
80
  ),
81
- (this.Go = Ee.CENTER);
81
+ (this.Go = Fe.CENTER);
82
82
  }
83
83
  qt() {
84
84
  return super.qt(dt.cE);
@@ -87,7 +87,7 @@ export default class FullScreenMessage extends InAppMessage {
87
87
  return new FullScreenMessage(
88
88
  r[cr.rE],
89
89
  r[cr.mE],
90
- r[cr.Fs],
90
+ r[cr.Is],
91
91
  r[cr.FE],
92
92
  r[cr.HE],
93
93
  r[cr.URI],
@@ -95,7 +95,7 @@ export default class FullScreenMessage extends InAppMessage {
95
95
  r[cr.BE],
96
96
  r[cr.lE],
97
97
  r[cr.bE],
98
- r[cr.ys],
98
+ r[cr.Bs],
99
99
  r[cr.gE],
100
100
  r[cr.YE],
101
101
  r[cr.KE],
@@ -115,7 +115,7 @@ export default class FullScreenMessage extends InAppMessage {
115
115
  r[cr.CSS],
116
116
  r[cr.JE],
117
117
  r[cr.LANGUAGE],
118
- r[cr.Ks],
118
+ r[cr.Ns],
119
119
  );
120
120
  }
121
121
  }
@@ -46,7 +46,7 @@ export default class HtmlMessage extends InAppMessage {
46
46
  od() {
47
47
  return !1;
48
48
  }
49
- ss(i) {
49
+ Yt(i) {
50
50
  if (this.ko === dt.iE) {
51
51
  if (this.rd) return !1;
52
52
  this.rd = !0;
@@ -60,7 +60,7 @@ export default class HtmlMessage extends InAppMessage {
60
60
  static ha(i) {
61
61
  return new HtmlMessage(
62
62
  i[cr.rE],
63
- i[cr.Fs],
63
+ i[cr.Is],
64
64
  i[cr.FE],
65
65
  i[cr.BE],
66
66
  i[cr.lE],
@@ -1,5 +1,5 @@
1
1
  import f from "../../managers/subscription-manager.js";
2
- import { IamColors as ss, IamClickAction as $e } from "../constants.js";
2
+ import { IamColors as ss, IamClickAction as Le } from "../constants.js";
3
3
  export default class InAppMessageButton {
4
4
  constructor(s, t, i, r, h, e, n) {
5
5
  (this.text = s),
@@ -13,7 +13,7 @@ export default class InAppMessageButton {
13
13
  (this.backgroundColor = t || ss._E),
14
14
  (this.textColor = i || ss.AE),
15
15
  (this.borderColor = r || this.backgroundColor),
16
- (this.clickAction = h || $e.NONE),
16
+ (this.clickAction = h || Le.NONE),
17
17
  (this.uri = e),
18
18
  null == n && (n = InAppMessageButton.Kn),
19
19
  (this.id = n),
@@ -21,7 +21,7 @@ export default class InAppMessageButton {
21
21
  (this.ti = new f());
22
22
  }
23
23
  subscribeToClickedEvent(s) {
24
- return this.ti.Kt(s);
24
+ return this.ti.Ut(s);
25
25
  }
26
26
  removeSubscription(s) {
27
27
  this.ti.removeSubscription(s);
@@ -29,7 +29,7 @@ export default class InAppMessageButton {
29
29
  removeAllSubscriptions() {
30
30
  this.ti.removeAllSubscriptions();
31
31
  }
32
- ss() {
32
+ Yt() {
33
33
  return !this.rd && ((this.rd = !0), this.ti.A(), !0);
34
34
  }
35
35
  static fromJson(s) {
@@ -10,17 +10,17 @@ import { isIFrame as St } from "../utils/in-app-message-utils.js";
10
10
  import {
11
11
  IamStrings as mr,
12
12
  IamColors as ss,
13
- IamClickAction as $e,
13
+ IamClickAction as Le,
14
14
  IAM_SHOW_CLASS as Tt,
15
15
  IAM_HIDE_CLASS as xt,
16
- IamDisplayFailures as Me,
17
- IamSlideFrom as De,
16
+ IamDisplayFailures as qe,
17
+ IamSlideFrom as Ee,
18
18
  IamDismissType as pr,
19
19
  IamOpenTarget as ut,
20
- IamImageStyle as qe,
21
- IamOrientation as Ae,
22
- IamTextAlignment as Ee,
23
- IamCropType as Le,
20
+ IamImageStyle as Ae,
21
+ IamOrientation as De,
22
+ IamTextAlignment as Fe,
23
+ IamCropType as Me,
24
24
  IamServerTypes as dt,
25
25
  IamTiming as Et,
26
26
  IamSerializationKeys as cr,
@@ -93,18 +93,18 @@ export default class InAppMessage {
93
93
  (this.language = D),
94
94
  (this.altImageText = z),
95
95
  (this.message = t),
96
- (this.messageAlignment = s || Ee.CENTER),
96
+ (this.messageAlignment = s || Fe.CENTER),
97
97
  (this.duration = u || 5e3),
98
- (this.slideFrom = i || De.BOTTOM),
98
+ (this.slideFrom = i || Ee.BOTTOM),
99
99
  (this.extras = h || {}),
100
100
  (this.triggerId = e),
101
- (this.clickAction = n || $e.NONE),
101
+ (this.clickAction = n || Le.NONE),
102
102
  (this.uri = r),
103
103
  (this.openTarget = o || ut.NONE),
104
104
  (this.dismissType = l || pr.AUTO_DISMISS),
105
105
  (this.icon = a),
106
106
  (this.imageUrl = m),
107
- (this.imageStyle = c || qe.TOP),
107
+ (this.imageStyle = c || Ae.TOP),
108
108
  (this.iconColor = d || ss.AE),
109
109
  (this.iconBackgroundColor = p || ss._E),
110
110
  (this.backgroundColor = b || ss.AE),
@@ -115,11 +115,11 @@ export default class InAppMessage {
115
115
  (this.animateOut = j),
116
116
  null == this.animateOut && (this.animateOut = !0),
117
117
  (this.header = k),
118
- (this.headerAlignment = w || Ee.CENTER),
118
+ (this.headerAlignment = w || Fe.CENTER),
119
119
  (this.headerTextColor = y || ss.IE),
120
120
  (this.frameColor = S || ss.SE),
121
121
  (this.buttons = T || []),
122
- (this.cropType = x || Le.FIT_CENTER),
122
+ (this.cropType = x || Me.FIT_CENTER),
123
123
  (this.orientation = E),
124
124
  (this.htmlId = H),
125
125
  (this.css = M),
@@ -128,20 +128,20 @@ export default class InAppMessage {
128
128
  (this.language = D),
129
129
  (this.altImageText = z),
130
130
  (this.th = !1),
131
- (this.Zt = !1),
131
+ (this.hs = !1),
132
132
  (this.rd = !1),
133
133
  (this.sh = !1),
134
134
  (this.Eo = null),
135
135
  (this.$o = null),
136
136
  (this.ti = new f()),
137
137
  (this.ih = new f()),
138
- (this.Go = Ee.CENTER);
138
+ (this.Go = Fe.CENTER);
139
139
  }
140
140
  subscribeToClickedEvent(t) {
141
- return this.ti.Kt(t);
141
+ return this.ti.Ut(t);
142
142
  }
143
143
  subscribeToDismissedEvent(t) {
144
- return this.ih.Kt(t);
144
+ return this.ih.Ut(t);
145
145
  }
146
146
  removeSubscription(t) {
147
147
  this.ti.removeSubscription(t), this.ih.removeSubscription(t);
@@ -167,16 +167,16 @@ export default class InAppMessage {
167
167
  Oo() {
168
168
  if (this.Bo() && this.Mo()) return this.htmlId + "-css";
169
169
  }
170
- gs() {
171
- return !this.Zt && ((this.Zt = !0), !0);
170
+ js() {
171
+ return !this.hs && ((this.hs = !0), !0);
172
172
  }
173
173
  sm() {
174
- return this.Zt;
174
+ return this.hs;
175
175
  }
176
- ss(t) {
176
+ Yt(t) {
177
177
  return !this.rd && ((this.rd = !0), this.ti.A(), !0);
178
178
  }
179
- ls() {
179
+ Ft() {
180
180
  return !this.sh && ((this.sh = !0), this.ih.A(), !0);
181
181
  }
182
182
  hide(t) {
@@ -215,7 +215,7 @@ export default class InAppMessage {
215
215
  t && t.parentNode && t.parentNode.removeChild(t);
216
216
  }
217
217
  null != e && "Safari" === ro.browser && (e.scrollTop = n),
218
- s ? s() : this.ls();
218
+ s ? s() : this.Ft();
219
219
  };
220
220
  h ? setTimeout(r, Et.gr) : r(), this.$o && this.$o.focus();
221
221
  }
@@ -240,7 +240,7 @@ export default class InAppMessage {
240
240
  const s = t.parentNode;
241
241
  this.zo() &&
242
242
  null != s &&
243
- this.orientation !== Ae.LANDSCAPE &&
243
+ this.orientation !== De.LANDSCAPE &&
244
244
  (null != s.classList && s.classList.add(mr.TE),
245
245
  document.body.addEventListener(
246
246
  "touchmove",
@@ -289,7 +289,7 @@ export default class InAppMessage {
289
289
  ? ((s[cr.rE] = this.message),
290
290
  (s[cr.mE] = this.messageAlignment),
291
291
  (s[cr.GE] = this.slideFrom),
292
- (s[cr.Fs] = this.extras),
292
+ (s[cr.Is] = this.extras),
293
293
  (s[cr.FE] = this.triggerId),
294
294
  (s[cr.HE] = this.clickAction),
295
295
  (s[cr.URI] = this.uri),
@@ -297,7 +297,7 @@ export default class InAppMessage {
297
297
  (s[cr.BE] = this.dismissType),
298
298
  (s[cr.lE] = this.duration),
299
299
  (s[cr.bE] = this.icon),
300
- (s[cr.ys] = this.imageUrl),
300
+ (s[cr.Bs] = this.imageUrl),
301
301
  (s[cr.gE] = this.imageStyle),
302
302
  (s[cr.YE] = this.iconColor),
303
303
  (s[cr.KE] = this.iconBackgroundColor),
@@ -318,21 +318,21 @@ export default class InAppMessage {
318
318
  (s[cr.xs] = t),
319
319
  (s[cr.JE] = this.messageExtras),
320
320
  (s[cr.LANGUAGE] = this.language),
321
- (s[cr.Ks] = this.altImageText),
321
+ (s[cr.Ns] = this.altImageText),
322
322
  s)
323
323
  : s;
324
324
  }
325
325
  }
326
326
  (InAppMessage.ah = ss),
327
- (InAppMessage.mh = Me),
328
- (InAppMessage.SlideFrom = De),
329
- (InAppMessage.ClickAction = $e),
327
+ (InAppMessage.mh = qe),
328
+ (InAppMessage.SlideFrom = Ee),
329
+ (InAppMessage.ClickAction = Le),
330
330
  (InAppMessage.DismissType = pr),
331
331
  (InAppMessage.OpenTarget = ut),
332
- (InAppMessage.ImageStyle = qe),
333
- (InAppMessage.Orientation = Ae),
334
- (InAppMessage.TextAlignment = Ee),
335
- (InAppMessage.CropType = Le),
332
+ (InAppMessage.ImageStyle = Ae),
333
+ (InAppMessage.Orientation = De),
334
+ (InAppMessage.TextAlignment = Fe),
335
+ (InAppMessage.CropType = Me),
336
336
  (InAppMessage.dh = dt),
337
337
  (InAppMessage.gr = Et.gr),
338
338
  (InAppMessage.pE = Et.pE),
@@ -1,9 +1,9 @@
1
1
  import {
2
- IamCropType as Le,
2
+ IamCropType as Me,
3
3
  IamDismissType as pr,
4
4
  IamSerializationKeys as cr,
5
5
  IamServerTypes as dt,
6
- IamTextAlignment as Ee,
6
+ IamTextAlignment as Fe,
7
7
  } from "../constants.js";
8
8
  import { buttonsFromSerializedInAppMessage as ur } from "../in-app-message-factory.js";
9
9
  import InAppMessage from "./in-app-message.js";
@@ -66,7 +66,7 @@ export default class ModalMessage extends InAppMessage {
66
66
  w,
67
67
  y,
68
68
  S,
69
- (b = b || Le.FIT_CENTER),
69
+ (b = b || Me.FIT_CENTER),
70
70
  void 0,
71
71
  k,
72
72
  q,
@@ -74,7 +74,7 @@ export default class ModalMessage extends InAppMessage {
74
74
  B,
75
75
  C,
76
76
  ),
77
- (this.Go = Ee.CENTER);
77
+ (this.Go = Fe.CENTER);
78
78
  }
79
79
  qt() {
80
80
  return super.qt(dt.aE);
@@ -83,7 +83,7 @@ export default class ModalMessage extends InAppMessage {
83
83
  return new ModalMessage(
84
84
  r[cr.rE],
85
85
  r[cr.mE],
86
- r[cr.Fs],
86
+ r[cr.Is],
87
87
  r[cr.FE],
88
88
  r[cr.HE],
89
89
  r[cr.URI],
@@ -91,7 +91,7 @@ export default class ModalMessage extends InAppMessage {
91
91
  r[cr.BE],
92
92
  r[cr.lE],
93
93
  r[cr.bE],
94
- r[cr.ys],
94
+ r[cr.Bs],
95
95
  r[cr.gE],
96
96
  r[cr.YE],
97
97
  r[cr.KE],
@@ -110,7 +110,7 @@ export default class ModalMessage extends InAppMessage {
110
110
  r[cr.CSS],
111
111
  r[cr.JE],
112
112
  r[cr.LANGUAGE],
113
- r[cr.Ks],
113
+ r[cr.Ns],
114
114
  );
115
115
  }
116
116
  }