@braze/web-sdk 4.10.1 → 5.0.1

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 (202) hide show
  1. package/index.d.ts +26 -111
  2. package/package.json +1 -1
  3. package/shared-lib/braze-shared-lib.js +8 -1
  4. package/shared-lib/encoding-utils.js +12 -1
  5. package/shared-lib/event-types.js +34 -1
  6. package/shared-lib/guid.js +10 -1
  7. package/shared-lib/indexed-db-adapter.js +352 -1
  8. package/shared-lib/logger.js +38 -1
  9. package/shared-lib/supported-options.js +26 -1
  10. package/shared-lib/types.js +1 -1
  11. package/src/Card/card-manager-factory.js +14 -1
  12. package/src/Card/card-manager.js +78 -1
  13. package/src/Card/display/card-display.js +138 -1
  14. package/src/Card/index.js +6 -1
  15. package/src/Card/log-card-click.js +11 -1
  16. package/src/Card/log-card-dismissal.js +11 -1
  17. package/src/Card/log-card-impressions.js +13 -1
  18. package/src/Card/log-content-card-click.js +4 -1
  19. package/src/Card/log-content-card-impressions.js +4 -1
  20. package/src/Card/models/captioned-image.js +33 -1
  21. package/src/Card/models/card.js +197 -1
  22. package/src/Card/models/classic-card.js +32 -1
  23. package/src/Card/models/control-card.js +23 -1
  24. package/src/Card/models/image-only.js +31 -1
  25. package/src/Card/models/index.js +5 -1
  26. package/src/Card/types.js +1 -1
  27. package/src/Card/util/card-factory.js +104 -1
  28. package/src/ContentCards/content-cards-provider-factory.js +20 -1
  29. package/src/ContentCards/content-cards-provider.js +391 -1
  30. package/src/ContentCards/content-cards.js +24 -1
  31. package/src/ContentCards/get-cached-content-cards.js +5 -1
  32. package/src/ContentCards/index.js +7 -1
  33. package/src/ContentCards/request-content-cards-refresh.js +5 -1
  34. package/src/ContentCards/subscribe-to-content-cards-updates.js +17 -1
  35. package/src/ContentCards/types.js +1 -1
  36. package/src/ContentCards/ui/hide-content-cards.js +8 -1
  37. package/src/ContentCards/ui/show-content-cards.js +77 -1
  38. package/src/ContentCards/ui/toggle-content-cards.js +8 -1
  39. package/src/Core/add-sdk-metadata.js +26 -1
  40. package/src/Core/braze-sdk-metadata.js +10 -1
  41. package/src/Core/change-user.js +17 -1
  42. package/src/Core/destroy.js +5 -1
  43. package/src/Core/device-properties.js +9 -1
  44. package/src/Core/disable-sdk.js +15 -1
  45. package/src/Core/enable-sdk.js +11 -1
  46. package/src/Core/get-device-id.js +13 -1
  47. package/src/Core/get-user.js +4 -1
  48. package/src/Core/handle-braze-action.js +87 -1
  49. package/src/Core/index.js +23 -1
  50. package/src/Core/initialize.js +4 -1
  51. package/src/Core/is-disabled.js +4 -1
  52. package/src/Core/log-custom-event.js +38 -1
  53. package/src/Core/log-purchase.js +245 -1
  54. package/src/Core/open-session.js +25 -1
  55. package/src/Core/remove-all-subscriptions.js +4 -1
  56. package/src/Core/remove-subscription.js +4 -1
  57. package/src/Core/request-immediate-data-flush.js +6 -1
  58. package/src/Core/set-logger.js +4 -1
  59. package/src/Core/set-sdk-authentication-signature.js +8 -1
  60. package/src/Core/subscribe-to-sdk-authentication-failures.js +6 -1
  61. package/src/Core/toggle-logging.js +4 -1
  62. package/src/Core/types.js +1 -1
  63. package/src/Core/wipe-data.js +16 -1
  64. package/src/FeatureFlags/feature-flag-factory.js +24 -1
  65. package/src/FeatureFlags/feature-flag.js +64 -1
  66. package/src/FeatureFlags/feature-flags-provider-factory.js +19 -1
  67. package/src/FeatureFlags/feature-flags-provider.js +145 -1
  68. package/src/FeatureFlags/get-all-feature-flags.js +12 -1
  69. package/src/FeatureFlags/get-feature-flag.js +10 -1
  70. package/src/FeatureFlags/index.js +6 -1
  71. package/src/FeatureFlags/log-feature-flag-impression.js +23 -1
  72. package/src/FeatureFlags/refresh-feature-flags.js +9 -1
  73. package/src/FeatureFlags/subscribe-to-feature-flags-updates.js +9 -1
  74. package/src/FeatureFlags/types.js +1 -1
  75. package/src/Feed/feed-provider-factory.js +18 -1
  76. package/src/Feed/feed-provider.js +90 -1
  77. package/src/Feed/feed.js +20 -1
  78. package/src/Feed/get-cached-feed.js +5 -1
  79. package/src/Feed/index.js +8 -1
  80. package/src/Feed/log-feed-displayed.js +7 -1
  81. package/src/Feed/request-feed-refresh.js +5 -1
  82. package/src/Feed/subscribe-to-feed-updates.js +5 -1
  83. package/src/Feed/types.js +1 -1
  84. package/src/Feed/ui/hide-feed.js +7 -1
  85. package/src/Feed/ui/show-feed.js +96 -1
  86. package/src/Feed/ui/toggle-feed.js +8 -1
  87. package/src/InAppMessage/defer-in-app-message.js +13 -1
  88. package/src/InAppMessage/display/get-animation-effect.js +19 -1
  89. package/src/InAppMessage/display/html-message-to-html.js +243 -1
  90. package/src/InAppMessage/display/in-app-message-to-html.js +188 -1
  91. package/src/InAppMessage/display/modal-utils.js +73 -1
  92. package/src/InAppMessage/get-deferred-in-app-message.js +5 -1
  93. package/src/InAppMessage/in-app-message-factory.js +166 -1
  94. package/src/InAppMessage/in-app-message-manager-factory.js +16 -1
  95. package/src/InAppMessage/in-app-message-manager.js +248 -1
  96. package/src/InAppMessage/index.js +16 -1
  97. package/src/InAppMessage/log-in-app-message-button-click.js +27 -1
  98. package/src/InAppMessage/log-in-app-message-click.js +19 -1
  99. package/src/InAppMessage/log-in-app-message-html-click.js +23 -1
  100. package/src/InAppMessage/log-in-app-message-impression.js +13 -1
  101. package/src/InAppMessage/models/control-message.js +11 -1
  102. package/src/InAppMessage/models/full-screen-message.js +105 -1
  103. package/src/InAppMessage/models/html-message.js +68 -1
  104. package/src/InAppMessage/models/in-app-message-button.js +47 -1
  105. package/src/InAppMessage/models/in-app-message.js +382 -1
  106. package/src/InAppMessage/models/modal-message.js +101 -1
  107. package/src/InAppMessage/models/slide-up-message.js +84 -1
  108. package/src/InAppMessage/models/templated-in-app-message.js +19 -1
  109. package/src/InAppMessage/subscribe-to-in-app-message.js +10 -1
  110. package/src/InAppMessage/types.js +1 -1
  111. package/src/InAppMessage/ui/automatically-show-in-app-messages.js +15 -1
  112. package/src/InAppMessage/ui/show-in-app-message.js +181 -1
  113. package/src/InAppMessage/utils/in-app-message-utils.js +1 -1
  114. package/src/Push/index.js +5 -1
  115. package/src/Push/is-push-blocked.js +5 -1
  116. package/src/Push/is-push-permission-granted.js +5 -1
  117. package/src/Push/is-push-supported.js +5 -1
  118. package/src/Push/push-manager-factory.js +30 -1
  119. package/src/Push/push-manager.js +387 -1
  120. package/src/Push/request-push-permission.js +9 -1
  121. package/src/Push/types.js +1 -1
  122. package/src/Push/unregister-push.js +5 -1
  123. package/src/Push/utils/push-utils.js +36 -1
  124. package/src/User/index.js +1 -1
  125. package/src/User/types.js +1 -1
  126. package/src/User/user-manager.js +73 -1
  127. package/src/User/user.js +302 -1
  128. package/src/common/base-feed.js +29 -1
  129. package/src/common/base-provider.js +6 -1
  130. package/src/common/constants.js +14 -1
  131. package/src/common/event-logger.js +31 -1
  132. package/src/common/feed-display.js +210 -1
  133. package/src/common/translations.js +148 -1
  134. package/src/common/types.js +1 -1
  135. package/src/index.js +9 -1
  136. package/src/l10n/l10n-manager-factory.js +22 -1
  137. package/src/l10n/l10n-manager.js +25 -1
  138. package/src/l10n/types.js +1 -1
  139. package/src/managers/auth-manager.js +51 -1
  140. package/src/managers/braze-instance.js +322 -1
  141. package/src/managers/device-manager.js +85 -1
  142. package/src/managers/network-manager.js +256 -1
  143. package/src/managers/server-config-manager.js +108 -1
  144. package/src/managers/session-manager.js +75 -1
  145. package/src/managers/storage-manager-factory.js +42 -1
  146. package/src/managers/storage-manager.js +426 -1
  147. package/src/managers/subscription-manager.js +28 -1
  148. package/src/managers/types.js +1 -1
  149. package/src/models/backend-errors.js +8 -1
  150. package/src/models/braze-event.js +47 -1
  151. package/src/models/braze-sdk-metadata.js +10 -1
  152. package/src/models/device.js +18 -1
  153. package/src/models/identifier.js +19 -1
  154. package/src/models/push-token.js +27 -1
  155. package/src/models/request-result.js +8 -1
  156. package/src/models/server-config.js +48 -1
  157. package/src/models/types.js +1 -1
  158. package/src/request-controller.js +311 -1
  159. package/src/triggers/models/custom-event-data.js +14 -1
  160. package/src/triggers/models/custom-event-property-data.js +21 -1
  161. package/src/triggers/models/filter-set.js +55 -1
  162. package/src/triggers/models/filter.js +102 -1
  163. package/src/triggers/models/in-app-message-click-data.js +25 -1
  164. package/src/triggers/models/purchase-data.js +14 -1
  165. package/src/triggers/models/purchase-property-data.js +21 -1
  166. package/src/triggers/models/push-click-data.js +15 -1
  167. package/src/triggers/models/trigger-condition.js +105 -1
  168. package/src/triggers/models/trigger-events.js +8 -1
  169. package/src/triggers/models/trigger.js +122 -1
  170. package/src/triggers/triggers-provider-factory.js +34 -1
  171. package/src/triggers/triggers-provider.js +326 -1
  172. package/src/triggers/types.js +1 -1
  173. package/src/types.js +1 -1
  174. package/src/ui/js/attach-css.js +13 -1
  175. package/src/ui/js/feed-css.js +12 -1
  176. package/src/ui/js/iam-css.js +12 -1
  177. package/src/ui/js/index.js +3 -1
  178. package/src/ui/js/load-font-awesome.js +13 -1
  179. package/src/util/base-device-parser.js +14 -1
  180. package/src/util/braze-actions.js +84 -1
  181. package/src/util/browser-detector.js +84 -1
  182. package/src/util/client-hints-parser.js +66 -1
  183. package/src/util/code-utils.js +100 -1
  184. package/src/util/color-utils.js +29 -1
  185. package/src/util/component-utils.js +26 -1
  186. package/src/util/date-utils.js +28 -1
  187. package/src/util/deprecation-utils.js +5 -1
  188. package/src/util/device-constants.js +13 -1
  189. package/src/util/dom-utils.js +91 -1
  190. package/src/util/error-utils.js +2 -1
  191. package/src/util/key-codes.js +1 -1
  192. package/src/util/math.js +5 -1
  193. package/src/util/net.js +71 -1
  194. package/src/util/request-header-utils.js +46 -1
  195. package/src/util/string-utils.js +22 -1
  196. package/src/util/types.js +1 -1
  197. package/src/util/url-utils.js +20 -1
  198. package/src/util/user-agent-parser.js +80 -1
  199. package/src/util/validation-utils.js +217 -1
  200. package/src/util/window-utils.js +34 -1
  201. package/src/Card/models/banner.js +0 -1
  202. package/src/ContentCards/log-content-cards-displayed.js +0 -1
@@ -1 +1,352 @@
1
- export default class Oe{constructor(t,e){this.database=t,this.j=e,this.parent="undefined"==typeof window?self:window,this.database=t,this.j=e}td(){if("indexedDB"in this.parent)return this.parent.indexedDB}isSupported(){var t;try{if(null==this.td())return!1;{const e=null===(t=this.td())||void 0===t?void 0:t.open("Braze IndexedDB Support Test");if(e&&(e.onupgradeneeded=()=>e.result.close(),e.onsuccess=()=>e.result.close()),"undefined"!=typeof window){const t=window,e=t.chrome||t.browser||t.ed;if(e&&e.runtime&&e.runtime.id)return this.j.info("Not using IndexedDB for storage because we are running inside an extension"),!1}return!0}}catch(t){return this.j.info("Not using IndexedDB for storage due to following error: "+t),!1}}nd(t,e){var n;const o=null===(n=this.td())||void 0===n?void 0:n.open(this.database.od,this.database.VERSION);if(null==o)return"function"==typeof e&&e(),!1;const i=this;return o.onupgradeneeded=t=>{var e;i.j.info("Upgrading indexedDB "+i.database.od+" to v"+i.database.VERSION+"...");const n=null===(e=t.target)||void 0===e?void 0:e.result;for(const t in i.database.Jt){const e=t;i.database.Jt.hasOwnProperty(t)&&!n.objectStoreNames.contains(i.database.Jt[e])&&n.createObjectStore(i.database.Jt[e])}},o.onsuccess=n=>{var o;const r=null===(o=n.target)||void 0===o?void 0:o.result;r.onversionchange=()=>{r.close(),"function"==typeof e&&e(),i.j.error("Needed to close the database unexpectedly because of an upgrade in another tab")},t(r)},o.onerror=t=>{var n;const o=t;return i.j.info("Could not open indexedDB "+i.database.od+" v"+i.database.VERSION+": "+(null===(n=o.target)||void 0===n?void 0:n.errorCode)),"function"==typeof e&&e(),!0},!0}setItem(t,e,n,o,i){if(!this.isSupported())return"function"==typeof i&&i(),!1;const r=this;return this.nd((d=>{if(!d.objectStoreNames.contains(t))return r.j.error("Could not store object "+e+" in "+t+" on indexedDB "+r.database.od+" - "+t+" is not a valid objectStore"),"function"==typeof i&&i(),void d.close();const s=d.transaction([t],"readwrite");s.oncomplete=()=>d.close();const u=s.objectStore(t).put(n,e);u.onerror=()=>{r.j.error("Could not store object "+e+" in "+t+" on indexedDB "+r.database.od),"function"==typeof i&&i()},u.onsuccess=()=>{"function"==typeof o&&o()}}),i)}getItem(t,e,n){if(!this.isSupported())return!1;const o=this;return this.nd((i=>{if(!i.objectStoreNames.contains(t))return o.j.error("Could not retrieve object "+e+" in "+t+" on indexedDB "+o.database.od+" - "+t+" is not a valid objectStore"),void i.close();const r=i.transaction([t],"readonly");r.oncomplete=()=>i.close();const d=r.objectStore(t).get(e);d.onerror=()=>{o.j.error("Could not retrieve object "+e+" in "+t+" on indexedDB "+o.database.od)},d.onsuccess=t=>{var e;const o=null===(e=t.target)||void 0===e?void 0:e.result;null!=o&&n(o)}}))}hr(t,e,n){if(!this.isSupported())return"function"==typeof n&&n(),!1;const o=this;return this.nd((i=>{if(!i.objectStoreNames.contains(t))return o.j.error("Could not retrieve last record from "+t+" on indexedDB "+o.database.od+" - "+t+" is not a valid objectStore"),"function"==typeof n&&n(),void i.close();const r=i.transaction([t],"readonly");r.oncomplete=()=>i.close();const d=r.objectStore(t).openCursor(null,"prev");d.onerror=()=>{o.j.error("Could not open cursor for "+t+" on indexedDB "+o.database.od),"function"==typeof n&&n()},d.onsuccess=t=>{var o;const i=null===(o=t.target)||void 0===o?void 0:o.result;null!=i&&null!=i.value&&null!=i.key?e(i.key,i.value):"function"==typeof n&&n()}}),n)}oe(t,e){if(!this.isSupported())return!1;const n=this;return this.nd((o=>{if(!o.objectStoreNames.contains(t))return n.j.error("Could not delete record "+e+" from "+t+" on indexedDB "+n.database.od+" - "+t+" is not a valid objectStore"),void o.close();const i=o.transaction([t],"readwrite");i.oncomplete=()=>o.close();i.objectStore(t).delete(e).onerror=()=>{n.j.error("Could not delete record "+e+" from "+t+" on indexedDB "+n.database.od)}}))}Mt(t,e){if(!this.isSupported())return!1;const n=this;return this.nd((o=>{if(!o.objectStoreNames.contains(t))return n.j.error("Could not retrieve objects from "+t+" on indexedDB "+n.database.od+" - "+t+" is not a valid objectStore"),void o.close();const i=o.transaction([t],"readwrite");i.oncomplete=()=>o.close();const r=i.objectStore(t),d=r.openCursor(),s=[];d.onerror=()=>{s.length>0?(n.j.info("Cursor closed midway through for "+t+" on indexedDB "+n.database.od),e(s)):n.j.error("Could not open cursor for "+t+" on indexedDB "+n.database.od)},d.onsuccess=t=>{var n;const o=null===(n=t.target)||void 0===n?void 0:n.result;if(null!=o){if(null!=o.value&&null!=o.key){r.delete(o.key).onsuccess=()=>{s.push(o.value)}}"function"==typeof o.continue&&o.continue()}else s.length>0&&e(s)}}))}clearData(){if(!this.isSupported())return!1;const t=[];for(const e in this.database.Jt){const n=e;this.database.Jt.hasOwnProperty(e)&&this.database.Jt[n]!==this.database.Jt.se&&t.push(this.database.Jt[n])}const e=this;return this.nd((function(n){const o=n.transaction(t,"readwrite");o.oncomplete=()=>n.close();for(let n=0;n<t.length;n++){const i=t[n];o.objectStore(i).clear().onerror=function(){e.j.error("Could not clear "+this.source.name+" on indexedDB "+e.database.od)}}o.onerror=function(){e.j.error("Could not clear object stores on indexedDB "+e.database.od)}}))}}Oe.ep={Ft:{od:"AppboyServiceWorkerAsyncStorage",VERSION:6,Jt:{Na:"data",kr:"pushClicks",cu:"pushSubscribed",dd:"fallbackDevice",qt:"cardUpdates",se:"optOut",wr:"pendingData",qh:"sdkAuthenticationSignature"},ie:1}};
1
+ export default class Oe {
2
+ constructor(t, e) {
3
+ (this.database = t),
4
+ (this.j = e),
5
+ (this.parent = "undefined" == typeof window ? self : window),
6
+ (this.database = t),
7
+ (this.j = e);
8
+ }
9
+ td() {
10
+ if ("indexedDB" in this.parent) return this.parent.indexedDB;
11
+ }
12
+ isSupported() {
13
+ var t;
14
+ try {
15
+ if (null == this.td()) return !1;
16
+ {
17
+ const e =
18
+ null === (t = this.td()) || void 0 === t
19
+ ? void 0
20
+ : t.open("Braze IndexedDB Support Test");
21
+ if (
22
+ (e &&
23
+ ((e.onupgradeneeded = () => e.result.close()),
24
+ (e.onsuccess = () => e.result.close())),
25
+ "undefined" != typeof window)
26
+ ) {
27
+ const t = window,
28
+ e = t.chrome || t.browser || t.ed;
29
+ if (e && e.runtime && e.runtime.id)
30
+ return (
31
+ this.j.info(
32
+ "Not using IndexedDB for storage because we are running inside an extension",
33
+ ),
34
+ !1
35
+ );
36
+ }
37
+ return !0;
38
+ }
39
+ } catch (t) {
40
+ return (
41
+ this.j.info(
42
+ "Not using IndexedDB for storage due to following error: " + t,
43
+ ),
44
+ !1
45
+ );
46
+ }
47
+ }
48
+ nd(t, e) {
49
+ var n;
50
+ const o =
51
+ null === (n = this.td()) || void 0 === n
52
+ ? void 0
53
+ : n.open(this.database.od, this.database.VERSION);
54
+ if (null == o) return "function" == typeof e && e(), !1;
55
+ const i = this;
56
+ return (
57
+ (o.onupgradeneeded = (t) => {
58
+ var e;
59
+ i.j.info(
60
+ "Upgrading indexedDB " +
61
+ i.database.od +
62
+ " to v" +
63
+ i.database.VERSION +
64
+ "...",
65
+ );
66
+ const n = null === (e = t.target) || void 0 === e ? void 0 : e.result;
67
+ for (const t in i.database.rs) {
68
+ const e = t;
69
+ i.database.rs.hasOwnProperty(t) &&
70
+ !n.objectStoreNames.contains(i.database.rs[e]) &&
71
+ n.createObjectStore(i.database.rs[e]);
72
+ }
73
+ }),
74
+ (o.onsuccess = (n) => {
75
+ var o;
76
+ const r = null === (o = n.target) || void 0 === o ? void 0 : o.result;
77
+ (r.onversionchange = () => {
78
+ r.close(),
79
+ "function" == typeof e && e(),
80
+ i.j.error(
81
+ "Needed to close the database unexpectedly because of an upgrade in another tab",
82
+ );
83
+ }),
84
+ t(r);
85
+ }),
86
+ (o.onerror = (t) => {
87
+ var n;
88
+ const o = t;
89
+ return (
90
+ i.j.info(
91
+ "Could not open indexedDB " +
92
+ i.database.od +
93
+ " v" +
94
+ i.database.VERSION +
95
+ ": " +
96
+ (null === (n = o.target) || void 0 === n ? void 0 : n.errorCode),
97
+ ),
98
+ "function" == typeof e && e(),
99
+ !0
100
+ );
101
+ }),
102
+ !0
103
+ );
104
+ }
105
+ setItem(t, e, n, o, i) {
106
+ if (!this.isSupported()) return "function" == typeof i && i(), !1;
107
+ const r = this;
108
+ return this.nd((d) => {
109
+ if (!d.objectStoreNames.contains(t))
110
+ return (
111
+ r.j.error(
112
+ "Could not store object " +
113
+ e +
114
+ " in " +
115
+ t +
116
+ " on indexedDB " +
117
+ r.database.od +
118
+ " - " +
119
+ t +
120
+ " is not a valid objectStore",
121
+ ),
122
+ "function" == typeof i && i(),
123
+ void d.close()
124
+ );
125
+ const s = d.transaction([t], "readwrite");
126
+ s.oncomplete = () => d.close();
127
+ const u = s.objectStore(t).put(n, e);
128
+ (u.onerror = () => {
129
+ r.j.error(
130
+ "Could not store object " +
131
+ e +
132
+ " in " +
133
+ t +
134
+ " on indexedDB " +
135
+ r.database.od,
136
+ ),
137
+ "function" == typeof i && i();
138
+ }),
139
+ (u.onsuccess = () => {
140
+ "function" == typeof o && o();
141
+ });
142
+ }, i);
143
+ }
144
+ getItem(t, e, n) {
145
+ if (!this.isSupported()) return !1;
146
+ const o = this;
147
+ return this.nd((i) => {
148
+ if (!i.objectStoreNames.contains(t))
149
+ return (
150
+ o.j.error(
151
+ "Could not retrieve object " +
152
+ e +
153
+ " in " +
154
+ t +
155
+ " on indexedDB " +
156
+ o.database.od +
157
+ " - " +
158
+ t +
159
+ " is not a valid objectStore",
160
+ ),
161
+ void i.close()
162
+ );
163
+ const r = i.transaction([t], "readonly");
164
+ r.oncomplete = () => i.close();
165
+ const d = r.objectStore(t).get(e);
166
+ (d.onerror = () => {
167
+ o.j.error(
168
+ "Could not retrieve object " +
169
+ e +
170
+ " in " +
171
+ t +
172
+ " on indexedDB " +
173
+ o.database.od,
174
+ );
175
+ }),
176
+ (d.onsuccess = (t) => {
177
+ var e;
178
+ const o = null === (e = t.target) || void 0 === e ? void 0 : e.result;
179
+ null != o && n(o);
180
+ });
181
+ });
182
+ }
183
+ hr(t, e, n) {
184
+ if (!this.isSupported()) return "function" == typeof n && n(), !1;
185
+ const o = this;
186
+ return this.nd((i) => {
187
+ if (!i.objectStoreNames.contains(t))
188
+ return (
189
+ o.j.error(
190
+ "Could not retrieve last record from " +
191
+ t +
192
+ " on indexedDB " +
193
+ o.database.od +
194
+ " - " +
195
+ t +
196
+ " is not a valid objectStore",
197
+ ),
198
+ "function" == typeof n && n(),
199
+ void i.close()
200
+ );
201
+ const r = i.transaction([t], "readonly");
202
+ r.oncomplete = () => i.close();
203
+ const d = r.objectStore(t).openCursor(null, "prev");
204
+ (d.onerror = () => {
205
+ o.j.error(
206
+ "Could not open cursor for " + t + " on indexedDB " + o.database.od,
207
+ ),
208
+ "function" == typeof n && n();
209
+ }),
210
+ (d.onsuccess = (t) => {
211
+ var o;
212
+ const i = null === (o = t.target) || void 0 === o ? void 0 : o.result;
213
+ null != i && null != i.value && null != i.key
214
+ ? e(i.key, i.value)
215
+ : "function" == typeof n && n();
216
+ });
217
+ }, n);
218
+ }
219
+ oe(t, e) {
220
+ if (!this.isSupported()) return !1;
221
+ const n = this;
222
+ return this.nd((o) => {
223
+ if (!o.objectStoreNames.contains(t))
224
+ return (
225
+ n.j.error(
226
+ "Could not delete record " +
227
+ e +
228
+ " from " +
229
+ t +
230
+ " on indexedDB " +
231
+ n.database.od +
232
+ " - " +
233
+ t +
234
+ " is not a valid objectStore",
235
+ ),
236
+ void o.close()
237
+ );
238
+ const i = o.transaction([t], "readwrite");
239
+ i.oncomplete = () => o.close();
240
+ i.objectStore(t).delete(e).onerror = () => {
241
+ n.j.error(
242
+ "Could not delete record " +
243
+ e +
244
+ " from " +
245
+ t +
246
+ " on indexedDB " +
247
+ n.database.od,
248
+ );
249
+ };
250
+ });
251
+ }
252
+ ss(t, e) {
253
+ if (!this.isSupported()) return !1;
254
+ const n = this;
255
+ return this.nd((o) => {
256
+ if (!o.objectStoreNames.contains(t))
257
+ return (
258
+ n.j.error(
259
+ "Could not retrieve objects from " +
260
+ t +
261
+ " on indexedDB " +
262
+ n.database.od +
263
+ " - " +
264
+ t +
265
+ " is not a valid objectStore",
266
+ ),
267
+ void o.close()
268
+ );
269
+ const i = o.transaction([t], "readwrite");
270
+ i.oncomplete = () => o.close();
271
+ const r = i.objectStore(t),
272
+ d = r.openCursor(),
273
+ s = [];
274
+ (d.onerror = () => {
275
+ s.length > 0
276
+ ? (n.j.info(
277
+ "Cursor closed midway through for " +
278
+ t +
279
+ " on indexedDB " +
280
+ n.database.od,
281
+ ),
282
+ e(s))
283
+ : n.j.error(
284
+ "Could not open cursor for " +
285
+ t +
286
+ " on indexedDB " +
287
+ n.database.od,
288
+ );
289
+ }),
290
+ (d.onsuccess = (t) => {
291
+ var n;
292
+ const o = null === (n = t.target) || void 0 === n ? void 0 : n.result;
293
+ if (null != o) {
294
+ if (null != o.value && null != o.key) {
295
+ r.delete(o.key).onsuccess = () => {
296
+ s.push(o.value);
297
+ };
298
+ }
299
+ "function" == typeof o.continue && o.continue();
300
+ } else s.length > 0 && e(s);
301
+ });
302
+ });
303
+ }
304
+ clearData() {
305
+ if (!this.isSupported()) return !1;
306
+ const t = [];
307
+ for (const e in this.database.rs) {
308
+ const n = e;
309
+ this.database.rs.hasOwnProperty(e) &&
310
+ this.database.rs[n] !== this.database.rs.se &&
311
+ t.push(this.database.rs[n]);
312
+ }
313
+ const e = this;
314
+ return this.nd(function (n) {
315
+ const o = n.transaction(t, "readwrite");
316
+ o.oncomplete = () => n.close();
317
+ for (let n = 0; n < t.length; n++) {
318
+ const i = t[n];
319
+ o.objectStore(i).clear().onerror = function () {
320
+ e.j.error(
321
+ "Could not clear " +
322
+ this.source.name +
323
+ " on indexedDB " +
324
+ e.database.od,
325
+ );
326
+ };
327
+ }
328
+ o.onerror = function () {
329
+ e.j.error(
330
+ "Could not clear object stores on indexedDB " + e.database.od,
331
+ );
332
+ };
333
+ });
334
+ }
335
+ }
336
+ Oe.ep = {
337
+ Zt: {
338
+ od: "AppboyServiceWorkerAsyncStorage",
339
+ VERSION: 6,
340
+ rs: {
341
+ Na: "data",
342
+ kr: "pushClicks",
343
+ cu: "pushSubscribed",
344
+ dd: "fallbackDevice",
345
+ hs: "cardUpdates",
346
+ se: "optOut",
347
+ wr: "pendingData",
348
+ qh: "sdkAuthenticationSignature",
349
+ },
350
+ ie: 1,
351
+ },
352
+ };
@@ -1 +1,38 @@
1
- const Ue={init:function(n){void 0===n&&void 0!==Ue.zg||(Ue.zg=!!n),Ue.t||(Ue.t=!0)},destroy:function(){Ue.t=!1,Ue.zg=void 0,Ue.j=void 0},setLogger:function(n){"function"==typeof n?(Ue.init(),Ue.j=n):Ue.info("Ignoring setLogger call since logger is not a function")},toggleLogging:function(){Ue.init(),Ue.zg?(console.log("Disabling Braze logging"),Ue.zg=!1):(console.log("Enabled Braze logging"),Ue.zg=!0)},info:function(n){if(Ue.zg){const o="Braze: "+n;null!=Ue.j?Ue.j(o):console.log(o)}},warn:function(n){if(Ue.zg){const o="Braze SDK Warning: "+n+" (v4.10.1)";null!=Ue.j?Ue.j(o):console.warn(o)}},error:function(n){if(Ue.zg){const o="Braze SDK Error: "+n+" (v4.10.1)";null!=Ue.j?Ue.j(o):console.error(o)}}};export default Ue;
1
+ const Ue = {
2
+ init: function (n) {
3
+ (void 0 === n && void 0 !== Ue.zg) || (Ue.zg = !!n), Ue.t || (Ue.t = !0);
4
+ },
5
+ destroy: function () {
6
+ (Ue.t = !1), (Ue.zg = void 0), (Ue.j = void 0);
7
+ },
8
+ setLogger: function (n) {
9
+ "function" == typeof n
10
+ ? (Ue.init(), (Ue.j = n))
11
+ : Ue.info("Ignoring setLogger call since logger is not a function");
12
+ },
13
+ toggleLogging: function () {
14
+ Ue.init(),
15
+ Ue.zg
16
+ ? (console.log("Disabling Braze logging"), (Ue.zg = !1))
17
+ : (console.log("Enabled Braze logging"), (Ue.zg = !0));
18
+ },
19
+ info: function (n) {
20
+ if (Ue.zg) {
21
+ const o = "Braze: " + n;
22
+ null != Ue.j ? Ue.j(o) : console.log(o);
23
+ }
24
+ },
25
+ warn: function (n) {
26
+ if (Ue.zg) {
27
+ const o = "Braze SDK Warning: " + n + " (v5.0.1)";
28
+ null != Ue.j ? Ue.j(o) : console.warn(o);
29
+ }
30
+ },
31
+ error: function (n) {
32
+ if (Ue.zg) {
33
+ const o = "Braze SDK Error: " + n + " (v5.0.1)";
34
+ null != Ue.j ? Ue.j(o) : console.error(o);
35
+ }
36
+ },
37
+ };
38
+ export default Ue;
@@ -1 +1,26 @@
1
- export default{ho:"allowCrawlerActivity",Eo:"baseUrl",_o:"noCookies",Io:"devicePropertyAllowlist",Aa:"disablePushTokenMaintenance",Ao:"enableLogging",So:"enableSdkAuthentication",qa:"manageServiceWorkerExternally",No:"minimumIntervalBetweenTriggerActionsInSeconds",wo:"sessionTimeoutInSeconds",Oo:"appVersion",Po:"appVersionNumber",_a:"serviceWorkerLocation",ka:"safariWebsitePushId",Ba:"localization",po:"contentSecurityNonce",Ro:"enableHtmlInAppMessages",Co:"allowUserSuppliedJavascript",lo:"inAppMessageZIndex",fo:"openInAppMessagesInNewTab",en:"openNewsFeedCardsInNewTab",mh:"requireExplicitInAppMessageDismissal",Lo:"doNotLoadFontAwesome",Mo:"sdkFlavor",tn:"openCardsInNewTab"};
1
+ export default {
2
+ ho: "allowCrawlerActivity",
3
+ _o: "baseUrl",
4
+ Eo: "noCookies",
5
+ Io: "devicePropertyAllowlist",
6
+ Aa: "disablePushTokenMaintenance",
7
+ Ao: "enableLogging",
8
+ So: "enableSdkAuthentication",
9
+ qa: "manageServiceWorkerExternally",
10
+ No: "minimumIntervalBetweenTriggerActionsInSeconds",
11
+ Oo: "sessionTimeoutInSeconds",
12
+ wo: "appVersion",
13
+ Po: "appVersionNumber",
14
+ _a: "serviceWorkerLocation",
15
+ ka: "safariWebsitePushId",
16
+ Ba: "localization",
17
+ po: "contentSecurityNonce",
18
+ Ro: "allowUserSuppliedJavascript",
19
+ lo: "inAppMessageZIndex",
20
+ fo: "openInAppMessagesInNewTab",
21
+ en: "openNewsFeedCardsInNewTab",
22
+ mh: "requireExplicitInAppMessageDismissal",
23
+ Co: "doNotLoadFontAwesome",
24
+ Lo: "sdkFlavor",
25
+ tn: "openCardsInNewTab",
26
+ };
@@ -1 +1 @@
1
- export{};
1
+ export {};
@@ -1 +1,14 @@
1
- import a from"./card-manager.js";import e from"../managers/braze-instance.js";const n={t:!1,i:null,m:()=>(n.o(),n.i||(n.i=new a(e.l())),n.i),o:()=>{n.t||(e.g(n),n.t=!0)},destroy:()=>{n.i=null,n.t=!1}};export default n;
1
+ import a from "./card-manager.js";
2
+ import e from "../managers/braze-instance.js";
3
+ const n = {
4
+ t: !1,
5
+ i: null,
6
+ m: () => (n.o(), n.i || (n.i = new a(e.l())), n.i),
7
+ o: () => {
8
+ n.t || (e.g(n), (n.t = !0));
9
+ },
10
+ destroy: () => {
11
+ (n.i = null), (n.t = !1);
12
+ },
13
+ };
14
+ export default n;
@@ -1 +1,78 @@
1
- import{ControlCard}from"./models/index.js";import s from"../common/event-logger.js";import t from"../models/request-result.js";import r from"../../shared-lib/braze-shared-lib.js";import{STORAGE_KEYS as i}from"../managers/storage-manager.js";export default class a{constructor(s){this.u=s,this.u=s}h(n,o){const e=new t;if(n.p(),null==n.url||""===n.url)return r.j.info(`Card ${n.id} has no url. Not logging click to Braze servers.`),e;if(o&&n.id&&this.u){const s=this.u.v(i.k.C)||{};s[n.id]=!0,this.u.D(i.k.C,s)}const l=this.I([n]);if(null==l)return e;const u=o?r.q.$:r.q.B;return s.N(u,l)}A(n){const o=new t;if(!n.F())return r.j.info(`Card ${n.id} refused this dismissal. Ignoring analytics event.`),o;if(n.id&&this.u){const s=this.u.v(i.k.G)||{};s[n.id]=!0,this.u.D(i.k.G,s)}const e=this.I([n]);return null==e?o:s.N(r.q.H,e)}J(n,o){const e=new t(!0),l=[],u=[];let a={};this.u&&(a=o?this.u.v(i.k.K)||{}:this.u.v(i.k.L)||{});for(const s of n)s.M(),s instanceof ControlCard?u.push(s):l.push(s),s.id&&(a[s.id]=!0);const h=this.I(l),c=this.I(u);if(null==h&&null==c)return e.O=!1,e;if(this.u&&(o?this.u.D(i.k.K,a):this.u.D(i.k.L,a)),null!=h){const t=o?r.q.P:r.q.R,n=s.N(t,h);e.S(n)}if(null!=c&&o){const t=s.N(r.q.T,c);e.S(t)}return e}I(s){let t,r=null;for(let n=0;n<s.length;n++)t=s[n].id,null!=t&&""!==t&&(r=r||{},r.ids=r.ids||[],r.ids.push(t));return r}}
1
+ import { ControlCard } from "./models/index.js";
2
+ import s from "../common/event-logger.js";
3
+ import t from "../models/request-result.js";
4
+ import r from "../../shared-lib/braze-shared-lib.js";
5
+ import { STORAGE_KEYS as i } from "../managers/storage-manager.js";
6
+ export default class a {
7
+ constructor(s) {
8
+ (this.u = s), (this.u = s);
9
+ }
10
+ h(n, o) {
11
+ const e = new t();
12
+ if ((n.p(), null == n.url || "" === n.url))
13
+ return (
14
+ r.j.info(
15
+ `Card ${n.id} has no url. Not logging click to Braze servers.`,
16
+ ),
17
+ e
18
+ );
19
+ if (o && n.id && this.u) {
20
+ const s = this.u.v(i.k.C) || {};
21
+ (s[n.id] = !0), this.u.D(i.k.C, s);
22
+ }
23
+ const l = this.I([n]);
24
+ if (null == l) return e;
25
+ const u = o ? r.q.$ : r.q.B;
26
+ return s.N(u, l);
27
+ }
28
+ A(n) {
29
+ const o = new t();
30
+ if (!n.F())
31
+ return (
32
+ r.j.info(
33
+ `Card ${n.id} refused this dismissal. Ignoring analytics event.`,
34
+ ),
35
+ o
36
+ );
37
+ if (n.id && this.u) {
38
+ const s = this.u.v(i.k.G) || {};
39
+ (s[n.id] = !0), this.u.D(i.k.G, s);
40
+ }
41
+ const e = this.I([n]);
42
+ return null == e ? o : s.N(r.q.H, e);
43
+ }
44
+ J(n, o) {
45
+ const e = new t(!0),
46
+ l = [],
47
+ u = [];
48
+ let a = {};
49
+ this.u && (a = o ? this.u.v(i.k.K) || {} : this.u.v(i.k.L) || {});
50
+ for (const s of n)
51
+ s.M(),
52
+ s instanceof ControlCard ? u.push(s) : l.push(s),
53
+ s.id && (a[s.id] = !0);
54
+ const h = this.I(l),
55
+ c = this.I(u);
56
+ if (null == h && null == c) return (e.O = !1), e;
57
+ if ((this.u && (o ? this.u.D(i.k.K, a) : this.u.D(i.k.L, a)), null != h)) {
58
+ const t = o ? r.q.P : r.q.R,
59
+ n = s.N(t, h);
60
+ e.S(n);
61
+ }
62
+ if (null != c && o) {
63
+ const t = s.N(r.q.T, c);
64
+ e.S(t);
65
+ }
66
+ return e;
67
+ }
68
+ I(s) {
69
+ let t,
70
+ r = null;
71
+ for (let n = 0; n < s.length; n++)
72
+ (t = s[n].id),
73
+ null != t &&
74
+ "" !== t &&
75
+ ((r = r || {}), (r.ids = r.ids || []), r.ids.push(t));
76
+ return r;
77
+ }
78
+ }
@@ -1 +1,138 @@
1
- import{createCloseButton as o}from"../../util/component-utils.js";import{detectSwipe as d,DIRECTIONS as c}from"../../util/dom-utils.js";import{_handleBrazeAction as m}from"../../Core/handle-braze-action.js";import{logCardDismissal}from"../index.js";import r from"../../../shared-lib/braze-shared-lib.js";export const TOP_IMPRESSION_DATA_ATTRIBUTE="data-ab-had-top-impression";export const BOTTOM_IMPRESSION_DATA_ATTRIBUTE="data-ab-had-bottom-impression";export function topHadImpression(t){return null!=t&&!!t.getAttribute("data-ab-had-top-impression")}export function impressOnTop(t){null!=t&&t.setAttribute("data-ab-had-top-impression","true")}export function bottomHadImpression(t){return null!=t&&!!t.getAttribute("data-ab-had-bottom-impression")}export function impressOnBottom(t){null!=t&&t.setAttribute("data-ab-had-bottom-impression","true")}export function markCardAsRead(t){if(null!=t){const o=t.querySelectorAll(".ab-unread-indicator")[0];null!=o&&(o.className+=" read")}}export function getCardId(t){return t.getAttribute("data-ab-card-id")}export function _setImageAltText(t,o){let e="";t.title||t.description||(e="Feed Image"),o.setAttribute("alt",e)}export function setCardHeight(t,o){const e=o.querySelectorAll(".ab-image-area");let a,n=0;e.length>0&&(n=e[0].offsetWidth);for(const o of t)if(a=o._,a&&o.imageUrl&&"number"==typeof o.aspectRatio){const t=n/o.aspectRatio;t&&(a.style.height=`${t}px`)}}export function cardToHtml(t,logCardClick,e){const a=document.createElement("div");a.className="ab-card ab-effect-card "+t.U,t.id&&(a.setAttribute("data-ab-card-id",t.id),a.setAttribute("id",t.id)),a.setAttribute("role","article"),a.setAttribute("tabindex","0");let n="",i=!1;t.url&&""!==t.url&&(n=t.url,i=!0);const s=o=>(markCardAsRead(a),i&&(logCardClick(t),m(n,e,o)),!1);if(t.pinned){const t=document.createElement("div");t.className="ab-pinned-indicator";const o=document.createElement("i");o.className="fa fa-star",t.appendChild(o),a.appendChild(t)}if(t.imageUrl&&""!==t.imageUrl){const o=document.createElement("div");o.className="ab-image-area";const e=document.createElement("img");if(e.setAttribute("src",t.imageUrl),e.onload=()=>{a.style.height="auto"},_setImageAltText(t,e),o.appendChild(e),a.className+=" with-image",i&&!t.V){const t=document.createElement("a");t.setAttribute("href",n),t.onclick=s,t.appendChild(o),a.appendChild(t)}else a.appendChild(o)}const u=document.createElement("div");if(u.className="ab-card-body",t.dismissible){t.logCardDismissal=()=>logCardDismissal(t);const e=o("Dismiss Card",void 0,t.dismissCard.bind(t));a.appendChild(e),d(u,c.W,(t=>{a.className+=" ab-swiped-left",e.onclick(t)})),d(u,c.X,(t=>{a.className+=" ab-swiped-right",e.onclick(t)}))}let p="",b=!1;if(t.title&&""!==t.title&&(p=t.title,b=!0),b){const t=document.createElement("h1");if(t.className="ab-title",t.id=r.Z.Y(),a.setAttribute("aria-labelledby",t.id),i){const o=document.createElement("a");o.setAttribute("href",n),o.onclick=s,o.appendChild(document.createTextNode(p)),t.appendChild(o)}else t.appendChild(document.createTextNode(p));u.appendChild(t)}const l=document.createElement("div");if(l.className=b?"ab-description":"ab-description ab-no-title",l.id=r.Z.Y(),a.setAttribute("aria-describedby",l.id),t.description&&l.appendChild(document.createTextNode(t.description)),i){const o=document.createElement("div");o.className="ab-url-area";const e=document.createElement("a");e.setAttribute("href",n),t.linkText&&e.appendChild(document.createTextNode(t.linkText)),e.onclick=s,o.appendChild(e),l.appendChild(o)}u.appendChild(l),a.appendChild(u);const f=document.createElement("div");return f.className="ab-unread-indicator",t.viewed&&(f.className+=" read"),a.appendChild(f),t._=a,a}
1
+ import { createCloseButton as o } from "../../util/component-utils.js";
2
+ import { detectSwipe as d, DIRECTIONS as c } from "../../util/dom-utils.js";
3
+ import { _handleBrazeAction as m } from "../../Core/handle-braze-action.js";
4
+ import { logCardDismissal } from "../index.js";
5
+ import r from "../../../shared-lib/braze-shared-lib.js";
6
+ export const TOP_IMPRESSION_DATA_ATTRIBUTE = "data-ab-had-top-impression";
7
+ export const BOTTOM_IMPRESSION_DATA_ATTRIBUTE = "data-ab-had-bottom-impression";
8
+ export function topHadImpression(t) {
9
+ return null != t && !!t.getAttribute("data-ab-had-top-impression");
10
+ }
11
+ export function impressOnTop(t) {
12
+ null != t && t.setAttribute("data-ab-had-top-impression", "true");
13
+ }
14
+ export function bottomHadImpression(t) {
15
+ return null != t && !!t.getAttribute("data-ab-had-bottom-impression");
16
+ }
17
+ export function impressOnBottom(t) {
18
+ null != t && t.setAttribute("data-ab-had-bottom-impression", "true");
19
+ }
20
+ export function markCardAsRead(t) {
21
+ if (null != t) {
22
+ const o = t.querySelectorAll(".ab-unread-indicator")[0];
23
+ null != o && (o.className += " read");
24
+ }
25
+ }
26
+ export function getCardId(t) {
27
+ return t.getAttribute("data-ab-card-id");
28
+ }
29
+ export function _setImageAltText(t, o) {
30
+ let e = "";
31
+ t.title || t.description || (e = "Feed Image"), o.setAttribute("alt", e);
32
+ }
33
+ export function setCardHeight(t, o) {
34
+ const e = o.querySelectorAll(".ab-image-area");
35
+ let a,
36
+ n = 0;
37
+ e.length > 0 && (n = e[0].offsetWidth);
38
+ for (const o of t)
39
+ if (((a = o._), a && o.imageUrl && "number" == typeof o.aspectRatio)) {
40
+ const t = n / o.aspectRatio;
41
+ t && (a.style.height = `${t}px`);
42
+ }
43
+ }
44
+ export function cardToHtml(t, logCardClick, e) {
45
+ const a = document.createElement("div");
46
+ (a.className = "ab-card ab-effect-card " + t.U),
47
+ t.id &&
48
+ (a.setAttribute("data-ab-card-id", t.id), a.setAttribute("id", t.id)),
49
+ a.setAttribute("role", "article"),
50
+ a.setAttribute("tabindex", "0");
51
+ let n = "",
52
+ i = !1;
53
+ t.url && "" !== t.url && ((n = t.url), (i = !0));
54
+ const s = (o) => (markCardAsRead(a), i && (logCardClick(t), m(n, e, o)), !1);
55
+ if (t.pinned) {
56
+ const t = document.createElement("div");
57
+ t.className = "ab-pinned-indicator";
58
+ const o = document.createElement("i");
59
+ (o.className = "fa fa-star"), t.appendChild(o), a.appendChild(t);
60
+ }
61
+ if (t.imageUrl && "" !== t.imageUrl) {
62
+ const o = document.createElement("div");
63
+ o.className = "ab-image-area";
64
+ const e = document.createElement("img");
65
+ if (
66
+ (e.setAttribute("src", t.imageUrl),
67
+ (e.onload = () => {
68
+ a.style.height = "auto";
69
+ }),
70
+ _setImageAltText(t, e),
71
+ o.appendChild(e),
72
+ (a.className += " with-image"),
73
+ i && !t.V)
74
+ ) {
75
+ const t = document.createElement("a");
76
+ t.setAttribute("href", n),
77
+ (t.onclick = s),
78
+ t.appendChild(o),
79
+ a.appendChild(t);
80
+ } else a.appendChild(o);
81
+ }
82
+ const u = document.createElement("div");
83
+ if (((u.className = "ab-card-body"), t.dismissible)) {
84
+ t.logCardDismissal = () => logCardDismissal(t);
85
+ const e = o("Dismiss Card", void 0, t.dismissCard.bind(t));
86
+ a.appendChild(e),
87
+ d(u, c.W, (t) => {
88
+ (a.className += " ab-swiped-left"), e.onclick(t);
89
+ }),
90
+ d(u, c.X, (t) => {
91
+ (a.className += " ab-swiped-right"), e.onclick(t);
92
+ });
93
+ }
94
+ let p = "",
95
+ b = !1;
96
+ if ((t.title && "" !== t.title && ((p = t.title), (b = !0)), b)) {
97
+ const t = document.createElement("h1");
98
+ if (
99
+ ((t.className = "ab-title"),
100
+ (t.id = r.Z.Y()),
101
+ a.setAttribute("aria-labelledby", t.id),
102
+ i)
103
+ ) {
104
+ const o = document.createElement("a");
105
+ o.setAttribute("href", n),
106
+ (o.onclick = s),
107
+ o.appendChild(document.createTextNode(p)),
108
+ t.appendChild(o);
109
+ } else t.appendChild(document.createTextNode(p));
110
+ u.appendChild(t);
111
+ }
112
+ const l = document.createElement("div");
113
+ if (
114
+ ((l.className = b ? "ab-description" : "ab-description ab-no-title"),
115
+ (l.id = r.Z.Y()),
116
+ a.setAttribute("aria-describedby", l.id),
117
+ t.description && l.appendChild(document.createTextNode(t.description)),
118
+ i)
119
+ ) {
120
+ const o = document.createElement("div");
121
+ o.className = "ab-url-area";
122
+ const e = document.createElement("a");
123
+ e.setAttribute("href", n),
124
+ t.linkText && e.appendChild(document.createTextNode(t.linkText)),
125
+ (e.onclick = s),
126
+ o.appendChild(e),
127
+ l.appendChild(o);
128
+ }
129
+ u.appendChild(l), a.appendChild(u);
130
+ const f = document.createElement("div");
131
+ return (
132
+ (f.className = "ab-unread-indicator"),
133
+ t.viewed && (f.className += " read"),
134
+ a.appendChild(f),
135
+ (t._ = a),
136
+ a
137
+ );
138
+ }