@braze/web-sdk 5.0.0 → 5.1.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 (158) hide show
  1. package/README.md +1 -1
  2. package/index.d.ts +12 -5
  3. package/package.json +1 -1
  4. package/shared-lib/encoding-utils.js +3 -3
  5. package/shared-lib/event-types.js +29 -29
  6. package/shared-lib/guid.js +3 -3
  7. package/shared-lib/index.js +6 -0
  8. package/shared-lib/indexed-db-adapter.js +70 -70
  9. package/shared-lib/logger.js +18 -18
  10. package/shared-lib/supported-options.js +21 -21
  11. package/src/Card/card-manager.js +43 -45
  12. package/src/Card/display/card-display.js +60 -60
  13. package/src/Card/log-card-click.js +4 -4
  14. package/src/Card/log-card-dismissal.js +2 -3
  15. package/src/Card/log-card-impressions.js +7 -7
  16. package/src/Card/models/captioned-image.js +21 -21
  17. package/src/Card/models/card.js +73 -73
  18. package/src/Card/models/classic-card.js +21 -21
  19. package/src/Card/models/control-card.js +11 -11
  20. package/src/Card/models/image-only.js +19 -19
  21. package/src/Card/util/card-factory.js +68 -68
  22. package/src/ContentCards/content-cards-provider-factory.js +3 -3
  23. package/src/ContentCards/content-cards-provider.js +255 -245
  24. package/src/ContentCards/content-cards.js +2 -2
  25. package/src/ContentCards/get-cached-content-cards.js +1 -1
  26. package/src/ContentCards/request-content-cards-refresh.js +1 -1
  27. package/src/ContentCards/subscribe-to-content-cards-updates.js +6 -6
  28. package/src/ContentCards/ui/hide-content-cards.js +1 -1
  29. package/src/ContentCards/ui/show-content-cards.js +24 -24
  30. package/src/ContentCards/ui/toggle-content-cards.js +1 -1
  31. package/src/Core/add-sdk-metadata.js +21 -19
  32. package/src/Core/change-user.js +10 -10
  33. package/src/Core/destroy.js +2 -2
  34. package/src/Core/disable-sdk.js +11 -11
  35. package/src/Core/enable-sdk.js +7 -7
  36. package/src/Core/get-device-id.js +6 -6
  37. package/src/Core/get-user.js +1 -1
  38. package/src/Core/handle-braze-action.js +41 -41
  39. package/src/Core/is-disabled.js +2 -2
  40. package/src/Core/log-custom-event.js +15 -15
  41. package/src/Core/log-purchase.js +31 -37
  42. package/src/Core/open-session.js +12 -12
  43. package/src/Core/remove-all-subscriptions.js +1 -1
  44. package/src/Core/remove-subscription.js +1 -1
  45. package/src/Core/request-immediate-data-flush.js +1 -1
  46. package/src/Core/set-logger.js +2 -2
  47. package/src/Core/set-sdk-authentication-signature.js +3 -3
  48. package/src/Core/subscribe-to-sdk-authentication-failures.js +6 -4
  49. package/src/Core/toggle-logging.js +2 -2
  50. package/src/Core/wipe-data.js +9 -9
  51. package/src/FeatureFlags/feature-flag-factory.js +12 -12
  52. package/src/FeatureFlags/feature-flag.js +10 -10
  53. package/src/FeatureFlags/feature-flags-provider-factory.js +3 -2
  54. package/src/FeatureFlags/feature-flags-provider.js +108 -80
  55. package/src/FeatureFlags/get-all-feature-flags.js +5 -5
  56. package/src/FeatureFlags/get-feature-flag.js +6 -6
  57. package/src/FeatureFlags/log-feature-flag-impression.js +15 -13
  58. package/src/FeatureFlags/refresh-feature-flags.js +1 -1
  59. package/src/FeatureFlags/subscribe-to-feature-flags-updates.js +7 -4
  60. package/src/Feed/feed-provider-factory.js +2 -2
  61. package/src/Feed/feed-provider.js +44 -44
  62. package/src/Feed/feed.js +1 -1
  63. package/src/Feed/get-cached-feed.js +1 -1
  64. package/src/Feed/log-feed-displayed.js +4 -4
  65. package/src/Feed/request-feed-refresh.js +1 -1
  66. package/src/Feed/subscribe-to-feed-updates.js +1 -1
  67. package/src/Feed/ui/hide-feed.js +1 -1
  68. package/src/Feed/ui/show-feed.js +28 -28
  69. package/src/Feed/ui/toggle-feed.js +1 -1
  70. package/src/InAppMessage/defer-in-app-message.js +5 -5
  71. package/src/InAppMessage/display/html-message-to-html.js +54 -54
  72. package/src/InAppMessage/display/in-app-message-to-html.js +79 -79
  73. package/src/InAppMessage/display/modal-utils.js +8 -8
  74. package/src/InAppMessage/get-deferred-in-app-message.js +1 -1
  75. package/src/InAppMessage/in-app-message-factory.js +49 -49
  76. package/src/InAppMessage/in-app-message-manager-factory.js +1 -1
  77. package/src/InAppMessage/in-app-message-manager.js +143 -138
  78. package/src/InAppMessage/log-in-app-message-button-click.js +12 -12
  79. package/src/InAppMessage/log-in-app-message-click.js +9 -9
  80. package/src/InAppMessage/log-in-app-message-html-click.js +12 -12
  81. package/src/InAppMessage/log-in-app-message-impression.js +6 -6
  82. package/src/InAppMessage/models/full-screen-message.js +33 -33
  83. package/src/InAppMessage/models/html-message.js +20 -20
  84. package/src/InAppMessage/models/in-app-message-button.js +6 -6
  85. package/src/InAppMessage/models/in-app-message.js +99 -99
  86. package/src/InAppMessage/models/modal-message.js +32 -32
  87. package/src/InAppMessage/models/slide-up-message.js +28 -28
  88. package/src/InAppMessage/models/templated-in-app-message.js +8 -8
  89. package/src/InAppMessage/subscribe-to-in-app-message.js +2 -2
  90. package/src/InAppMessage/ui/automatically-show-in-app-messages.js +4 -4
  91. package/src/InAppMessage/ui/show-in-app-message.js +81 -81
  92. package/src/Push/is-push-blocked.js +1 -1
  93. package/src/Push/is-push-permission-granted.js +1 -1
  94. package/src/Push/is-push-supported.js +1 -1
  95. package/src/Push/push-manager-factory.js +5 -5
  96. package/src/Push/push-manager.js +176 -173
  97. package/src/Push/request-push-permission.js +1 -1
  98. package/src/Push/unregister-push.js +1 -1
  99. package/src/Push/utils/push-utils.js +4 -4
  100. package/src/User/user-manager.js +29 -29
  101. package/src/User/user.js +72 -74
  102. package/src/common/base-feed.js +7 -7
  103. package/src/common/base-provider.js +1 -1
  104. package/src/common/constants.js +2 -0
  105. package/src/common/event-logger.js +21 -18
  106. package/src/common/feed-display.js +44 -44
  107. package/src/l10n/l10n-manager-factory.js +3 -3
  108. package/src/l10n/l10n-manager.js +7 -7
  109. package/src/managers/auth-manager.js +32 -32
  110. package/src/managers/braze-instance.js +188 -189
  111. package/src/managers/device-manager.js +28 -28
  112. package/src/managers/network-manager.js +189 -138
  113. package/src/managers/server-config-manager.js +69 -53
  114. package/src/managers/session-manager.js +34 -30
  115. package/src/managers/storage-manager-factory.js +16 -16
  116. package/src/managers/storage-manager.js +210 -188
  117. package/src/managers/subscription-manager.js +12 -12
  118. package/src/models/backend-errors.js +5 -5
  119. package/src/models/braze-event.js +3 -3
  120. package/src/models/device.js +2 -2
  121. package/src/models/identifier.js +34 -14
  122. package/src/models/push-token.js +8 -8
  123. package/src/models/request-result.js +3 -3
  124. package/src/models/server-config.js +32 -23
  125. package/src/request-controller.js +187 -180
  126. package/src/triggers/models/custom-event-data.js +7 -7
  127. package/src/triggers/models/custom-event-property-data.js +10 -10
  128. package/src/triggers/models/filter-set.js +13 -13
  129. package/src/triggers/models/filter.js +45 -45
  130. package/src/triggers/models/in-app-message-click-data.js +12 -12
  131. package/src/triggers/models/purchase-data.js +2 -2
  132. package/src/triggers/models/purchase-property-data.js +10 -10
  133. package/src/triggers/models/push-click-data.js +7 -7
  134. package/src/triggers/models/trigger-condition.js +57 -59
  135. package/src/triggers/models/trigger-events.js +4 -4
  136. package/src/triggers/models/trigger.js +38 -38
  137. package/src/triggers/triggers-provider-factory.js +4 -4
  138. package/src/triggers/triggers-provider.js +127 -130
  139. package/src/ui/js/attach-css.js +2 -2
  140. package/src/ui/js/iam-css.js +1 -1
  141. package/src/ui/js/load-font-awesome.js +1 -1
  142. package/src/util/base-device-parser.js +3 -3
  143. package/src/util/braze-actions.js +35 -35
  144. package/src/util/browser-detector.js +21 -21
  145. package/src/util/client-hints-parser.js +8 -8
  146. package/src/util/code-utils.js +2 -2
  147. package/src/util/component-utils.js +1 -1
  148. package/src/util/deprecation-utils.js +4 -4
  149. package/src/util/device-constants.js +1 -1
  150. package/src/util/dom-utils.js +18 -18
  151. package/src/util/key-codes.js +1 -1
  152. package/src/util/net.js +18 -18
  153. package/src/util/request-header-utils.js +39 -37
  154. package/src/util/string-utils.js +10 -10
  155. package/src/util/user-agent-parser.js +18 -18
  156. package/src/util/validation-utils.js +37 -39
  157. package/src/util/window-utils.js +3 -3
  158. package/shared-lib/braze-shared-lib.js +0 -8
@@ -2,10 +2,10 @@ import { isDate as yt } from "../../util/code-utils.js";
2
2
  import {
3
3
  convertMsToSeconds as h,
4
4
  dateFromUnixTimestamp as l,
5
- secondsAgo as ts,
6
- secondsInTheFuture as es,
5
+ secondsAgo as es,
6
+ secondsInTheFuture as ls,
7
7
  } from "../../util/date-utils.js";
8
- export default class Zt {
8
+ export default class lr {
9
9
  constructor(t, s, e, i) {
10
10
  (this.Tl = t),
11
11
  (this.Al = s),
@@ -15,48 +15,48 @@ export default class Zt {
15
15
  (this.Al = s),
16
16
  (this.comparator = e),
17
17
  (this._l = i),
18
- this.Al === Zt.Rl.Ml &&
19
- this.comparator !== Zt.Il.Ll &&
20
- this.comparator !== Zt.Il.Ol &&
21
- this.comparator !== Zt.Il.Ul &&
22
- this.comparator !== Zt.Il.Ql &&
18
+ this.Al === lr.Il.Ll &&
19
+ this.comparator !== lr.Ul.Ol &&
20
+ this.comparator !== lr.Ul.Ql &&
21
+ this.comparator !== lr.Ul.Xl &&
22
+ this.comparator !== lr.Ul.Fl &&
23
23
  (this._l = l(this._l));
24
24
  }
25
- Bl(t) {
25
+ Jl(t) {
26
26
  let s = null;
27
27
  switch ((null != t && (s = t[this.Tl]), this.comparator)) {
28
- case Zt.Il.Xl:
28
+ case lr.Ul.Kl:
29
29
  return null != s && s.valueOf() === this._l.valueOf();
30
- case Zt.Il.Fl:
30
+ case lr.Ul.Pl:
31
31
  return null == s || s.valueOf() !== this._l.valueOf();
32
- case Zt.Il.Kl:
32
+ case lr.Ul.Yl:
33
33
  return null != s && typeof s == typeof this._l && s > this._l;
34
- case Zt.Il.Ll:
35
- return this.Al === Zt.Rl.Ml
36
- ? null != s && yt(s) && ts(s) <= this._l.valueOf()
34
+ case lr.Ul.Ol:
35
+ return this.Al === lr.Il.Ll
36
+ ? null != s && yt(s) && es(s) <= this._l.valueOf()
37
37
  : null != s && typeof s == typeof this._l && s >= this._l;
38
- case Zt.Il.Pl:
38
+ case lr.Ul.Zl:
39
39
  return null != s && typeof s == typeof this._l && s < this._l;
40
- case Zt.Il.Ol:
41
- return this.Al === Zt.Rl.Ml
42
- ? null != s && yt(s) && ts(s) >= this._l.valueOf()
40
+ case lr.Ul.Ql:
41
+ return this.Al === lr.Il.Ll
42
+ ? null != s && yt(s) && es(s) >= this._l.valueOf()
43
43
  : null != s && typeof s == typeof this._l && s <= this._l;
44
- case Zt.Il.Yl:
44
+ case lr.Ul.$l:
45
45
  return (
46
46
  null != s &&
47
47
  "string" == typeof s &&
48
48
  typeof s == typeof this._l &&
49
49
  null != s.match(this._l)
50
50
  );
51
- case Zt.Il.Zl:
51
+ case lr.Ul.Eu:
52
52
  return null != s;
53
- case Zt.Il.$l:
53
+ case lr.Ul.Hu:
54
54
  return null == s;
55
- case Zt.Il.Ul:
56
- return null != s && yt(s) && es(s) < this._l;
57
- case Zt.Il.Ql:
58
- return null != s && yt(s) && es(s) > this._l;
59
- case Zt.Il.Eu:
55
+ case lr.Ul.Xl:
56
+ return null != s && yt(s) && ls(s) < this._l;
57
+ case lr.Ul.Fl:
58
+ return null != s && yt(s) && ls(s) > this._l;
59
+ case lr.Ul.Qu:
60
60
  return (
61
61
  null == s ||
62
62
  typeof s != typeof this._l ||
@@ -67,36 +67,36 @@ export default class Zt {
67
67
  return !1;
68
68
  }
69
69
  static fromJson(t) {
70
- return new Zt(
70
+ return new lr(
71
71
  t.property_key,
72
72
  t.property_type,
73
73
  t.comparator,
74
74
  t.property_value,
75
75
  );
76
76
  }
77
- tt() {
77
+ Y() {
78
78
  let t = this._l;
79
79
  return (
80
80
  yt(this._l) && (t = h(t.valueOf())),
81
81
  { k: this.Tl, t: this.Al, c: this.comparator, v: t }
82
82
  );
83
83
  }
84
- static Yn(t) {
85
- return new Zt(t.k, t.t, t.c, t.v);
84
+ static En(t) {
85
+ return new lr(t.k, t.t, t.c, t.v);
86
86
  }
87
87
  }
88
- (Zt.Rl = { _u: "boolean", Hu: "number", Iu: "string", Ml: "date" }),
89
- (Zt.Il = {
90
- Xl: 1,
91
- Fl: 2,
92
- Kl: 3,
93
- Ll: 4,
94
- Pl: 5,
95
- Ol: 6,
96
- Yl: 10,
97
- Zl: 11,
98
- $l: 12,
99
- Ul: 15,
100
- Ql: 16,
101
- Eu: 17,
88
+ (lr.Il = { Xu: "boolean", Bu: "number", Gu: "string", Ll: "date" }),
89
+ (lr.Ul = {
90
+ Kl: 1,
91
+ Pl: 2,
92
+ Yl: 3,
93
+ Ol: 4,
94
+ Zl: 5,
95
+ Ql: 6,
96
+ $l: 10,
97
+ Eu: 11,
98
+ Hu: 12,
99
+ Xl: 15,
100
+ Fl: 16,
101
+ Qu: 17,
102
102
  });
@@ -1,25 +1,25 @@
1
1
  import ri from "./trigger-condition.js";
2
- export default class si {
2
+ export default class ni {
3
3
  constructor(t, i) {
4
- (this.xu = t), (this.zu = i), (this.xu = t), (this.zu = i);
4
+ (this.zu = t), (this.Ju = i), (this.zu = t), (this.Ju = i);
5
5
  }
6
- Bl(t) {
7
- if (null == this.xu) return !1;
8
- const i = ri.Bu(t[0], this.xu);
6
+ Jl(t) {
7
+ if (null == this.zu) return !1;
8
+ const i = ri.Ku(t[0], this.zu);
9
9
  if (!i) return !1;
10
- let r = null == this.zu || 0 === this.zu.length;
11
- if (null != this.zu)
12
- for (let i = 0; i < this.zu.length; i++)
13
- if (this.zu[i] === t[1]) {
10
+ let r = null == this.Ju || 0 === this.Ju.length;
11
+ if (null != this.Ju)
12
+ for (let i = 0; i < this.Ju.length; i++)
13
+ if (this.Ju[i] === t[1]) {
14
14
  r = !0;
15
15
  break;
16
16
  }
17
17
  return i && r;
18
18
  }
19
19
  static fromJson(t) {
20
- return new si(t ? t.id : null, t ? t.buttons : null);
20
+ return new ni(t ? t.id : null, t ? t.buttons : null);
21
21
  }
22
- tt() {
23
- return this.xu;
22
+ Y() {
23
+ return this.zu;
24
24
  }
25
25
  }
@@ -2,13 +2,13 @@ export default class rs {
2
2
  constructor(t) {
3
3
  (this.productId = t), (this.productId = t);
4
4
  }
5
- Bl(t) {
5
+ Jl(t) {
6
6
  return null == this.productId || t[0] === this.productId;
7
7
  }
8
8
  static fromJson(t) {
9
9
  return new rs(t ? t.product_id : null);
10
10
  }
11
- tt() {
11
+ Y() {
12
12
  return this.productId;
13
13
  }
14
14
  }
@@ -1,21 +1,21 @@
1
- import Wt from "./filter-set.js";
2
- export default class is {
1
+ import ts from "./filter-set.js";
2
+ export default class ns {
3
3
  constructor(t, s) {
4
- (this.productId = t), (this.Jl = s), (this.productId = t), (this.Jl = s);
4
+ (this.productId = t), (this.Ml = s), (this.productId = t), (this.Ml = s);
5
5
  }
6
- Bl(t) {
7
- if (null == this.productId || null == this.Jl) return !1;
6
+ Jl(t) {
7
+ if (null == this.productId || null == this.Ml) return !1;
8
8
  const s = t[0],
9
9
  i = t[1];
10
- return s === this.productId && this.Jl.Bl(i);
10
+ return s === this.productId && this.Ml.Jl(i);
11
11
  }
12
12
  static fromJson(t) {
13
- return new is(
13
+ return new ns(
14
14
  t ? t.product_id : null,
15
- t ? Wt.fromJson(t.property_filters) : null,
15
+ t ? ts.fromJson(t.property_filters) : null,
16
16
  );
17
17
  }
18
- tt() {
19
- return { id: this.productId, pf: this.Jl ? this.Jl.tt() : null };
18
+ Y() {
19
+ return { id: this.productId, pf: this.Ml ? this.Ml.Y() : null };
20
20
  }
21
21
  }
@@ -1,15 +1,15 @@
1
1
  import ri from "./trigger-condition.js";
2
- export default class sr {
2
+ export default class ur {
3
3
  constructor(t) {
4
- (this.xu = t), (this.xu = t);
4
+ (this.zu = t), (this.zu = t);
5
5
  }
6
- Bl(t) {
7
- return null == this.xu || ri.Bu(t[0], this.xu);
6
+ Jl(t) {
7
+ return null == this.zu || ri.Ku(t[0], this.zu);
8
8
  }
9
9
  static fromJson(t) {
10
- return new sr(t ? t.campaign_id : null);
10
+ return new ur(t ? t.campaign_id : null);
11
11
  }
12
- tt() {
13
- return this.xu;
12
+ Y() {
13
+ return this.zu;
14
14
  }
15
15
  }
@@ -1,28 +1,26 @@
1
- import Qt from "./custom-event-data.js";
2
- import Yt from "./custom-event-property-data.js";
3
- import Wt from "./filter-set.js";
4
- import si from "./in-app-message-click-data.js";
1
+ import Zt from "./custom-event-data.js";
2
+ import is from "./custom-event-property-data.js";
3
+ import ts from "./filter-set.js";
4
+ import ni from "./in-app-message-click-data.js";
5
5
  import rs from "./purchase-data.js";
6
- import is from "./purchase-property-data.js";
7
- import sr from "./push-click-data.js";
6
+ import ns from "./purchase-property-data.js";
7
+ import ur from "./push-click-data.js";
8
8
  import tt from "./trigger-events.js";
9
- import r from "../../../shared-lib/braze-shared-lib.js";
10
- import { getErrorMessage as ei } from "../../util/error-utils.js";
9
+ import { logger as r } from "../../../shared-lib/index.js";
10
+ import { getErrorMessage as si } from "../../util/error-utils.js";
11
11
  export default class ri {
12
12
  constructor(e, t) {
13
13
  (this.type = e), (this.data = t), (this.type = e), (this.data = t);
14
14
  }
15
- ec(e, t) {
16
- return ri.rc[this.type] === e && (null == this.data || this.data.Bl(t));
15
+ sc(e, t) {
16
+ return ri.cc[this.type] === e && (null == this.data || this.data.Jl(t));
17
17
  }
18
- static Bu(e, t) {
18
+ static Ku(e, t) {
19
19
  let s = null;
20
20
  try {
21
21
  s = window.atob(e);
22
22
  } catch (t) {
23
- return (
24
- r.j.info("Failed to unencode analytics id " + e + ": " + ei(t)), !1
25
- );
23
+ return r.info("Failed to unencode analytics id " + e + ": " + si(t)), !1;
26
24
  }
27
25
  return t === s.split("_")[0];
28
26
  }
@@ -30,76 +28,76 @@ export default class ri {
30
28
  const t = e.type;
31
29
  let r = null;
32
30
  switch (t) {
33
- case ri.Wr.OPEN:
34
- case ri.Wr.vt:
31
+ case ri.Kr.OPEN:
32
+ case ri.Kr.kt:
35
33
  break;
36
- case ri.Wr.Rr:
34
+ case ri.Kr.Rr:
37
35
  r = rs.fromJson(e.data);
38
36
  break;
39
- case ri.Wr.sc:
40
- r = is.fromJson(e.data);
37
+ case ri.Kr.nc:
38
+ r = ns.fromJson(e.data);
41
39
  break;
42
- case ri.Wr.zr:
43
- r = sr.fromJson(e.data);
40
+ case ri.Kr.vr:
41
+ r = ur.fromJson(e.data);
44
42
  break;
45
- case ri.Wr.$e:
46
- r = Qt.fromJson(e.data);
43
+ case ri.Kr.ue:
44
+ r = Zt.fromJson(e.data);
47
45
  break;
48
- case ri.Wr.ac:
49
- r = Yt.fromJson(e.data);
46
+ case ri.Kr.lc:
47
+ r = is.fromJson(e.data);
50
48
  break;
51
- case ri.Wr.ro:
52
- r = si.fromJson(e.data);
49
+ case ri.Kr.mo:
50
+ r = ni.fromJson(e.data);
53
51
  }
54
52
  return new ri(t, r);
55
53
  }
56
- tt() {
57
- return { t: this.type, d: this.data ? this.data.tt() : null };
54
+ Y() {
55
+ return { t: this.type, d: this.data ? this.data.Y() : null };
58
56
  }
59
- static Yn(e) {
57
+ static En(e) {
60
58
  let t,
61
59
  r = null;
62
60
  switch (e.t) {
63
- case ri.Wr.OPEN:
64
- case ri.Wr.vt:
61
+ case ri.Kr.OPEN:
62
+ case ri.Kr.kt:
65
63
  break;
66
- case ri.Wr.Rr:
64
+ case ri.Kr.Rr:
67
65
  r = new rs(e.d);
68
66
  break;
69
- case ri.Wr.sc:
70
- (t = e.d || {}), (r = new is(t.id, Wt.Yn(t.pf || [])));
67
+ case ri.Kr.nc:
68
+ (t = e.d || {}), (r = new ns(t.id, ts.En(t.pf || [])));
71
69
  break;
72
- case ri.Wr.zr:
73
- r = new sr(e.d);
70
+ case ri.Kr.vr:
71
+ r = new ur(e.d);
74
72
  break;
75
- case ri.Wr.$e:
76
- r = new Qt(e.d);
73
+ case ri.Kr.ue:
74
+ r = new Zt(e.d);
77
75
  break;
78
- case ri.Wr.ac:
79
- (t = e.d || {}), (r = new Yt(t.e, Wt.Yn(t.pf || [])));
76
+ case ri.Kr.lc:
77
+ (t = e.d || {}), (r = new is(t.e, ts.En(t.pf || [])));
80
78
  break;
81
- case ri.Wr.ro:
82
- r = new si(e.d);
79
+ case ri.Kr.mo:
80
+ r = new ni(e.d);
83
81
  }
84
82
  return new ri(e.t, r);
85
83
  }
86
84
  }
87
- (ri.Wr = {
85
+ (ri.Kr = {
88
86
  OPEN: "open",
89
87
  Rr: "purchase",
90
- sc: "purchase_property",
91
- zr: "push_click",
92
- $e: "custom_event",
93
- ac: "custom_event_property",
94
- ro: "iam_click",
95
- vt: "test",
88
+ nc: "purchase_property",
89
+ vr: "push_click",
90
+ ue: "custom_event",
91
+ lc: "custom_event_property",
92
+ mo: "iam_click",
93
+ kt: "test",
96
94
  }),
97
- (ri.rc = {}),
98
- (ri.rc[ri.Wr.OPEN] = tt.OPEN),
99
- (ri.rc[ri.Wr.Rr] = tt.Rr),
100
- (ri.rc[ri.Wr.sc] = tt.Rr),
101
- (ri.rc[ri.Wr.zr] = tt.zr),
102
- (ri.rc[ri.Wr.$e] = tt.$e),
103
- (ri.rc[ri.Wr.ac] = tt.$e),
104
- (ri.rc[ri.Wr.ro] = tt.ro),
105
- (ri.rc[ri.Wr.vt] = tt.vt);
95
+ (ri.cc = {}),
96
+ (ri.cc[ri.Kr.OPEN] = tt.OPEN),
97
+ (ri.cc[ri.Kr.Rr] = tt.Rr),
98
+ (ri.cc[ri.Kr.nc] = tt.Rr),
99
+ (ri.cc[ri.Kr.vr] = tt.vr),
100
+ (ri.cc[ri.Kr.ue] = tt.ue),
101
+ (ri.cc[ri.Kr.lc] = tt.ue),
102
+ (ri.cc[ri.Kr.mo] = tt.mo),
103
+ (ri.cc[ri.Kr.kt] = tt.kt);
@@ -1,8 +1,8 @@
1
1
  export default {
2
2
  OPEN: "open",
3
3
  Rr: "purchase",
4
- zr: "push_click",
5
- $e: "custom_event",
6
- ro: "iam_click",
7
- vt: "test",
4
+ vr: "push_click",
5
+ ue: "custom_event",
6
+ mo: "iam_click",
7
+ kt: "test",
8
8
  };
@@ -2,58 +2,58 @@ import {
2
2
  dateFromUnixTimestamp as l,
3
3
  rehydrateDateAfterJsonization as w,
4
4
  } from "../../util/date-utils.js";
5
- import r from "../../../shared-lib/braze-shared-lib.js";
5
+ import { logger as r } from "../../../shared-lib/index.js";
6
6
  import ri from "./trigger-condition.js";
7
- import { validateValueIsFromEnum as G } from "../../util/code-utils.js";
7
+ import { validateValueIsFromEnum as J } from "../../util/code-utils.js";
8
8
  export default class pt {
9
- constructor(t, i = [], s, e, r = 0, h, l, o = 0, n = pt.Ju, a, u, d) {
9
+ constructor(t, i = [], s, e, r = 0, h, l, o = 0, n = pt.Vu, a, u, d) {
10
10
  (this.id = t),
11
- (this.Vu = i),
11
+ (this.Wu = i),
12
12
  (this.startTime = s),
13
13
  (this.endTime = e),
14
14
  (this.priority = r),
15
15
  (this.type = h),
16
16
  (this.data = l),
17
- (this.Gu = o),
18
- (this.Ku = n),
19
- (this.sn = a),
20
- (this.Ou = u),
21
- (this.Qu = d),
17
+ (this.Yu = o),
18
+ (this.Zu = n),
19
+ (this.Vr = a),
20
+ (this.td = u),
21
+ (this.sd = d),
22
22
  (this.id = t),
23
- (this.Vu = i || []),
23
+ (this.Wu = i || []),
24
24
  void 0 === s && (s = null),
25
25
  (this.startTime = s),
26
26
  void 0 === e && (e = null),
27
27
  (this.endTime = e),
28
28
  (this.priority = r || 0),
29
29
  (this.type = h),
30
- (this.Gu = o || 0),
31
- null == a && (a = 1e3 * (this.Gu + 30)),
32
- (this.sn = a),
30
+ (this.Yu = o || 0),
31
+ null == a && (a = 1e3 * (this.Yu + 30)),
32
+ (this.Vr = a),
33
33
  (this.data = l),
34
- null != n && (this.Ku = n),
35
- (this.Ou = u),
36
- (this.Qu = d || null);
34
+ null != n && (this.Zu = n),
35
+ (this.td = u),
36
+ (this.sd = d || null);
37
37
  }
38
- Uu(t) {
38
+ ed(t) {
39
39
  return (
40
- null == this.Qu || (this.Ku !== pt.Ju && t - this.Qu >= 1e3 * this.Ku)
40
+ null == this.sd || (this.Zu !== pt.Vu && t - this.sd >= 1e3 * this.Zu)
41
41
  );
42
42
  }
43
- Wu(t) {
44
- this.Qu = t;
43
+ rd(t) {
44
+ this.sd = t;
45
45
  }
46
- Xu(t) {
47
- const i = t + 1e3 * this.Gu;
46
+ hd(t) {
47
+ const i = t + 1e3 * this.Yu;
48
48
  return Math.max(i - new Date().valueOf(), 0);
49
49
  }
50
- Yu(t) {
50
+ od(t) {
51
51
  const i = new Date().valueOf() - t,
52
- s = null == t || isNaN(i) || null == this.sn || i < this.sn;
52
+ s = null == t || isNaN(i) || null == this.Vr || i < this.Vr;
53
53
  return (
54
54
  s ||
55
- r.j.info(
56
- `Trigger action ${this.type} is no longer eligible for display - fired ${i}ms ago and has a timeout of ${this.sn}ms.`,
55
+ r.info(
56
+ `Trigger action ${this.type} is no longer eligible for display - fired ${i}ms ago and has a timeout of ${this.Vr}ms.`,
57
57
  ),
58
58
  !s
59
59
  );
@@ -72,8 +72,8 @@ export default class pt {
72
72
  u = t.timeout,
73
73
  d = t.data,
74
74
  m = t.min_seconds_since_last_trigger;
75
- return G(
76
- pt.Wr,
75
+ return J(
76
+ pt.Kr,
77
77
  o,
78
78
  "Could not construct Trigger from server data",
79
79
  "Trigger.Types",
@@ -81,9 +81,9 @@ export default class pt {
81
81
  ? new pt(i, s, e, r, h, o, d, n, a, u, m)
82
82
  : null;
83
83
  }
84
- tt() {
84
+ Y() {
85
85
  const t = [];
86
- for (let i = 0; i < this.Vu.length; i++) t.push(this.Vu[i].tt());
86
+ for (let i = 0; i < this.Wu.length; i++) t.push(this.Wu[i].Y());
87
87
  return {
88
88
  i: this.id,
89
89
  c: t,
@@ -92,17 +92,17 @@ export default class pt {
92
92
  p: this.priority,
93
93
  t: this.type,
94
94
  da: this.data,
95
- d: this.Gu,
96
- r: this.Ku,
97
- tm: this.sn,
98
- ss: this.Ou,
99
- ld: this.Qu,
95
+ d: this.Yu,
96
+ r: this.Zu,
97
+ tm: this.Vr,
98
+ ss: this.td,
99
+ ld: this.sd,
100
100
  };
101
101
  }
102
- static Yn(t) {
102
+ static En(t) {
103
103
  const i = [],
104
104
  s = t.c || [];
105
- for (let t = 0; t < s.length; t++) i.push(ri.Yn(s[t]));
105
+ for (let t = 0; t < s.length; t++) i.push(ri.En(s[t]));
106
106
  return new pt(
107
107
  t.i,
108
108
  i,
@@ -119,4 +119,4 @@ export default class pt {
119
119
  );
120
120
  }
121
121
  }
122
- (pt.Wr = { Vr: "inapp", Zu: "templated_iam" }), (pt.Ju = -1);
122
+ (pt.Kr = { Jr: "inapp", nd: "templated_iam" }), (pt.Vu = -1);
@@ -4,22 +4,22 @@ import gr from "./triggers-provider.js";
4
4
  export const TriggersProviderFactory = {
5
5
  t: !1,
6
6
  provider: null,
7
- er: () => (
7
+ rr: () => (
8
8
  TriggersProviderFactory.o(),
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.No);
14
+ const r = e.nn(L.Po);
15
15
  (TriggersProviderFactory.provider = new gr(
16
16
  null != r ? r : 30,
17
- se.m().Ze(),
17
+ se.m().He(),
18
18
  e.l(),
19
19
  e.cr(),
20
20
  se.m(),
21
21
  )),
22
- e.dr(TriggersProviderFactory.provider);
22
+ e.ar(TriggersProviderFactory.provider);
23
23
  }
24
24
  },
25
25
  o: () => {