@braze/web-sdk 5.8.0 → 5.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 (140) hide show
  1. package/index.d.ts +14 -9
  2. package/package.json +1 -1
  3. package/shared-lib/encoding-utils.js +1 -1
  4. package/shared-lib/event-types.js +25 -25
  5. package/shared-lib/guid.js +3 -3
  6. package/shared-lib/indexed-db-adapter.js +18 -18
  7. package/shared-lib/logger.js +2 -2
  8. package/shared-lib/supported-options.js +16 -16
  9. package/src/Banner/banner-provider.js +90 -87
  10. package/src/Banner/banner.js +9 -9
  11. package/src/Banner/display/banner-to-html.js +32 -27
  12. package/src/Banner/get-all-banners.js +11 -5
  13. package/src/Banner/get-banner.js +7 -4
  14. package/src/Banner/log-banner-click.js +4 -4
  15. package/src/Banner/log-banner-impressions.js +6 -6
  16. package/src/Banner/request-banners-refresh.js +6 -3
  17. package/src/Banner/subscribe-to-banners-updates.js +7 -7
  18. package/src/Banner/ui/insert-banner.js +2 -2
  19. package/src/Card/card-manager.js +39 -39
  20. package/src/Card/display/card-display.js +11 -11
  21. package/src/Card/log-card-click.js +2 -2
  22. package/src/Card/log-card-dismissal.js +2 -2
  23. package/src/Card/log-card-impressions.js +3 -3
  24. package/src/Card/models/captioned-image.js +21 -21
  25. package/src/Card/models/card.js +96 -96
  26. package/src/Card/models/classic-card.js +21 -21
  27. package/src/Card/models/control-card.js +11 -11
  28. package/src/Card/models/image-only.js +19 -19
  29. package/src/Card/util/card-factory.js +43 -43
  30. package/src/ContentCards/content-cards-provider.js +156 -154
  31. package/src/ContentCards/get-cached-content-cards.js +1 -1
  32. package/src/ContentCards/request-content-cards-refresh.js +1 -1
  33. package/src/ContentCards/subscribe-to-content-cards-updates.js +6 -6
  34. package/src/ContentCards/ui/show-content-cards.js +3 -3
  35. package/src/Core/change-user.js +1 -1
  36. package/src/Core/disable-sdk.js +8 -8
  37. package/src/Core/enable-sdk.js +6 -6
  38. package/src/Core/get-device-id.js +2 -2
  39. package/src/Core/handle-braze-action.js +2 -2
  40. package/src/Core/is-disabled.js +2 -2
  41. package/src/Core/is-initialized.js +1 -1
  42. package/src/Core/log-custom-event.js +5 -5
  43. package/src/Core/log-purchase.js +4 -4
  44. package/src/Core/open-session.js +8 -8
  45. package/src/Core/request-immediate-data-flush.js +1 -1
  46. package/src/Core/wipe-data.js +7 -5
  47. package/src/FeatureFlags/feature-flag-factory.js +10 -10
  48. package/src/FeatureFlags/feature-flag.js +15 -15
  49. package/src/FeatureFlags/feature-flags-provider.js +69 -63
  50. package/src/FeatureFlags/get-all-feature-flags.js +2 -2
  51. package/src/FeatureFlags/get-feature-flag.js +2 -2
  52. package/src/FeatureFlags/log-feature-flag-impression.js +4 -4
  53. package/src/FeatureFlags/subscribe-to-feature-flags-updates.js +2 -2
  54. package/src/Feed/feed-provider-factory.js +1 -1
  55. package/src/Feed/feed-provider.js +44 -44
  56. package/src/Feed/get-cached-feed.js +1 -1
  57. package/src/Feed/log-feed-displayed.js +1 -1
  58. package/src/Feed/request-feed-refresh.js +1 -1
  59. package/src/Feed/subscribe-to-feed-updates.js +1 -1
  60. package/src/Feed/ui/show-feed.js +1 -1
  61. package/src/InAppMessage/defer-in-app-message.js +1 -1
  62. package/src/InAppMessage/display/html-message-to-html.js +10 -10
  63. package/src/InAppMessage/display/in-app-message-to-html.js +25 -25
  64. package/src/InAppMessage/display/modal-utils.js +8 -8
  65. package/src/InAppMessage/in-app-message-factory.js +7 -7
  66. package/src/InAppMessage/in-app-message-manager.js +92 -92
  67. package/src/InAppMessage/log-in-app-message-button-click.js +7 -7
  68. package/src/InAppMessage/log-in-app-message-click.js +5 -5
  69. package/src/InAppMessage/log-in-app-message-html-click.js +7 -7
  70. package/src/InAppMessage/log-in-app-message-impression.js +2 -2
  71. package/src/InAppMessage/models/control-message.js +5 -5
  72. package/src/InAppMessage/models/full-screen-message.js +34 -34
  73. package/src/InAppMessage/models/html-message.js +20 -20
  74. package/src/InAppMessage/models/in-app-message-button.js +8 -8
  75. package/src/InAppMessage/models/in-app-message.js +82 -82
  76. package/src/InAppMessage/models/modal-message.js +33 -33
  77. package/src/InAppMessage/models/slide-up-message.js +29 -29
  78. package/src/InAppMessage/models/templated-in-app-message.js +8 -8
  79. package/src/InAppMessage/subscribe-to-in-app-message.js +1 -1
  80. package/src/InAppMessage/ui/automatically-show-in-app-messages.js +3 -3
  81. package/src/InAppMessage/ui/show-in-app-message.js +18 -18
  82. package/src/Push/push-manager-factory.js +1 -1
  83. package/src/Push/push-manager.js +94 -94
  84. package/src/Push/request-push-permission.js +1 -1
  85. package/src/Push/utils/push-utils.js +4 -4
  86. package/src/User/user-manager.js +20 -20
  87. package/src/User/user.js +38 -38
  88. package/src/common/base-feed.js +1 -1
  89. package/src/common/base-provider.js +1 -1
  90. package/src/common/constants.js +2 -0
  91. package/src/common/event-logger.js +7 -7
  92. package/src/common/feed-display.js +8 -8
  93. package/src/l10n/l10n-manager-factory.js +1 -1
  94. package/src/l10n/l10n-manager.js +1 -1
  95. package/src/managers/auth-manager.js +14 -14
  96. package/src/managers/braze-instance.js +134 -133
  97. package/src/managers/device-manager.js +25 -25
  98. package/src/managers/network-manager.js +167 -161
  99. package/src/managers/server-config-manager.js +104 -92
  100. package/src/managers/session-manager.js +29 -29
  101. package/src/managers/storage-manager-factory.js +12 -12
  102. package/src/managers/storage-manager.js +86 -86
  103. package/src/managers/subscription-manager.js +11 -11
  104. package/src/managers/utils.js +4 -4
  105. package/src/models/backend-errors.js +5 -5
  106. package/src/models/braze-event.js +9 -9
  107. package/src/models/device.js +2 -2
  108. package/src/models/identifier.js +4 -4
  109. package/src/models/push-token.js +8 -8
  110. package/src/models/request-result.js +4 -4
  111. package/src/models/server-config.js +37 -37
  112. package/src/request-controller.js +159 -158
  113. package/src/triggers/models/custom-event-data.js +2 -2
  114. package/src/triggers/models/custom-event-property-data.js +4 -4
  115. package/src/triggers/models/filter-set.js +6 -6
  116. package/src/triggers/models/filter.js +7 -7
  117. package/src/triggers/models/in-app-message-click-data.js +2 -2
  118. package/src/triggers/models/purchase-data.js +2 -2
  119. package/src/triggers/models/purchase-property-data.js +4 -4
  120. package/src/triggers/models/push-click-data.js +2 -2
  121. package/src/triggers/models/trigger-condition.js +36 -36
  122. package/src/triggers/models/trigger-events.js +3 -3
  123. package/src/triggers/models/trigger.js +14 -14
  124. package/src/triggers/triggers-provider-factory.js +3 -3
  125. package/src/triggers/triggers-provider.js +72 -72
  126. package/src/ui/js/attach-css.js +1 -1
  127. package/src/ui/js/load-font-awesome.js +1 -1
  128. package/src/util/base-device-parser.js +1 -1
  129. package/src/util/braze-actions.js +4 -4
  130. package/src/util/browser-detector.js +5 -5
  131. package/src/util/client-hints-parser.js +1 -1
  132. package/src/util/component-utils.js +2 -2
  133. package/src/util/dom-utils.js +4 -4
  134. package/src/util/html-display-utils.js +14 -14
  135. package/src/util/key-codes.js +1 -1
  136. package/src/util/net.js +7 -7
  137. package/src/util/request-header-utils.js +21 -21
  138. package/src/util/user-agent-parser.js +1 -1
  139. package/src/util/validation-utils.js +2 -2
  140. package/src/util/window-utils.js +2 -2
@@ -1,8 +1,8 @@
1
1
  import {
2
- GLOBAL_RATE_LIMIT_CAPACITY_DEFAULT as Zt,
3
- GLOBAL_RATE_LIMIT_REFILL_RATE_DEFAULT as hi,
2
+ GLOBAL_RATE_LIMIT_CAPACITY_DEFAULT as hi,
3
+ GLOBAL_RATE_LIMIT_REFILL_RATE_DEFAULT as li,
4
4
  } from "../common/constants.js";
5
- export default class Jt {
5
+ export default class Qt {
6
6
  constructor(
7
7
  t = 0,
8
8
  i = [],
@@ -12,50 +12,50 @@ export default class Jt {
12
12
  l = null,
13
13
  r = { enabled: !1 },
14
14
  a = { enabled: !1, refresh_rate_limit: void 0 },
15
- n = { enabled: !0, capacity: Zt, refill_rate: hi, endpoint_overrides: {} },
16
- o = { enabled: !1, max_placements: 0 },
15
+ n = { enabled: !0, capacity: hi, refill_rate: li, endpoint_overrides: {} },
16
+ o = null,
17
17
  ) {
18
- (this.fl = t),
19
- (this.vl = i),
20
- (this.wl = s),
21
- (this.yl = h),
22
- (this.Bl = e),
23
- (this.Cl = l),
24
- (this.El = r),
25
- (this.we = a),
26
- (this.Rl = n),
18
+ (this.dl = t),
19
+ (this.Rl = i),
20
+ (this.Cl = s),
21
+ (this.El = h),
22
+ (this.yl = e),
23
+ (this.fl = l),
24
+ (this.vl = r),
25
+ (this.De = a),
26
+ (this.bl = n),
27
27
  (this.banners = o),
28
- (this.fl = t),
29
- (this.vl = i),
30
- (this.wl = s),
31
- (this.yl = h),
32
- (this.Bl = e),
33
- (this.Cl = l),
34
- (this.El = r),
35
- (this.we = a),
36
- (this.Rl = n),
28
+ (this.dl = t),
29
+ (this.Rl = i),
30
+ (this.Cl = s),
31
+ (this.El = h),
32
+ (this.yl = e),
33
+ (this.fl = l),
34
+ (this.vl = r),
35
+ (this.De = a),
36
+ (this.bl = n),
37
37
  (this.banners = o);
38
38
  }
39
- bs() {
39
+ bt() {
40
40
  return {
41
- s: "5.8.0",
42
- l: this.fl,
43
- e: this.vl,
44
- a: this.wl,
45
- p: this.yl,
46
- m: this.Bl,
47
- v: this.Cl,
48
- c: this.El,
49
- f: this.we,
50
- grl: this.Rl,
41
+ s: "5.9.0",
42
+ l: this.dl,
43
+ e: this.Rl,
44
+ a: this.Cl,
45
+ p: this.El,
46
+ m: this.yl,
47
+ v: this.fl,
48
+ c: this.vl,
49
+ f: this.De,
50
+ grl: this.bl,
51
51
  b: this.banners,
52
52
  };
53
53
  }
54
- static Bn(t) {
54
+ static Rn(t) {
55
55
  let i = t.l;
56
56
  return (
57
- "5.8.0" !== t.s && (i = 0),
58
- new Jt(i, t.e, t.a, t.p, t.m, t.v, t.c, t.f, t.grl, t.b)
57
+ "5.9.0" !== t.s && (i = 0),
58
+ new Qt(i, t.e, t.a, t.p, t.m, t.v, t.c, t.f, t.grl, t.b)
59
59
  );
60
60
  }
61
61
  }
@@ -2,104 +2,104 @@ import l from "./util/net.js";
2
2
  import ve from "./models/braze-event.js";
3
3
  import c from "./common/event-logger.js";
4
4
  import { randomInclusive as a } from "./util/math.js";
5
- import E from "./models/request-result.js";
5
+ import F from "./models/request-result.js";
6
6
  import {
7
7
  logger as N,
8
- IndexedDBAdapter as tt,
9
- Guid as G,
8
+ IndexedDBAdapter as st,
9
+ Guid as K,
10
10
  EventTypes as d,
11
11
  } from "../shared-lib/index.js";
12
- import { STORAGE_KEYS as t } from "./managers/storage-manager.js";
12
+ import { STORAGE_KEYS as s } from "./managers/storage-manager.js";
13
13
  import u from "./managers/subscription-manager.js";
14
14
  import vt from "./Push/utils/push-utils.js";
15
15
  import h from "./util/request-header-utils.js";
16
16
  export default class Lt {
17
17
  constructor(t, i, s, e, h, o, n, r, l, a) {
18
- (this.cn = t),
18
+ (this.an = t),
19
19
  (this.baseUrl = i),
20
20
  (this.T = s),
21
- (this.fn = e),
22
- (this.As = h),
21
+ (this.hn = e),
22
+ (this.Cs = h),
23
23
  (this.B = o),
24
24
  (this.C = n),
25
25
  (this.$l = r),
26
- (this.Na = l),
26
+ (this.Pa = l),
27
27
  (this.S = a),
28
- (this.cn = t),
28
+ (this.an = t),
29
29
  (this.baseUrl = i),
30
- (this.Ml = 0),
30
+ (this.Tl = 0),
31
31
  (this.dE = n.IE() || 0),
32
- (this.Pl = null),
32
+ (this.Ml = null),
33
33
  (this.T = s),
34
- (this.fn = e),
35
- (this.As = h),
34
+ (this.hn = e),
35
+ (this.Cs = h),
36
36
  (this.B = o),
37
37
  (this.C = n),
38
- (this.Na = l),
38
+ (this.Pa = l),
39
39
  (this.S = a),
40
40
  (this.$l = r),
41
- (this.Ol = new u()),
42
- (this.Ul = null),
43
- (this._l = 50),
44
- (this.Xl = !1);
41
+ (this.Pl = new u()),
42
+ (this.Ol = null),
43
+ (this.Ul = 50),
44
+ (this._l = !1);
45
45
  }
46
- Ql(t, i) {
47
- return !t && !i && this.Na.Kh() >= this._l;
46
+ Kl(t, i) {
47
+ return !t && !i && this.Pa.Kh() >= this.Ul;
48
48
  }
49
- Yl(t) {
49
+ Xl(t) {
50
50
  let i = this.T.zl();
51
51
  if (t.length > 0) {
52
- const s = this.As.getUserId();
52
+ const s = this.Cs.getUserId();
53
53
  for (const e of t) {
54
54
  const t = (!e.userId && !s) || e.userId === s;
55
- e.type === d.Il && t && (i = !0);
55
+ e.type === d.Fl && t && (i = !0);
56
56
  }
57
57
  }
58
58
  return i;
59
59
  }
60
- Zl(i = !1, s = !1, e = !0, o, n, r, u = !1, c = !1) {
61
- e && this.sc();
60
+ Ql(t = !1, i = !1, e = !0, o, n, r, u = !1, c = !1) {
61
+ e && this.Yl();
62
62
  const d = this.C.AE(),
63
63
  m = this.C.OE();
64
64
  let f = !1;
65
- const g = (i, s, u = -1) => {
65
+ const g = (t, i, u = -1) => {
66
66
  const c = new Date().valueOf();
67
- h.W(this.C, h.O.Su, c),
68
- -1 !== u && s.push(["X-Braze-Req-Tokens-Remaining", u.toString()]);
67
+ h.W(this.C, h.O.Nu, c),
68
+ -1 !== u && i.push(["X-Braze-Req-Tokens-Remaining", u.toString()]);
69
69
  let d = !1;
70
70
  l.Y({
71
71
  url: this.baseUrl + "/data/",
72
- data: i,
73
- headers: s,
74
- ss: (e) => {
75
- null != i.respond_with &&
76
- i.respond_with.triggers &&
77
- (this.Ml = Math.max(this.Ml - 1, 0)),
78
- this.S.ts(i, e, s)
79
- ? (this.Na.es(),
80
- this.B.dl(e),
81
- (null != i.respond_with &&
82
- i.respond_with.user_id != this.As.getUserId()) ||
83
- (null != i.device && this.C.Bs(t.gs.ec, i.device),
84
- null != i.sdk_metadata &&
85
- (this.C.Bs(t.gs.gu, i.sdk_metadata),
86
- this.C.Bs(t.gs.bu, this.T.Ss())),
72
+ data: t,
73
+ headers: i,
74
+ tt: (e) => {
75
+ null != t.respond_with &&
76
+ t.respond_with.triggers &&
77
+ (this.Tl = Math.max(this.Tl - 1, 0)),
78
+ this.S.st(t, e, i)
79
+ ? (this.Pa.it(),
80
+ this.B.gl(e),
81
+ (null != t.respond_with &&
82
+ t.respond_with.user_id != this.Cs.getUserId()) ||
83
+ (null != t.device && this.C.Bt(s.gt.oc, t.device),
84
+ null != t.sdk_metadata &&
85
+ (this.C.Bt(s.gt.pu, t.sdk_metadata),
86
+ this.C.Bt(s.gt.Ru, this.T.St())),
87
87
  this.$l(e),
88
- h.$u(this.C, h.O.Su, 1),
88
+ h.Mu(this.C, h.O.Nu, 1),
89
89
  "function" == typeof o && o()))
90
90
  : e.auth_error && (d = !0);
91
91
  },
92
92
  error: () => {
93
93
  (d = !0),
94
- null != i.respond_with &&
95
- i.respond_with.triggers &&
96
- (this.Ml = Math.max(this.Ml - 1, 0)),
97
- this.S.qu(i.events, i.attributes),
94
+ null != t.respond_with &&
95
+ t.respond_with.triggers &&
96
+ (this.Tl = Math.max(this.Tl - 1, 0)),
97
+ this.S.gu(t.events, t.attributes),
98
98
  "function" == typeof n && n();
99
99
  },
100
- rs: (t, i) => {
100
+ nt: (t, i) => {
101
101
  "function" == typeof r && r(!d);
102
- const s = this.S.xu(i);
102
+ const s = this.S.Pu(i);
103
103
  let o = 0;
104
104
  if (s)
105
105
  switch (s.type) {
@@ -111,139 +111,140 @@ export default class Lt {
111
111
  }
112
112
  if (e && !f) {
113
113
  if (d) {
114
- h.Hu(this.C, h.O.Su);
115
- let t = this.Pl;
114
+ h.Uu(this.C, h.O.Nu);
115
+ let t = this.Ml;
116
116
  (null == t || t < 1e3 * this.dE) && (t = 1e3 * this.dE);
117
117
  const i = Math.min(3e5, a(1e3 * this.dE, 3 * t)) + o;
118
- this.hc(i);
119
- } else this.hc(Math.max(1e3 * this.dE, o));
118
+ this.Zl(i);
119
+ } else this.Zl(Math.max(1e3 * this.dE, o));
120
120
  f = !0;
121
121
  }
122
122
  },
123
123
  });
124
124
  },
125
- p = this.Yl(d),
126
- v = s || p;
127
- if (this.Ql(u, p))
125
+ p = this.Xl(d),
126
+ v = i || p;
127
+ if (this.Kl(u, p))
128
128
  return void N.info(
129
129
  "Declining to flush data due to 50 consecutive authentication failures",
130
130
  );
131
- if (e && !this.S.wu(d, m, i, v))
132
- return this.hc(), void ("function" == typeof r && r(!0));
133
- const b = this.S.Cu(i, v, d, m, c);
134
- v && this.Ml++;
131
+ if (e && !this.S.yu(d, m, t, v))
132
+ return this.Zl(), void ("function" == typeof r && r(!0));
133
+ const b = this.S.wu(t, v, d, m, c);
134
+ v && this.Tl++;
135
135
  let w = !1;
136
136
  if (b)
137
137
  for (const t of b)
138
138
  this.S.V(
139
139
  t.requestData,
140
140
  (i) => g(t.requestData, t.headers, i),
141
- h.O.Su,
141
+ h.O.Nu,
142
142
  n,
143
143
  ),
144
144
  (w = !0);
145
- this.Na.jh() && e && !w
146
- ? this.hc()
147
- : p && (N.info("Invoking new session subscriptions"), this.Ol.X());
145
+ this.Pa.jh() && e && !w
146
+ ? this.Zl()
147
+ : p && (N.info("Invoking new session subscriptions"), this.Pl.X());
148
148
  }
149
- uc() {
150
- return this.Ml > 0;
149
+ dc() {
150
+ return this.Tl > 0;
151
151
  }
152
- hc(t = 1e3 * this.dE) {
153
- this.Xl ||
154
- (this.sc(),
155
- (this.Ul = window.setTimeout(() => {
152
+ Zl(t = 1e3 * this.dE) {
153
+ this._l ||
154
+ (this.Yl(),
155
+ (this.Ol = window.setTimeout(() => {
156
156
  if (document.hidden) {
157
157
  const t = "visibilitychange",
158
158
  i = () => {
159
159
  document.hidden ||
160
- (document.removeEventListener(t, i, !1), this.Zl());
160
+ (document.removeEventListener(t, i, !1), this.Ql());
161
161
  };
162
162
  document.addEventListener(t, i, !1);
163
- } else this.Zl();
163
+ } else this.Ql();
164
164
  }, t)),
165
- (this.Pl = t));
165
+ (this.Ml = t));
166
166
  }
167
- sc() {
168
- null != this.Ul && (clearTimeout(this.Ul), (this.Ul = null));
167
+ Yl() {
168
+ null != this.Ol && (clearTimeout(this.Ol), (this.Ol = null));
169
169
  }
170
170
  initialize() {
171
- (this.Xl = !1), this.hc();
171
+ (this._l = !1), this.Zl();
172
172
  }
173
173
  destroy() {
174
- this.Ol.removeAllSubscriptions(),
175
- this.Na.Hh(),
176
- this.sc(),
177
- (this.Xl = !0),
178
- this.Zl(void 0, void 0, !1, void 0, void 0, void 0, void 0, !0),
179
- (this.Ul = null);
174
+ this.Pl.removeAllSubscriptions(),
175
+ this.Pa.Hh(),
176
+ this.Yl(),
177
+ (this._l = !0),
178
+ this.Ql(void 0, void 0, !1, void 0, void 0, void 0, void 0, !0),
179
+ (this.Ol = null);
180
180
  }
181
- rn(t) {
182
- return this.Ol.Fs(t);
181
+ on(t) {
182
+ return this.Pl.Dt(t);
183
183
  }
184
184
  openSession() {
185
- const i = this.T.Ss() !== this.T.Eo();
186
- i && (this.C.TE(t.iu.Xh), this.C.TE(t.iu.su)),
187
- this.Zl(void 0, !1, void 0, () => {
188
- this.C.Es(t.gs.Be);
185
+ const t = this.T.St() !== this.T.Qo();
186
+ t && (this.C.TE(s.iu.Na), this.C.TE(s.iu.su)),
187
+ this.Ql(void 0, !1, void 0, () => {
188
+ this.C.Ut(s.gt.Ge);
189
189
  }),
190
- this.du(),
191
- i &&
192
- import("./Push/push-manager-factory.js").then((i) => {
193
- if (this.Xl) return;
194
- const s = i.default.ea();
190
+ this.Qn(),
191
+ t &&
192
+ import("./Push/push-manager-factory.js").then((t) => {
193
+ if (this._l) return;
194
+ const i = t.default.ea();
195
195
  if (
196
- null != s &&
196
+ null != i &&
197
197
  (vt.isPushPermissionGranted() || vt.isPushBlocked())
198
198
  ) {
199
- const i = () => {
200
- s.Sn()
199
+ const t = () => {
200
+ i.wn()
201
201
  ? N.info(
202
202
  "Push token maintenance is disabled, not refreshing token for backend.",
203
203
  )
204
- : s.subscribe();
204
+ : i.subscribe();
205
205
  },
206
- e = (t, s) => {
207
- s && i();
206
+ e = (i, s) => {
207
+ s && t();
208
208
  },
209
209
  h = () => {
210
- const s = this.C.vs(t.gs.Fn);
211
- (null == s || s) && i();
210
+ const i = this.C.ft(s.gt.zn);
211
+ (null == i || i) && t();
212
212
  },
213
- o = tt._s.Xs;
214
- new tt(o, N).cr(o.Ks.cu, e, h);
213
+ o = st.Ls.Fs;
214
+ new st(o, N).cr(o.Ms.cu, e, h);
215
215
  }
216
216
  });
217
217
  }
218
- dc() {
219
- this.C.Es(t.gs.$e), this.C.Es(t.gs.di), this.C.Es(t.gs.Zr);
218
+ mc() {
219
+ this.C.Ut(s.gt.Xe), this.C.Ut(s.gt.Hs), this.C.Ut(s.gt.Kr);
220
220
  }
221
- changeUser(i, s, e) {
222
- const h = this.As.getUserId();
223
- if (h !== i) {
224
- this.T.Jl(),
225
- this.dc(),
226
- null != h && this.Zl(void 0, !1, void 0, void 0, void 0),
227
- this.As.ou(i),
228
- e ? this.Na.setSdkAuthenticationSignature(e) : this.Na.Bh();
229
- for (let t = 0; t < s.length; t++) s[t].changeUser(null == h);
230
- null != h && this.C.Es(t.gs.Ct),
231
- this.C.Es(t.gs.ec),
232
- this.C.Es(t.gs._E),
221
+ changeUser(t, i, e) {
222
+ const h = this.Cs.getUserId();
223
+ if (h !== t) {
224
+ this.T.Il(),
225
+ this.mc(),
226
+ null != h && this.Ql(void 0, !1, void 0, void 0, void 0),
227
+ this.Cs.ou(t),
228
+ e ? this.Pa.setSdkAuthenticationSignature(e) : this.Pa.Bh();
229
+ for (let t = 0; t < i.length; t++) i[t].changeUser(null == h);
230
+ this.S.fo(),
231
+ null != h && this.C.Ut(s.gt.Zt),
232
+ this.C.Ut(s.gt.oc),
233
+ this.C.Ut(s.gt._E),
233
234
  this.openSession(),
234
- N.info('Changed user to "' + i + '".');
235
+ N.info('Changed user to "' + t + '".');
235
236
  } else {
236
- let t = "Doing nothing.";
237
+ let i = "Doing nothing.";
237
238
  e &&
238
- this.Na.xh() !== e &&
239
- (this.Na.setSdkAuthenticationSignature(e),
240
- (t = "Updated SDK authentication signature")),
241
- N.info(`Current user is already ${i}. ${t}`);
239
+ this.Pa.xh() !== e &&
240
+ (this.Pa.setSdkAuthenticationSignature(e),
241
+ (i = "Updated SDK authentication signature")),
242
+ N.info(`Current user is already ${t}. ${i}`);
242
243
  }
243
244
  }
244
245
  requestImmediateDataFlush(t) {
245
- this.sc(), this.T.Eo();
246
- this.Zl(
246
+ this.Yl(), this.T.Qo();
247
+ this.Ql(
247
248
  void 0,
248
249
  void 0,
249
250
  void 0,
@@ -256,29 +257,29 @@ export default class Lt {
256
257
  );
257
258
  }
258
259
  requestFeedRefresh() {
259
- this.T.Eo(), this.Zl(!0);
260
+ this.T.Qo(), this.Ql(!0);
260
261
  }
261
262
  br(t, i) {
262
- this.T.Eo(),
263
+ this.T.Qo(),
263
264
  N.info("Requesting explicit trigger refresh."),
264
- this.Zl(void 0, !0, void 0, t, i);
265
+ this.Ql(void 0, !0, void 0, t, i);
265
266
  }
266
- Ln(i, s) {
267
- const e = d.mc,
268
- h = { a: i, l: s },
269
- o = c.cs(e, h);
267
+ Cn(t, i) {
268
+ const e = d.fc,
269
+ h = { a: t, l: i },
270
+ o = c.ut(e, h);
270
271
  return (
271
- o && (N.info(`Logged alias ${i} with label ${s}`), this.C.Bs(t.gs._E, h)),
272
+ o && (N.info(`Logged alias ${t} with label ${i}`), this.C.Bt(s.gt._E, h)),
272
273
  o
273
274
  );
274
275
  }
275
- Gn(t, i, s) {
276
+ Ln(t, i, s) {
276
277
  if (this.B.hu(i))
277
278
  return (
278
- N.info(`Custom Attribute "${i}" is blocklisted, ignoring.`), new E()
279
+ N.info(`Custom Attribute "${i}" is blocklisted, ignoring.`), new F()
279
280
  );
280
281
  const e = { key: i, value: s },
281
- h = c.cs(t, e);
282
+ h = c.ut(t, e);
282
283
  if (h) {
283
284
  const t = "object" == typeof s ? JSON.stringify(s, null, 2) : s;
284
285
  N.info(`Logged custom attribute: ${i} with value: ${t}`);
@@ -290,7 +291,7 @@ export default class Lt {
290
291
  null != e && (n.altitude = e),
291
292
  null != h && (n.ll_accuracy = h),
292
293
  null != o && (n.alt_accuracy = o);
293
- const r = c.cs(d.fc, n, t || void 0);
294
+ const r = c.ut(d.vc, n, t || void 0);
294
295
  return (
295
296
  r &&
296
297
  N.info(`Set user last known location as ${JSON.stringify(n, null, 2)}`),
@@ -298,44 +299,44 @@ export default class Lt {
298
299
  );
299
300
  }
300
301
  lr(t, i) {
301
- const s = this.T.Eo();
302
- return new ve(this.As.getUserId(), d.gc, t, s, { cid: i });
302
+ const s = this.T.Qo();
303
+ return new ve(this.Cs.getUserId(), d.bc, t, s, { cid: i });
303
304
  }
304
- vc(t, i) {
305
- return new tt(t, i);
305
+ wc(t, i) {
306
+ return new st(t, i);
306
307
  }
307
- du() {
308
- const t = tt._s.Xs;
309
- this.vc(t, N).setItem(t.Ks.Su, 1, {
308
+ Qn() {
309
+ const t = st.Ls.Fs;
310
+ this.wc(t, N).setItem(t.Ms.Nu, 1, {
310
311
  baseUrl: this.baseUrl,
311
- data: { api_key: this.cn, device_id: this.fn.de().id },
312
- userId: this.As.getUserId(),
313
- sdkAuthEnabled: this.Na.jh(),
312
+ data: { api_key: this.an, device_id: this.hn.ve().id },
313
+ userId: this.Cs.getUserId(),
314
+ sdkAuthEnabled: this.Pa.jh(),
314
315
  });
315
316
  }
316
317
  vr(t) {
317
318
  for (const i of t)
318
- if (i.api_key === this.cn) this.S.qu(i.events, i.attributes);
319
+ if (i.api_key === this.an) this.S.gu(i.events, i.attributes);
319
320
  else {
320
- const t = tt._s.Xs;
321
- new tt(t, N).setItem(t.Ks.kr, G.Rt(), i);
321
+ const t = st.Ls.Fs;
322
+ new st(t, N).setItem(t.Ms.kr, K.ce(), i);
322
323
  }
323
324
  }
324
- Qn(t, i, s) {
325
+ Kn(t, i, s) {
325
326
  if (this.B.hu(t))
326
327
  return (
327
- N.info(`Custom Attribute "${t}" is blocklisted, ignoring.`), new E()
328
+ N.info(`Custom Attribute "${t}" is blocklisted, ignoring.`), new F()
328
329
  );
329
330
  let e, h;
330
331
  return (
331
332
  null === i && null === s
332
- ? ((e = d.bc), (h = { key: t }))
333
- : ((e = d.wc), (h = { key: t, latitude: i, longitude: s })),
334
- c.cs(e, h)
333
+ ? ((e = d.kc), (h = { key: t }))
334
+ : ((e = d.yc), (h = { key: t, latitude: i, longitude: s })),
335
+ c.ut(e, h)
335
336
  );
336
337
  }
337
- Xn(t, i) {
338
+ Mn(t, i) {
338
339
  const s = { group_id: t, status: i };
339
- return c.cs(d.kc, s);
340
+ return c.ut(d.jc, s);
340
341
  }
341
342
  }
@@ -2,13 +2,13 @@ export default class ts {
2
2
  constructor(t) {
3
3
  (this.xc = t), (this.xc = t);
4
4
  }
5
- yc(t) {
5
+ zc(t) {
6
6
  return null == this.xc || this.xc === t[0];
7
7
  }
8
8
  static fromJson(t) {
9
9
  return new ts(t ? t.event_name : null);
10
10
  }
11
- bs() {
11
+ bt() {
12
12
  return this.xc;
13
13
  }
14
14
  }
@@ -3,11 +3,11 @@ export default class rs {
3
3
  constructor(t, s) {
4
4
  (this.xc = t), (this.tf = s), (this.xc = t), (this.tf = s);
5
5
  }
6
- yc(t) {
6
+ zc(t) {
7
7
  if (null == this.xc || null == this.tf) return !1;
8
8
  const s = t[0],
9
9
  i = t[1];
10
- return s === this.xc && this.tf.yc(i);
10
+ return s === this.xc && this.tf.zc(i);
11
11
  }
12
12
  static fromJson(t) {
13
13
  return new rs(
@@ -15,7 +15,7 @@ export default class rs {
15
15
  t ? is.fromJson(t.property_filters) : null,
16
16
  );
17
17
  }
18
- bs() {
19
- return { e: this.xc, pf: this.tf ? this.tf.bs() : null };
18
+ bt() {
19
+ return { e: this.xc, pf: this.tf ? this.tf.bt() : null };
20
20
  }
21
21
  }
@@ -4,13 +4,13 @@ export default class is {
4
4
  constructor(t) {
5
5
  (this.filters = t), (this.filters = t);
6
6
  }
7
- yc(t) {
7
+ zc(t) {
8
8
  let r = !0;
9
9
  for (let e = 0; e < this.filters.length; e++) {
10
10
  const o = this.filters[e];
11
11
  let s = !1;
12
12
  for (let r = 0; r < o.length; r++)
13
- if (o[r].yc(t)) {
13
+ if (o[r].zc(t)) {
14
14
  s = !0;
15
15
  break;
16
16
  }
@@ -32,22 +32,22 @@ export default class is {
32
32
  }
33
33
  return new is(r);
34
34
  }
35
- bs() {
35
+ bt() {
36
36
  const t = [];
37
37
  for (let r = 0; r < this.filters.length; r++) {
38
38
  const e = this.filters[r],
39
39
  o = [];
40
- for (let t = 0; t < e.length; t++) o.push(e[t].bs());
40
+ for (let t = 0; t < e.length; t++) o.push(e[t].bt());
41
41
  t.push(o);
42
42
  }
43
43
  return t;
44
44
  }
45
- static Bn(t) {
45
+ static Rn(t) {
46
46
  const r = [];
47
47
  for (let e = 0; e < t.length; e++) {
48
48
  const o = [],
49
49
  s = t[e];
50
- for (let t = 0; t < s.length; t++) o.push(fr.Bn(s[t]));
50
+ for (let t = 0; t < s.length; t++) o.push(fr.Rn(s[t]));
51
51
  r.push(o);
52
52
  }
53
53
  return new is(r);