@braze/web-sdk 5.3.2 → 5.5.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 (96) hide show
  1. package/index.d.ts +20 -4
  2. package/package.json +1 -1
  3. package/shared-lib/event-types.js +12 -12
  4. package/shared-lib/indexed-db-adapter.js +14 -14
  5. package/shared-lib/logger.js +2 -2
  6. package/shared-lib/supported-options.js +10 -9
  7. package/src/Card/card-manager.js +46 -42
  8. package/src/Card/display/card-display.js +59 -58
  9. package/src/Card/models/card.js +61 -55
  10. package/src/Card/models/classic-card.js +1 -1
  11. package/src/Card/models/control-card.js +1 -1
  12. package/src/Card/models/image-only.js +1 -1
  13. package/src/Card/util/card-factory.js +20 -20
  14. package/src/ContentCards/content-cards-provider.js +140 -140
  15. package/src/ContentCards/get-cached-content-cards.js +1 -1
  16. package/src/ContentCards/request-content-cards-refresh.js +1 -1
  17. package/src/ContentCards/subscribe-to-content-cards-updates.js +4 -4
  18. package/src/ContentCards/ui/show-content-cards.js +3 -3
  19. package/src/Core/disable-sdk.js +2 -2
  20. package/src/Core/enable-sdk.js +2 -2
  21. package/src/Core/index.js +1 -0
  22. package/src/Core/is-initialized.js +4 -0
  23. package/src/Core/log-custom-event.js +14 -14
  24. package/src/Core/log-purchase.js +8 -8
  25. package/src/Core/open-session.js +4 -4
  26. package/src/Core/wipe-data.js +2 -2
  27. package/src/FeatureFlags/feature-flag-factory.js +5 -5
  28. package/src/FeatureFlags/feature-flag.js +1 -1
  29. package/src/FeatureFlags/feature-flags-provider.js +74 -74
  30. package/src/FeatureFlags/get-all-feature-flags.js +2 -2
  31. package/src/FeatureFlags/get-feature-flag.js +2 -2
  32. package/src/FeatureFlags/log-feature-flag-impression.js +12 -12
  33. package/src/FeatureFlags/subscribe-to-feature-flags-updates.js +2 -2
  34. package/src/Feed/feed-provider.js +29 -29
  35. package/src/Feed/get-cached-feed.js +1 -1
  36. package/src/Feed/request-feed-refresh.js +1 -1
  37. package/src/Feed/subscribe-to-feed-updates.js +1 -1
  38. package/src/Feed/ui/show-feed.js +1 -1
  39. package/src/InAppMessage/display/in-app-message-to-html.js +64 -62
  40. package/src/InAppMessage/in-app-message-manager.js +63 -63
  41. package/src/InAppMessage/log-in-app-message-button-click.js +2 -2
  42. package/src/InAppMessage/log-in-app-message-click.js +2 -2
  43. package/src/InAppMessage/log-in-app-message-html-click.js +2 -2
  44. package/src/InAppMessage/log-in-app-message-impression.js +1 -1
  45. package/src/InAppMessage/models/full-screen-message.js +10 -10
  46. package/src/InAppMessage/models/html-message.js +13 -13
  47. package/src/InAppMessage/models/in-app-message-button.js +4 -4
  48. package/src/InAppMessage/models/in-app-message.js +59 -59
  49. package/src/InAppMessage/models/modal-message.js +9 -9
  50. package/src/InAppMessage/models/slide-up-message.js +11 -11
  51. package/src/InAppMessage/models/templated-in-app-message.js +8 -8
  52. package/src/InAppMessage/ui/show-in-app-message.js +42 -40
  53. package/src/Push/push-manager-factory.js +5 -4
  54. package/src/Push/push-manager.js +77 -89
  55. package/src/Push/utils/push-utils.js +4 -4
  56. package/src/User/user-manager.js +8 -8
  57. package/src/User/user.js +29 -29
  58. package/src/common/base-provider.js +1 -1
  59. package/src/common/event-logger.js +11 -11
  60. package/src/common/feed-display.js +18 -17
  61. package/src/l10n/l10n-manager-factory.js +7 -7
  62. package/src/l10n/l10n-manager.js +15 -5
  63. package/src/managers/auth-manager.js +9 -9
  64. package/src/managers/braze-instance.js +89 -87
  65. package/src/managers/device-manager.js +17 -17
  66. package/src/managers/network-manager.js +130 -130
  67. package/src/managers/server-config-manager.js +24 -24
  68. package/src/managers/session-manager.js +12 -12
  69. package/src/managers/storage-manager-factory.js +1 -1
  70. package/src/managers/storage-manager.js +31 -31
  71. package/src/managers/subscription-manager.js +2 -2
  72. package/src/models/backend-errors.js +5 -5
  73. package/src/models/braze-event.js +4 -4
  74. package/src/models/device.js +2 -2
  75. package/src/models/request-result.js +1 -1
  76. package/src/models/server-config.js +5 -5
  77. package/src/request-controller.js +130 -130
  78. package/src/triggers/models/filter.js +9 -9
  79. package/src/triggers/models/in-app-message-click-data.js +8 -8
  80. package/src/triggers/models/push-click-data.js +3 -3
  81. package/src/triggers/models/trigger-condition.js +27 -27
  82. package/src/triggers/models/trigger-events.js +1 -1
  83. package/src/triggers/models/trigger.js +7 -7
  84. package/src/triggers/triggers-provider.js +29 -29
  85. package/src/ui/js/attach-css.js +1 -1
  86. package/src/ui/js/feed-css.js +1 -1
  87. package/src/ui/js/iam-css.js +1 -1
  88. package/src/util/base-device-parser.js +7 -7
  89. package/src/util/braze-actions.js +4 -4
  90. package/src/util/browser-detector.js +21 -21
  91. package/src/util/client-hints-parser.js +3 -3
  92. package/src/util/component-utils.js +13 -12
  93. package/src/util/net.js +4 -4
  94. package/src/util/request-header-utils.js +17 -17
  95. package/src/util/user-agent-parser.js +3 -3
  96. package/src/util/window-utils.js +1 -1
package/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Type definitions for @braze/web-sdk v5.3.2
2
+ * Type definitions for @braze/web-sdk v5.5.0
3
3
  * Project: https://github.com/braze-inc/braze-web-sdk
4
4
  * (c) Braze, Inc. 2024 - http://braze.com
5
5
  * License available at https://github.com/braze-inc/braze-web-sdk/blob/master/LICENSE
@@ -2138,7 +2138,7 @@ export function openSession(): void;
2138
2138
  * - Create a `service-worker.js` file with the content below and place it in the root directory of your website:
2139
2139
  *
2140
2140
  * ```
2141
- * self.importScripts('https://js.appboycdn.com/web-sdk-develop/5.3/service-worker.js');
2141
+ * self.importScripts('https://js.appboycdn.com/web-sdk-develop/5.5/service-worker.js');
2142
2142
  * ```
2143
2143
  *
2144
2144
  * For more details, see [Our Product Documentation](https://www.braze.com/docs/developer_guide/platform_integration_guides/web/push_notifications/integration).
@@ -2408,7 +2408,7 @@ export function subscribeToFeatureFlagsUpdates(
2408
2408
  export function getAllFeatureFlags(): FeatureFlag[];
2409
2409
 
2410
2410
  /**
2411
- * Logs impression for a given feature flag.
2411
+ * Logs impression for a given feature flag. This is limited to one impression per session per feature flag ID.
2412
2412
  *
2413
2413
  * @param featureFlagId - ID of the feature flag that has received the impression.
2414
2414
  *
@@ -2418,6 +2418,11 @@ export function logFeatureFlagImpression(
2418
2418
  featureFlagId: string,
2419
2419
  ): boolean | undefined;
2420
2420
 
2421
+ /**
2422
+ * Getter method to determine if the Braze SDK has been initialized.
2423
+ */
2424
+ export function isInitialized(): boolean;
2425
+
2421
2426
  /**
2422
2427
  * Supported initialization options
2423
2428
  *
@@ -2513,7 +2518,7 @@ export type InitializationOptions = {
2513
2518
  * lifecycle of, set this option to true and the Braze SDK will not register or unregister a service worker. If you set this
2514
2519
  * option to true, in order for push to function correctly you must register the service worker yourself BEFORE calling
2515
2520
  * `requestPushPermission`, and ensure that it contains Braze's service worker code, either with
2516
- * `self.importScripts('https://js.appboycdn.com/web-sdk-develop/5.3/service-worker.js');` or by including the content
2521
+ * `self.importScripts('https://js.appboycdn.com/web-sdk-develop/5.5/service-worker.js');` or by including the content
2517
2522
  * of that file directly. When this option is true, the `serviceWorkerLocation` option is irrelevant and is ignored.
2518
2523
  */
2519
2524
  manageServiceWorkerExternally?: boolean;
@@ -2570,6 +2575,17 @@ export type InitializationOptions = {
2570
2575
  * default with a value of your own.
2571
2576
  */
2572
2577
  deviceId?: string;
2578
+ /**
2579
+ * By default, Braze will register service worker with scope as the directory where the service worker script is located.
2580
+ *
2581
+ * Provide a value for this option to override that with a different scope. If you are using Service-Worker-Allowed header to specify scope,
2582
+ * ensure that the value provided here either matches the value returned by the header or is a subdirectory of it.
2583
+ *
2584
+ * For example, if the scope is '/path/to/subdirectory/' and the header is set to '/', the registration will succeed. However, if the scope is '/' and the
2585
+ * header is set to '/path/to/subdirectory/', the registration will fail because the provided scope ('/') is not under the maximum scope allowed
2586
+ * by Service-Worker-Allowed: '/path/to/subdirectory/'.
2587
+ */
2588
+ serviceWorkerScope?: string;
2573
2589
  };
2574
2590
 
2575
2591
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@braze/web-sdk",
3
- "version": "5.3.2",
3
+ "version": "5.5.0",
4
4
  "description": "Braze SDK for web sites and other JS platforms.",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -1,33 +1,33 @@
1
1
  const i = {
2
2
  CustomEvent: "ce",
3
3
  Pr: "p",
4
- _u: "pc",
4
+ Ku: "pc",
5
5
  vc: "ca",
6
- Ea: "i",
7
- qs: "ie",
6
+ Ua: "i",
7
+ Ls: "ie",
8
8
  M: "cci",
9
9
  R: "ccic",
10
- I: "ccc",
10
+ k: "ccc",
11
11
  F: "ccd",
12
12
  ql: "ss",
13
13
  xl: "se",
14
- Gi: "si",
14
+ Xi: "si",
15
15
  $i: "sc",
16
- Ei: "sbc",
16
+ Oi: "sbc",
17
17
  Cc: "sfe",
18
18
  mo: "iec",
19
- Uu: "lr",
20
- zu: "uae",
19
+ Ju: "lr",
20
+ Eu: "uae",
21
21
  O: "ci",
22
- $: "cc",
23
- Ju: "lcaa",
24
- Eu: "lcar",
22
+ D: "cc",
23
+ Xu: "lcaa",
24
+ Gu: "lcar",
25
25
  On: "inc",
26
26
  Ln: "add",
27
27
  Rn: "rem",
28
28
  $n: "set",
29
29
  Bn: "ncam",
30
- Ku: "sgu",
30
+ Hu: "sgu",
31
31
  Fr: "ffi",
32
32
  },
33
33
  or = { Ar: "feed_displayed", Ec: "content_cards_displayed" };
@@ -64,11 +64,11 @@ export default class A {
64
64
  "...",
65
65
  );
66
66
  const n = null === (e = t.target) || void 0 === e ? void 0 : e.result;
67
- for (const t in i.database.ss) {
67
+ for (const t in i.database.hs) {
68
68
  const e = t;
69
- i.database.ss.hasOwnProperty(t) &&
70
- !n.objectStoreNames.contains(i.database.ss[e]) &&
71
- n.createObjectStore(i.database.ss[e]);
69
+ i.database.hs.hasOwnProperty(t) &&
70
+ !n.objectStoreNames.contains(i.database.hs[e]) &&
71
+ n.createObjectStore(i.database.hs[e]);
72
72
  }
73
73
  }),
74
74
  (o.onsuccess = (n) => {
@@ -249,7 +249,7 @@ export default class A {
249
249
  };
250
250
  });
251
251
  }
252
- Zt(t, e) {
252
+ ss(t, e) {
253
253
  if (!this.isSupported()) return !1;
254
254
  const n = this;
255
255
  return this.Bd((o) => {
@@ -304,11 +304,11 @@ export default class A {
304
304
  clearData() {
305
305
  if (!this.isSupported()) return !1;
306
306
  const t = [];
307
- for (const e in this.database.ss) {
307
+ for (const e in this.database.hs) {
308
308
  const n = e;
309
- this.database.ss.hasOwnProperty(e) &&
310
- this.database.ss[n] !== this.database.ss.ae &&
311
- t.push(this.database.ss[n]);
309
+ this.database.hs.hasOwnProperty(e) &&
310
+ this.database.hs[n] !== this.database.hs.ae &&
311
+ t.push(this.database.hs[n]);
312
312
  }
313
313
  const e = this;
314
314
  return this.Bd(function (n) {
@@ -333,16 +333,16 @@ export default class A {
333
333
  });
334
334
  }
335
335
  }
336
- A.Yt = {
337
- Qt: {
336
+ A.ts = {
337
+ Zt: {
338
338
  Sd: "AppboyServiceWorkerAsyncStorage",
339
339
  VERSION: 6,
340
- ss: {
341
- $a: "data",
340
+ hs: {
341
+ Ka: "data",
342
342
  hr: "pushClicks",
343
343
  cu: "pushSubscribed",
344
344
  Cd: "fallbackDevice",
345
- ts: "cardUpdates",
345
+ es: "cardUpdates",
346
346
  ae: "optOut",
347
347
  wr: "pendingData",
348
348
  jh: "sdkAuthenticationSignature",
@@ -24,13 +24,13 @@ const r = {
24
24
  },
25
25
  warn: function (n) {
26
26
  if (r.zg) {
27
- const o = "Braze SDK Warning: " + n + " (v5.3.2)";
27
+ const o = "Braze SDK Warning: " + n + " (v5.5.0)";
28
28
  null != r.vd ? r.vd(o) : console.warn(o);
29
29
  }
30
30
  },
31
31
  error: function (n) {
32
32
  if (r.zg) {
33
- const o = "Braze SDK Error: " + n + " (v5.3.2)";
33
+ const o = "Braze SDK Error: " + n + " (v5.5.0)";
34
34
  null != r.vd ? r.vd(o) : console.error(o);
35
35
  }
36
36
  },
@@ -2,17 +2,17 @@ export default {
2
2
  Eo: "allowCrawlerActivity",
3
3
  _o: "baseUrl",
4
4
  Io: "noCookies",
5
- Ao: "devicePropertyAllowlist",
6
- _a: "disablePushTokenMaintenance",
7
- So: "enableLogging",
5
+ So: "devicePropertyAllowlist",
6
+ Aa: "disablePushTokenMaintenance",
7
+ Ao: "enableLogging",
8
8
  No: "enableSdkAuthentication",
9
- Ma: "manageServiceWorkerExternally",
9
+ qa: "manageServiceWorkerExternally",
10
10
  Oo: "minimumIntervalBetweenTriggerActionsInSeconds",
11
- Po: "sessionTimeoutInSeconds",
12
- Ro: "appVersion",
11
+ Ro: "sessionTimeoutInSeconds",
12
+ Po: "appVersion",
13
13
  Lo: "appVersionNumber",
14
- wa: "serviceWorkerLocation",
15
- ya: "safariWebsitePushId",
14
+ Ma: "serviceWorkerLocation",
15
+ ka: "safariWebsitePushId",
16
16
  zn: "localization",
17
17
  bo: "contentSecurityNonce",
18
18
  Do: "allowUserSuppliedJavascript",
@@ -22,6 +22,7 @@ export default {
22
22
  Lh: "requireExplicitInAppMessageDismissal",
23
23
  Mo: "doNotLoadFontAwesome",
24
24
  Uo: "deviceId",
25
- Bo: "sdkFlavor",
25
+ _a: "serviceWorkerScope",
26
+ Wo: "sdkFlavor",
26
27
  tn: "openCardsInNewTab",
27
28
  };
@@ -1,30 +1,30 @@
1
1
  import { ControlCard } from "./models/index.js";
2
- import s from "../common/event-logger.js";
3
- import t from "../models/request-result.js";
2
+ import t from "../common/event-logger.js";
3
+ import s from "../models/request-result.js";
4
4
  import { logger as r, EventTypes as i } from "../../shared-lib/index.js";
5
5
  import { STORAGE_KEYS as o } from "../managers/storage-manager.js";
6
6
  export default class a {
7
- constructor(s) {
8
- (this.u = s), (this.u = s);
7
+ constructor(t) {
8
+ (this.u = t), (this.u = t);
9
9
  }
10
10
  h(n, e) {
11
- const l = new t();
11
+ const l = new s();
12
12
  if ((n.p(), null == n.url || "" === n.url))
13
13
  return (
14
14
  r.info(`Card ${n.id} has no url. Not logging click to Braze servers.`),
15
15
  l
16
16
  );
17
17
  if (e && n.id && this.u) {
18
- const s = this.u.j(o.C.v) || {};
19
- (s[n.id] = !0), this.u.k(o.C.v, s);
18
+ const t = this.u.j(o.C.v) || {};
19
+ (t[n.id] = !0), this.u.I(o.C.v, t);
20
20
  }
21
- const u = this.D([n]);
22
- if (null == u) return l;
23
- const c = e ? i.I : i.$;
24
- return s.q(c, u);
21
+ const a = this.$([n]);
22
+ if (null == a) return l;
23
+ const u = e ? i.k : i.D;
24
+ return t.q(u, a);
25
25
  }
26
26
  B(n) {
27
- const e = new t();
27
+ const e = new s();
28
28
  if (!n.N())
29
29
  return (
30
30
  r.info(
@@ -33,44 +33,48 @@ export default class a {
33
33
  e
34
34
  );
35
35
  if (n.id && this.u) {
36
- const s = this.u.j(o.C.A) || {};
37
- (s[n.id] = !0), this.u.k(o.C.A, s);
36
+ const t = this.u.j(o.C.A) || {};
37
+ (t[n.id] = !0), this.u.I(o.C.A, t);
38
38
  }
39
- const l = this.D([n]);
40
- return null == l ? e : s.q(i.F, l);
39
+ const l = this.$([n]);
40
+ return null == l ? e : t.q(i.F, l);
41
41
  }
42
- G(n, r) {
43
- const e = new t(!0),
44
- l = [],
42
+ G(n, e) {
43
+ const l = new s(!0),
44
+ a = [],
45
45
  u = [];
46
46
  let c = {};
47
- this.u && (c = r ? this.u.j(o.C.H) || {} : this.u.j(o.C.J) || {});
48
- for (const s of n)
49
- s.K(),
50
- s instanceof ControlCard ? u.push(s) : l.push(s),
51
- s.id && (c[s.id] = !0);
52
- const h = this.D(l),
53
- a = this.D(u);
54
- if (null == h && null == a) return (e.L = !1), e;
55
- if ((this.u && (r ? this.u.k(o.C.H, c) : this.u.k(o.C.J, c)), null != h)) {
56
- const t = r ? i.M : i.O,
57
- n = s.q(t, h);
58
- e.P(n);
47
+ this.u && (c = e ? this.u.j(o.C.H) || {} : this.u.j(o.C.J) || {});
48
+ for (const t of n) {
49
+ t.K()
50
+ ? (t instanceof ControlCard ? u.push(t) : a.push(t),
51
+ t.id && (c[t.id] = !0))
52
+ : r.info(
53
+ `Card ${t.id} logged an impression too recently. Ignoring analytics event.`,
54
+ );
59
55
  }
60
- if (null != a && r) {
61
- const t = s.q(i.R, a);
62
- e.P(t);
56
+ const h = this.$(a),
57
+ m = this.$(u);
58
+ if (null == h && null == m) return (l.L = !1), l;
59
+ if ((this.u && (e ? this.u.I(o.C.H, c) : this.u.I(o.C.J, c)), null != h)) {
60
+ const s = e ? i.M : i.O,
61
+ n = t.q(s, h);
62
+ l.P(n);
63
63
  }
64
- return e;
64
+ if (null != m && e) {
65
+ const s = t.q(i.R, m);
66
+ l.P(s);
67
+ }
68
+ return l;
65
69
  }
66
- D(s) {
67
- let t,
70
+ $(t) {
71
+ let s,
68
72
  n = null;
69
- for (let r = 0; r < s.length; r++)
70
- (t = s[r].id),
71
- null != t &&
72
- "" !== t &&
73
- ((n = n || {}), (n.ids = n.ids || []), n.ids.push(t));
73
+ for (let r = 0; r < t.length; r++)
74
+ (s = t[r].id),
75
+ null != s &&
76
+ "" !== s &&
77
+ ((n = n || {}), (n.ids = n.ids || []), n.ids.push(s));
74
78
  return n;
75
79
  }
76
80
  }
@@ -41,98 +41,99 @@ export function setCardHeight(t, o) {
41
41
  t && (a.style.height = `${t}px`);
42
42
  }
43
43
  }
44
- export function cardToHtml(t, logCardClick, o) {
45
- const e = document.createElement("div");
46
- (e.className = "ab-card ab-effect-card " + t._),
44
+ export function cardToHtml(t, logCardClick, o, e = "ltr") {
45
+ const a = document.createElement("div");
46
+ (a.dir = e),
47
+ (a.className = "ab-card ab-effect-card " + t._),
47
48
  t.id &&
48
- (e.setAttribute("data-ab-card-id", t.id), e.setAttribute("id", t.id)),
49
- e.setAttribute("role", "article"),
50
- e.setAttribute("tabindex", "0");
51
- let a = "",
52
- n = !1;
53
- t.url && "" !== t.url && ((a = t.url), (n = !0));
54
- const i = (i) => (markCardAsRead(e), n && (logCardClick(t), u(a, o, i)), !1);
49
+ (a.setAttribute("data-ab-card-id", t.id), a.setAttribute("id", t.id)),
50
+ a.setAttribute("role", "article"),
51
+ a.setAttribute("tabindex", "0");
52
+ let n = "",
53
+ i = !1;
54
+ t.url && "" !== t.url && ((n = t.url), (i = !0));
55
+ const r = (e) => (markCardAsRead(a), i && (logCardClick(t), u(n, o, e)), !1);
55
56
  if (t.pinned) {
56
57
  const t = document.createElement("div");
57
58
  t.className = "ab-pinned-indicator";
58
59
  const o = document.createElement("i");
59
- (o.className = "fa fa-star"), t.appendChild(o), e.appendChild(t);
60
+ (o.className = "fa fa-star"), t.appendChild(o), a.appendChild(t);
60
61
  }
61
62
  if (t.imageUrl && "" !== t.imageUrl) {
62
63
  const o = document.createElement("div");
63
- o.className = "ab-image-area";
64
- const r = document.createElement("img");
64
+ (o.dir = e), (o.className = "ab-image-area");
65
+ const d = document.createElement("img");
65
66
  if (
66
- (r.setAttribute("src", t.imageUrl),
67
- (r.onload = () => {
68
- e.style.height = "auto";
67
+ (d.setAttribute("src", t.imageUrl),
68
+ (d.onload = () => {
69
+ a.style.height = "auto";
69
70
  }),
70
- _setImageAltText(t, r),
71
- o.appendChild(r),
72
- (e.className += " with-image"),
73
- n && !t.S)
71
+ _setImageAltText(t, d),
72
+ o.appendChild(d),
73
+ (a.className += " with-image"),
74
+ i && !t.S)
74
75
  ) {
75
76
  const t = document.createElement("a");
76
- t.setAttribute("href", a),
77
- (t.onclick = i),
77
+ t.setAttribute("href", n),
78
+ (t.onclick = r),
78
79
  t.appendChild(o),
79
- e.appendChild(t);
80
- } else e.appendChild(o);
80
+ a.appendChild(t);
81
+ } else a.appendChild(o);
81
82
  }
82
- const r = document.createElement("div");
83
- if (((r.className = "ab-card-body"), t.dismissible)) {
83
+ const s = document.createElement("div");
84
+ if (((s.className = "ab-card-body"), (s.dir = e), t.dismissible)) {
84
85
  t.logCardDismissal = () => logCardDismissal(t);
85
- const o = d("Dismiss Card", void 0, t.dismissCard.bind(t));
86
- e.appendChild(o),
87
- c(r, m.U, (t) => {
88
- (e.className += " ab-swiped-left"), o.onclick(t);
86
+ const o = d("Dismiss Card", void 0, t.dismissCard.bind(t), e);
87
+ a.appendChild(o),
88
+ c(s, m.U, (t) => {
89
+ (a.className += " ab-swiped-left"), o.onclick(t);
89
90
  }),
90
- c(r, m.V, (t) => {
91
- (e.className += " ab-swiped-right"), o.onclick(t);
91
+ c(s, m.V, (t) => {
92
+ (a.className += " ab-swiped-right"), o.onclick(t);
92
93
  });
93
94
  }
94
- let s = "",
95
- l = !1;
96
- if ((t.title && "" !== t.title && ((s = t.title), (l = !0)), l)) {
95
+ let l = "",
96
+ b = !1;
97
+ if ((t.title && "" !== t.title && ((l = t.title), (b = !0)), b)) {
97
98
  const t = document.createElement("h1");
98
99
  if (
99
100
  ((t.className = "ab-title"),
100
101
  (t.id = p.W()),
101
- e.setAttribute("aria-labelledby", t.id),
102
- n)
102
+ a.setAttribute("aria-labelledby", t.id),
103
+ i)
103
104
  ) {
104
105
  const o = document.createElement("a");
105
- o.setAttribute("href", a),
106
- (o.onclick = i),
107
- o.appendChild(document.createTextNode(s)),
106
+ o.setAttribute("href", n),
107
+ (o.onclick = r),
108
+ o.appendChild(document.createTextNode(l)),
108
109
  t.appendChild(o);
109
- } else t.appendChild(document.createTextNode(s));
110
- r.appendChild(t);
110
+ } else t.appendChild(document.createTextNode(l));
111
+ s.appendChild(t);
111
112
  }
112
- const b = document.createElement("div");
113
+ const f = document.createElement("div");
113
114
  if (
114
- ((b.className = l ? "ab-description" : "ab-description ab-no-title"),
115
- (b.id = p.W()),
116
- e.setAttribute("aria-describedby", b.id),
117
- t.description && b.appendChild(document.createTextNode(t.description)),
118
- n)
115
+ ((f.className = b ? "ab-description" : "ab-description ab-no-title"),
116
+ (f.id = p.W()),
117
+ a.setAttribute("aria-describedby", f.id),
118
+ t.description && f.appendChild(document.createTextNode(t.description)),
119
+ i)
119
120
  ) {
120
121
  const o = document.createElement("div");
121
122
  o.className = "ab-url-area";
122
123
  const e = document.createElement("a");
123
- e.setAttribute("href", a),
124
+ e.setAttribute("href", n),
124
125
  t.linkText && e.appendChild(document.createTextNode(t.linkText)),
125
- (e.onclick = i),
126
+ (e.onclick = r),
126
127
  o.appendChild(e),
127
- b.appendChild(o);
128
+ f.appendChild(o);
128
129
  }
129
- r.appendChild(b), e.appendChild(r);
130
- const f = document.createElement("div");
130
+ s.appendChild(f), a.appendChild(s);
131
+ const x = document.createElement("div");
131
132
  return (
132
- (f.className = "ab-unread-indicator"),
133
- t.viewed && (f.className += " read"),
134
- e.appendChild(f),
135
- (t.T = e),
136
- e
133
+ (x.className = "ab-unread-indicator"),
134
+ t.viewed && (x.className += " read"),
135
+ a.appendChild(x),
136
+ (t.T = a),
137
+ a
137
138
  );
138
139
  }