@mjhls/mjh-framework 1.0.108 → 1.0.109-8.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 (370) hide show
  1. package/README.md +1 -5
  2. package/dist/cjs/AD.js +32 -0
  3. package/dist/cjs/AD300x250.js +95 -0
  4. package/dist/cjs/AD300x250x600.js +112 -0
  5. package/dist/cjs/AD728x90.js +109 -0
  6. package/dist/cjs/ADFloatingFooter.js +151 -0
  7. package/dist/cjs/ADFooter.js +53 -0
  8. package/dist/cjs/ADGutter.js +123 -0
  9. package/dist/cjs/ADInfeed-7c075eda.js +75 -0
  10. package/dist/cjs/ADSkyscraper.js +125 -0
  11. package/dist/cjs/ADSponsoredResources.js +122 -0
  12. package/dist/cjs/ADWebcast.js +127 -0
  13. package/dist/cjs/ADWelcome.js +166 -0
  14. package/dist/cjs/ADlgInfeed-d4f556bd.js +69 -0
  15. package/dist/cjs/AccordionPanel.js +94 -0
  16. package/dist/cjs/AdSlot.js +283 -0
  17. package/dist/cjs/AdSlotsProvider.js +184 -0
  18. package/dist/cjs/AlgoliaSearch.js +15221 -0
  19. package/dist/cjs/AlphabeticList.js +134 -0
  20. package/dist/cjs/ArticleCarousel.js +45 -0
  21. package/dist/cjs/ArticleProgramLandingPage.js +186 -0
  22. package/dist/cjs/ArticleSeriesLandingPage.js +162 -0
  23. package/dist/cjs/ArticleSeriesListing.js +314 -0
  24. package/dist/cjs/AuthWrapper.js +1526 -0
  25. package/dist/cjs/AuthorComponent-7d00f6d5.js +96 -0
  26. package/dist/cjs/Beam.js +405 -0
  27. package/dist/cjs/BlockContent-96b44364.js +916 -0
  28. package/dist/cjs/Breadcrumbs.js +107 -0
  29. package/dist/cjs/CEDeckSupabase.js +444 -0
  30. package/dist/cjs/CMEDeck.js +444 -0
  31. package/dist/cjs/Column1.js +36 -0
  32. package/dist/cjs/Column2.js +73 -0
  33. package/dist/cjs/Column3.js +140 -0
  34. package/dist/cjs/ConferenceArticleCard.js +94 -0
  35. package/dist/cjs/ConferenceBanner-213003ce.js +24 -0
  36. package/dist/cjs/ContentCardPaginated.js +416 -0
  37. package/dist/cjs/DeckContent.js +507 -0
  38. package/dist/cjs/DeckQueue.js +402 -0
  39. package/dist/cjs/DeckQueuePaginated.js +347 -0
  40. package/dist/cjs/Dfp-67646058.js +103 -0
  41. package/dist/cjs/EventsDeck.js +856 -0
  42. package/dist/cjs/ExternalResources.js +220 -0
  43. package/dist/cjs/Feature.js +132 -0
  44. package/dist/cjs/ForbesHero.js +138 -0
  45. package/dist/cjs/GridContent.js +828 -0
  46. package/dist/cjs/GridContentPaginated.js +703 -0
  47. package/dist/cjs/GridHero.js +148 -0
  48. package/dist/cjs/GroupDeck.js +314 -0
  49. package/dist/cjs/HamMagazine.js +664 -0
  50. package/dist/cjs/Header.js +65 -0
  51. package/dist/cjs/HealthCareProfessionalModal.js +78 -0
  52. package/dist/cjs/Hero.js +49 -0
  53. package/dist/cjs/HighlightenVideo.js +69 -0
  54. package/dist/cjs/HorizontalArticleListing.js +167 -0
  55. package/dist/cjs/HorizontalHero.js +112 -0
  56. package/dist/cjs/ImageSlider-7c995858.js +2808 -0
  57. package/dist/cjs/IssueContentDeck.js +242 -0
  58. package/dist/cjs/IssueDeck.js +267 -0
  59. package/dist/cjs/IssueLanding.js +176 -0
  60. package/dist/cjs/KMTracker.js +27 -0
  61. package/dist/cjs/LeftNav.js +153 -0
  62. package/dist/cjs/MasterDeck.js +555 -0
  63. package/dist/cjs/MasterDeckPaginated.js +468 -0
  64. package/dist/cjs/MediaSeriesCard.js +134 -0
  65. package/dist/cjs/MediaSeriesLanding.js +507 -0
  66. package/dist/cjs/MediaSeriesLandingPaginated.js +532 -0
  67. package/dist/cjs/NavDvm.js +278 -0
  68. package/dist/cjs/NavFooter-b7b16d48.js +72 -0
  69. package/dist/cjs/NavMagazine.js +615 -0
  70. package/dist/cjs/NavNative.js +880 -0
  71. package/dist/cjs/OncliveHero.js +80 -0
  72. package/dist/cjs/OncliveLargeHero.js +242 -0
  73. package/dist/cjs/PageFilter.js +72 -0
  74. package/dist/cjs/Pagination-6359861a.js +97 -0
  75. package/dist/cjs/PartnerDetailListing.js +374 -0
  76. package/dist/cjs/PartnerDetailListingPaginated.js +365 -0
  77. package/dist/cjs/PdfDownload.js +28 -0
  78. package/dist/cjs/PixelTracking.js +191 -0
  79. package/dist/cjs/PodcastsLanding.js +234 -0
  80. package/dist/cjs/PopUpModal.js +58 -0
  81. package/dist/cjs/PtceDeck.js +150 -0
  82. package/dist/cjs/PubSection.js +120 -0
  83. package/dist/cjs/PubToc.js +88 -0
  84. package/dist/cjs/PublicationDeck.js +184 -0
  85. package/dist/cjs/PublicationFeature-4b68e0db.js +130 -0
  86. package/dist/cjs/PublicationLanding.js +826 -0
  87. package/dist/cjs/QueueDeckExpanded.js +1540 -0
  88. package/dist/cjs/QueueDeckExpandedPaginated.js +1387 -0
  89. package/dist/cjs/RecentNews.js +91 -0
  90. package/dist/cjs/RelatedContent.js +115 -0
  91. package/dist/cjs/RelatedTopicsDropdown.js +90 -0
  92. package/dist/cjs/RolesDeck.js +94 -0
  93. package/dist/cjs/Schema.js +102 -0
  94. package/dist/cjs/Search.js +66 -0
  95. package/dist/cjs/Segment.js +458 -0
  96. package/dist/cjs/SeriesListingDeck.js +247 -0
  97. package/dist/cjs/SeriesSlider-086a8319.js +332 -0
  98. package/dist/cjs/SetCookie.js +10 -0
  99. package/dist/cjs/SideFooter.js +152 -0
  100. package/dist/cjs/SocialIcons.js +103 -0
  101. package/dist/cjs/SocialSearchComponent-d7e5d3a6.js +213 -0
  102. package/dist/cjs/SocialShare.js +74 -0
  103. package/dist/cjs/TaxonomyCard.js +256 -0
  104. package/dist/cjs/TaxonomyDescription.js +208 -0
  105. package/dist/cjs/TemplateNormal.js +204 -0
  106. package/dist/cjs/ThumbnailCard.js +60 -0
  107. package/dist/cjs/Tooltip-b8516cbf.js +9541 -0
  108. package/dist/cjs/Ustream.js +157 -0
  109. package/dist/cjs/VerticalHero.js +75 -0
  110. package/dist/cjs/VideoProgramLandingPage.js +262 -0
  111. package/dist/cjs/VideoSeriesCard.js +88 -0
  112. package/dist/cjs/VideoSeriesFilter.js +129 -0
  113. package/dist/cjs/VideoSeriesLandingPage.js +178 -0
  114. package/dist/cjs/VideoSeriesListing.js +421 -0
  115. package/dist/cjs/View.js +2841 -0
  116. package/dist/cjs/YahooHero.js +127 -0
  117. package/dist/cjs/YoutubeGroup.js +372 -0
  118. package/dist/cjs/_commonjsHelpers-06173234.js +25 -0
  119. package/dist/cjs/_is-array-54228b29.js +74 -0
  120. package/dist/cjs/_iter-detect-b1df62f0.js +52 -0
  121. package/dist/cjs/_library-dd23b178.js +5 -0
  122. package/dist/cjs/_object-sap-d1978572.js +16 -0
  123. package/dist/cjs/_object-to-array-9337ba83.js +25 -0
  124. package/dist/cjs/_set-species-0c7864a2.js +55 -0
  125. package/dist/cjs/asyncToGenerator-65df6bf8.js +1347 -0
  126. package/dist/cjs/brightcove-react-player-loader.es-35faab67.js +2232 -0
  127. package/dist/cjs/checkSisterSite-c3a4ac98.js +19 -0
  128. package/dist/cjs/core.get-iterator-method-5643aa10.js +584 -0
  129. package/dist/cjs/debounce-d4a2369b.js +216 -0
  130. package/dist/cjs/define-property-e8404b64.js +20 -0
  131. package/dist/cjs/defineProperty-19580e93.js +71 -0
  132. package/dist/cjs/defineProperty-9673846a.js +34 -0
  133. package/dist/cjs/entities-df1aed86.js +510 -0
  134. package/dist/cjs/eq-5fc26c07.js +79 -0
  135. package/dist/cjs/extends-be0d85bc.js +100 -0
  136. package/dist/cjs/faundadb.js +765 -0
  137. package/dist/cjs/get-5839e5b5.js +920 -0
  138. package/dist/cjs/getContentCategory-f38a4c00.js +11 -0
  139. package/dist/cjs/getKeywords.js +46 -0
  140. package/dist/cjs/getPtceActivities.js +90 -0
  141. package/dist/cjs/getQuery.js +27 -0
  142. package/dist/cjs/getRelatedArticle.js +766 -0
  143. package/dist/cjs/getRootDocGroup.js +63 -0
  144. package/dist/cjs/getSerializers.js +66 -0
  145. package/dist/cjs/getSeriesDetail.js +40 -0
  146. package/dist/cjs/getTIData.js +93 -0
  147. package/dist/cjs/getTargeting-7ce7037b.js +166 -0
  148. package/dist/cjs/getTargeting.js +12 -0
  149. package/dist/cjs/iconBase-be4097c0.js +104 -0
  150. package/dist/cjs/index-187c967e.js +54 -0
  151. package/dist/cjs/index-3177f564.js +1573 -0
  152. package/dist/cjs/index-65621b6c.js +613 -0
  153. package/dist/cjs/index-7435b964.js +1683 -0
  154. package/dist/cjs/index-a26637a3.js +11764 -0
  155. package/dist/cjs/index-d48b231c.js +556 -0
  156. package/dist/cjs/index-ff83a88b.js +104 -0
  157. package/dist/cjs/index.es-1ab8dda7.js +445 -0
  158. package/dist/cjs/index.esm-2ea9e9ff.js +98 -0
  159. package/dist/cjs/index.esm-c1e16606.js +13 -0
  160. package/dist/cjs/index.esm-d51c9ac6.js +25 -0
  161. package/dist/cjs/index.esm-d81454e7.js +19 -0
  162. package/dist/cjs/index.js +638 -0
  163. package/dist/cjs/inherits-e47b5342.js +188 -0
  164. package/dist/cjs/isSymbol-03abbdf0.js +209 -0
  165. package/dist/cjs/js.cookie-a511c430.js +160 -0
  166. package/dist/cjs/keys-e982b3fa.js +25 -0
  167. package/dist/cjs/lodash-f0783643.js +17195 -0
  168. package/dist/cjs/main-ae8472f3.js +969 -0
  169. package/dist/cjs/moment-f730814d.js +5684 -0
  170. package/dist/cjs/react-social-icons-2c5c389a.js +616 -0
  171. package/dist/cjs/slicedToArray-067dd3bc.js +95 -0
  172. package/dist/cjs/smoothscroll-99df7f93.js +438 -0
  173. package/dist/cjs/stringify-f7a37a8d.js +17 -0
  174. package/dist/cjs/style-inject.es-dcee06b6.js +30 -0
  175. package/dist/cjs/timeDifferenceCalc.js +39 -0
  176. package/dist/cjs/toConsumableArray-d7797c2b.js +74 -0
  177. package/dist/cjs/toNumber-5e1fac58.js +104 -0
  178. package/dist/cjs/typeof-220bbf73.js +382 -0
  179. package/dist/cjs/urlFor.js +66 -0
  180. package/dist/cjs/urlForFile-5084fc48.js +29 -0
  181. package/dist/cjs/ustream-api-3819e4aa.js +106 -0
  182. package/dist/cjs/visibility-sensor-56020df6.js +597 -0
  183. package/dist/cjs/web.dom.iterable-d98303e0.js +50 -0
  184. package/dist/esm/AD.js +26 -0
  185. package/dist/esm/AD300x250.js +89 -0
  186. package/dist/esm/AD300x250x600.js +106 -0
  187. package/dist/esm/AD728x90.js +103 -0
  188. package/dist/esm/ADFloatingFooter.js +145 -0
  189. package/dist/esm/ADFooter.js +47 -0
  190. package/dist/esm/ADGutter.js +117 -0
  191. package/dist/esm/ADInfeed-3442c999.js +68 -0
  192. package/dist/esm/ADSkyscraper.js +119 -0
  193. package/dist/esm/ADSponsoredResources.js +116 -0
  194. package/dist/esm/ADWebcast.js +121 -0
  195. package/dist/esm/ADWelcome.js +160 -0
  196. package/dist/esm/ADlgInfeed-30649360.js +63 -0
  197. package/dist/esm/AccordionPanel.js +87 -0
  198. package/dist/esm/AdSlot.js +276 -0
  199. package/dist/esm/AdSlotsProvider.js +177 -0
  200. package/dist/esm/AlgoliaSearch.js +15214 -0
  201. package/dist/esm/AlphabeticList.js +128 -0
  202. package/dist/esm/ArticleCarousel.js +39 -0
  203. package/dist/esm/ArticleProgramLandingPage.js +180 -0
  204. package/dist/esm/ArticleSeriesLandingPage.js +156 -0
  205. package/dist/esm/ArticleSeriesListing.js +307 -0
  206. package/dist/esm/AuthWrapper.js +1520 -0
  207. package/dist/esm/AuthorComponent-d9653ae5.js +90 -0
  208. package/dist/esm/Beam.js +403 -0
  209. package/dist/esm/BlockContent-1e73bd2c.js +909 -0
  210. package/dist/esm/Breadcrumbs.js +100 -0
  211. package/dist/esm/CEDeckSupabase.js +438 -0
  212. package/dist/esm/CMEDeck.js +438 -0
  213. package/dist/esm/Column1.js +28 -0
  214. package/dist/esm/Column2.js +65 -0
  215. package/dist/esm/Column3.js +132 -0
  216. package/dist/esm/ConferenceArticleCard.js +88 -0
  217. package/dist/esm/ConferenceBanner-8792ebd2.js +18 -0
  218. package/dist/esm/ContentCardPaginated.js +405 -0
  219. package/dist/esm/DeckContent.js +497 -0
  220. package/dist/esm/DeckQueue.js +392 -0
  221. package/dist/esm/DeckQueuePaginated.js +336 -0
  222. package/dist/esm/Dfp-3b6eb620.js +96 -0
  223. package/dist/esm/EventsDeck.js +843 -0
  224. package/dist/esm/ExternalResources.js +213 -0
  225. package/dist/esm/Feature.js +125 -0
  226. package/dist/esm/ForbesHero.js +132 -0
  227. package/dist/esm/GridContent.js +818 -0
  228. package/dist/esm/GridContentPaginated.js +692 -0
  229. package/dist/esm/GridHero.js +142 -0
  230. package/dist/esm/GroupDeck.js +308 -0
  231. package/dist/esm/HamMagazine.js +651 -0
  232. package/dist/esm/Header.js +54 -0
  233. package/dist/esm/HealthCareProfessionalModal.js +70 -0
  234. package/dist/esm/Hero.js +43 -0
  235. package/dist/esm/HighlightenVideo.js +63 -0
  236. package/dist/esm/HorizontalArticleListing.js +161 -0
  237. package/dist/esm/HorizontalHero.js +106 -0
  238. package/dist/esm/ImageSlider-75f7b81a.js +2799 -0
  239. package/dist/esm/IssueContentDeck.js +232 -0
  240. package/dist/esm/IssueDeck.js +257 -0
  241. package/dist/esm/IssueLanding.js +170 -0
  242. package/dist/esm/KMTracker.js +25 -0
  243. package/dist/esm/LeftNav.js +143 -0
  244. package/dist/esm/MasterDeck.js +548 -0
  245. package/dist/esm/MasterDeckPaginated.js +460 -0
  246. package/dist/esm/MediaSeriesCard.js +128 -0
  247. package/dist/esm/MediaSeriesLanding.js +500 -0
  248. package/dist/esm/MediaSeriesLandingPaginated.js +525 -0
  249. package/dist/esm/NavDvm.js +265 -0
  250. package/dist/esm/NavFooter-4bcffccb.js +66 -0
  251. package/dist/esm/NavMagazine.js +602 -0
  252. package/dist/esm/NavNative.js +864 -0
  253. package/dist/esm/OncliveHero.js +74 -0
  254. package/dist/esm/OncliveLargeHero.js +236 -0
  255. package/dist/esm/PageFilter.js +66 -0
  256. package/dist/esm/Pagination-9fe9f61d.js +90 -0
  257. package/dist/esm/PartnerDetailListing.js +368 -0
  258. package/dist/esm/PartnerDetailListingPaginated.js +359 -0
  259. package/dist/esm/PdfDownload.js +22 -0
  260. package/dist/esm/PixelTracking.js +182 -0
  261. package/dist/esm/PodcastsLanding.js +227 -0
  262. package/dist/esm/PopUpModal.js +51 -0
  263. package/dist/esm/PtceDeck.js +144 -0
  264. package/dist/esm/PubSection.js +114 -0
  265. package/dist/esm/PubToc.js +82 -0
  266. package/dist/esm/PublicationDeck.js +174 -0
  267. package/dist/esm/PublicationFeature-6c334891.js +121 -0
  268. package/dist/esm/PublicationLanding.js +816 -0
  269. package/dist/esm/QueueDeckExpanded.js +1534 -0
  270. package/dist/esm/QueueDeckExpandedPaginated.js +1381 -0
  271. package/dist/esm/RecentNews.js +85 -0
  272. package/dist/esm/RelatedContent.js +109 -0
  273. package/dist/esm/RelatedTopicsDropdown.js +82 -0
  274. package/dist/esm/RolesDeck.js +84 -0
  275. package/dist/esm/Schema.js +96 -0
  276. package/dist/esm/Search.js +57 -0
  277. package/dist/esm/Segment.js +456 -0
  278. package/dist/esm/SeriesListingDeck.js +241 -0
  279. package/dist/esm/SeriesSlider-acbdf4c9.js +326 -0
  280. package/dist/esm/SetCookie.js +8 -0
  281. package/dist/esm/SideFooter.js +146 -0
  282. package/dist/esm/SocialIcons.js +97 -0
  283. package/dist/esm/SocialSearchComponent-9e65c8d6.js +204 -0
  284. package/dist/esm/SocialShare.js +67 -0
  285. package/dist/esm/TaxonomyCard.js +246 -0
  286. package/dist/esm/TaxonomyDescription.js +201 -0
  287. package/dist/esm/TemplateNormal.js +197 -0
  288. package/dist/esm/ThumbnailCard.js +53 -0
  289. package/dist/esm/Tooltip-fe0ed92d.js +9532 -0
  290. package/dist/esm/Ustream.js +151 -0
  291. package/dist/esm/VerticalHero.js +69 -0
  292. package/dist/esm/VideoProgramLandingPage.js +253 -0
  293. package/dist/esm/VideoSeriesCard.js +82 -0
  294. package/dist/esm/VideoSeriesFilter.js +123 -0
  295. package/dist/esm/VideoSeriesLandingPage.js +172 -0
  296. package/dist/esm/VideoSeriesListing.js +414 -0
  297. package/dist/esm/View.js +2831 -0
  298. package/dist/esm/YahooHero.js +121 -0
  299. package/dist/esm/YoutubeGroup.js +366 -0
  300. package/dist/esm/_commonjsHelpers-0c4b6f40.js +19 -0
  301. package/dist/esm/_is-array-68c79b29.js +71 -0
  302. package/dist/esm/_iter-detect-2f89237f.js +48 -0
  303. package/dist/esm/_library-528f1934.js +3 -0
  304. package/dist/esm/_object-sap-14bd8e96.js +14 -0
  305. package/dist/esm/_object-to-array-9dfdfb29.js +23 -0
  306. package/dist/esm/_set-species-7d3317b7.js +50 -0
  307. package/dist/esm/asyncToGenerator-1ebeb135.js +1343 -0
  308. package/dist/esm/brightcove-react-player-loader.es-a2422c4b.js +2226 -0
  309. package/dist/esm/checkSisterSite-a7218fda.js +17 -0
  310. package/dist/esm/core.get-iterator-method-95db387d.js +547 -0
  311. package/dist/esm/debounce-533d9748.js +214 -0
  312. package/dist/esm/define-property-433c51d3.js +18 -0
  313. package/dist/esm/defineProperty-e5afb9eb.js +32 -0
  314. package/dist/esm/defineProperty-e8022d1e.js +66 -0
  315. package/dist/esm/entities-6d9154b4.js +507 -0
  316. package/dist/esm/eq-bdcbf886.js +76 -0
  317. package/dist/esm/extends-2f4448b8.js +94 -0
  318. package/dist/esm/faundadb.js +754 -0
  319. package/dist/esm/get-3c308da4.js +918 -0
  320. package/dist/esm/getContentCategory-15dcc413.js +9 -0
  321. package/dist/esm/getKeywords.js +44 -0
  322. package/dist/esm/getPtceActivities.js +88 -0
  323. package/dist/esm/getQuery.js +25 -0
  324. package/dist/esm/getRelatedArticle.js +764 -0
  325. package/dist/esm/getRootDocGroup.js +61 -0
  326. package/dist/esm/getSerializers.js +60 -0
  327. package/dist/esm/getSeriesDetail.js +38 -0
  328. package/dist/esm/getTIData.js +91 -0
  329. package/dist/esm/getTargeting-301942ae.js +163 -0
  330. package/dist/esm/getTargeting.js +6 -0
  331. package/dist/esm/iconBase-ccc56b97.js +81 -0
  332. package/dist/esm/index-3f5c03b2.js +553 -0
  333. package/dist/esm/index-4550ef23.js +1571 -0
  334. package/dist/esm/index-5cc7b406.js +1674 -0
  335. package/dist/esm/index-755f2cc2.js +605 -0
  336. package/dist/esm/index-a68bfe70.js +11743 -0
  337. package/dist/esm/index-c7e2ac95.js +52 -0
  338. package/dist/esm/index-c8d5e72b.js +99 -0
  339. package/dist/esm/index.es-a6137319.js +439 -0
  340. package/dist/esm/index.esm-1bd8a0a8.js +18 -0
  341. package/dist/esm/index.esm-9508070a.js +91 -0
  342. package/dist/esm/index.esm-9b042655.js +10 -0
  343. package/dist/esm/index.esm-eb1e8e80.js +14 -0
  344. package/dist/esm/index.js +531 -0
  345. package/dist/esm/inherits-96c84cbd.js +179 -0
  346. package/dist/esm/isSymbol-a7e9aafe.js +203 -0
  347. package/dist/esm/js.cookie-6874175c.js +158 -0
  348. package/dist/esm/keys-185288f4.js +23 -0
  349. package/dist/esm/lodash-f97fd99a.js +17193 -0
  350. package/dist/esm/main-754d4992.js +956 -0
  351. package/dist/esm/moment-48faeb9c.js +5682 -0
  352. package/dist/esm/react-social-icons-9be47857.js +609 -0
  353. package/dist/esm/slicedToArray-72ed566b.js +92 -0
  354. package/dist/esm/smoothscroll-fa4e3f8c.js +436 -0
  355. package/dist/esm/stringify-1e2a5946.js +15 -0
  356. package/dist/esm/style-inject.es-1f59c1d0.js +28 -0
  357. package/dist/esm/timeDifferenceCalc.js +37 -0
  358. package/dist/esm/toConsumableArray-e6f28e5c.js +71 -0
  359. package/dist/esm/toNumber-5aeba6e7.js +102 -0
  360. package/dist/esm/typeof-3ab7d3b6.js +378 -0
  361. package/dist/esm/urlFor.js +64 -0
  362. package/dist/esm/urlForFile-2e523b67.js +27 -0
  363. package/dist/esm/ustream-api-63a164b3.js +104 -0
  364. package/dist/esm/visibility-sensor-72fd8f8b.js +590 -0
  365. package/dist/esm/web.dom.iterable-3fffc027.js +48 -0
  366. package/package.json +55 -26
  367. package/dist/index.es.js +0 -20497
  368. package/dist/index.es.js.map +0 -1
  369. package/dist/index.js +0 -20535
  370. package/dist/index.js.map +0 -1
@@ -0,0 +1,2841 @@
1
+ 'use strict';
2
+
3
+ var asyncToGenerator = require('./asyncToGenerator-65df6bf8.js');
4
+ var _extends = require('./extends-be0d85bc.js');
5
+ var slicedToArray = require('./slicedToArray-067dd3bc.js');
6
+ var React = require('react');
7
+ var Head = require('next/head');
8
+ var Router = require('next/router');
9
+ var stringify = require('./stringify-f7a37a8d.js');
10
+ var toConsumableArray = require('./toConsumableArray-d7797c2b.js');
11
+ var moment = require('./moment-f730814d.js');
12
+ var BlockContent = require('./BlockContent-96b44364.js');
13
+ var main = require('./main-ae8472f3.js');
14
+ require('react-bootstrap/Dropdown');
15
+ var Form = require('react-bootstrap/Form');
16
+ var FormControl = require('react-bootstrap/FormControl');
17
+ var Button = require('react-bootstrap/Button');
18
+ var visibilitySensor = require('./visibility-sensor-56020df6.js');
19
+ var SocialShare = require('./SocialShare.js');
20
+ var getSerializers = require('./index-a26637a3.js');
21
+ var AdSlot = require('./AdSlot.js');
22
+ var SeriesSlider = require('./SeriesSlider-086a8319.js');
23
+ var getTargeting = require('./getTargeting-7ce7037b.js');
24
+ var getKeywords = require('./getKeywords.js');
25
+ var urlFor = require('./urlFor.js');
26
+ var urlForFile = require('./urlForFile-5084fc48.js');
27
+ var _typeof = require('./typeof-220bbf73.js');
28
+ var index_esm = require('./index.esm-d51c9ac6.js');
29
+ var styleInject_es = require('./style-inject.es-dcee06b6.js');
30
+ require('./index-65621b6c.js');
31
+ var disqusReact = require('disqus-react');
32
+ var Schema = require('./Schema.js');
33
+ var _commonjsHelpers = require('./_commonjsHelpers-06173234.js');
34
+ var PixelTracking = require('./PixelTracking.js');
35
+ var keys = require('./keys-e982b3fa.js');
36
+ var index_es = require('./index.es-1ab8dda7.js');
37
+ var index = require('./index-7435b964.js');
38
+ var getRelatedArticle = require('./getRelatedArticle.js');
39
+ var getQuery = require('./getQuery.js');
40
+ var getSeriesDetail = require('./getSeriesDetail.js');
41
+ require('./core.get-iterator-method-5643aa10.js');
42
+ require('./web.dom.iterable-d98303e0.js');
43
+ require('./_library-dd23b178.js');
44
+ require('./_set-species-0c7864a2.js');
45
+ require('./_iter-detect-b1df62f0.js');
46
+ require('prop-types');
47
+ require('./index-d48b231c.js');
48
+ require('react-dom');
49
+ require('react-share');
50
+ require('react-bootstrap');
51
+ require('./index-187c967e.js');
52
+ require('./Beam.js');
53
+ require('./Segment.js');
54
+ require('./brightcove-react-player-loader.es-35faab67.js');
55
+ require('./_object-to-array-9337ba83.js');
56
+ require('react-bootstrap/Modal');
57
+ require('react-ga');
58
+ require('./GroupDeck.js');
59
+ require('./smoothscroll-99df7f93.js');
60
+ require('./_is-array-54228b29.js');
61
+ require('react-bootstrap/Pagination');
62
+ require('./entities-df1aed86.js');
63
+ require('react-bootstrap/Row');
64
+ require('react-bootstrap/Col');
65
+ require('./inherits-e47b5342.js');
66
+ require('./_object-sap-d1978572.js');
67
+ require('./define-property-e8404b64.js');
68
+ require('./index.esm-d81454e7.js');
69
+ require('./iconBase-be4097c0.js');
70
+ require('react-bootstrap/Figure');
71
+ require('react-bootstrap/OverlayTrigger');
72
+ require('react-bootstrap/Tooltip');
73
+ require('react-bootstrap/Popover');
74
+ require('./checkSisterSite-c3a4ac98.js');
75
+ require('./debounce-d4a2369b.js');
76
+ require('./isSymbol-03abbdf0.js');
77
+ require('./toNumber-5e1fac58.js');
78
+
79
+ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
80
+
81
+ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
82
+ var Head__default = /*#__PURE__*/_interopDefaultLegacy(Head);
83
+ var Form__default = /*#__PURE__*/_interopDefaultLegacy(Form);
84
+ var FormControl__default = /*#__PURE__*/_interopDefaultLegacy(FormControl);
85
+ var Button__default = /*#__PURE__*/_interopDefaultLegacy(Button);
86
+
87
+ var getArticleSummary = function getArticleSummary(article) {
88
+ if (article.summary && article.summary.length > 0) {
89
+ return article.summary;
90
+ } else {
91
+ return false;
92
+ }
93
+ };
94
+
95
+ var getDocumentGroupUrl = function getDocumentGroupUrl(docGroup) {
96
+ if (!docGroup) {
97
+ return null;
98
+ }
99
+ var url = void 0;
100
+ try {
101
+ if (docGroup.path && docGroup.path.includes('/') && (!docGroup.parent || !docGroup.parent.parent)) {
102
+ return '/' + docGroup.path;
103
+ }
104
+ } catch (e) {
105
+ console.log(e.message);
106
+ }
107
+ // Checking if Parent has Parent
108
+ try {
109
+ if (docGroup.path && docGroup.path.includes('/') && docGroup.parent && docGroup.parent.parent) {
110
+ if (docGroup.path.includes(docGroup.parent.identifier.current)) {
111
+ return '/' + docGroup.parent.parent.identifier.current + '/' + docGroup.path;
112
+ } else {
113
+ return '/' + docGroup.parent.parent.identifier.current + '/' + docGroup.parent.identifier.current + '/' + docGroup.path;
114
+ }
115
+ }
116
+ } catch (e) {
117
+ console.log(e.message);
118
+ }
119
+
120
+ try {
121
+ if (docGroup.parent && docGroup.parent.identifier && docGroup.parent.parent && docGroup.parent.parent.identifier && docGroup.parent.identifier.current.includes('/') && docGroup.parent.identifier.current.split('/')[0] === docGroup.parent.parent.identifier.current) {
122
+ return '/' + docGroup.parent.identifier.current + '/' + docGroup.path;
123
+ }
124
+ } catch (e) {
125
+ console.log(e.message);
126
+ }
127
+
128
+ if (docGroup.parent) {
129
+ url = '/' + docGroup.parent.identifier.current;
130
+ if (docGroup.parent.parent && docGroup.parent.parent.name) {
131
+ url = '/' + docGroup.parent.parent.identifier.current + url;
132
+ }
133
+ }
134
+
135
+ if (typeof url !== 'undefined') {
136
+ url = url + '/' + docGroup.path;
137
+ } else {
138
+ // url = '/' + docGroup.path
139
+ return null;
140
+ }
141
+
142
+ return url;
143
+ };
144
+
145
+ var getDocumentGroupName = function getDocumentGroupName(docGroup) {
146
+ var name = void 0;
147
+ if (!docGroup) {
148
+ return null;
149
+ }
150
+
151
+ if (docGroup.parent) {
152
+ name = docGroup.parent.name;
153
+
154
+ if (docGroup.parent.parent && docGroup.parent.parent.name) {
155
+ name = docGroup.parent.parent.name + ' | ' + name;
156
+ }
157
+ }
158
+
159
+ if (typeof name !== 'undefined') {
160
+ name = name + ' | <b>' + docGroup.name + '</b>';
161
+ } else {
162
+ // name = '<b>' + docGroup.name + '</b>'
163
+ return null;
164
+ }
165
+
166
+ return name && typeof name != 'undefined' ? name : null;
167
+ };
168
+
169
+ var DocumentGroup = function DocumentGroup(_ref) {
170
+ var article = _ref.article,
171
+ client = _ref.client;
172
+
173
+
174
+ var mediaSeriesGroup = null;
175
+ var disableThumbnail = false;
176
+
177
+ if (article.documentGroup && article.documentGroup.hideThumbnail === true) {
178
+ disableThumbnail = true;
179
+ }
180
+
181
+ if (article.documentGroup && article.documentGroup.isShow !== false && article.documentGroup.isSeries !== true) {
182
+ mediaSeriesGroup = article.documentGroup;
183
+ }
184
+ if (!article.documentGroup && article.documentGroupMapping) {
185
+ for (var i = 0; i < article.documentGroupMapping.length; i++) {
186
+ if (article.documentGroupMapping[i].isShow !== false && article.documentGroupMapping[i].isSeries !== true) {
187
+ mediaSeriesGroup = article.documentGroupMapping[i];
188
+ break;
189
+ }
190
+ }
191
+ }
192
+
193
+ if (!mediaSeriesGroup) {
194
+ return null;
195
+ }
196
+
197
+ var name = getDocumentGroupName(mediaSeriesGroup);
198
+ var url = getDocumentGroupUrl(mediaSeriesGroup);
199
+ var thumbnailUrl = false;
200
+
201
+ if (mediaSeriesGroup.thumbnail) {
202
+ thumbnailUrl = urlFor({ client: client, source: mediaSeriesGroup.thumbnail });
203
+ }
204
+ var margin = article.documentGroupMapping && article.documentGroupMapping[0] && article.documentGroupMapping[0].parent && article.documentGroupMapping[0].parent.parent && article.documentGroupMapping[0].parent.parent.contextText || article.documentGroup && article.documentGroup.parent && article.documentGroup.parent.parent && article.documentGroup.parent.parent.contextText ? 'none' : '1rem';
205
+ return React__default["default"].createElement(
206
+ 'div',
207
+ null,
208
+ React__default["default"].createElement(
209
+ 'p',
210
+ { style: { textAlign: 'center', fontWeight: 600 } },
211
+ article.documentGroupMapping && article.documentGroupMapping[0] && article.documentGroupMapping[0].parent && article.documentGroupMapping[0].parent.parent && article.documentGroupMapping[0].parent.parent.contextText ? article.documentGroupMapping[0].parent.parent.contextText : article.documentGroup && article.documentGroup.parent && article.documentGroup.parent.parent && article.documentGroup.parent.parent.contextText ? article.documentGroup.parent.parent.contextText : null
212
+ ),
213
+ url && name && React__default["default"].createElement(
214
+ 'a',
215
+ {
216
+ href: url,
217
+ className: 'doc-group',
218
+ style: { display: 'flex', flexDirection: 'column', padding: '0 1rem', justifyContent: thumbnailUrl ? 'center' : 'flex-start', alignItems: 'center' } },
219
+ thumbnailUrl && !disableThumbnail && React__default["default"].createElement('img', { style: { maxWidth: '210px', maxHeight: '100px', marginTop: margin }, src: thumbnailUrl, alt: name }),
220
+ (disableThumbnail || !thumbnailUrl) && React__default["default"].createElement('p', {
221
+ style: { maxWidth: '315px', margin: '0', color: 'var(--primary)', textAlign: thumbnailUrl ? 'center' : main.main_43 ? 'left' : 'right', marginTop: '.25rem' },
222
+ dangerouslySetInnerHTML: { __html: name } }),
223
+ main.main_43 && !thumbnailUrl && React__default["default"].createElement(
224
+ 'style',
225
+ { jsx: 'true' },
226
+ '\n a.doc-group {\n display: block !important;\n padding: 0 !important;\n }\n '
227
+ )
228
+ )
229
+ );
230
+ };
231
+
232
+ var findIndex = function findIndex(arr) {
233
+ var indexes = [];
234
+ if ((typeof arr === 'undefined' ? 'undefined' : _typeof._typeof(arr)) === 'object') {
235
+ var _iteratorNormalCompletion = true;
236
+ var _didIteratorError = false;
237
+ var _iteratorError = undefined;
238
+
239
+ try {
240
+ for (var _iterator = slicedToArray._getIterator(arr), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
241
+ var ele = _step.value;
242
+
243
+ if (ele['_type'] === 'block' && ele.children.some(function (child) {
244
+ return child.text.trim().length > 0;
245
+ }) && ele['listItem'] !== 'bullet' &&
246
+ // To skip li tags when setting contextual native ads
247
+ ele['listItem'] !== 'number' && ele['style'] === 'normal' || ele['_type'] === 'figure') {
248
+ indexes.push(arr.indexOf(ele));
249
+ }
250
+ }
251
+ } catch (err) {
252
+ _didIteratorError = true;
253
+ _iteratorError = err;
254
+ } finally {
255
+ try {
256
+ if (!_iteratorNormalCompletion && _iterator.return) {
257
+ _iterator.return();
258
+ }
259
+ } finally {
260
+ if (_didIteratorError) {
261
+ throw _iteratorError;
262
+ }
263
+ }
264
+ }
265
+ }
266
+ return indexes;
267
+ };
268
+
269
+ var ISI = function ISI(props) {
270
+ var children = props.children;
271
+
272
+ var _useState = React.useState(false),
273
+ _useState2 = slicedToArray._slicedToArray(_useState, 2),
274
+ active = _useState2[0],
275
+ setActive = _useState2[1];
276
+
277
+ var _useState3 = React.useState(false),
278
+ _useState4 = slicedToArray._slicedToArray(_useState3, 2),
279
+ bottomOfArticle = _useState4[0],
280
+ setbottomOfArticle = _useState4[1];
281
+
282
+ var isi = React.useRef();
283
+
284
+ React.useEffect(function () {
285
+ if (active) {
286
+ var offset = '5rem';
287
+ var nav = document.getElementsByTagName('header');
288
+ if (nav && nav.length > 0) {
289
+ offset = nav[0].offsetHeight + 'px';
290
+ }
291
+ isi.current.style.maxHeight = 'calc(100% - ' + offset + ')';
292
+ isi.current.style.overflowY = 'scroll';
293
+ } else {
294
+ isi.current.style.maxHeight = '';
295
+ isi.current.style.overflowY = '';
296
+ }
297
+ }, [active]);
298
+ React.useEffect(function () {
299
+ var detectBottomOfArticle = function detectBottomOfArticle() {
300
+ var article_body = document.getElementById('article__block');
301
+ var isi = document.getElementById('isi');
302
+ var articleBottomPosition = article_body.getBoundingClientRect().bottom - window.innerHeight;
303
+ // console.log(articleBottomPosition, bottomOfArticle)
304
+ if (articleBottomPosition < 30 && !isi.classList.contains('in-view')) {
305
+ setbottomOfArticle(true);
306
+ }
307
+ if (articleBottomPosition > 60 && isi.classList.contains('in-view')) {
308
+ setbottomOfArticle(false);
309
+ }
310
+ };
311
+ window.addEventListener('scroll', detectBottomOfArticle);
312
+ return function () {
313
+ return window.removeEventListener('scroll', detectBottomOfArticle);
314
+ };
315
+ }, []);
316
+
317
+ React.useEffect(function () {
318
+ var isi = document.getElementById('isi');
319
+ if (bottomOfArticle) {
320
+ toggleSticky(true);
321
+ isi.classList.add('in-view');
322
+ if (active) {
323
+ setActive(false);
324
+ }
325
+ }
326
+ if (!bottomOfArticle) {
327
+ toggleSticky(false);
328
+ isi.classList.remove('in-view');
329
+ }
330
+ }, [bottomOfArticle]);
331
+
332
+ var toggleSticky = function toggleSticky(sticky) {
333
+ var isiToggle = document.getElementById('isiToggle');
334
+ var isiContent = document.getElementById('isiContent');
335
+ var isi = document.getElementById('isi');
336
+ if (sticky) {
337
+ isi.style.bottom = '-200px';
338
+ setTimeout(function () {
339
+ isi.style.maxHeight = 'unset';
340
+ isi.style.position = 'relative';
341
+ isi.style.boxShadow = 'none';
342
+ isi.style.zIndex = '1';
343
+ isi.style.marginTop = '-25rem';
344
+ isi.style.marginBottom = '15rem';
345
+ isiToggle.style.display = 'none';
346
+ isiContent.style.padding = '0';
347
+ }, 300);
348
+ } else if (!sticky) {
349
+
350
+ isi.style.marginBottom = '0';
351
+ isi.style.maxHeight = '12rem';
352
+ isi.style.position = 'fixed';
353
+ isi.style.boxShadow = '0 0 1rem 0 rgba(0, 0, 0, 0.5)';
354
+ isi.style.zIndex = '99999';
355
+
356
+ isiToggle.style.display = 'block';
357
+ isiContent.style.padding = '1rem';
358
+ setTimeout(function () {
359
+ isi.style.bottom = '0';
360
+ isi.style.marginTop = '0';
361
+ }, 300);
362
+ }
363
+ };
364
+ return React__default["default"].createElement(
365
+ React__default["default"].Fragment,
366
+ null,
367
+ React__default["default"].createElement(
368
+ 'div',
369
+ { id: 'isi', ref: isi },
370
+ React__default["default"].createElement(
371
+ 'div',
372
+ { id: 'isiContent' },
373
+ React__default["default"].createElement(
374
+ 'div',
375
+ { onClick: function onClick() {
376
+ return setActive(function (prev) {
377
+ return !prev;
378
+ });
379
+ }, id: 'isiToggle' },
380
+ active ? React__default["default"].createElement(
381
+ 'p',
382
+ null,
383
+ 'Close ',
384
+ React__default["default"].createElement(index_esm.FaMinus, null)
385
+ ) : React__default["default"].createElement(
386
+ 'p',
387
+ null,
388
+ 'See More ',
389
+ React__default["default"].createElement(index_esm.FaPlus, null)
390
+ )
391
+ ),
392
+ children
393
+ )
394
+ ),
395
+ React__default["default"].createElement(
396
+ 'style',
397
+ { jsx: true },
398
+ '\n #isi {\n position: fixed;\n z-index: 9999999;\n bottom: 0;\n left: 0;\n max-height: 12rem;\n background-color: #ffffff;\n overflow-x: hidden;\n overflow-y: hidden;\n width: 100%;\n box-shadow: 0 0 1rem 0 rgba(0, 0, 0, 0.5);\n transition: bottom .5s ease , margin-top .3s, max-height .2s;\n }\n #isiContent {\n width: 100%;\n max-width: 1000px;\n margin-left: auto;\n margin-right: auto;\n position: relative;\n padding: 1rem;\n font-size: 1rem;\n }\n #isi::-webkit-scrollbar {\n display: none;\n }\n #isiToggle {\n position: absolute;\n top: 0;\n right: 0;\n padding: 1rem;\n font-weight: bold;\n cursor: pointer;\n font-size: 1rem;\n }\n #isiToggle p {\n margin: 0;\n }\n '
399
+ )
400
+ );
401
+ };
402
+
403
+ var css$1 = ".RelatedArticles-module_mediaContainer__10h9k {\n display: flex;\n flex-direction: row;\n flex-wrap: nowrap;\n margin: 0 -1rem;\n}\n.RelatedArticles-module_mediaCard__3wQbn {\n margin: 0 1rem 1rem;\n width: calc(33% - 1rem);\n display: column;\n flex-direction: row;\n margin-bottom: 0.75rem;\n padding-bottom: 0.75rem;\n border-bottom: none;\n}\n.RelatedArticles-module_mediaCard__3wQbn:last-child {\n border-bottom: none;\n}\n.RelatedArticles-module_cardTitle__3P-Ib {\n font-weight: bold;\n color: #252525;\n margin-bottom: 0.25rem;\n font-size: 15px;\n}\n.RelatedArticles-module_authorListing__1EFg4 span.RelatedArticles-module_text-muted__3b0zX {\n color: #000;\n font-weight: bold;\n}\n.RelatedArticles-module_cardDate__1wOR5 {\n color: var(--dark);\n display: block;\n background: #fff !important;\n margin-bottom: 0;\n}\n.RelatedArticles-module_imgWrapper__5Jx_4 {\n display: block;\n text-align: center;\n margin-bottom: 0.5rem;\n}\n.RelatedArticles-module_imgWrapper__5Jx_4 img {\n height: 135px;\n width: 100%;\n object-fit: cover;\n object-position: center;\n}\n@media screen and (max-width: 1064px) {\n}\n@media screen and (max-width: 968px) {\n .RelatedArticles-module_mediaContainer__10h9k {\n flex-wrap: wrap;\n }\n .RelatedArticles-module_imgWrapper__5Jx_4 {\n display: none;\n }\n .RelatedArticles-module_mediaCard__3wQbn {\n width: 100%;\n margin-bottom: 0.5rem;\n padding: 0;\n }\n .RelatedArticles-module_cardTitle__3P-Ib {\n font-size: 0.75rem;\n margin-bottom: 0;\n }\n}\n";
404
+ var styles$1 = { "mediaContainer": "RelatedArticles-module_mediaContainer__10h9k", "mediaCard": "RelatedArticles-module_mediaCard__3wQbn", "cardTitle": "RelatedArticles-module_cardTitle__3P-Ib", "authorListing": "RelatedArticles-module_authorListing__1EFg4", "text-muted": "RelatedArticles-module_text-muted__3b0zX", "cardDate": "RelatedArticles-module_cardDate__1wOR5", "imgWrapper": "RelatedArticles-module_imgWrapper__5Jx_4" };
405
+ styleInject_es.styleInject(css$1);
406
+
407
+ var RelatedArticle = function RelatedArticle(_ref) {
408
+ var articles = _ref.articles,
409
+ client = _ref.client,
410
+ fallbackImage = _ref.fallbackImage,
411
+ _ref$showRelatedArtic = _ref.showRelatedArticleFallbackImage,
412
+ showRelatedArticleFallbackImage = _ref$showRelatedArtic === undefined ? true : _ref$showRelatedArtic;
413
+
414
+ if (!articles || articles.length == 0 || !articles[0]) {
415
+ return null;
416
+ }
417
+ return React__default["default"].createElement(
418
+ 'div',
419
+ { className: styles$1.mediaContainer },
420
+ articles.map(function (article, index) {
421
+ if (article && article.url && article.url.current) {
422
+ return React__default["default"].createElement(
423
+ 'div',
424
+ { id: 'related-card', key: index, className: styles$1.mediaCard },
425
+ React__default["default"].createElement(
426
+ 'a',
427
+ { className: styles$1.imgWrapper, href: '/view/' + (article.url ? article.url.current : '') },
428
+ article.thumbnail ? React__default["default"].createElement('img', {
429
+ style: { objectFit: 'cover', objectPosition: 'center' },
430
+ src: article.thumbnail && urlFor({ client: client, source: article.thumbnail.asset, imageWidth: 250 }),
431
+ alt: article.title
432
+ }) : React__default["default"].createElement(
433
+ React__default["default"].Fragment,
434
+ null,
435
+ fallbackImage && showRelatedArticleFallbackImage && React__default["default"].createElement('img', { src: fallbackImage, alt: 'website logo', style: { objectFit: 'contain' } })
436
+ )
437
+ ),
438
+ React__default["default"].createElement(
439
+ 'div',
440
+ { className: styles$1.mediaBody },
441
+ React__default["default"].createElement(
442
+ 'a',
443
+ { href: '/view/' + (article.url ? article.url.current : '') },
444
+ React__default["default"].createElement(
445
+ 'div',
446
+ { className: styles$1.cardTitle },
447
+ article.title
448
+ )
449
+ )
450
+ )
451
+ );
452
+ }
453
+ })
454
+ );
455
+ };
456
+
457
+ var getSocialShareDisableFlag = function getSocialShareDisableFlag(article) {
458
+ //Need to check Taxonomy, DocumentGroup, and Authors for showSocialShare
459
+ var showSocialShare = true;
460
+ if (article.showSocialShare === true) {
461
+ return showSocialShare;
462
+ }
463
+
464
+ if (article.showSocialShare === false) {
465
+ showSocialShare = false;
466
+ return showSocialShare;
467
+ }
468
+
469
+ if (article.content_placement && article.content_placement.length > 0) {
470
+ //loop through each
471
+ article.content_placement.forEach(function (category) {
472
+ if (category.showSocialShare === false) {
473
+ showSocialShare = false;
474
+ }
475
+ });
476
+ }
477
+ if (article.authorDetails && article.authorDetails.length > 0) {
478
+ article.authorDetails.forEach(function (author) {
479
+ if (author.showSocialShare === false) {
480
+ showSocialShare = false;
481
+ }
482
+ });
483
+ }
484
+ if (article.documentGroup && article.documentGroup.length > 0) {
485
+ article.documentGroup.forEach(function (docGroup) {
486
+ if (docGroup.showSocialShare === false) {
487
+ showSocialShare = false;
488
+ }
489
+ });
490
+ }
491
+ if (article.documentGroupMapping && article.documentGroupMapping.length > 0) {
492
+ article.documentGroupMapping.forEach(function (docGroup) {
493
+ if (docGroup.showSocialShare === false) {
494
+ showSocialShare = false;
495
+ }
496
+ });
497
+ }
498
+
499
+ return showSocialShare;
500
+ };
501
+
502
+ var FileSaver_min = _commonjsHelpers.createCommonjsModule(function (module, exports) {
503
+ (function(a,b){b();})(_commonjsHelpers.commonjsGlobal,function(){function b(a,b){return "undefined"==typeof b?b={autoBom:!1}:"object"!=typeof b&&(console.warn("Deprecated: Expected third argument to be a object"),b={autoBom:!b}),b.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(a.type)?new Blob(["\uFEFF",a],{type:a.type}):a}function c(a,b,c){var d=new XMLHttpRequest;d.open("GET",a),d.responseType="blob",d.onload=function(){g(d.response,b,c);},d.onerror=function(){console.error("could not download file");},d.send();}function d(a){var b=new XMLHttpRequest;b.open("HEAD",a,!1);try{b.send();}catch(a){}return 200<=b.status&&299>=b.status}function e(a){try{a.dispatchEvent(new MouseEvent("click"));}catch(c){var b=document.createEvent("MouseEvents");b.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),a.dispatchEvent(b);}}var f="object"==typeof window&&window.window===window?window:"object"==typeof self&&self.self===self?self:"object"==typeof _commonjsHelpers.commonjsGlobal&&_commonjsHelpers.commonjsGlobal.global===_commonjsHelpers.commonjsGlobal?_commonjsHelpers.commonjsGlobal:void 0,a=f.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),g=f.saveAs||("object"!=typeof window||window!==f?function(){}:"download"in HTMLAnchorElement.prototype&&!a?function(b,g,h){var i=f.URL||f.webkitURL,j=document.createElement("a");g=g||b.name||"download",j.download=g,j.rel="noopener","string"==typeof b?(j.href=b,j.origin===location.origin?e(j):d(j.href)?c(b,g,h):e(j,j.target="_blank")):(j.href=i.createObjectURL(b),setTimeout(function(){i.revokeObjectURL(j.href);},4E4),setTimeout(function(){e(j);},0));}:"msSaveOrOpenBlob"in navigator?function(f,g,h){if(g=g||f.name||"download","string"!=typeof f)navigator.msSaveOrOpenBlob(b(f,h),g);else if(d(f))c(f,g,h);else {var i=document.createElement("a");i.href=f,i.target="_blank",setTimeout(function(){e(i);});}}:function(b,d,e,g){if(g=g||open("","_blank"),g&&(g.document.title=g.document.body.innerText="downloading..."),"string"==typeof b)return c(b,d,e);var h="application/octet-stream"===b.type,i=/constructor/i.test(f.HTMLElement)||f.safari,j=/CriOS\/[\d]+/.test(navigator.userAgent);if((j||h&&i||a)&&"undefined"!=typeof FileReader){var k=new FileReader;k.onloadend=function(){var a=k.result;a=j?a:a.replace(/^data:[^;]*;/,"data:attachment/file;"),g?g.location.href=a:location=a,g=null;},k.readAsDataURL(b);}else {var l=f.URL||f.webkitURL,m=l.createObjectURL(b);g?g.location=m:location.href=m,g=null,setTimeout(function(){l.revokeObjectURL(m);},4E4);}});f.saveAs=g.saveAs=g,(module.exports=g);});
504
+
505
+
506
+ });
507
+
508
+ var css = ".RecommendedArticles-module_recommendTitle__2kUji {\n border-bottom: 2px solid var(--secondary-blue);\n font-size: 1.5rem;\n font-weight: bold;\n color: #0d335a;\n padding: 0.5rem;\n}\n.RecommendedArticles-module_recommendContainer__sZukI {\n display: flex;\n flex-direction: row;\n flex-wrap: wrap;\n margin: 0 -0.5rem;\n}\n.RecommendedArticles-module_recommendTop__1_yqw {\n margin: 0.5rem;\n width: 100%;\n flex-basis: 100%;\n display: flex;\n\n}\n.RecommendedArticles-module_recommendTopImg__1b9gu {\n min-width: 55%;\n width: 55%;\n height: 100%;\n}\n.RecommendedArticles-module_recommendTopImg__1b9gu img {\n width: 100%;\n height: 100%;\n object-fit: cover;\n}\n.RecommendedArticles-module_recommendTopBody__-13FI {\n margin-left: 1rem;\n line-height: 1.3;\n color: #121212;\n display: flex;\n flex-direction: column;\n}\n.RecommendedArticles-module_topTitle__2EafN {\n font-size: 25px;\n font-weight: bold;\n margin-bottom: 0.5rem;\n}\n.RecommendedArticles-module_topBody__2_VNi {\n font-size: 19px;\n margin-bottom: 0.5rem;\n}\n.RecommendedArticles-module_topLink__2RnXu {\n font-size: 19px;\n color: rgb(43, 43, 151);\n text-decoration: underline;\n margin-top: auto;\n}\n.RecommendedArticles-module_smContainer__4byBO {\n width: calc(25% - 1rem);\n margin: 0 0.5rem;\n}\n.RecommendedArticles-module_smImage__TYZGY img {\n width: 100%;\n}\n.RecommendedArticles-module_title__3q1ud {\n margin-top: 1rem;\n line-height: 1.2;\n color: #121212;\n}\n.RecommendedArticles-module_category__2jRto {\n text-transform: uppercase;\n font-size: 16px;\n letter-spacing: 2px;\n margin: 0.25rem 0;\n}\n\n/* media query */\n\n@media screen and (max-width: 1399px) {\n .RecommendedArticles-module_topTitle__2EafN {\n font-size: 21px;\n }\n .RecommendedArticles-module_topBody__2_VNi {\n font-size: 15px;\n }\n}\n@media screen and (max-width: 1191px) {\n .RecommendedArticles-module_topTitle__2EafN {\n font-size: 23px;\n }\n .RecommendedArticles-module_topBody__2_VNi,\n .RecommendedArticles-module_topLink__2RnXu {\n font-size: 17px;\n }\n}\n@media screen and (max-width: 968px) {\n .RecommendedArticles-module_topTitle__2EafN {\n font-size: 18px;\n }\n .RecommendedArticles-module_topBody__2_VNi,\n .RecommendedArticles-module_topLink__2RnXu {\n font-size: 15px;\n }\n}\n@media screen and (max-width: 768px) {\n .RecommendedArticles-module_recommendTop__1_yqw {\n flex-direction: column;\n }\n .RecommendedArticles-module_recommendTopImg__1b9gu,\n .RecommendedArticles-module_recommendTopBody__-13FI {\n width: 100%;\n margin: 0;\n }\n .RecommendedArticles-module_recommendTopBody__-13FI {\n margin-bottom: 1rem;\n }\n .RecommendedArticles-module_smContainer__4byBO {\n width: calc(50% - 1rem);\n }\n}";
509
+ var styles = { "recommendTitle": "RecommendedArticles-module_recommendTitle__2kUji", "recommendContainer": "RecommendedArticles-module_recommendContainer__sZukI", "recommendTop": "RecommendedArticles-module_recommendTop__1_yqw", "recommendTopImg": "RecommendedArticles-module_recommendTopImg__1b9gu", "recommendTopBody": "RecommendedArticles-module_recommendTopBody__-13FI", "topTitle": "RecommendedArticles-module_topTitle__2EafN", "topBody": "RecommendedArticles-module_topBody__2_VNi", "topLink": "RecommendedArticles-module_topLink__2RnXu", "smContainer": "RecommendedArticles-module_smContainer__4byBO", "smImage": "RecommendedArticles-module_smImage__TYZGY", "title": "RecommendedArticles-module_title__3q1ud", "category": "RecommendedArticles-module_category__2jRto" };
510
+ styleInject_es.styleInject(css);
511
+
512
+ var _this$2 = undefined;
513
+
514
+ var Recommended = function Recommended(props) {
515
+ var article = props.article,
516
+ client = props.client,
517
+ _props$index = props.index,
518
+ index = _props$index === undefined ? 0 : _props$index,
519
+ cpModificationRequired = props.cpModificationRequired,
520
+ emailList = props.emailList,
521
+ articleRecsQuery = props.articleRecsQuery;
522
+
523
+ var _useState = React.useState(false),
524
+ _useState2 = slicedToArray._slicedToArray(_useState, 2),
525
+ segmentLoaded = _useState2[0],
526
+ setSegmentLoaded = _useState2[1];
527
+
528
+ var _useState3 = React.useState([]),
529
+ _useState4 = slicedToArray._slicedToArray(_useState3, 2),
530
+ articles = _useState4[0],
531
+ setArticles = _useState4[1];
532
+
533
+ var _useState5 = React.useState('loading'),
534
+ _useState6 = slicedToArray._slicedToArray(_useState5, 2),
535
+ loaded = _useState6[0],
536
+ setLoaded = _useState6[1]; // loading, loaded, failed
537
+
538
+
539
+ var starting = index * 5;
540
+ var emailTracked = React.useRef(false);
541
+
542
+ var contentMapping = {
543
+ videos: 'video',
544
+ articles: 'article',
545
+ podcasts: 'podcast'
546
+ };
547
+ var mainCategories = article.content_placement.filter(function (cp) {
548
+ return cp.usedForRecommendations === true;
549
+ }).map(function (cp) {
550
+ return cp.name;
551
+ }).sort();
552
+
553
+ React.useEffect(function () {
554
+ try {
555
+ if (!segmentLoaded) {
556
+ return;
557
+ }
558
+ if (mainCategories.length > 0) {
559
+ analytics.track('Article Category Viewed', {
560
+ 'categories.$': stringify._JSON$stringify(mainCategories)
561
+ });
562
+ }
563
+ var getSegmentProfile = function () {
564
+ var _ref = asyncToGenerator._asyncToGenerator( /*#__PURE__*/asyncToGenerator.regenerator.mark(function _callee() {
565
+ var anonymousId, traits, i, response, data, addTaxonomyName, favoriteCategories, articlesCategory, videosCategory, podcastCategory, taxonomyCategories, taxonomies, articlesQuery, videosQuery, podcastQuery, params, _ref2, _ref3, _articles, videos, podcasts, recs;
566
+
567
+ return asyncToGenerator.regenerator.wrap(function _callee$(_context) {
568
+ while (1) {
569
+ switch (_context.prev = _context.next) {
570
+ case 0:
571
+ anonymousId = analytics.user().anonymousId();
572
+ traits = analytics.user().traits();
573
+ // console.log('anonymousId', anonymousId)
574
+
575
+ if (!(traits && traits.email)) {
576
+ _context.next = 11;
577
+ break;
578
+ }
579
+
580
+ i = 0;
581
+
582
+ case 4:
583
+ if (!(i < emailList.length)) {
584
+ _context.next = 11;
585
+ break;
586
+ }
587
+
588
+ if (!(traits.email === emailList[i].email)) {
589
+ _context.next = 8;
590
+ break;
591
+ }
592
+
593
+ emailTracked.current = true;
594
+ return _context.abrupt('break', 11);
595
+
596
+ case 8:
597
+ i++;
598
+ _context.next = 4;
599
+ break;
600
+
601
+ case 11:
602
+ _context.next = 13;
603
+ return fetch('/api/getSegmentProfile?anonymousId=' + anonymousId, {
604
+ method: 'GET'
605
+ });
606
+
607
+ case 13:
608
+ response = _context.sent;
609
+ _context.next = 16;
610
+ return response.json();
611
+
612
+ case 16:
613
+ data = _context.sent;
614
+
615
+ if (!(emailTracked.current || data && data.traits)) {
616
+ _context.next = 54;
617
+ break;
618
+ }
619
+
620
+ // console.log('%csegment user profile', 'font-size:1.5rem;color:#000000;padding:1rem;background-color:yellow;', data.traits)
621
+ addTaxonomyName = function addTaxonomyName(taxArr) {
622
+ if (!taxArr) return '';
623
+ var query = ' && ( ';
624
+ taxArr.forEach(function (item, index) {
625
+ if (index === 0) {
626
+ query = query + ('name == \'' + item + '\'');
627
+ } else {
628
+ query = query + (' || name == \'' + item + '\'');
629
+ }
630
+ });
631
+
632
+ query = query + ' )';
633
+
634
+ return query;
635
+ };
636
+
637
+ favoriteCategories = data.traits.most_frequent_article_category ? JSON.parse(data.traits.most_frequent_article_category) : null;
638
+
639
+ // grab contentCategory ID
640
+
641
+ _context.next = 22;
642
+ return client.fetch("*[_type == 'contentCategory' && name == 'Articles'][0]{_id}");
643
+
644
+ case 22:
645
+ articlesCategory = _context.sent;
646
+ _context.next = 25;
647
+ return client.fetch("*[_type == 'contentCategory' && name == 'Videos'][0]{_id}");
648
+
649
+ case 25:
650
+ videosCategory = _context.sent;
651
+ _context.next = 28;
652
+ return client.fetch("*[_type == 'contentCategory' && name == 'Podcasts'][0]{_id}");
653
+
654
+ case 28:
655
+ podcastCategory = _context.sent;
656
+ _context.next = 31;
657
+ return client.fetch('*[_type == \'taxonomy\' ' + addTaxonomyName(favoriteCategories) + ']');
658
+
659
+ case 31:
660
+ taxonomyCategories = _context.sent;
661
+ taxonomies = '';
662
+
663
+ taxonomyCategories.forEach(function (taxonomy, index) {
664
+ if (index === 0) {
665
+ taxonomies = taxonomies + (' && ( references(\'' + taxonomy._id + '\')');
666
+ } else {
667
+ taxonomies = taxonomies + (' || references(\'' + taxonomy._id + '\')');
668
+ }
669
+ });
670
+ taxonomies = taxonomies + ' )';
671
+ // grab 3 articles from sanity different from the one currently being read
672
+ articlesQuery = '*[_type == \'article\'\n && !(_id in path("drafts.**"))\n && defined(title)\n && defined(url)\n && is_visible == true \n && passwordLock != true\n && references(\'' + articlesCategory._id + '\')\n ' + taxonomies + '\n && defined(published)\n && _id != $id\n && dateTime(published) <= dateTime(now())] | order(published desc) [' + starting + '...' + (starting + 5) + '] {\n ...,\n title,\n thumbnail,\n url,\n contentCategory->,\n published,\n }';
673
+ videosQuery = '*[_type == \'article\'\n && !(_id in path("drafts.**"))\n && defined(title)\n && defined(url)\n && is_visible == true \n && passwordLock != true\n && references(\'' + videosCategory._id + '\')\n ' + taxonomies + '\n && defined(published)\n && _id != $id\n && dateTime(published) <= dateTime(now())] | order(published desc) [' + starting + '...' + (starting + 1) + '] {\n ...,\n title,\n thumbnail,\n url,\n contentCategory->,\n published,\n }';
674
+ podcastQuery = '*[_type == \'article\'\n && !(_id in path("drafts.**"))\n && defined(title)\n && defined(url)\n && is_visible == true \n && passwordLock != true\n && references(\'' + podcastCategory._id + '\')\n ' + taxonomies + '\n && defined(published)\n && _id != $id\n && dateTime(published) <= dateTime(now())] | order(published desc) [' + starting + '...' + (starting + 2) + '] {\n ...,\n title,\n thumbnail,\n url,\n contentCategory->,\n published,\n }';
675
+ params = {
676
+ id: article._id
677
+ };
678
+ _context.next = 41;
679
+ return asyncToGenerator._Promise.all([client.fetch(articlesQuery, params), client.fetch(videosQuery, params), client.fetch(podcastQuery, params), client.fetch(articleRecsQuery)]);
680
+
681
+ case 41:
682
+ _ref2 = _context.sent;
683
+ _ref3 = slicedToArray._slicedToArray(_ref2, 4);
684
+ _articles = _ref3[0];
685
+ videos = _ref3[1];
686
+ podcasts = _ref3[2];
687
+ recs = _ref3[3];
688
+
689
+ if (_articles.length === 0) setLoaded('failed');
690
+
691
+ if (!(emailTracked.current && recs)) {
692
+ _context.next = 51;
693
+ break;
694
+ }
695
+
696
+ setArticles(recs);
697
+ return _context.abrupt('return');
698
+
699
+ case 51:
700
+ if (_articles && !emailTracked.current) {
701
+ if (videos[0] && _articles[2]) {
702
+ _articles[2] = videos[0];
703
+ }
704
+ if (videos[1] && _articles[4]) {
705
+ _articles[4] = videos[1];
706
+ }
707
+ if (podcasts[0] && _articles[3]) {
708
+ _articles[3] = podcasts[0];
709
+ }
710
+ setArticles(_articles);
711
+ }
712
+ _context.next = 55;
713
+ break;
714
+
715
+ case 54:
716
+ setLoaded('failed');
717
+
718
+ case 55:
719
+ case 'end':
720
+ return _context.stop();
721
+ }
722
+ }
723
+ }, _callee, _this$2);
724
+ }));
725
+
726
+ return function getSegmentProfile() {
727
+ return _ref.apply(this, arguments);
728
+ };
729
+ }();
730
+ getSegmentProfile();
731
+ } catch (err) {
732
+ console.log(err);
733
+ setLoaded('failed');
734
+ }
735
+ }, [segmentLoaded]);
736
+
737
+ React.useEffect(function () {
738
+ if (articles && articles.length > 0) {
739
+ setLoaded('loaded');
740
+ }
741
+ }, [articles]);
742
+
743
+ React.useEffect(function () {
744
+ try {
745
+ analytics.ready(function () {
746
+ setSegmentLoaded(function () {
747
+ return 'loaded';
748
+ });
749
+ });
750
+ } catch (err) {
751
+ console.log(err);
752
+ setLoaded('failed');
753
+ }
754
+ }, []);
755
+
756
+ return React__default["default"].createElement(
757
+ 'div',
758
+ { id: 'recommended', style: { minHeight: '150px' } },
759
+ loaded === 'loaded' && React__default["default"].createElement(
760
+ React__default["default"].Fragment,
761
+ null,
762
+ React__default["default"].createElement(
763
+ 'h4',
764
+ { className: styles.recommendTitle },
765
+ 'Recommended For You'
766
+ ),
767
+ React__default["default"].createElement(
768
+ 'div',
769
+ { className: styles.recommendContainer, id: 'recommendedContent' },
770
+ articles.map(function (article, index) {
771
+ if (index === 0) {
772
+ return React__default["default"].createElement(
773
+ 'div',
774
+ { key: article._id + ('-' + index), className: styles.recommendTop },
775
+ React__default["default"].createElement(
776
+ 'div',
777
+ { className: styles.recommendTopImg },
778
+ React__default["default"].createElement(
779
+ 'a',
780
+ { href: '/view/' + article.url.current + '?utm_source=website&utm_medium=dynamic_content&utm_campaign=in_feed_unit' },
781
+ React__default["default"].createElement('img', { src: urlFor({ source: article.thumbnail, client: client, imageHeight: 306, imageWidth: 544 }) })
782
+ )
783
+ ),
784
+ React__default["default"].createElement(
785
+ 'div',
786
+ { className: styles.recommendTopBody },
787
+ React__default["default"].createElement(
788
+ 'div',
789
+ { className: styles.topTitle },
790
+ article.title
791
+ ),
792
+ React__default["default"].createElement(
793
+ 'p',
794
+ { className: styles.topBody },
795
+ article.summary
796
+ ),
797
+ React__default["default"].createElement(
798
+ 'a',
799
+ { href: '/view/' + article.url.current + '?utm_source=website&utm_medium=dynamic_content&utm_campaign=in_feed_unit', className: styles.topLink },
800
+ '>> ',
801
+ 'Read Article'
802
+ )
803
+ )
804
+ );
805
+ } else {
806
+ return React__default["default"].createElement(
807
+ 'div',
808
+ { key: article._id + ('-' + index), className: styles.smContainer },
809
+ React__default["default"].createElement(
810
+ 'div',
811
+ { className: styles.category },
812
+ contentMapping && contentMapping[article.contentCategory.name] && contentMapping[article.contentCategory.name.toLowerCase()] ? contentMapping[article.contentCategory.name.toLowerCase()] : article.contentCategory.name
813
+ ),
814
+ React__default["default"].createElement(
815
+ 'a',
816
+ { href: '/view/' + article.url.current + '?utm_source=website&utm_medium=dynamic_content&utm_campaign=in_feed_unit' },
817
+ React__default["default"].createElement(
818
+ 'div',
819
+ { className: styles.smImage },
820
+ React__default["default"].createElement('img', { src: urlFor({ source: article.thumbnail, client: client, imageHeight: 270, imageWidth: 480 }) })
821
+ ),
822
+ React__default["default"].createElement(
823
+ 'div',
824
+ { className: styles.title },
825
+ article.title
826
+ )
827
+ )
828
+ );
829
+ }
830
+ })
831
+ )
832
+ ),
833
+ loaded === 'failed' && React__default["default"].createElement(
834
+ 'section',
835
+ { id: 'related-content-section', className: 'my-1' },
836
+ (article.relatedArticle || RelevantTopics({ article: article })) && React__default["default"].createElement(
837
+ 'p',
838
+ { className: 'mb-0' },
839
+ React__default["default"].createElement(
840
+ 'b',
841
+ null,
842
+ 'Related Content:'
843
+ )
844
+ ),
845
+ React__default["default"].createElement(RelevantTopics, { article: article, cpModificationRequired: cpModificationRequired, Settings: props.Settings }),
846
+ React__default["default"].createElement(
847
+ 'div',
848
+ { className: 'pt-2' },
849
+ React__default["default"].createElement(RelatedArticle, {
850
+ articles: article.relatedArticle,
851
+ client: client,
852
+ fallbackImage: props.Settings.logo,
853
+ showRelatedArticleFallbackImage: props.showRelatedArticleFallbackImage
854
+ })
855
+ )
856
+ )
857
+ );
858
+ };
859
+
860
+ var RelevantTopics = function RelevantTopics(props) {
861
+ var article = props.article,
862
+ cpModificationRequired = props.cpModificationRequired;
863
+ var content_placement = article.content_placement,
864
+ documentGroupMapping = article.documentGroupMapping,
865
+ issueGroup = article.issueGroup;
866
+
867
+ if (content_placement && content_placement.length > 0 || documentGroupMapping && documentGroupMapping.length > 0) {
868
+ var relatedLinks = [];
869
+ if (documentGroupMapping && documentGroupMapping.length > 0) {
870
+ documentGroupMapping.forEach(function (documentGroup) {
871
+ if (documentGroup.isShow === false || documentGroup.excludeRelatedContents) {
872
+ return null;
873
+ }
874
+ if (documentGroup.parent) {
875
+ relatedLinks = [].concat(toConsumableArray._toConsumableArray(relatedLinks), [{
876
+ label: documentGroup.name,
877
+ href: cpModificationRequired ? getDocumentGroupUrl(documentGroup) : documentGroup.parent.identifier && documentGroup.parent.identifier.current && !documentGroup.path.includes('/') ? '/' + documentGroup.parent.identifier.current + '/' + documentGroup.path : '/' + documentGroup.path
878
+ }]);
879
+ }
880
+ });
881
+ }
882
+ if (content_placement && content_placement.length > 0) {
883
+ console.log("content_placement: ", content_placement);
884
+ content_placement.filter(function (item) {
885
+ return item.path !== 'news';
886
+ }).forEach(function (cp) {
887
+ if (cp.excludeRelatedContents) {
888
+ return null;
889
+ }
890
+ var cp_url = cpModificationRequired ? getTargeting.getContentPlacementUrl(cp) : cp.path;
891
+ console.log("cp_url: ", cp_url);
892
+ var href = '/' + cp_url;
893
+ relatedLinks = [].concat(toConsumableArray._toConsumableArray(relatedLinks), [{ label: cp.name, href: href }]);
894
+ });
895
+ }
896
+ if (issueGroup && issueGroup.name && issueGroup.identifier && issueGroup.identifier.current && issueGroup.parent && issueGroup.parent.identifier && issueGroup.parent.identifier.current) {
897
+ var _props$Settings$issue = props.Settings.issueMapping,
898
+ issueMapping = _props$Settings$issue === undefined ? '/publications' : _props$Settings$issue;
899
+
900
+ relatedLinks = [].concat(toConsumableArray._toConsumableArray(relatedLinks), [{ label: issueGroup.name, href: issueMapping + '/' + issueGroup.parent.identifier.current + '/' + issueGroup.identifier.current }]);
901
+ }
902
+ console.log("RELATED LINKS: ", relatedLinks);
903
+ if (relatedLinks && relatedLinks.length > 0) {
904
+ return React__default["default"].createElement(
905
+ 'div',
906
+ null,
907
+ relatedLinks.map(function (relatedLink, index) {
908
+ if (relatedLink && relatedLink.href && relatedLink.label) {
909
+ return React__default["default"].createElement(
910
+ 'span',
911
+ { key: relatedLink.label, className: 'related-link me-too' },
912
+ React__default["default"].createElement(
913
+ 'a',
914
+ { className: 'related-links', style: { color: 'blue' }, href: relatedLink.href },
915
+ relatedLink.label
916
+ ),
917
+ React__default["default"].createElement(
918
+ 'style',
919
+ { jsx: 'true' },
920
+ '\n .related-link:not(:first-child):before {\n content: \' | \';\n }\n '
921
+ )
922
+ );
923
+ }
924
+ })
925
+ );
926
+ }
927
+ return null;
928
+ }
929
+ return null;
930
+ };
931
+
932
+ var checkDocGroupMappingForSeries = function checkDocGroupMappingForSeries(docGroupArray) {
933
+
934
+ for (var i = 0; i < docGroupArray.length; i++) {
935
+ if (docGroupArray[i].isSeries) {
936
+ return docGroupArray[i];
937
+ }
938
+ }
939
+
940
+ return false;
941
+ };
942
+
943
+ var Article = React__default["default"].memo(React.forwardRef(function (props, ref) {
944
+ var onVote = function () {
945
+ var _ref = asyncToGenerator._asyncToGenerator( /*#__PURE__*/asyncToGenerator.regenerator.mark(function _callee(nodeKey, selectedChoice) {
946
+ var response, result;
947
+ return asyncToGenerator.regenerator.wrap(function _callee$(_context) {
948
+ while (1) {
949
+ switch (_context.prev = _context.next) {
950
+ case 0:
951
+ _context.next = 2;
952
+ return fetch('/api/polls/vote', {
953
+ method: 'POST',
954
+ headers: { 'Content-Type': 'application/json' },
955
+ body: stringify._JSON$stringify({ articleId: props.article._id, nodeKey: nodeKey, selectedChoice: selectedChoice, body: articleBody })
956
+ });
957
+
958
+ case 2:
959
+ response = _context.sent;
960
+
961
+ if (!response.ok) {
962
+ _context.next = 11;
963
+ break;
964
+ }
965
+
966
+ _context.next = 6;
967
+ return response.json();
968
+
969
+ case 6:
970
+ result = _context.sent;
971
+
972
+ setArticleBody(result.body);
973
+
974
+ console.log('Voted successfully');
975
+ _context.next = 12;
976
+ break;
977
+
978
+ case 11:
979
+ console.log('Unable to vote!');
980
+
981
+ case 12:
982
+ case 'end':
983
+ return _context.stop();
984
+ }
985
+ }
986
+ }, _callee, this);
987
+ }));
988
+
989
+ return function onVote(_x, _x2) {
990
+ return _ref.apply(this, arguments);
991
+ };
992
+ }();
993
+
994
+ var article = props.article,
995
+ Ads = props.Ads,
996
+ showRelatedArticles = props.showRelatedArticles,
997
+ _props$hideFBShare = props.hideFBShare,
998
+ hideFBShare = _props$hideFBShare === undefined ? false : _props$hideFBShare,
999
+ _props$hidePinterestS = props.hidePinterestShare,
1000
+ hidePinterestShare = _props$hidePinterestS === undefined ? false : _props$hidePinterestS,
1001
+ onChangeArticle = props.onChangeArticle,
1002
+ _props$showSocialShar = props.showSocialShare,
1003
+ showSocialShare = _props$showSocialShar === undefined ? true : _props$showSocialShar;
1004
+ var client = props.client,
1005
+ pageview = props.pageview,
1006
+ videoAccountIDs = props.videoAccountIDs,
1007
+ drupalLeadSettings = props.drupalLeadSettings,
1008
+ currentPage = props.currentPage,
1009
+ _props$showAuthorDeta = props.showAuthorDetails,
1010
+ showAuthorDetails = _props$showAuthorDeta === undefined ? false : _props$showAuthorDeta,
1011
+ audioAutoplay = props.audioAutoplay,
1012
+ _props$article = props.article,
1013
+ title = _props$article.title,
1014
+ _props$article$passwo = _props$article.passwordLock,
1015
+ passwordLock = _props$article$passwo === undefined ? false : _props$article$passwo,
1016
+ authorDetails = _props$article.authorDetails,
1017
+ pageNumber = _props$article.pageNumber,
1018
+ published = _props$article.published,
1019
+ _props$article$showPu = _props$article.showPublished,
1020
+ showPublished = _props$article$showPu === undefined ? true : _props$article$showPu,
1021
+ body = _props$article.body,
1022
+ thumbnail = _props$article.thumbnail,
1023
+ content_placement = _props$article.content_placement,
1024
+ _props$article$url = _props$article.url;
1025
+ _props$article$url = _props$article$url === undefined ? {
1026
+ current: ''
1027
+ } : _props$article$url;
1028
+ var url = _props$article$url.current,
1029
+ issue = _props$article.issue,
1030
+ source = _props$article.source,
1031
+ documentGroupMapping = _props$article.documentGroupMapping,
1032
+ issueGroup = _props$article.issueGroup,
1033
+ showIsi = _props$article.showIsi,
1034
+ isi = _props$article.isi,
1035
+ _props$article$displa = _props$article.display_summary,
1036
+ display_summary = _props$article$displa === undefined ? true : _props$article$displa,
1037
+ regionalPages = props.regionalPages,
1038
+ nationalPage = props.nationalPage,
1039
+ ISIContent = props.ISIContent,
1040
+ shareOptions = props.shareOptions,
1041
+ cpModificationRequired = props.cpModificationRequired,
1042
+ authorPrefix = props.authorPrefix,
1043
+ _props$lgContextAd = props.lgContextAd,
1044
+ lgContextAd = _props$lgContextAd === undefined ? false : _props$lgContextAd,
1045
+ queueData = props.queueData,
1046
+ _props$sponsoredFlag = props.sponsoredFlag,
1047
+ sponsoredFlag = _props$sponsoredFlag === undefined ? false : _props$sponsoredFlag,
1048
+ _props$authorImgHeigh = props.authorImgHeight,
1049
+ authorImgHeight = _props$authorImgHeigh === undefined ? 270 : _props$authorImgHeigh;
1050
+ props.active;
1051
+ var _props$refreshFlag = props.refreshFlag,
1052
+ refreshFlag = _props$refreshFlag === undefined ? false : _props$refreshFlag,
1053
+ disqusConfig = props.disqusConfig,
1054
+ showDisqus = props.showDisqus,
1055
+ _props$downloadCitati = props.downloadCitation,
1056
+ downloadCitation = _props$downloadCitati === undefined ? false : _props$downloadCitati,
1057
+ _props$useSegmentReco = props.useSegmentRecommendedArticles,
1058
+ useSegmentRecommendedArticles = _props$useSegmentReco === undefined ? false : _props$useSegmentReco,
1059
+ showIssueNameOnly = props.showIssueNameOnly,
1060
+ showPageNumber = props.showPageNumber,
1061
+ emailList = props.emailList,
1062
+ articleRecs = props.articleRecs;
1063
+
1064
+
1065
+ var parentRisToggle = issueGroup && issueGroup.parent && issueGroup.parent.risMapping ? issueGroup.parent.risMapping.show_download_ris_button : null;
1066
+ var issueGroupRisToggle = issueGroup && issueGroup.risMapping ? issueGroup.risMapping.show_download_ris_button : null;
1067
+
1068
+ var sliderData = props.sliderData;
1069
+
1070
+ var disableEpisodeNumber = false;
1071
+ var articleRecsQuery = '*[_type == \'article\' && url.current in ';
1072
+
1073
+ if (article && article.documentGroup && article.documentGroup.disableEpisodeNumber === true) {
1074
+ disableEpisodeNumber = true;
1075
+ }
1076
+ var logicforDisplayingEpisodeNumber = !disableEpisodeNumber;
1077
+ var targeting = getTargeting.getTargeting(props);
1078
+ // remove slider data if toggled
1079
+ if (article && article.documentGroup && article.documentGroup.hideSeriesSlider === true) {
1080
+ sliderData = null;
1081
+ }
1082
+ // build query string for article recs, pass down as props
1083
+ if (articleRecs) {
1084
+ articleRecs.forEach(function (rec, ind) {
1085
+ ind === 0 ? articleRecsQuery = articleRecsQuery.concat('[\'' + rec + '\', ') : ind === articleRecs.length - 1 ? articleRecsQuery = articleRecsQuery.concat('\'' + rec + '\']]') : articleRecsQuery = articleRecsQuery.concat('\'' + rec + '\', ');
1086
+ });
1087
+ }
1088
+ // next video url
1089
+ if (sliderData) {
1090
+ var nextArticle = void 0;
1091
+ sliderData.forEach(function (data, index) {
1092
+ if (data.url.current === props.article.url.current) {
1093
+ nextArticle = index + 1;
1094
+ }
1095
+ });
1096
+
1097
+ if (nextArticle && sliderData[nextArticle]) {
1098
+ article.nextVideo = sliderData[nextArticle].url.current;
1099
+ }
1100
+ }
1101
+
1102
+ // if showSocialShare is not disabled for entire site, check article taxonomy, docgroup, authors for showSocialShare === false
1103
+ if (showSocialShare) {
1104
+ showSocialShare = getSocialShareDisableFlag(props.article);
1105
+ }
1106
+
1107
+ // If sponsored flag, disable contextual ads
1108
+ if (sponsoredFlag || article.disableNativeAds) {
1109
+ article.contextualVideoAD = false;
1110
+ article.contextualAD = false;
1111
+ }
1112
+
1113
+ if (article.disableRelatedContent || sponsoredFlag) {
1114
+ showRelatedArticles = false;
1115
+ }
1116
+ // This was being done in ArticleQueue2 which wasnt effecting articles excluded from infinite scroll, moved inside article component
1117
+ if (!sponsoredFlag && Ads.getVideoContextualAD) {
1118
+ article.contextualVideoAD = Ads.getVideoContextualAD(getTargeting.getTargeting(props, 'in-context_video'));
1119
+ }
1120
+ if (!sponsoredFlag && Ads.getNativeContextualAD && !article.disableNativeAds) {
1121
+ article.contextualAD = Ads.getNativeContextualAD(getTargeting.getTargeting(props, 'native-ad'));
1122
+ }
1123
+
1124
+ var _useState = React.useState(null),
1125
+ _useState2 = slicedToArray._slicedToArray(_useState, 2),
1126
+ contextualADFlag = _useState2[0],
1127
+ setContextualADFlag = _useState2[1];
1128
+ // Setting new Flag 'visibleFlag' to know when the article is visible so that new contextual ad can be appended into DOM.
1129
+
1130
+
1131
+ var _useState3 = React.useState(false),
1132
+ _useState4 = slicedToArray._slicedToArray(_useState3, 2),
1133
+ visibleFlag = _useState4[0],
1134
+ setVisibleFlag = _useState4[1];
1135
+
1136
+ var summary = getArticleSummary(props.article);
1137
+
1138
+ var _useState5 = React.useState(1),
1139
+ _useState6 = slicedToArray._slicedToArray(_useState5, 2),
1140
+ auth = _useState6[0],
1141
+ setAuth = _useState6[1];
1142
+
1143
+ var _useState7 = React.useState(''),
1144
+ _useState8 = slicedToArray._slicedToArray(_useState7, 2),
1145
+ passwordKey = _useState8[0],
1146
+ setPasswordKey = _useState8[1];
1147
+
1148
+ var _useState9 = React.useState(body),
1149
+ _useState10 = slicedToArray._slicedToArray(_useState9, 2),
1150
+ articleBody = _useState10[0],
1151
+ setArticleBody = _useState10[1];
1152
+
1153
+ var _useState11 = React.useState(0),
1154
+ _useState12 = slicedToArray._slicedToArray(_useState11, 2),
1155
+ containerHeight = _useState12[0],
1156
+ setContainerHeight = _useState12[1];
1157
+
1158
+ var _useState13 = React.useState(true),
1159
+ _useState14 = slicedToArray._slicedToArray(_useState13, 2);
1160
+ _useState14[0];
1161
+ var setPreviewAd = _useState14[1];
1162
+
1163
+ var _useState15 = React.useState(props.index === 0),
1164
+ _useState16 = slicedToArray._slicedToArray(_useState15, 2),
1165
+ isFirstArticle = _useState16[0],
1166
+ setIsFirstArticle = _useState16[1];
1167
+
1168
+ React.useEffect(function () {
1169
+ var path = window && window.location && window.location.search;
1170
+ // Setting flag for Ad-preview URLs
1171
+ setPreviewAd(path.split('&').some(function (param) {
1172
+ return param.includes('creativeId');
1173
+ }));
1174
+ setContainerHeight(window.innerHeight);
1175
+ }, []);
1176
+
1177
+ var isCutomPage = function isCutomPage(article) {
1178
+ var url = article.url.current;
1179
+
1180
+ if (regionalPages || nationalPage) {
1181
+ return regionalPages.includes(url) || nationalPage === url;
1182
+ } else {
1183
+ return false;
1184
+ }
1185
+ };
1186
+ var renderAuthorBiography = function renderAuthorBiography(biography) {
1187
+ if (biography) {
1188
+ return React__default["default"].createElement(BlockContent.BlockContent, _extends._extends({
1189
+ serializers: getSerializers.getSerializers(client, pageview, videoAccountIDs, onVote, true, drupalLeadSettings, currentPage, false, contextualADFlag),
1190
+ blocks: [biography]
1191
+ }, client.config()));
1192
+ }
1193
+ };
1194
+
1195
+ var getAbstract = function getAbstract() {
1196
+ return article.abstract && article.abstract.map(function (block) {
1197
+ if (block.children) {
1198
+ return block.children.map(function (child) {
1199
+ if (child._type === 'span') return child.text;
1200
+ });
1201
+ }
1202
+ }).join(' ');
1203
+ };
1204
+
1205
+ var renderIsiContent = function renderIsiContent(article) {
1206
+ var url = article.url.current;
1207
+
1208
+ if (regionalPages && ISIContent && regionalPages.includes(url)) {
1209
+ return React__default["default"].createElement(ISIContent, null);
1210
+ } else if (nationalPage === url && ISIContent) {
1211
+ return React__default["default"].createElement(ISIContent, { national: true });
1212
+ }
1213
+ return null;
1214
+ };
1215
+ var generateRIS = function generateRIS() {
1216
+ var fileContent = 'TY - JOUR\n';
1217
+ if (issue) {
1218
+ if (article.title) {
1219
+ fileContent += 'TI - ' + article.title + '\n'; // Title - TI
1220
+ fileContent += 'T1 - ' + article.title + '\n'; // Title - T1
1221
+ }
1222
+ if (authorDetails && authorDetails.length) {
1223
+ authorDetails.map(function (authorDetail, index) {
1224
+ return fileContent += 'AU - ' + (authorDetail.firstName && authorDetail.lastName ? authorDetail.lastName + ', ' + authorDetail.firstName : '' + authorDetail.displayName) + '\n';
1225
+ } // Author
1226
+ );
1227
+ }
1228
+ if (issue.publication && issue.publication.name) {
1229
+ fileContent += 'T2 - ' + issue.publication.name + '\n'; // Secondary Title - T2
1230
+ fileContent += 'JF - ' + issue.publication.name + '\n'; // Journal Name - JF
1231
+ }
1232
+ if (issue.name) {
1233
+ fileContent += 'T3 - ' + issue.name + '\n'; // Issue Name - T3
1234
+ }
1235
+ if (issue.abbreviatedJournal) {
1236
+ fileContent += 'JO - ' + issue.abbreviatedJournal + '\n'; // Journal Name - JO
1237
+ }
1238
+ if (article.abstract) fileContent += 'AB - ' + getAbstract() + '\n'; // Abstract - AB
1239
+ if (article.abstract) fileContent += 'N2 - ' + getAbstract() + '\n'; // Abstract - N2
1240
+ if (issue.issueNumber) fileContent += 'IS - ' + issue.issueNumber + '\n'; // Issue Number - IS
1241
+ fileContent += 'PB - MJH Life Sciences\n'; // Publisher - PB
1242
+ if (issue.year) fileContent += 'PY - ' + issue.year + '\n'; // Published Year - PY
1243
+ if (issue.volume) fileContent += 'VL - ' + issue.volume + '\n'; // Volume - VL
1244
+ if (issue.url) fileContent += 'L1 - ' + issue.url + '\n'; // Link to PDF - L1
1245
+ if (shareOptions && shareOptions.shareBaseUrl) {
1246
+ fileContent += 'L2 - ' + (shareOptions.shareBaseUrl + url) + '\n'; // Link to Full-text - L2
1247
+ fileContent += 'UR - ' + (shareOptions.shareBaseUrl + url) + '\n'; // Doc URL - UR
1248
+ }
1249
+ if (props.Website) fileContent += 'LK - https://' + props.Website.liveDomain + '\n'; // Website Link - LK
1250
+ if (issue.isbn_issn) {
1251
+ fileContent += 'SN - ' + issue.isbn_issn + '\n'; // ISSN/ISBN - TI
1252
+ }
1253
+ if (pageNumber) {
1254
+ if (pageNumber.includes('-')) {
1255
+ fileContent += 'SP - ' + pageNumber.split('-')[0] + '\n'; // Start Page - SP
1256
+ fileContent += 'EP - ' + pageNumber.split('-')[1] + '\n'; // End Page - EP
1257
+ } else {
1258
+ fileContent += 'SP - ' + pageNumber + '\n';
1259
+ }
1260
+ }
1261
+ if (article.published) fileContent += 'Y1 - ' + moment.moment(published).format('DD-MMMM-YYYY') + '\n'; // Primary Date - Y1
1262
+ fileContent += 'Y2 - ' + moment.moment().format('DD-MMMM-YYYY') + '\n'; // Access Date - Y2
1263
+ }
1264
+ fileContent += 'ER -\n'; // End of Record
1265
+ return fileContent;
1266
+ };
1267
+ var getAuthorList = function getAuthorList() {
1268
+ var authorList = '';
1269
+ if (authorDetails && authorDetails.length > 0) {
1270
+ authorDetails.map(function (author) {
1271
+ if (author.lastName && author.firstName) authorList += author.lastName + ',' + author.firstName + ';';else if (author.displayName) authorList += author.displayName + ';';
1272
+ });
1273
+ }
1274
+ return authorList;
1275
+ };
1276
+ var downloadRIS = function downloadRIS() {
1277
+ var fileContent = generateRIS();
1278
+ var file = new File([fileContent], 'citation-' + url + '.ris', { type: 'application/x-research-info-systems;charset=utf-8' });
1279
+ FileSaver_min.saveAs(file, 'citation-' + url + '.ris');
1280
+ };
1281
+
1282
+ var RelevantTopics = function RelevantTopics() {
1283
+ if (content_placement && content_placement.length > 0 || documentGroupMapping && documentGroupMapping.length > 0) {
1284
+ var relatedLinks = [];
1285
+ if (documentGroupMapping && documentGroupMapping.length > 0) {
1286
+ documentGroupMapping.forEach(function (documentGroup) {
1287
+ if (documentGroup.isShow === false || documentGroup.excludeRelatedContents) {
1288
+ return null;
1289
+ }
1290
+
1291
+ // let doc_url = cpModificationRequired
1292
+ // ? getDocumentGroupUrl(documentGroup)
1293
+ // : documentGroup.ancestor
1294
+ // ? documentGroup.parent && !documentGroup.path.includes('/')
1295
+ // ? `/${documentGroup.ancestor}/${documentGroup.parent.identifier.current}/${documentGroup.path}` : `/${documentGroup.ancestor}/${documentGroup.path}` : documentGroup.parent
1296
+ // ? !documentGroup.path.includes('/')
1297
+ // ? `/${documentGroup.parent.identifier.current}/${documentGroup.path}` : `/${documentGroup.path}` : `/${documentGroup.path}`
1298
+
1299
+ var docUrl = '/' + documentGroup.path;
1300
+
1301
+ if (cpModificationRequired) {
1302
+ docUrl = getDocumentGroupUrl(documentGroup);
1303
+ } else {
1304
+ try {
1305
+ if (documentGroup.ancestor) {
1306
+ if (documentGroup.parent && documentGroup.path.findIndex('/') < 0) {
1307
+ docUrl = '/' + documentGroup.ancestor + '/' + documentGroup.parent.identifier.current + '/' + documentGroup.path;
1308
+ } else {
1309
+ docUrl = '/' + documentGroup.ancestor + '/' + documentGroup.path;
1310
+ }
1311
+ } else if (documentGroup.parent) {
1312
+ if (documentGroup.path.findIndex('/') < 0) {
1313
+ docUrl = '/' + documentGroup.parent.identifier.current + '/' + documentGroup.path;
1314
+ } else {
1315
+ docUrl = '/' + documentGroup.path;
1316
+ }
1317
+ }
1318
+ } catch (e) {
1319
+ console.log(e.message);
1320
+ }
1321
+ }
1322
+
1323
+ var href = '' + docUrl;
1324
+ relatedLinks = [].concat(toConsumableArray._toConsumableArray(relatedLinks), [{ label: documentGroup.name, href: href }]);
1325
+ // if (documentGroup.parent) {
1326
+ // relatedLinks = [
1327
+ // ...relatedLinks,
1328
+ // {
1329
+ // label: documentGroup.name,
1330
+ // href: cpModificationRequired
1331
+ // ? getDocumentGroupUrl(documentGroup)
1332
+ // : documentGroup.parent.identifier && documentGroup.parent.identifier.current && !documentGroup.path.includes('/')
1333
+ // ? `/${documentGroup.parent.identifier.current}/${documentGroup.path}`
1334
+ // : `/${documentGroup.path}`
1335
+ // }
1336
+ // ]
1337
+ // }
1338
+ });
1339
+ }
1340
+ console.log("HELLO");
1341
+ if (content_placement && content_placement.length > 0) {
1342
+ console.log("content_placement 1", content_placement);
1343
+ console.log("cpmodificationrequired", cpModificationRequired);
1344
+ content_placement.filter(function (item) {
1345
+ return item.path !== 'news';
1346
+ }).forEach(function (cp) {
1347
+ if (cp.excludeRelatedContents) {
1348
+ return null;
1349
+ }
1350
+ var cp_url = '' + cp.path;
1351
+ try {
1352
+ cp_url = cpModificationRequired ? getTargeting.getContentPlacementUrl(cp) : cp.ancestor ? cp.parent && cp.path.indexOf('/') < 0 ? cp.ancestor + '/' + cp.parent + '/' + cp.path : !cp.path.indexOf(cp.ancestor) < 0 ? cp.ancestor + '/' + cp.path : '' + cp.path : cp.parent ? !cp.path.indexOf('/') < 0 ? cp.parent + '/' + cp.path : '' + cp.path : '' + cp.path;
1353
+ } catch (e) {
1354
+ console.log(e.message);
1355
+ }
1356
+ var href = '/' + cp_url;
1357
+ relatedLinks = [].concat(toConsumableArray._toConsumableArray(relatedLinks), [{ label: cp.name, href: href }]);
1358
+ });
1359
+ }
1360
+ console.log("relatedLinks 2", relatedLinks);
1361
+ if (issueGroup && issueGroup.name && issueGroup.identifier && issueGroup.identifier.current && issueGroup.parent && issueGroup.parent.identifier && issueGroup.parent.identifier.current) {
1362
+ var _props$Settings$issue = props.Settings.issueMapping,
1363
+ issueMapping = _props$Settings$issue === undefined ? '/publications' : _props$Settings$issue;
1364
+
1365
+ relatedLinks = [].concat(toConsumableArray._toConsumableArray(relatedLinks), [{ label: issueGroup.name, href: issueMapping + '/' + issueGroup.parent.identifier.current + '/' + issueGroup.identifier.current }]);
1366
+ }
1367
+ if (relatedLinks && relatedLinks.length > 0) {
1368
+ return React__default["default"].createElement(
1369
+ 'div',
1370
+ null,
1371
+ relatedLinks.map(function (relatedLink, index) {
1372
+ if (relatedLink && relatedLink.href && relatedLink.label) {
1373
+ if (relatedLink.href === 'null') return;
1374
+ return React__default["default"].createElement(
1375
+ 'span',
1376
+ { key: index, className: 'related-link yes-me' },
1377
+ React__default["default"].createElement(
1378
+ 'a',
1379
+ { className: 'related-links article', style: { color: 'blue' }, href: relatedLink.href },
1380
+ relatedLink.label
1381
+ ),
1382
+ React__default["default"].createElement(
1383
+ 'style',
1384
+ { jsx: 'true' },
1385
+ '\n .related-link:not(:first-child):before {\n content: \' | \';\n }\n '
1386
+ )
1387
+ );
1388
+ }
1389
+ })
1390
+ );
1391
+ }
1392
+ return null;
1393
+ }
1394
+ return null;
1395
+ };
1396
+
1397
+ var RelatedContent = React__default["default"].memo(function () {
1398
+ return React__default["default"].createElement(
1399
+ 'div',
1400
+ null,
1401
+ useSegmentRecommendedArticles ? React__default["default"].createElement(Recommended, {
1402
+ client: client,
1403
+ article: article,
1404
+ index: props.index,
1405
+ Settings: props.Settings,
1406
+ showRelatedArticleFallbackImage: props.showRelatedArticleFallbackImage,
1407
+ cpModificationRequired: cpModificationRequired,
1408
+ emailList: emailList,
1409
+ articleRecsQuery: articleRecsQuery
1410
+ }) : React__default["default"].createElement(
1411
+ 'section',
1412
+ { id: 'related-content-section', className: 'my-1' },
1413
+ (article.relatedArticle || RelevantTopics()) && React__default["default"].createElement(
1414
+ 'p',
1415
+ { className: 'mb-0' },
1416
+ React__default["default"].createElement(
1417
+ 'b',
1418
+ null,
1419
+ 'Related Content:'
1420
+ )
1421
+ ),
1422
+ React__default["default"].createElement(RelevantTopics, null),
1423
+ React__default["default"].createElement(
1424
+ 'div',
1425
+ { className: 'pt-2' },
1426
+ React__default["default"].createElement(RelatedArticle, {
1427
+ articles: article.relatedArticle,
1428
+ client: client,
1429
+ fallbackImage: props.Settings.logo,
1430
+ showRelatedArticleFallbackImage: props.showRelatedArticleFallbackImage
1431
+ })
1432
+ )
1433
+ )
1434
+ );
1435
+ });
1436
+
1437
+ var form = function form() {
1438
+ return React__default["default"].createElement(
1439
+ React__default["default"].Fragment,
1440
+ null,
1441
+ React__default["default"].createElement(
1442
+ Head__default["default"],
1443
+ null,
1444
+ React__default["default"].createElement('meta', { name: 'googlebot', content: 'noindex' })
1445
+ ),
1446
+ React__default["default"].createElement(
1447
+ 'div',
1448
+ { className: 'mt-5', style: { display: 'flex', justifyContent: 'center', alignItems: 'center' } },
1449
+ React__default["default"].createElement(
1450
+ Form__default["default"],
1451
+ {
1452
+ inline: true,
1453
+ onSubmit: function onSubmit(e) {
1454
+ e.preventDefault();
1455
+ } },
1456
+ React__default["default"].createElement(FormControl__default["default"], { type: 'text', className: 'mr-sm-2', value: passwordKey, onChange: function onChange(e) {
1457
+ return setPasswordKey(e.target.value);
1458
+ }, placeholder: 'Password' }),
1459
+ React__default["default"].createElement(
1460
+ Button__default["default"],
1461
+ {
1462
+ variant: 'primary',
1463
+ onClick: function onClick() {
1464
+ if (passwordKey === props.article.password) {
1465
+ setAuth(2);
1466
+ } else {
1467
+ alert('Incorrect Password');
1468
+ }
1469
+ } },
1470
+ 'Submit'
1471
+ )
1472
+ )
1473
+ )
1474
+ );
1475
+ };
1476
+
1477
+ var renderBlockContent = function renderBlockContent(payload, meta, authorImgHeight) {
1478
+ var _payload = payload,
1479
+ body = _payload.body;
1480
+
1481
+ var indexes = findIndex(body);
1482
+ var seriesInfo = checkIfMediaSeriesHasVideo(article);
1483
+ var isMediaSeries = false;
1484
+ if (article.documentGroup && article.documentGroup.isSeries) {
1485
+ isMediaSeries = true;
1486
+ } else if (!article.documentGroup && article.documentGroupMapping && checkDocGroupMappingForSeries(article.documentGroupMapping)) {
1487
+ isMediaSeries = true;
1488
+ }
1489
+
1490
+ if (indexes.length >= 2 && body.length > 3 && payload.contextualAD && payload.contextualVideoAD) {
1491
+ payload = _extends._extends({}, payload, {
1492
+ contextualAD: _extends._extends({}, payload.contextualAD, {
1493
+ slotId: (payload.contextualAD.slotId || 'contextual_ad') + '-' + payload._id
1494
+ }),
1495
+ contextualVideoAD: _extends._extends({}, payload.contextualVideoAD, {
1496
+ slotId: (payload.contextualVideoAD.slotId || 'in-context_video') + '-' + payload._id
1497
+ })
1498
+ });
1499
+ var selectedIndex = !(indexes.length % 2) ? indexes.length / 2 + 1 : Math.round(indexes.length / 2);
1500
+ if (seriesInfo.hasVideo) {
1501
+ selectedIndex = seriesInfo.videoIndex;
1502
+ }
1503
+
1504
+ var checkIsVideoAdFound = function checkIsVideoAdFound(isFound) {
1505
+ if (!isFound) {
1506
+ var parent = document.getElementById('contextual-video-ad-' + payload._id);
1507
+ parent.style.height = '0%';
1508
+ parent.style.width = '0%';
1509
+ parent.style.display = 'none';
1510
+ setContextualADFlag(false);
1511
+ } else {
1512
+ setContextualADFlag(true);
1513
+ }
1514
+ };
1515
+ return React__default["default"].createElement(
1516
+ React__default["default"].Fragment,
1517
+ null,
1518
+ React__default["default"].createElement(BlockContent.BlockContent, _extends._extends({
1519
+ serializers: getSerializers.getSerializers(client, pageview, videoAccountIDs, onVote, true, drupalLeadSettings, currentPage, isMediaSeries, contextualADFlag, null, article.Ads, targeting, article, meta, authorPrefix, authorImgHeight, audioAutoplay),
1520
+ blocks: [].concat(toConsumableArray._toConsumableArray(articleBody.slice(0, selectedIndex))),
1521
+ imageOptions: { w: 320, h: 240, fit: 'max' }
1522
+ }, client.config())),
1523
+ React__default["default"].createElement('span', { className: 'clearfix' }),
1524
+ isMediaSeries && sliderData && seriesInfo.hasVideo && React__default["default"].createElement(SeriesSlider.SeriesSlider, { dataset: sliderData, client: client, nowPlaying: article.title, displayEpisodeNumber: logicforDisplayingEpisodeNumber }),
1525
+ React__default["default"].createElement(
1526
+ 'div',
1527
+ { id: 'contextual-native-ad-' + payload._id, className: 'contextual-native-ad' },
1528
+ React__default["default"].createElement(AdSlot, _extends._extends({}, payload.contextualAD, { refreshFlag: refreshFlag }))
1529
+ ),
1530
+ React__default["default"].createElement(
1531
+ 'style',
1532
+ { jsx: 'true' },
1533
+ '\n .contextual-native-ad {\n margin-bottom: 1rem;\n }\n '
1534
+ ),
1535
+ React__default["default"].createElement('span', { className: 'clearfix' }),
1536
+ React__default["default"].createElement(
1537
+ 'div',
1538
+ { id: 'contextual-video-ad-' + payload._id, className: 'contextual-video-ad' },
1539
+ React__default["default"].createElement(AdSlot, _extends._extends({}, payload.contextualVideoAD, { refreshFlag: refreshFlag, checkIsAdFound: checkIsVideoAdFound }))
1540
+ ),
1541
+ React__default["default"].createElement(BlockContent.BlockContent, _extends._extends({
1542
+ serializers: getSerializers.getSerializers(client, pageview, videoAccountIDs, onVote, true, drupalLeadSettings, currentPage, isMediaSeries, null, null, article.Ads, targeting, article, meta, authorPrefix, authorImgHeight, audioAutoplay),
1543
+ blocks: [].concat(toConsumableArray._toConsumableArray(articleBody.slice(selectedIndex))),
1544
+ imageOptions: { w: 320, h: 240, fit: 'max' }
1545
+ }, client.config()))
1546
+ );
1547
+ } else if (indexes.length >= 2 && body.length >= 3 && payload.contextualAD && !payload.contextualVideoAD) {
1548
+ payload = _extends._extends({}, payload, {
1549
+ contextualAD: _extends._extends({}, payload.contextualAD, {
1550
+ slotId: (payload.contextualAD.slotId || 'contextual_ad') + '-' + payload._id,
1551
+ className: 'ADFluid',
1552
+ // Fetching new contextual targeting based on the current active article.
1553
+ targeting: getTargeting.getTargeting(props, 'native-ad'),
1554
+ // Adding new ad size for large contextual ad for desktop screen width >= 1400
1555
+ sizes: lgContextAd ? [[728, 90], 'fluid', [300, 100]] : ['fluid', [300, 100]],
1556
+ sizeMapping: lgContextAd ? [{
1557
+ viewport: [1400, 0],
1558
+ sizes: [[728, 90], 'fluid', [300, 100]]
1559
+ }, { viewport: [0, 0], sizes: ['fluid', [300, 100]] }] : [{ viewport: [0, 0], sizes: ['fluid', [300, 100]] }]
1560
+ })
1561
+ });
1562
+ var _selectedIndex = !(indexes.length % 2) ? indexes.length / 2 + 1 : Math.round(indexes.length / 2);
1563
+ if (seriesInfo.hasVideo) {
1564
+ _selectedIndex = seriesInfo.videoIndex;
1565
+ }
1566
+ return React__default["default"].createElement(
1567
+ React__default["default"].Fragment,
1568
+ null,
1569
+ React__default["default"].createElement(BlockContent.BlockContent, _extends._extends({
1570
+ serializers: getSerializers.getSerializers(client, pageview, videoAccountIDs, onVote, true, drupalLeadSettings, currentPage, isMediaSeries, contextualADFlag, null, article.Ads, targeting, article, meta, authorPrefix, authorImgHeight, audioAutoplay),
1571
+ blocks: [].concat(toConsumableArray._toConsumableArray(articleBody.slice(0, _selectedIndex))),
1572
+ imageOptions: { w: 320, h: 240, fit: 'max' }
1573
+ }, client.config())),
1574
+ contextualADFlag && React__default["default"].createElement('span', { className: 'clearfix' }),
1575
+ isMediaSeries && sliderData && seriesInfo.hasVideo && React__default["default"].createElement(SeriesSlider.SeriesSlider, { dataset: sliderData, client: client, nowPlaying: article.title, displayEpisodeNumber: logicforDisplayingEpisodeNumber }),
1576
+ (visibleFlag || queueData && queueData.length === 1 || !props.infiniteScroll) && React__default["default"].createElement(
1577
+ React__default["default"].Fragment,
1578
+ null,
1579
+ React__default["default"].createElement(
1580
+ 'div',
1581
+ { id: 'contextual-native-ad-' + payload._id, className: 'contextual-native-ad' },
1582
+ React__default["default"].createElement(AdSlot, _extends._extends({}, payload.contextualAD, { refreshFlag: refreshFlag }))
1583
+ ),
1584
+ React__default["default"].createElement(
1585
+ 'style',
1586
+ { jsx: 'true' },
1587
+ '\n .contextual-native-ad {\n margin-bottom: 1rem;\n }\n '
1588
+ )
1589
+ ),
1590
+ contextualADFlag && React__default["default"].createElement('span', { className: 'clearfix' }),
1591
+ React__default["default"].createElement(BlockContent.BlockContent, _extends._extends({
1592
+ serializers: getSerializers.getSerializers(client, pageview, videoAccountIDs, onVote, true, drupalLeadSettings, currentPage, isMediaSeries, null, null, article.Ads, targeting, article, meta, authorPrefix, authorImgHeight, audioAutoplay),
1593
+ blocks: [].concat(toConsumableArray._toConsumableArray(articleBody.slice(_selectedIndex))),
1594
+ imageOptions: { w: 320, h: 240, fit: 'max' }
1595
+ }, client.config()))
1596
+ );
1597
+ } else if (indexes.length >= 2 && body.length > 3 && payload.contextualVideoAD && !payload.contextualAD) {
1598
+ payload = _extends._extends({}, payload, {
1599
+ contextualVideoAD: _extends._extends({}, payload.contextualVideoAD, {
1600
+ slotId: (payload.contextualVideoAD.slotId || 'in-context_video') + '-' + payload._id
1601
+ })
1602
+ });
1603
+ var _selectedIndex2 = !(indexes.length % 2) ? indexes.length / 2 + 1 : Math.round(indexes.length / 2);
1604
+ if (seriesInfo.hasVideo) {
1605
+ _selectedIndex2 = seriesInfo.videoIndex;
1606
+ }
1607
+ var checkIsAdFound = function checkIsAdFound(isFound) {
1608
+ if (!isFound) {
1609
+ var parent = document.getElementById('contextual-video-ad-' + payload._id);
1610
+ parent.style.height = '0%';
1611
+ parent.style.width = '0%';
1612
+ parent.style.display = 'none';
1613
+ setContextualADFlag(false);
1614
+ } else {
1615
+ if (body && body[1] && body[1]._type === 'figure') {
1616
+ setContextualADFlag(true);
1617
+ }
1618
+ }
1619
+ };
1620
+
1621
+ return React__default["default"].createElement(
1622
+ React__default["default"].Fragment,
1623
+ null,
1624
+ React__default["default"].createElement(BlockContent.BlockContent, _extends._extends({
1625
+ serializers: getSerializers.getSerializers(client, pageview, videoAccountIDs, onVote, true, drupalLeadSettings, currentPage, isMediaSeries, contextualADFlag, null, article.Ads, targeting, article, meta, authorPrefix, authorImgHeight, audioAutoplay),
1626
+ blocks: [].concat(toConsumableArray._toConsumableArray(articleBody.slice(0, _selectedIndex2))),
1627
+ imageOptions: { w: 320, h: 240, fit: 'max' }
1628
+ }, client.config())),
1629
+ React__default["default"].createElement('span', { className: 'clearfix' }),
1630
+ isMediaSeries && sliderData && seriesInfo.hasVideo && React__default["default"].createElement(SeriesSlider.SeriesSlider, { dataset: sliderData, client: client, nowPlaying: article.title, displayEpisodeNumber: logicforDisplayingEpisodeNumber }),
1631
+ React__default["default"].createElement(
1632
+ 'div',
1633
+ { id: 'contextual-video-ad-' + payload._id, className: 'contextual-video-ad' },
1634
+ React__default["default"].createElement(AdSlot, _extends._extends({}, payload.contextualVideoAD, { refreshFlag: refreshFlag, checkIsAdFound: checkIsAdFound }))
1635
+ ),
1636
+ React__default["default"].createElement(BlockContent.BlockContent, _extends._extends({
1637
+ serializers: getSerializers.getSerializers(client, pageview, videoAccountIDs, onVote, true, drupalLeadSettings, currentPage, isMediaSeries, null, null, article.Ads, targeting, article, meta, authorPrefix, authorImgHeight, audioAutoplay),
1638
+ blocks: [].concat(toConsumableArray._toConsumableArray(articleBody.slice(_selectedIndex2))),
1639
+ imageOptions: { w: 320, h: 240, fit: 'max' }
1640
+ }, client.config()))
1641
+ );
1642
+ } else {
1643
+ var _selectedIndex3 = !(indexes.length % 2) ? indexes.length / 2 + 1 : Math.round(indexes.length / 2);
1644
+ if (seriesInfo.hasVideo) {
1645
+ _selectedIndex3 = seriesInfo.videoIndex;
1646
+ }
1647
+
1648
+ return React__default["default"].createElement(
1649
+ 'div',
1650
+ null,
1651
+ React__default["default"].createElement(BlockContent.BlockContent, _extends._extends({
1652
+ serializers: getSerializers.getSerializers(client, pageview, videoAccountIDs, onVote, true, drupalLeadSettings, currentPage, isMediaSeries, false, null, article.Ads, targeting, article, meta, authorPrefix, authorImgHeight, audioAutoplay),
1653
+ blocks: article.documentGroup && article.documentGroup.isSeries ? [].concat(toConsumableArray._toConsumableArray(articleBody.slice(0, _selectedIndex3))) : articleBody,
1654
+ imageOptions: { w: 320, h: 240, fit: 'max' }
1655
+ }, client.config())),
1656
+ isMediaSeries && sliderData && seriesInfo.hasVideo && React__default["default"].createElement(SeriesSlider.SeriesSlider, { dataset: sliderData, client: client, nowPlaying: article.title, displayEpisodeNumber: logicforDisplayingEpisodeNumber }),
1657
+ article.documentGroup && article.documentGroup.isSeries && React__default["default"].createElement(BlockContent.BlockContent, _extends._extends({
1658
+ serializers: getSerializers.getSerializers(client, pageview, videoAccountIDs, onVote, true, drupalLeadSettings, currentPage, isMediaSeries, null, null, article.Ads, targeting, article, meta, authorPrefix, authorImgHeight, audioAutoplay),
1659
+ blocks: [].concat(toConsumableArray._toConsumableArray(articleBody.slice(_selectedIndex3))),
1660
+ imageOptions: { w: 320, h: 240, fit: 'max' }
1661
+ }, client.config()))
1662
+ );
1663
+ }
1664
+ };
1665
+
1666
+ var checkIfVideoSeries = function checkIfVideoSeries(article) {
1667
+ if (!article || !article.body) {
1668
+ return false;
1669
+ }
1670
+
1671
+ for (var i = 0; i < article.body.length; i++) {
1672
+ var block = article.body[i];
1673
+ if (block._type === 'youtubeGallery') {
1674
+ return true;
1675
+ }
1676
+ }
1677
+
1678
+ return false;
1679
+ };
1680
+ var checkIfFormAssembly = function checkIfFormAssembly(article) {
1681
+ if (!article || !article.body) {
1682
+ return false;
1683
+ }
1684
+
1685
+ for (var i = 0; i < article.body.length; i++) {
1686
+ var block = article.body[i];
1687
+ if (block._type === 'formassembly') {
1688
+ return true;
1689
+ }
1690
+ }
1691
+ return false;
1692
+ };
1693
+ var checkIfMediaSeriesHasVideo = function checkIfMediaSeriesHasVideo(article) {
1694
+ var seriesInfo = { hasVideo: false, videoIndex: 0 };
1695
+ if (!article || !article.body) {
1696
+ return false;
1697
+ }
1698
+
1699
+ for (var i = 0; i < article.body.length; i++) {
1700
+ var block = article.body[i];
1701
+ if (block._type == 'video' || block._type == 'youtube' || block._type == 'audio') {
1702
+ seriesInfo.hasVideo = true;
1703
+ seriesInfo.videoIndex = i + 1;
1704
+ }
1705
+ }
1706
+
1707
+ return seriesInfo;
1708
+ };
1709
+
1710
+ var detail = function detail() {
1711
+ var shareVia = shareOptions.shareVia,
1712
+ shareSubject = shareOptions.shareSubject,
1713
+ twitterSiteName = shareOptions.twitterSiteName,
1714
+ shareImageDefault = shareOptions.shareImageDefault,
1715
+ shareBaseUrl = shareOptions.shareBaseUrl;
1716
+ shareOptions.shareSiteTitle;
1717
+
1718
+ var shareUrl = shareBaseUrl + props.article.url.current;
1719
+ var shareTitle = article.title;
1720
+ var shareSummary = article.summary;
1721
+ var shareImage = thumbnail && thumbnail.asset ? urlFor({ client: props.client, source: thumbnail.asset }) : shareImageDefault;
1722
+ var siteName = props.Website && props.Website.title ? props.Website.title : '';
1723
+ var shareKeywords = getKeywords(props.article).join(',');
1724
+
1725
+ var meta = {
1726
+ shareTitle: shareTitle,
1727
+ shareSiteName: props.cache.siteSettingCache.name,
1728
+ shareSummary: shareSummary,
1729
+ shareUrl: shareUrl,
1730
+ shareImage: shareImage,
1731
+ shareVia: props.Settings.title,
1732
+ shareKeywords: shareKeywords
1733
+ };
1734
+ if (!props.infiniteScroll) {
1735
+ onChangeArticle = function onChangeArticle() {
1736
+ return null;
1737
+ };
1738
+ }
1739
+ var fetchCurrentEpisode = function fetchCurrentEpisode(sliderData, article) {
1740
+ if (!sliderData) return null;
1741
+ var episode = null;
1742
+ sliderData.forEach(function (seriesArticle, index) {
1743
+ if (seriesArticle.title === article.title) {
1744
+ episode = index + 1;
1745
+ }
1746
+ });
1747
+ return episode;
1748
+ };
1749
+ // pixels from bottom of window to change trigger visibility change
1750
+ var triggerOffset = 20;
1751
+ var isVideoSeries = checkIfVideoSeries(article);
1752
+ var episodeNumber = fetchCurrentEpisode(sliderData, props.article);
1753
+ var isMediaSeries = false;
1754
+ var mediaSeriesName = '';
1755
+ var seriesInfo = checkIfMediaSeriesHasVideo(article);
1756
+ var isFormAssembly = checkIfFormAssembly(article);
1757
+
1758
+ if (article.documentGroup && article.documentGroup.isSeries) {
1759
+ isMediaSeries = true;
1760
+ mediaSeriesName = article.documentGroup.name;
1761
+ }
1762
+ if (!article.documentGroup && article.documentGroupMapping && checkDocGroupMappingForSeries(article.documentGroupMapping)) {
1763
+ isMediaSeries = true;
1764
+ mediaSeriesName = checkDocGroupMappingForSeries(article.documentGroupMapping).name;
1765
+ }
1766
+
1767
+ var baseUrl = client ? client.config().baseUrl : '';
1768
+
1769
+ return React__default["default"].createElement(
1770
+ React__default["default"].Fragment,
1771
+ null,
1772
+ React__default["default"].createElement(
1773
+ visibilitySensor.VisibilitySensor,
1774
+ {
1775
+ partialVisibility: true,
1776
+ offset: { bottom: triggerOffset, top: containerHeight && containerHeight },
1777
+ onChange: function onChange(isVisible) {
1778
+ if (isVisible && !isFirstArticle) {
1779
+ var pageviewProperties = _extends._extends({}, targeting, {
1780
+ category: article && article.category ? article.category.name : ''
1781
+ });
1782
+ onChangeArticle(url, meta, pageviewProperties);
1783
+ setVisibleFlag(function () {
1784
+ return true;
1785
+ });
1786
+ }
1787
+ if (isFirstArticle) {
1788
+ setIsFirstArticle(false);
1789
+ }
1790
+ } },
1791
+ React__default["default"].createElement(
1792
+ 'div',
1793
+ { id: 'article__block', style: { position: 'relative' }, ref: ref },
1794
+ React__default["default"].createElement(PixelTracking.PixelTrackingArticle, { article: article, infiniteScroll: props.infiniteScroll }),
1795
+ React__default["default"].createElement(
1796
+ 'div',
1797
+ { className: 'video-detail', style: { marginBottom: isCutomPage(props.article) || showIsi && Array.isArray(isi) && isi.length > 0 ? '15rem' : 0 } },
1798
+ issue && React__default["default"].createElement(
1799
+ Head__default["default"],
1800
+ null,
1801
+ article.title && React__default["default"].createElement('meta', { name: 'citation_title', content: article.title }),
1802
+ published && React__default["default"].createElement('meta', { name: 'citation_date', content: moment.moment(published).format('LL') }),
1803
+ issue.publication && issue.publication.name && React__default["default"].createElement('meta', { name: 'citation_journal_title', content: issue.publication.name }),
1804
+ issue.year && React__default["default"].createElement('meta', { name: 'citation_year', content: issue.year }),
1805
+ issue.volume && React__default["default"].createElement('meta', { name: 'citation_volume', content: issue.volume }),
1806
+ issue.issueNumber && React__default["default"].createElement('meta', { name: 'citation_issue', content: issue.issueNumber }),
1807
+ article.pageNumber && React__default["default"].createElement('meta', { name: 'citation_firstpage', content: article.pageNumber }),
1808
+ article.pageNumber && React__default["default"].createElement('meta', { name: 'citation_lastpage', content: article.pageNumber }),
1809
+ issue.name && React__default["default"].createElement('meta', { name: 'citation_series_title', content: issue.name }),
1810
+ issue.isbn_issn && React__default["default"].createElement('meta', { name: 'citation_isbn', content: issue.isbn_issn }),
1811
+ article.abstract && React__default["default"].createElement('meta', { name: 'citation_abstract', content: getAbstract() }),
1812
+ React__default["default"].createElement('meta', { name: 'citation_author', content: getAuthorList() }),
1813
+ React__default["default"].createElement('meta', { name: 'citation_publisher', content: 'MJH Life Sciences' }),
1814
+ issue.pdf && React__default["default"].createElement('meta', { name: 'citation_pdf_url', content: urlForFile.urlForFile({ asset: issue.pdf }, baseUrl) })
1815
+ ),
1816
+ isVideoSeries && renderBlockContent(article, meta, authorImgHeight),
1817
+ !isVideoSeries && React__default["default"].createElement(
1818
+ 'div',
1819
+ null,
1820
+ isMediaSeries && React__default["default"].createElement(
1821
+ 'p',
1822
+ { style: { fontSize: '14px' } },
1823
+ disableEpisodeNumber ? '' + mediaSeriesName : mediaSeriesName + ' - Episode ' + episodeNumber
1824
+ ),
1825
+ React__default["default"].createElement(
1826
+ 'h1',
1827
+ { className: 'page-title', style: { fontSize: '1.9rem' } },
1828
+ title
1829
+ )
1830
+ ),
1831
+ React__default["default"].createElement(
1832
+ 'div',
1833
+ {
1834
+ className: 'mb-3 doc-group-container',
1835
+ style: {
1836
+ display: 'flex',
1837
+ justifyContent: 'space-between',
1838
+ alignItems: article.documentGroupMapping && article.documentGroupMapping[0] && article.documentGroupMapping[0].parent && article.documentGroupMapping[0].parent.parent && article.documentGroupMapping[0].parent.parent.contextText || article.documentGroup && article.documentGroup.parent && article.documentGroup.parent.parent && article.documentGroup.parent.parent.contextText ? 'flex-start' : 'flex-end',
1839
+ margin: '0, 0, 1rem, 0'
1840
+ // margin: article.documentGroup && article.documentGroup.thumbnail && article.documentGroup.thumbnail.caption ? '1rem 0 1rem 0' : '0 0 1rem 0'
1841
+ } },
1842
+ React__default["default"].createElement(
1843
+ 'style',
1844
+ { jsx: 'true' },
1845
+ '\n .social-ris-container {\n display: flex;\n justify-content: space-between;\n }\n @media screen and (max-width: 468px) {\n .video-detail .doc-group-container {\n flex-direction: column;\n align-items: flex-start !important;\n }\n .video-detail .doc-group {\n margin-top: 2rem;\n width: calc(100vw - 45px);\n align-items: center;\n }\n .video-detail .doc-group img,\n .doc-group p {\n max-width: calc(100vw - 45px) !important;\n }\n .social-ris-container {\n flex-direction: column;\n }\n }\n .author-details-img {\n margin-right: 10px;\n max-height: 250px;\n min-height: 150px;\n max-width: 250px;\n min-width: 150px;\n width: 100%;\n height: 100%;\n object-fit: contain;\n }\n .author-details-img-container {\n text-align: center;\n }\n .author-details-col {\n padding-left: 25px;\n }\n .left-wrap {\n width: 100%;\n }\n '
1846
+ ),
1847
+ React__default["default"].createElement(
1848
+ 'div',
1849
+ { className: 'left-wrap' },
1850
+ !isVideoSeries && !isFormAssembly && showPublished && React__default["default"].createElement(
1851
+ 'div',
1852
+ null,
1853
+ 'Published on:',
1854
+ '\xA0',
1855
+ React__default["default"].createElement(
1856
+ 'time',
1857
+ {
1858
+ className: 'meta-date',
1859
+ dateTime: moment.moment(published).utc().format(moment.moment.HTML5_FMT.DATETIME_LOCAL_MS) },
1860
+ moment.moment(published).format('LL')
1861
+ )
1862
+ )
1863
+ /* Show Published date */
1864
+ ,
1865
+ React__default["default"].createElement(
1866
+ 'div',
1867
+ { className: 'mb-3' },
1868
+ !isVideoSeries && authorDetails && authorDetails.map(function (authorDetail, index) {
1869
+ return React__default["default"].createElement(
1870
+ 'span',
1871
+ { key: index },
1872
+ getSerializers.renderAuthor(authorDetail.displayName, authorDetail.url, index, authorDetails.length, authorPrefix, authorDetail.biography && renderAuthorBiography(authorDetail.biography[0]), authorDetail.profileImage && urlFor({ client: props.client, source: authorDetail.profileImage, imageHeight: authorImgHeight }), showAuthorDetails)
1873
+ );
1874
+ }),
1875
+ React__default["default"].createElement(
1876
+ 'div',
1877
+ null,
1878
+ source && React__default["default"].createElement(
1879
+ 'p',
1880
+ {
1881
+ style: {
1882
+ display: 'inline-block',
1883
+ padding: '0 .25rem',
1884
+ color: 'var(--franchise-primary, #484848)',
1885
+ borderRadius: '2px',
1886
+ fontWeight: 'bold',
1887
+ border: '2px solid var(--franchise-primary, #484848)'
1888
+ },
1889
+ className: 'source-label' },
1890
+ source
1891
+ )
1892
+ ),
1893
+ issue && React__default["default"].createElement(
1894
+ 'div',
1895
+ { className: 'volume-issue' },
1896
+ issue.publication && issue.publication.name && React__default["default"].createElement(
1897
+ 'span',
1898
+ { className: 'mb-0-pub' },
1899
+ React__default["default"].createElement(
1900
+ 'b',
1901
+ null,
1902
+ issue.publication.name
1903
+ ),
1904
+ ',',
1905
+ ' '
1906
+ ),
1907
+ issue.name && showIssueNameOnly === undefined ? React__default["default"].createElement(
1908
+ 'span',
1909
+ { className: 'mb-0' },
1910
+ issue.name,
1911
+ ', '
1912
+ ) : issue.name && showIssueNameOnly === false ? React__default["default"].createElement(
1913
+ 'span',
1914
+ { className: 'mb-0' },
1915
+ issue.name,
1916
+ ', '
1917
+ ) : null,
1918
+ issue.volume && React__default["default"].createElement(
1919
+ 'span',
1920
+ null,
1921
+ 'Volume ' + issue.volume,
1922
+ ', '
1923
+ ),
1924
+ issue.issueNumber && React__default["default"].createElement(
1925
+ 'span',
1926
+ null,
1927
+ ' Issue ' + issue.issueNumber
1928
+ )
1929
+ ),
1930
+ pageNumber && showPageNumber ? React__default["default"].createElement(
1931
+ 'div',
1932
+ { className: 'article-pageNumber' },
1933
+ 'Pages: ' + pageNumber
1934
+ ) : pageNumber && showPageNumber === undefined ? React__default["default"].createElement(
1935
+ 'div',
1936
+ { className: 'article-pageNumber' },
1937
+ 'Pages: ' + pageNumber
1938
+ ) : null,
1939
+ props.article.doiLink && React__default["default"].createElement(
1940
+ 'div',
1941
+ null,
1942
+ React__default["default"].createElement(
1943
+ 'a',
1944
+ { href: props.article.doiLink },
1945
+ props.article.doiLink
1946
+ )
1947
+ )
1948
+ ),
1949
+ React__default["default"].createElement(
1950
+ 'div',
1951
+ { className: 'social-ris-container' },
1952
+ !isVideoSeries && showSocialShare && React__default["default"].createElement(
1953
+ 'p',
1954
+ null,
1955
+ React__default["default"].createElement(SocialShare, {
1956
+ shareUrl: shareUrl,
1957
+ shareTitle: shareTitle,
1958
+ shareVia: shareVia,
1959
+ shareSummary: shareSummary,
1960
+ shareSubject: shareSubject,
1961
+ shareImage: shareImage,
1962
+ size: 32,
1963
+ siteName: siteName,
1964
+ twitterSiteName: twitterSiteName,
1965
+ disableMeta: true,
1966
+ hidePinterest: hidePinterestShare,
1967
+ hideFacebook: hideFBShare
1968
+ })
1969
+ ),
1970
+ downloadCitation && (parentRisToggle || issueGroupRisToggle) ? React__default["default"].createElement(
1971
+ Button__default["default"],
1972
+ { className: 'ris-download-button', onClick: function onClick() {
1973
+ return downloadRIS();
1974
+ } },
1975
+ 'Download RIS'
1976
+ ) : null
1977
+ )
1978
+ ),
1979
+ React__default["default"].createElement(
1980
+ 'div',
1981
+ null,
1982
+ React__default["default"].createElement(DocumentGroup, { article: props.article, client: props.client })
1983
+ )
1984
+ ),
1985
+ !isVideoSeries && summary && display_summary && React__default["default"].createElement(
1986
+ 'p',
1987
+ null,
1988
+ React__default["default"].createElement(
1989
+ 'em',
1990
+ null,
1991
+ summary
1992
+ )
1993
+ ),
1994
+ React__default["default"].createElement(
1995
+ 'div',
1996
+ { className: 'ad-box', style: { textAlign: 'center' } },
1997
+ main.main_43 && !sponsoredFlag && props.article.Ads && props.article.Ads.length > 0 && props.article.Ads.map(function (ad, index) {
1998
+ if (index === 0) {
1999
+ return React__default["default"].createElement(
2000
+ 'div',
2001
+ {
2002
+ key: index,
2003
+ id: 'addid-' + index,
2004
+ style: {
2005
+ display: 'flex',
2006
+ flex: '1 0 auto',
2007
+ justifyContent: 'center',
2008
+ alignItems: 'center',
2009
+ textAlign: 'center'
2010
+ } },
2011
+ ad.component
2012
+ );
2013
+ }
2014
+ })
2015
+ ),
2016
+ React__default["default"].createElement(
2017
+ 'div',
2018
+ { className: 'block-content mt-3' },
2019
+ !isVideoSeries && renderBlockContent(article, meta),
2020
+ React__default["default"].createElement('div', { className: 'clearfix' }),
2021
+ React__default["default"].createElement(
2022
+ 'noscript',
2023
+ null,
2024
+ React__default["default"].createElement(
2025
+ 'div',
2026
+ { style: { display: 'flex', justifyContent: 'center' }, className: 'series-links' },
2027
+ props.article.seriesDetail && props.article.seriesDetail.prevUrl && React__default["default"].createElement(
2028
+ 'a',
2029
+ { className: 'mx-3', href: props.article.seriesDetail.prevUrl },
2030
+ 'Previous ',
2031
+ props.article.seriesDetail.type
2032
+ ),
2033
+ props.article.seriesDetail && props.article.seriesDetail.nextUrl && React__default["default"].createElement(
2034
+ 'a',
2035
+ { className: 'mx-3', href: props.article.seriesDetail.nextUrl },
2036
+ 'Next ',
2037
+ props.article.seriesDetail.type
2038
+ )
2039
+ )
2040
+ ),
2041
+ React__default["default"].createElement(
2042
+ 'div',
2043
+ { className: 'downloads-container' },
2044
+ issue && issue.pdf && React__default["default"].createElement(
2045
+ 'a',
2046
+ { rel: 'noopener', href: urlForFile.urlForFile({ asset: issue.pdf }, baseUrl), target: '_blank', title: 'Download issue' },
2047
+ React__default["default"].createElement('img', { style: { margin: '1rem', maxHeight: '40px', maxWidth: '40px' }, src: '/download.png', alt: 'download issue' }),
2048
+ article && article.pdfUrl && article.pdfUrl.hasOwnProperty('caption') && article.pdfUrl.caption,
2049
+ article && article.pdfUrl && !article.pdfUrl.caption && 'Download Issue: ' + issue.name,
2050
+ article && !article.pdfUrl && 'Download Issue: ' + issue.name
2051
+ )
2052
+ )
2053
+ ),
2054
+ React__default["default"].createElement('div', { className: 'clearfix', style: { minHeight: '1px' } }),
2055
+ article.documentGroup && article.documentGroup.isSeries && sliderData && !seriesInfo.hasVideo && React__default["default"].createElement(
2056
+ 'div',
2057
+ null,
2058
+ false ,
2059
+ React__default["default"].createElement(SeriesSlider.SeriesSlider, { dataset: sliderData, client: client, nowPlaying: article.title, displayEpisodeNumber: logicforDisplayingEpisodeNumber })
2060
+ ),
2061
+ showRelatedArticles && !showIsi && React__default["default"].createElement(RelatedContent, null),
2062
+ disqusConfig && showDisqus && React__default["default"].createElement(
2063
+ 'div',
2064
+ { id: 'disqusContainer' },
2065
+ React__default["default"].createElement(disqusReact.DiscussionEmbed, {
2066
+ shortname: disqusConfig.shortname,
2067
+ config: {
2068
+ url: disqusConfig.url,
2069
+ identifier: disqusConfig.identifier,
2070
+ title: disqusConfig.title
2071
+ }
2072
+ })
2073
+ )
2074
+ ),
2075
+ renderIsiContent(props.article)
2076
+ )
2077
+ ),
2078
+ showIsi && Array.isArray(isi) && isi.length > 0 && React__default["default"].createElement(
2079
+ ISI,
2080
+ null,
2081
+ React__default["default"].createElement(BlockContent.BlockContent, {
2082
+ serializers: getSerializers.getSerializers(client, pageview, videoAccountIDs, onVote, true, drupalLeadSettings, currentPage, false, false, null, article.Ads, targeting),
2083
+ blocks: isi
2084
+ })
2085
+ ),
2086
+ main.main_43 && !sponsoredFlag && props.article.Ads && props.article.Ads.length > 0 && props.article.Ads.map(function (ad, index) {
2087
+ if (index > 0) {
2088
+ return React__default["default"].createElement(
2089
+ 'div',
2090
+ { key: index, id: 'addid-' + index },
2091
+ ad.component
2092
+ );
2093
+ }
2094
+ }),
2095
+ React__default["default"].createElement(
2096
+ 'noscript',
2097
+ null,
2098
+ props.infiniteScroll && props.article.relatedArticle && props.article.relatedArticle[0] && props.article.relatedArticle[0].url && props.article.relatedArticle[0].url.current && React__default["default"].createElement(
2099
+ 'div',
2100
+ { style: { textAlign: 'center' } },
2101
+ React__default["default"].createElement(
2102
+ 'a',
2103
+ { href: '/view/' + props.article.relatedArticle[0].url.current },
2104
+ 'Related Article ',
2105
+ '>>>'
2106
+ )
2107
+ )
2108
+ ),
2109
+ props.infiniteScroll && React__default["default"].createElement('hr', { className: 'article-seperater mb-5 mt-3' }),
2110
+ React__default["default"].createElement(Schema, { article: props.article, Website: props.Website, client: props.client })
2111
+ );
2112
+ };
2113
+
2114
+ if (passwordLock) {
2115
+ if (auth === 2) {
2116
+ return detail();
2117
+ } else {
2118
+ return form();
2119
+ }
2120
+ } else {
2121
+ return detail();
2122
+ }
2123
+ }), function (prevProps, nextProps) {
2124
+ if (prevProps.article._id === nextProps.article._id) return true;
2125
+ return false;
2126
+ });
2127
+
2128
+ var _this$1 = undefined;
2129
+
2130
+ var ArticleQueue = function ArticleQueue(props) {
2131
+ var router = Router.useRouter();
2132
+
2133
+ var _props$prevUrl = props.prevUrl,
2134
+ prevUrl = _props$prevUrl === undefined ? '/' : _props$prevUrl,
2135
+ Ads = props.Ads,
2136
+ _props$maxListLength = props.maxListLength,
2137
+ maxListLength = _props$maxListLength === undefined ? 10 : _props$maxListLength;
2138
+ props.sponsoredTaxonomies;
2139
+ var _props$cpModification = props.cpModificationRequired,
2140
+ cpModificationRequired = _props$cpModification === undefined ? false : _props$cpModification,
2141
+ _props$authorPrefix = props.authorPrefix,
2142
+ authorPrefix = _props$authorPrefix === undefined ? 'authors' : _props$authorPrefix,
2143
+ showRelatedArticles = props.showRelatedArticles,
2144
+ canonicalTag = props.canonicalTag,
2145
+ _props$disablePrevUrl = props.disablePrevUrlCheckContentPlacement,
2146
+ disablePrevUrlCheckContentPlacement = _props$disablePrevUrl === undefined ? false : _props$disablePrevUrl;
2147
+
2148
+ var _useState = React.useState(0),
2149
+ _useState2 = slicedToArray._slicedToArray(_useState, 2),
2150
+ containerHeight = _useState2[0],
2151
+ setContainerHeight = _useState2[1];
2152
+
2153
+ React.useEffect(function () {
2154
+ var checkFullScreen = function checkFullScreen() {
2155
+ if (window.innerWidth == screen.width && window.innerHeight == screen.height) {
2156
+ return true;
2157
+ } else {
2158
+ return false;
2159
+ }
2160
+ };
2161
+ setContainerHeight(function () {
2162
+ return window.innerHeight;
2163
+ });
2164
+ var handleResize = function handleResize() {
2165
+ return !checkFullScreen() && setContainerHeight(function () {
2166
+ return window.innerHeight;
2167
+ });
2168
+ };
2169
+ window.addEventListener('resize', handleResize);
2170
+ return function () {
2171
+ return window.removeEventListener('resize', handleResize);
2172
+ };
2173
+ }, []);
2174
+
2175
+ var firstArticle = function firstArticle() {
2176
+ var article = _extends._Object$assign({}, props.article);
2177
+ var targeting = getTargeting.getTargeting(props);
2178
+ article.Ads = Ads.getRightItems(targeting);
2179
+ return article;
2180
+ };
2181
+
2182
+ var _useState3 = React.useState([firstArticle()]),
2183
+ _useState4 = slicedToArray._slicedToArray(_useState3, 2),
2184
+ queueData = _useState4[0],
2185
+ setQueueData = _useState4[1];
2186
+
2187
+ var _useState5 = React.useState(queueData[0]._id),
2188
+ _useState6 = slicedToArray._slicedToArray(_useState5, 2),
2189
+ active = _useState6[0],
2190
+ setActive = _useState6[1];
2191
+
2192
+ var refreshAD = function refreshAD(path) {
2193
+ var activeArticle = queueData.find(function (item) {
2194
+ return item.url.current === path;
2195
+ });
2196
+ var targeting = getTargeting.getTargeting({ article: activeArticle, cpModificationRequired: cpModificationRequired, position: props.position, prevUrl: prevUrl, disablePrevUrlCheckContentPlacement: disablePrevUrlCheckContentPlacement });
2197
+ if (!main.main_43) {
2198
+ index.lib_3.getGoogletag().then(function (googletag) {
2199
+ if (window.googletag && googletag.pubadsReady) {
2200
+ var slots = googletag.pubads().getSlots();
2201
+ slots.forEach(function (slot) {
2202
+ var pos = slot.getTargeting('pos');
2203
+ slot.clearTargeting();
2204
+ keys._Object$keys(targeting).forEach(function (key) {
2205
+ slot.setTargeting(key, targeting[key]);
2206
+ });
2207
+ slot.setTargeting('pos', pos);
2208
+ });
2209
+ index.lib_3.refresh();
2210
+ }
2211
+ });
2212
+ }
2213
+ //Refresh leaderboard ad on mobile
2214
+ if (main.main_43) {
2215
+ var leaderboardSlotId = '';
2216
+ index.lib_3.getGoogletag().then(function (googletag) {
2217
+ if (window.googletag && googletag.pubadsReady) {
2218
+ var slots = googletag.pubads().getSlots();
2219
+ slots.forEach(function (slot) {
2220
+ var pos = slot.getTargeting('pos');
2221
+ if (pos == 'top-mobile') {
2222
+ //gets the slotId of the leaderboard ad to refresh
2223
+ leaderboardSlotId = slot.getSlotId().getDomId();
2224
+ slot.clearTargeting();
2225
+ keys._Object$keys(targeting).forEach(function (key) {
2226
+ slot.setTargeting(key, targeting[key]);
2227
+ });
2228
+ slot.setTargeting('pos', pos);
2229
+ }
2230
+ });
2231
+ index.lib_3.refresh(leaderboardSlotId);
2232
+ }
2233
+ });
2234
+ }
2235
+ };
2236
+
2237
+ var hasVerticalScroll = function hasVerticalScroll() {
2238
+ if (window.innerHeight) {
2239
+ return document.body.offsetHeight > window.innerHeight;
2240
+ } else {
2241
+ return document.documentElement.scrollHeight > document.documentElement.offsetHeight || document.body.scrollHeight > document.body.offsetHeight;
2242
+ }
2243
+ };
2244
+
2245
+ React.useEffect(function () {
2246
+ // Fetching related article after component mounted if vertical scroll not found
2247
+ setTimeout(function () {
2248
+ if (!hasVerticalScroll()) {
2249
+ loadmore();
2250
+ }
2251
+ }, 1000);
2252
+ }, [queueData.length]);
2253
+
2254
+ var loadmore = function () {
2255
+ var _ref = asyncToGenerator._asyncToGenerator( /*#__PURE__*/asyncToGenerator.regenerator.mark(function _callee() {
2256
+ var index, article, startingIndex, endingIndex, targeting;
2257
+ return asyncToGenerator.regenerator.wrap(function _callee$(_context) {
2258
+ while (1) {
2259
+ switch (_context.prev = _context.next) {
2260
+ case 0:
2261
+ if (!(queueData && queueData.length < maxListLength)) {
2262
+ _context.next = 27;
2263
+ break;
2264
+ }
2265
+
2266
+ index = queueData.length - 1;
2267
+ article = null;
2268
+ _context.prev = 3;
2269
+ _context.next = 6;
2270
+ return getRelatedArticle(null, props.client, props.article, prevUrl, index);
2271
+
2272
+ case 6:
2273
+ article = _context.sent;
2274
+ _context.next = 12;
2275
+ break;
2276
+
2277
+ case 9:
2278
+ _context.prev = 9;
2279
+ _context.t0 = _context['catch'](3);
2280
+
2281
+ console.error(_context.t0);
2282
+
2283
+ case 12:
2284
+ if (!(article && article._id)) {
2285
+ _context.next = 27;
2286
+ break;
2287
+ }
2288
+
2289
+ //query next 4 related article without repeating previous 4 related articles
2290
+ startingIndex = queueData.length + 1;
2291
+ endingIndex = startingIndex + 2;
2292
+ _context.prev = 15;
2293
+ _context.next = 18;
2294
+ return getRelatedArticle(null, props.client, props.article, prevUrl, startingIndex + '..' + endingIndex);
2295
+
2296
+ case 18:
2297
+ article.relatedArticle = _context.sent;
2298
+ _context.next = 24;
2299
+ break;
2300
+
2301
+ case 21:
2302
+ _context.prev = 21;
2303
+ _context.t1 = _context['catch'](15);
2304
+
2305
+ console.error(_context.t1);
2306
+
2307
+ case 24:
2308
+ targeting = getTargeting.getTargeting({ article: article, cpModificationRequired: cpModificationRequired, prevUrl: prevUrl, disablePrevUrlCheckContentPlacement: disablePrevUrlCheckContentPlacement });
2309
+
2310
+ article.Ads = Ads.getRightItems(targeting);
2311
+ setQueueData([].concat(toConsumableArray._toConsumableArray(queueData), [article]));
2312
+
2313
+ case 27:
2314
+ case 'end':
2315
+ return _context.stop();
2316
+ }
2317
+ }
2318
+ }, _callee, _this$1, [[3, 9], [15, 21]]);
2319
+ }));
2320
+
2321
+ return function loadmore() {
2322
+ return _ref.apply(this, arguments);
2323
+ };
2324
+ }();
2325
+
2326
+ var currentPath = router && router.asPath;
2327
+ var seoLinks = props.cache.seoManager && props.cache.seoManager.filter(function (eachDocument) {
2328
+ return eachDocument.urlSeo == currentPath;
2329
+ });
2330
+
2331
+ var metaDescriptionSanity = seoLinks && seoLinks.length == 1 && seoLinks[0].metaDescription;
2332
+ var metaTitleSanity = seoLinks && seoLinks.length == 1 && seoLinks[0].metaTitle;
2333
+ // let urlSeo = seoLinks && seoLinks.length ==1 && seoLinks[0].urlSeo
2334
+
2335
+ var changeMetaFromSanity = function changeMetaFromSanity(metaDescription, metaTitle, oldMeta) {
2336
+ document.title = metaTitle;
2337
+ //this was throwing an error if there was no description, doing a check for the description meta
2338
+ if (document.querySelector('meta[name="description"]')) document.querySelector('meta[name="description"]').setAttribute('content', metaDescription);
2339
+ if (document.querySelector('meta[name="keywords"]')) document.querySelector('meta[name="keywords"]').setAttribute('content', oldMeta.shareKeywords);
2340
+ if (document.querySelector('meta[property="og:url"]')) document.querySelector('meta[property="og:url"]').setAttribute('content', oldMeta.shareUrl);
2341
+ if (document.querySelector('meta[property="og:title"]')) document.querySelector('meta[property="og:title"]').setAttribute('content', metaTitle);
2342
+ if (document.querySelector('meta[property="og:site_name"]')) document.querySelector('meta[property="og:site_name"]').setAttribute('content', oldMeta.shareVia);
2343
+ if (document.querySelector('meta[property="og:description"]')) document.querySelector('meta[property="og:description"]').setAttribute('content', metaDescription);
2344
+ if (document.querySelector('meta[name="twitter:title"]')) document.querySelector('meta[name="twitter:title"]').setAttribute('content', metaTitle);
2345
+ if (document.querySelector('meta[name="twitter:image"]')) document.querySelector('meta[name="twitter:image"]').setAttribute('content', oldMeta.shareImage);
2346
+ if (document.querySelector('meta[name="twitter:site"]')) document.querySelector('meta[name="twitter:site"]').setAttribute('content', oldMeta.shareVia);
2347
+ //this was throwing an error if there was no description, doing a check for the description meta
2348
+ if (document.querySelector('meta[name="twitter:description"]')) document.querySelector('meta[name="twitter:description"]').setAttribute('content', metaDescription);
2349
+ if (canonicalTag && document.querySelector('link[rel="canonical"]')) {
2350
+ document.querySelector('link[rel="canonical"]').setAttribute('href', oldMeta.shareUrl);
2351
+ }
2352
+ };
2353
+
2354
+ var changeMeta = function changeMeta(meta) {
2355
+ document.title = meta.shareTitle;
2356
+ //this was throwing an error if there was no description, doing a check for the description meta
2357
+ if (document.querySelector('meta[name="description"]')) document.querySelector('meta[name="description"]').setAttribute('content', meta.shareSummary);
2358
+ if (document.querySelector('meta[name="keywords"]')) document.querySelector('meta[name="keywords"]').setAttribute('content', meta.shareKeywords);
2359
+ if (document.querySelector('meta[property="og:url"]')) document.querySelector('meta[property="og:url"]').setAttribute('content', meta.shareUrl);
2360
+ if (document.querySelector('meta[property="og:title"]')) document.querySelector('meta[property="og:title"]').setAttribute('content', meta.shareTitle);
2361
+ if (document.querySelector('meta[property="og:site_name"]')) document.querySelector('meta[property="og:site_name"]').setAttribute('content', meta.shareVia);
2362
+ if (document.querySelector('meta[property="og:description"]')) document.querySelector('meta[property="og:description"]').setAttribute('content', meta.shareSummary);
2363
+ if (document.querySelector('meta[name="twitter:title"]')) document.querySelector('meta[name="twitter:title"]').setAttribute('content', meta.shareTitle);
2364
+ if (document.querySelector('meta[name="twitter:image"]')) document.querySelector('meta[name="twitter:image"]').setAttribute('content', meta.shareImage);
2365
+ if (document.querySelector('meta[name="twitter:site"]')) document.querySelector('meta[name="twitter:site"]').setAttribute('content', meta.shareVia);
2366
+ //this was throwing an error if there was no description, doing a check for the description meta
2367
+ if (document.querySelector('meta[name="twitter:description"]')) document.querySelector('meta[name="twitter:description"]').setAttribute('content', meta.shareSummary);
2368
+ if (canonicalTag && document.querySelector('link[rel="canonical"]')) {
2369
+ document.querySelector('link[rel="canonical"]').setAttribute('href', meta.shareUrl);
2370
+ }
2371
+ };
2372
+
2373
+ var onChangeArticle = function onChangeArticle(path, meta, pageviewProperties) {
2374
+ var newPath = '/view/' + path;
2375
+ var activeArticle = queueData.find(function (item) {
2376
+ return item.url.current === path;
2377
+ });
2378
+ setActive(function () {
2379
+ return activeArticle._id;
2380
+ });
2381
+ // Change URL and do other changes
2382
+ window.history.pushState({ page: path }, meta.shareTitle, newPath);
2383
+
2384
+ if (metaDescriptionSanity && metaTitleSanity && currentPath == newPath) {
2385
+ changeMetaFromSanity(metaDescriptionSanity, metaTitleSanity, meta);
2386
+ } else {
2387
+ changeMeta(meta);
2388
+ }
2389
+ if (props.setCustomDimensions) {
2390
+ props.setCustomDimensions(activeArticle, '200', prevUrl, '');
2391
+ }
2392
+ if (props.pageview) props.pageview(newPath, null, pageviewProperties);
2393
+ if (props.gtagSetCustomDimensions) props.gtagSetCustomDimensions(activeArticle, '200', prevUrl, '', true);
2394
+ refreshAD(path);
2395
+ };
2396
+
2397
+ return React__default["default"].createElement(
2398
+ index_es.InfiniteScroll,
2399
+ { dataLength: queueData.length, next: loadmore, scrollThreshold: '40%', hasMore: true, style: { overflow: 'hidden' } },
2400
+ queueData.map(function (article, index) {
2401
+ return React__default["default"].createElement(
2402
+ React__default["default"].Fragment,
2403
+ { key: index },
2404
+ React__default["default"].createElement(Article, _extends._extends({}, props, {
2405
+ containerHeight: containerHeight,
2406
+ onChangeArticle: onChangeArticle,
2407
+ authorPrfix: authorPrefix,
2408
+ article: article,
2409
+ cpModificationRequired: cpModificationRequired,
2410
+ active: active === article._id
2411
+ // Passing queueData to check for single article
2412
+ , queueData: queueData,
2413
+ showRelatedArticles: showRelatedArticles,
2414
+ index: index,
2415
+ showPageNumber: article.issueGroup && article.issueGroup.parent ? article.issueGroup.parent.showPageNumber : null,
2416
+ showIssueNameOnly: article.issueGroup && article.issueGroup.parent ? article.issueGroup.parent.showIssueNameOnly : null
2417
+ }))
2418
+ );
2419
+ })
2420
+ );
2421
+ };
2422
+
2423
+ var _this = undefined;
2424
+
2425
+ var View = function View(props) {
2426
+ var router = Router.useRouter();
2427
+ var shareOptions = props.shareOptions,
2428
+ article = props.article,
2429
+ _props$article = props.article,
2430
+ hideComments = _props$article.hideComments,
2431
+ content_placement = _props$article.content_placement,
2432
+ _props$sponsoredFlag = props.sponsoredFlag,
2433
+ sponsoredFlag = _props$sponsoredFlag === undefined ? false : _props$sponsoredFlag;
2434
+ props.sponsoredTaxonomies;
2435
+ var Ads = props.Ads,
2436
+ setCustomDimensions = props.setCustomDimensions,
2437
+ gtagSetCustomDimensions = props.gtagSetCustomDimensions,
2438
+ statusCode = props.statusCode,
2439
+ prevUrl = props.prevUrl,
2440
+ pageview = props.pageview,
2441
+ _props$showRelatedArt = props.showRelatedArticles,
2442
+ showRelatedArticles = _props$showRelatedArt === undefined ? false : _props$showRelatedArt,
2443
+ _props$canonicalTag = props.canonicalTag,
2444
+ canonicalTag = _props$canonicalTag === undefined ? true : _props$canonicalTag,
2445
+ _props$infiniteScroll = props.infiniteScrollFlag,
2446
+ infiniteScrollFlag = _props$infiniteScroll === undefined ? true : _props$infiniteScroll,
2447
+ emailList = props.emailList,
2448
+ articleRecs = props.articleRecs;
2449
+ var _props$article2 = props.article,
2450
+ _props$article2$passw = _props$article2.passwordLock,
2451
+ passwordLock = _props$article2$passw === undefined ? false : _props$article2$passw;
2452
+ _props$article2.description;
2453
+ var title = _props$article2.title,
2454
+ seriesShareOptions = _props$article2.seriesShareOptions;
2455
+
2456
+ var _useState = React.useState(0),
2457
+ _useState2 = slicedToArray._slicedToArray(_useState, 2),
2458
+ currentPage = _useState2[0],
2459
+ setCurrentPage = _useState2[1];
2460
+ // Logging GA pageview for the initial article with custom dimensions
2461
+
2462
+
2463
+ React.useEffect(function () {
2464
+ if (pageview && setCustomDimensions) {
2465
+ var timer = void 0;
2466
+ var pageviewProperties = _extends._extends({}, getTargeting.getTargeting(props), {
2467
+ category: article && article.category ? article.category.name : ''
2468
+ });
2469
+ var waitAndExicute = function waitAndExicute() {
2470
+ if (typeof window.GA_INITIALIZED !== 'undefined') {
2471
+ setCustomDimensions(article, statusCode, prevUrl, '');
2472
+ pageview(router.asPath, null, pageviewProperties);
2473
+ } else timer = setTimeout(waitAndExicute, 1000);
2474
+ };
2475
+ waitAndExicute();
2476
+ return function () {
2477
+ clearTimeout(timer);
2478
+ };
2479
+ } else if (gtagSetCustomDimensions) {
2480
+ var _timer = void 0;
2481
+ var _waitAndExicute = function _waitAndExicute() {
2482
+ if (typeof window.GA_INITIALIZED !== 'undefined') {
2483
+ gtagSetCustomDimensions(article, statusCode, prevUrl, '', false);
2484
+ } else _timer = setTimeout(_waitAndExicute, 1000);
2485
+ };
2486
+ _waitAndExicute();
2487
+ return function () {
2488
+ clearTimeout(_timer);
2489
+ };
2490
+ }
2491
+ }, []);
2492
+
2493
+ var isVideoSeries = false;
2494
+ // check for certain serializers that need to disable infinite scroll
2495
+ var checkBodyForDisableInfiniteScroll = function checkBodyForDisableInfiniteScroll(article) {
2496
+ if (!article || !article.body) {
2497
+ return false;
2498
+ }
2499
+ for (var i = 0; i < article.body.length; i++) {
2500
+ if (article.body[i]._type === 'articleSeries' || article.body[i]._type === 'slideshows' || article.body[i]._type === 'quiz') {
2501
+ return true;
2502
+ }
2503
+ var row = article.body[i];
2504
+ if (typeof row.videos !== 'undefined') {
2505
+ isVideoSeries = true;
2506
+ return true;
2507
+ }
2508
+ }
2509
+ return false;
2510
+ };
2511
+
2512
+ var isMediaSeries = false;
2513
+
2514
+ if (article.documentGroup && article.documentGroup.isSeries) {
2515
+ isMediaSeries = true;
2516
+ }
2517
+ if (!article.documentGroup && article.documentGroupMapping && checkDocGroupMappingForSeries(article.documentGroupMapping)) {
2518
+ isMediaSeries = true;
2519
+ }
2520
+
2521
+ var disableInfiniteScroll = checkBodyForDisableInfiniteScroll(props.article);
2522
+ var commentsEnabledInTaxonomy = Array.isArray(content_placement) && content_placement.some(function (t) {
2523
+ return t.showComments === true;
2524
+ });
2525
+ var showDisqus = commentsEnabledInTaxonomy || hideComments === false;
2526
+ var needInfiniteScroll = ['Articles', 'Videos', 'Podcasts'].includes(article.category.name) && article.taxonomyMapping && article.passwordLock !== true && !disableInfiniteScroll && !article.ExcludeFromInfiniteScroll && !sponsoredFlag && infiniteScrollFlag && !article.showIsi && !isMediaSeries && !showDisqus;
2527
+
2528
+ if (['Articles', 'Videos', 'Podcasts'].includes(article.category.name)) {
2529
+ title = null;
2530
+ }
2531
+
2532
+ if (!needInfiniteScroll && !title) {
2533
+ title = props.article ? props.article.title : '';
2534
+ }
2535
+ // add mobile ads to articles not using infinite scroll
2536
+ if (!needInfiniteScroll) {
2537
+ var targeting = getTargeting.getTargeting(props);
2538
+ article.Ads = Ads.getRightItems(targeting);
2539
+ if (!sponsoredFlag && Ads.getVideoContextualAD) {
2540
+ article.contextualVideoAD = Ads.getVideoContextualAD(getTargeting.getTargeting(props, 'in-context_video'));
2541
+ }
2542
+ if (!sponsoredFlag && Ads.getNativeContextualAD) {
2543
+ article.contextualAD = Ads.getNativeContextualAD(getTargeting.getTargeting(props, 'native-ad'));
2544
+ }
2545
+ }
2546
+ React.useEffect(function () {
2547
+ router.asPath && router.asPath.length > 0 && router.asPath.includes('?') && router.asPath.split('?')[1].split('&').forEach(function (item) {
2548
+ if (item.includes('page=')) {
2549
+ setCurrentPage(item.split('=')[1]);
2550
+ } else {
2551
+ setCurrentPage(0);
2552
+ }
2553
+ });
2554
+ if (!router.asPath.includes('page=') && currentPage !== 0) {
2555
+ setCurrentPage(0);
2556
+ }
2557
+ }, [router]);
2558
+
2559
+ var meta_description = seriesShareOptions && seriesShareOptions.seriesSummary ? '' + seriesShareOptions.seriesSummary + (currentPage > 0 ? ' | Page ' + currentPage : '') : article.seo && article.seo.meta_description ? '' + article.seo.meta_description + (currentPage > 0 ? ' | Page ' + currentPage : '') : shareOptions.shareSummary ? '' + shareOptions.shareSummary + (currentPage > 0 ? ' | Page ' + currentPage : '') : '' + (currentPage > 0 ? 'Page ' + currentPage : '');
2560
+
2561
+ if (isVideoSeries) {
2562
+ meta_description = seriesShareOptions && seriesShareOptions.seriesSummary ? '' + seriesShareOptions.seriesSummary + (currentPage > 0 ? ' | Page ' + currentPage : '') : '';
2563
+ }
2564
+
2565
+ var currentPath = router && router.asPath;
2566
+ var seoLinks = props.cache.seoManager && props.cache.seoManager.filter(function (eachDocument) {
2567
+ return eachDocument.urlSeo == currentPath;
2568
+ });
2569
+
2570
+ var metaDescriptionSanity = seoLinks && seoLinks.length == 1 && seoLinks[0].metaDescription;
2571
+ var metaTitleSanity = seoLinks && seoLinks.length == 1 && seoLinks[0].metaTitle;
2572
+ return React__default["default"].createElement(
2573
+ React__default["default"].Fragment,
2574
+ null,
2575
+ React__default["default"].createElement(
2576
+ Head__default["default"],
2577
+ null,
2578
+ React__default["default"].createElement(
2579
+ 'title',
2580
+ { key: 'title' },
2581
+ metaTitleSanity ? '' + metaTitleSanity + (currentPage > 0 ? ' | Page ' + currentPage : '') : seriesShareOptions && seriesShareOptions.seriesTitle ? '' + seriesShareOptions.seriesTitle + (currentPage > 0 ? ' | Page ' + currentPage : '') : article && article.seo && article.seo.seo_title ? '' + article.seo.seo_title + (currentPage > 0 ? ' | Page ' + currentPage : '') : '' + article.title + (currentPage > 0 ? ' | Page ' + currentPage : '')
2582
+ ),
2583
+ metaDescriptionSanity ? React__default["default"].createElement('meta', { name: 'description', key: 'description', content: metaDescriptionSanity }) : meta_description && React__default["default"].createElement('meta', { name: 'description', key: 'description', content: meta_description }),
2584
+ React__default["default"].createElement('meta', { name: 'keywords', content: getKeywords(article).join(','), key: 'keywords' }),
2585
+ passwordLock && React__default["default"].createElement('meta', { name: 'robots', content: 'noindex, nofollow' }),
2586
+ !passwordLock && (article.applyNoIndexTag || article.applyNoFollowTag) && React__default["default"].createElement('meta', {
2587
+ name: 'robots',
2588
+ content: article.applyNoIndexTag && article.applyNoFollowTag ? 'noindex, nofollow' : article.applyNoIndexTag && !article.applyNoFollowTag ? 'noindex' : 'nofollow'
2589
+ }),
2590
+ React__default["default"].createElement('meta', {
2591
+ property: 'og:url',
2592
+ content: seriesShareOptions && seriesShareOptions.seriesUrl ? shareOptions.shareUrl + seriesShareOptions.seriesUrl : shareOptions.shareUrl,
2593
+ key: 'og:url'
2594
+ }),
2595
+ React__default["default"].createElement('meta', {
2596
+ property: 'og:title',
2597
+ content: metaTitleSanity ? '' + metaTitleSanity + (currentPage > 0 ? ' | Page ' + currentPage : '') : seriesShareOptions && seriesShareOptions.seriesTitle ? '' + seriesShareOptions.seriesTitle + (currentPage > 0 ? ' | Page ' + currentPage : '') : article.seo && article.seo.seo_title ? '' + article.seo.seo_title + (currentPage > 0 ? ' | Page ' + currentPage : '') : '' + shareOptions.shareTitle + (currentPage > 0 ? ' | Page ' + currentPage : ''),
2598
+ key: 'og:title'
2599
+ }),
2600
+ React__default["default"].createElement('meta', {
2601
+ property: 'og:image',
2602
+ content: seriesShareOptions && seriesShareOptions.seriesThumbnail ? seriesShareOptions.seriesThumbnail : shareOptions.shareImage,
2603
+ key: 'og:image'
2604
+ }),
2605
+ React__default["default"].createElement('meta', { property: 'og:site_name', content: props.Settings.title, key: 'og:site_name' }),
2606
+ metaDescriptionSanity ? React__default["default"].createElement('meta', { property: 'og:description', key: 'og:description', content: metaDescriptionSanity }) : meta_description && React__default["default"].createElement('meta', { property: 'og:description', key: 'og:description', content: meta_description }),
2607
+ React__default["default"].createElement('meta', { name: 'twitter:card', content: 'summary', key: 'twitter:card' }),
2608
+ React__default["default"].createElement('meta', {
2609
+ name: 'twitter:title',
2610
+ content: metaTitleSanity ? '' + metaTitleSanity + (currentPage > 0 ? ' | Page ' + currentPage : '') : seriesShareOptions && seriesShareOptions.seriesTitle ? '' + seriesShareOptions.seriesTitle + (currentPage > 0 ? ' | Page ' + currentPage : '') : article.seo && article.seo.seo_title ? '' + article.seo.seo_title + (currentPage > 0 ? ' | Page ' + currentPage : '') : '' + shareOptions.shareTitle + (currentPage > 0 ? ' | Page ' + currentPage : ''),
2611
+ key: 'twitter:title'
2612
+ }),
2613
+ React__default["default"].createElement('meta', {
2614
+ name: 'twitter:image',
2615
+ content: seriesShareOptions && seriesShareOptions.seriesThumbnail ? seriesShareOptions.seriesThumbnail : shareOptions.shareImage,
2616
+ key: 'twitter:image'
2617
+ }),
2618
+ React__default["default"].createElement('meta', { name: 'twitter:site', content: '@' + props.Settings.title, key: 'twitter:site' }),
2619
+ metaDescriptionSanity ? React__default["default"].createElement('meta', { name: 'twitter:description', key: 'twitter:description', content: metaDescriptionSanity }) : meta_description && React__default["default"].createElement('meta', { name: 'twitter:description', key: 'twitter:description', content: meta_description }),
2620
+ canonicalTag && React__default["default"].createElement('link', {
2621
+ rel: 'canonical',
2622
+ href: seriesShareOptions && seriesShareOptions.seriesUrl ? shareOptions.shareUrl + seriesShareOptions.seriesUrl : shareOptions.shareUrl,
2623
+ key: 'canonical'
2624
+ }),
2625
+ React__default["default"].createElement(
2626
+ 'noscript',
2627
+ null,
2628
+ props.article.seriesDetail && props.article.seriesDetail.prevUrl && React__default["default"].createElement('link', { rel: 'prev', href: props.article.seriesDetail.prevUrl }),
2629
+ props.article.seriesDetail && props.article.seriesDetail.nextUrl && React__default["default"].createElement('link', { rel: 'next', href: props.article.seriesDetail.nextUrl })
2630
+ )
2631
+ ),
2632
+ !needInfiniteScroll ? React__default["default"].createElement(Article, _extends._extends({
2633
+ infiniteScroll: false,
2634
+ showRelatedArticles: showRelatedArticles,
2635
+ showDisqus: showDisqus,
2636
+ emailList: emailList,
2637
+ articleRecs: articleRecs
2638
+ }, props, {
2639
+ showIssueNameOnly: article.issueGroup && article.issueGroup.parent ? article.issueGroup.parent.showIssueNameOnly : null,
2640
+ showPageNumber: article.issueGroup && article.issueGroup.parent ? article.issueGroup.parent.showPageNumber : null
2641
+ })) : React__default["default"].createElement(ArticleQueue, _extends._extends({
2642
+ infiniteScroll: true,
2643
+ showRelatedArticles: showRelatedArticles,
2644
+ canonicalTag: canonicalTag,
2645
+ checkSponsered: true,
2646
+ Ads: props.WAds,
2647
+ onVote: function onVote() {},
2648
+ sponsoredTaxonomies: []
2649
+ }, props))
2650
+ );
2651
+ };
2652
+
2653
+ // This should be called in /view/[url] getInitialProps to fetch the article data and related articles. This will also set the sponsoredFlag to true if any taxonomies have disabled ads.
2654
+ View.returnGetInitialProps = function () {
2655
+ var _ref = asyncToGenerator._asyncToGenerator( /*#__PURE__*/asyncToGenerator.regenerator.mark(function _callee(url, prevUrl, seriesVid, client, sao) {
2656
+ var context = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : null;
2657
+
2658
+ var article, relatedArticleQuery, sliderData, statusCode, sliderArticles, _sliderArticles, _context$query$series, seriesArticle, sponsoredFlag;
2659
+
2660
+ return asyncToGenerator.regenerator.wrap(function _callee$(_context) {
2661
+ while (1) {
2662
+ switch (_context.prev = _context.next) {
2663
+ case 0:
2664
+ _context.next = 2;
2665
+ return client.fetch(getQuery('article'), { url: url });
2666
+
2667
+ case 2:
2668
+ article = _context.sent;
2669
+ relatedArticleQuery = getQuery('related');
2670
+
2671
+ article.seriesDetail = getSeriesDetail(article, seriesVid);
2672
+ sliderData = [];
2673
+ statusCode = 200;
2674
+
2675
+ if (!article || !article._id || !article.body) {
2676
+ statusCode = 404;
2677
+ }
2678
+
2679
+ if (!(article.documentGroup && article.documentGroup.isSeries)) {
2680
+ _context.next = 15;
2681
+ break;
2682
+ }
2683
+
2684
+ _context.next = 11;
2685
+ return client.fetch('*[!(_id in path("drafts.**")) \n && _type == "article"\n && defined(title)\n && references(\'' + article.documentGroup._id + '\')\n && is_visible == true\n && defined(published)\n && dateTime(published) <= dateTime(now())\n ] | order(published asc) {\n title,\n thumbnail,\n url,\n published\n }');
2686
+
2687
+ case 11:
2688
+ sliderArticles = _context.sent;
2689
+
2690
+ sliderData = sliderArticles;
2691
+ _context.next = 20;
2692
+ break;
2693
+
2694
+ case 15:
2695
+ if (!(article.documentGroupMapping && article.documentGroupMapping[0] && article.documentGroupMapping[0].isSeries)) {
2696
+ _context.next = 20;
2697
+ break;
2698
+ }
2699
+
2700
+ _context.next = 18;
2701
+ return client.fetch('*[!(_id in path("drafts.**")) \n && _type == "article"\n && defined(title)\n && references(\'' + article.documentGroupMapping[0]._id + '\')\n && is_visible == true\n && defined(published)\n && dateTime(published) <= dateTime(now())\n ] | order(published asc) {\n title,\n thumbnail,\n url,\n published\n }');
2702
+
2703
+ case 18:
2704
+ _sliderArticles = _context.sent;
2705
+
2706
+ sliderData = _sliderArticles;
2707
+
2708
+ case 20:
2709
+ _context$query$series = context.query.seriesArticle, seriesArticle = _context$query$series === undefined ? false : _context$query$series;
2710
+
2711
+ if ((seriesArticle || seriesVid) && article.body) {
2712
+ article.body.map(function (block) {
2713
+ if (block._type === 'articleSeries' && block.articles && block.articles.length > 0) {
2714
+ block.articles.map(function (subArticle) {
2715
+ if (subArticle.param.current === seriesArticle) {
2716
+ var seriesShareOptions = {
2717
+ seriesUrl: '?seriesArticle=' + seriesArticle,
2718
+ seriesTitle: subArticle.title,
2719
+ seriesSummary: subArticle.summary,
2720
+ seriesThumbnail: subArticle.thumbnail && subArticle.thumbnail.asset ? urlFor({ client: client, source: subArticle.thumbnail.asset }) : null
2721
+ };
2722
+ article.seriesShareOptions = seriesShareOptions;
2723
+ }
2724
+ });
2725
+ }
2726
+ if (block._type === 'youtubeGallery' && block.videos && block.videos.length > 0) {
2727
+ block.videos.map(function (video, index) {
2728
+ if (index + 1 === Number(seriesVid)) {
2729
+ var seriesShareOptions = {
2730
+ seriesUrl: '?seriesVid=' + seriesVid,
2731
+ seriesTitle: video.title,
2732
+ seriesSummary: video.intro,
2733
+ seriesThumbnail: video.thumbnail && video.thumbnail.asset ? urlFor({ client: client, source: video.thumbnail.asset }) : null
2734
+ };
2735
+ article.seriesShareOptions = seriesShareOptions;
2736
+ }
2737
+ });
2738
+ }
2739
+ });
2740
+ }
2741
+ sponsoredFlag = false;
2742
+
2743
+ // check for disableAds flag on each taxonomoy
2744
+
2745
+ if (article && article.content_placement) {
2746
+ article.content_placement.forEach(function (x) {
2747
+ if (x.disableAds) {
2748
+ sponsoredFlag = true;
2749
+ }
2750
+ if (x.applyNoIndexTag) {
2751
+ article.applyNoIndexTag = true;
2752
+ }
2753
+ if (x.applyNoFollowTag) {
2754
+ article.applyNoFollowTag = true;
2755
+ }
2756
+ if (x.disableNativeAds) {
2757
+ article.disableNativeAds = true;
2758
+ }
2759
+ });
2760
+ }
2761
+ // check for disableAds flag on content category
2762
+ if (article.category && article.category.disableAds) {
2763
+ sponsoredFlag = true;
2764
+ }
2765
+
2766
+ if (!article.disableRelatedContent) {
2767
+ _context.next = 30;
2768
+ break;
2769
+ }
2770
+
2771
+ article.relatedArticle = null;
2772
+ _context.next = 34;
2773
+ break;
2774
+
2775
+ case 30:
2776
+ if (!article) {
2777
+ _context.next = 34;
2778
+ break;
2779
+ }
2780
+
2781
+ _context.next = 33;
2782
+ return getRelatedArticle(context, client, article, prevUrl, '0..2');
2783
+
2784
+ case 33:
2785
+ article.relatedArticle = _context.sent;
2786
+
2787
+ case 34:
2788
+
2789
+ //check documentGroup and documentGroupMapping for disableNativeAds:true
2790
+ if (!article.disableNativeAds) {
2791
+ if (article.documentGroup && article.documentGroup.length) {
2792
+ article.documentGroup.forEach(function (docGroup) {
2793
+ var node = docGroup.parent ? docGroup.parent : null;
2794
+ if (docGroup.disableNativeAds) {
2795
+ article.disableNativeAds = true;
2796
+ }
2797
+ while (node) {
2798
+ if (node.disableNativeAds) [article.disableNativeAds = true];
2799
+ node = node.parent || null;
2800
+ }
2801
+ });
2802
+ }
2803
+ if (article.documentGroupMapping && article.documentGroupMapping.length) {
2804
+ article.documentGroupMapping.forEach(function (docGroup) {
2805
+ var node = docGroup.parent ? docGroup.parent : null;
2806
+ if (docGroup.disableNativeAds) {
2807
+ article.disableNativeAds = true;
2808
+ }
2809
+ while (node) {
2810
+ if (node.disableNativeAds) [article.disableNativeAds = true];
2811
+ node = node.parent || null;
2812
+ }
2813
+ });
2814
+ }
2815
+ }
2816
+
2817
+ return _context.abrupt('return', {
2818
+ url: url,
2819
+ sao: sao,
2820
+ statusCode: statusCode,
2821
+ prevUrl: prevUrl,
2822
+ relatedArticleQuery: relatedArticleQuery,
2823
+ article: article,
2824
+ sliderData: sliderData,
2825
+ sponsoredFlag: sponsoredFlag
2826
+ });
2827
+
2828
+ case 36:
2829
+ case 'end':
2830
+ return _context.stop();
2831
+ }
2832
+ }
2833
+ }, _callee, _this);
2834
+ }));
2835
+
2836
+ return function (_x, _x2, _x3, _x4, _x5) {
2837
+ return _ref.apply(this, arguments);
2838
+ };
2839
+ }();
2840
+
2841
+ module.exports = View;