@mjhls/mjh-framework 1.0.849 → 1.0.850-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (263) hide show
  1. package/README.md +168 -168
  2. package/dist/cjs/AD.js +9 -10
  3. package/dist/cjs/AD300x250.js +11 -11
  4. package/dist/cjs/AD300x250x600.js +11 -11
  5. package/dist/cjs/AD728x90.js +12 -12
  6. package/dist/cjs/ADFloatingFooter.js +13 -13
  7. package/dist/cjs/ADFooter.js +8 -9
  8. package/dist/cjs/ADGutter.js +13 -13
  9. package/dist/cjs/{ADInfeed-86e987a0.js → ADInfeed-98c71bcd.js} +9 -11
  10. package/dist/cjs/ADSkyscraper.js +13 -13
  11. package/dist/cjs/ADSponsoredResources.js +13 -13
  12. package/dist/cjs/ADWebcast.js +13 -13
  13. package/dist/cjs/ADWelcome.js +17 -17
  14. package/dist/cjs/{ADlgInfeed-5d6f91d7.js → ADlgInfeed-9de32585.js} +6 -7
  15. package/dist/cjs/AccordionPanel.js +22 -24
  16. package/dist/cjs/AdSlot.js +15 -15
  17. package/dist/cjs/AdSlotsProvider.js +903 -11
  18. package/dist/cjs/AlgoliaSearch.js +14011 -48
  19. package/dist/cjs/AlphabeticList.js +16 -17
  20. package/dist/cjs/ArticleCarousel.js +11 -12
  21. package/dist/cjs/ArticleProgramLandingPage.js +24 -25
  22. package/dist/cjs/ArticleSeriesLandingPage.js +21 -21
  23. package/dist/cjs/ArticleSeriesListing.js +41 -41
  24. package/dist/cjs/Auth.js +144 -232
  25. package/dist/cjs/AuthWrapper.js +561 -26
  26. package/dist/cjs/{AuthorComponent-ac8972ce.js → AuthorComponent-bb831b74.js} +12 -13
  27. package/dist/cjs/{BlockContent-8b494587.js → BlockContent-091a991f.js} +24 -25
  28. package/dist/cjs/Breadcrumbs.js +21 -23
  29. package/dist/cjs/CMEDeck.js +65 -64
  30. package/dist/cjs/Column1.js +11 -14
  31. package/dist/cjs/Column2.js +19 -22
  32. package/dist/cjs/Column3.js +34 -36
  33. package/dist/cjs/ConferenceArticleCard.js +32 -33
  34. package/dist/cjs/ConferenceBanner-4a16fddc.js +23 -0
  35. package/dist/cjs/DeckContent.js +82 -85
  36. package/dist/cjs/DeckQueue.js +70 -73
  37. package/dist/cjs/{Dfp-0bf098b5.js → Dfp-26baccf1.js} +23 -23
  38. package/dist/cjs/EventsDeck.js +134 -141
  39. package/dist/cjs/ExternalResources.js +48 -49
  40. package/dist/cjs/Feature.js +23 -25
  41. package/dist/cjs/ForbesHero.js +34 -35
  42. package/dist/cjs/GridContent.js +205 -209
  43. package/dist/cjs/GridHero.js +35 -36
  44. package/dist/cjs/GroupDeck.js +48 -49
  45. package/dist/cjs/HamMagazine.js +125 -130
  46. package/dist/cjs/Header.js +12 -14
  47. package/dist/cjs/Hero.js +9 -10
  48. package/dist/cjs/HighlightenVideo.js +16 -17
  49. package/dist/cjs/HorizontalArticleListing.js +38 -39
  50. package/dist/cjs/HorizontalHero.js +23 -24
  51. package/dist/cjs/IssueContentDeck.js +65 -70
  52. package/dist/cjs/IssueDeck.js +61 -66
  53. package/dist/cjs/IssueLanding.js +58 -61
  54. package/dist/cjs/KMTracker.js +15 -15
  55. package/dist/cjs/LeftNav.js +22 -23
  56. package/dist/cjs/MasterDeck.js +59 -59
  57. package/dist/cjs/MediaSeriesLanding.js +909 -801
  58. package/dist/cjs/NavDvm.js +63 -68
  59. package/dist/cjs/{NavFooter-3dcd99a8.js → NavFooter-76c913e3.js} +14 -15
  60. package/dist/cjs/NavMagazine.js +126 -131
  61. package/dist/cjs/NavNative.js +117 -125
  62. package/dist/cjs/OncliveHero.js +17 -17
  63. package/dist/cjs/OncliveLargeHero.js +63 -64
  64. package/dist/cjs/PageFilter.js +8 -9
  65. package/dist/cjs/PartnerDetailListing.js +187 -289
  66. package/dist/cjs/PdfDownload.js +8 -9
  67. package/dist/cjs/PopUpModal.js +13 -15
  68. package/dist/cjs/PubSection.js +20 -22
  69. package/dist/cjs/PubToc.js +7 -8
  70. package/dist/cjs/PublicationDeck.js +59 -64
  71. package/dist/cjs/PublicationLanding.js +110 -114
  72. package/dist/cjs/QueueDeckExpanded.js +1129 -1109
  73. package/dist/cjs/RecentNews.js +19 -20
  74. package/dist/cjs/RelatedContent.js +50 -51
  75. package/dist/cjs/RelatedTopicsDropdown.js +29 -32
  76. package/dist/cjs/RolesDeck.js +27 -32
  77. package/dist/cjs/Search.js +12 -16
  78. package/dist/cjs/Segment.js +362 -337
  79. package/dist/cjs/SeriesListingDeck.js +27 -26
  80. package/dist/cjs/{SeriesSlider-60fa1342.js → SeriesSlider-8bbc989f.js} +37 -38
  81. package/dist/cjs/SideFooter.js +25 -26
  82. package/dist/cjs/SocialIcons.js +9 -10
  83. package/dist/cjs/{SocialSearchComponent-19548e2a.js → SocialSearchComponent-cea213aa.js} +34 -38
  84. package/dist/cjs/SocialShare.js +29 -31
  85. package/dist/cjs/TaxonomyCard.js +55 -60
  86. package/dist/cjs/TaxonomyDescription.js +23 -24
  87. package/dist/cjs/TemplateNormal.js +36 -36
  88. package/dist/cjs/ThumbnailCard.js +17 -19
  89. package/dist/cjs/Ustream.js +21 -22
  90. package/dist/cjs/VerticalHero.js +15 -16
  91. package/dist/cjs/VideoProgramLandingPage.js +41 -45
  92. package/dist/cjs/VideoSeriesCard.js +23 -24
  93. package/dist/cjs/VideoSeriesFilter.js +9 -9
  94. package/dist/cjs/VideoSeriesLandingPage.js +26 -26
  95. package/dist/cjs/VideoSeriesListing.js +58 -58
  96. package/dist/cjs/View.js +201 -205
  97. package/dist/cjs/YahooHero.js +30 -31
  98. package/dist/cjs/YoutubeGroup.js +54 -55
  99. package/dist/cjs/{brightcove-react-player-loader.es-5c98aec7.js → brightcove-react-player-loader.es-156bd4d6.js} +8 -10
  100. package/dist/cjs/events-1b438fe7.js +469 -0
  101. package/dist/cjs/{extends-60837c34.js → extends-0a918631.js} +1 -0
  102. package/dist/cjs/faundadb.js +1 -1
  103. package/dist/cjs/getRelatedArticle.js +131 -67
  104. package/dist/cjs/getSerializers.js +13 -13
  105. package/dist/cjs/{getTargeting-3e45e4d4.js → getTargeting-f1821260.js} +11 -11
  106. package/dist/cjs/getTargeting.js +2 -2
  107. package/dist/cjs/iconBase-68959171.js +3 -0
  108. package/dist/cjs/{index-99edf08a.js → index-3294d3bc.js} +1 -1
  109. package/dist/cjs/{index-9d365128.js → index-96b3db50.js} +10 -12
  110. package/dist/cjs/{index-44481153.js → index-98e01cb9.js} +47 -494
  111. package/dist/cjs/{index-80e98193.js → index-bc88f898.js} +1099 -872
  112. package/dist/cjs/{index-b5eb3ff8.js → index-be0c82be.js} +19 -20
  113. package/dist/cjs/index-e2e62963.js +89 -0
  114. package/dist/cjs/{index.es-f3e47207.js → index.es-9110add6.js} +12 -31
  115. package/dist/cjs/{index.esm-3ffa049c.js → index.esm-4d410430.js} +20 -20
  116. package/dist/cjs/{index.esm-974f47d9.js → index.esm-90433435.js} +15 -6
  117. package/dist/cjs/{index.esm-44f3e2d0.js → index.esm-e32d3e8e.js} +6 -3
  118. package/dist/cjs/{index.esm-05850a2f.js → index.esm-ff47db6f.js} +12 -5
  119. package/dist/cjs/index.js +62 -65
  120. package/dist/cjs/{inherits-87492b40.js → inherits-452ff02c.js} +4 -1
  121. package/dist/cjs/inherits-8d29278d.js +110 -0
  122. package/dist/cjs/{lodash-7fd85bcf.js → lodash-fc2922d0.js} +22 -71
  123. package/dist/cjs/{main-7b5e57b0.js → main-02daeefe.js} +54 -90
  124. package/dist/cjs/{md5-e1ca5797.js → md5-5039b1a6.js} +1 -1
  125. package/dist/cjs/{moment-ca3bd9fb.js → moment-575fe24c.js} +8 -10
  126. package/dist/cjs/{react-social-icons-07939b41.js → react-social-icons-f7f48f71.js} +11 -12
  127. package/dist/cjs/timeDifferenceCalc.js +1 -1
  128. package/dist/cjs/{typeof-9d7f610f.js → typeof-725500bc.js} +1 -1
  129. package/dist/cjs/urlFor.js +3 -3
  130. package/dist/cjs/{visibility-sensor-eb2c5b69.js → visibility-sensor-ad5e3116.js} +5 -7
  131. package/dist/esm/AD.js +7 -7
  132. package/dist/esm/AD300x250.js +10 -9
  133. package/dist/esm/AD300x250x600.js +10 -9
  134. package/dist/esm/AD728x90.js +11 -10
  135. package/dist/esm/ADFloatingFooter.js +12 -11
  136. package/dist/esm/ADFooter.js +6 -6
  137. package/dist/esm/ADGutter.js +12 -11
  138. package/dist/esm/{ADInfeed-4096aff2.js → ADInfeed-bbdd5398.js} +7 -7
  139. package/dist/esm/ADSkyscraper.js +12 -11
  140. package/dist/esm/ADSponsoredResources.js +12 -11
  141. package/dist/esm/ADWebcast.js +12 -11
  142. package/dist/esm/ADWelcome.js +16 -15
  143. package/dist/esm/{ADlgInfeed-8e4fcfbd.js → ADlgInfeed-4473ee3b.js} +4 -4
  144. package/dist/esm/AccordionPanel.js +17 -17
  145. package/dist/esm/AdSlot.js +8 -7
  146. package/dist/esm/AdSlotsProvider.js +904 -11
  147. package/dist/esm/AlgoliaSearch.js +14004 -40
  148. package/dist/esm/AlphabeticList.js +14 -14
  149. package/dist/esm/ArticleCarousel.js +9 -9
  150. package/dist/esm/ArticleProgramLandingPage.js +23 -23
  151. package/dist/esm/ArticleSeriesLandingPage.js +20 -19
  152. package/dist/esm/ArticleSeriesListing.js +38 -37
  153. package/dist/esm/Auth.js +128 -212
  154. package/dist/esm/AuthWrapper.js +561 -24
  155. package/dist/esm/{AuthorComponent-8ffd4679.js → AuthorComponent-34b16174.js} +10 -10
  156. package/dist/esm/Beam.js +1 -1
  157. package/dist/esm/{BlockContent-d05b5b23.js → BlockContent-e9b4ddcf.js} +4 -4
  158. package/dist/esm/Breadcrumbs.js +11 -11
  159. package/dist/esm/CMEDeck.js +63 -62
  160. package/dist/esm/Column1.js +9 -9
  161. package/dist/esm/Column2.js +18 -18
  162. package/dist/esm/Column3.js +33 -32
  163. package/dist/esm/ConferenceArticleCard.js +30 -30
  164. package/dist/esm/{ConferenceBanner-9162d0ca.js → ConferenceBanner-8792ebd2.js} +4 -4
  165. package/dist/esm/DeckContent.js +79 -78
  166. package/dist/esm/DeckQueue.js +66 -65
  167. package/dist/esm/{Dfp-85c9513e.js → Dfp-b7236041.js} +11 -10
  168. package/dist/esm/EventsDeck.js +110 -110
  169. package/dist/esm/ExternalResources.js +44 -44
  170. package/dist/esm/Feature.js +17 -17
  171. package/dist/esm/ForbesHero.js +28 -28
  172. package/dist/esm/GridContent.js +175 -174
  173. package/dist/esm/GridHero.js +29 -29
  174. package/dist/esm/GroupDeck.js +36 -36
  175. package/dist/esm/HamMagazine.js +101 -101
  176. package/dist/esm/Header.js +8 -8
  177. package/dist/esm/Hero.js +7 -7
  178. package/dist/esm/HighlightenVideo.js +14 -14
  179. package/dist/esm/HorizontalArticleListing.js +37 -37
  180. package/dist/esm/HorizontalHero.js +21 -21
  181. package/dist/esm/IssueContentDeck.js +53 -53
  182. package/dist/esm/IssueDeck.js +55 -55
  183. package/dist/esm/IssueLanding.js +57 -59
  184. package/dist/esm/KMTracker.js +15 -15
  185. package/dist/esm/LeftNav.js +19 -18
  186. package/dist/esm/MasterDeck.js +57 -56
  187. package/dist/esm/MediaSeriesLanding.js +673 -562
  188. package/dist/esm/NavDvm.js +47 -47
  189. package/dist/esm/{NavFooter-c29526b7.js → NavFooter-e27bd93b.js} +12 -12
  190. package/dist/esm/NavMagazine.js +104 -104
  191. package/dist/esm/NavNative.js +93 -93
  192. package/dist/esm/OncliveHero.js +15 -14
  193. package/dist/esm/OncliveLargeHero.js +52 -52
  194. package/dist/esm/PageFilter.js +6 -6
  195. package/dist/esm/PartnerDetailListing.js +79 -180
  196. package/dist/esm/PdfDownload.js +6 -6
  197. package/dist/esm/PopUpModal.js +8 -8
  198. package/dist/esm/PubSection.js +19 -20
  199. package/dist/esm/PubToc.js +6 -6
  200. package/dist/esm/PublicationDeck.js +51 -51
  201. package/dist/esm/PublicationLanding.js +97 -97
  202. package/dist/esm/QueueDeckExpanded.js +1120 -1100
  203. package/dist/esm/RecentNews.js +17 -17
  204. package/dist/esm/RelatedContent.js +45 -45
  205. package/dist/esm/RelatedTopicsDropdown.js +21 -21
  206. package/dist/esm/RolesDeck.js +25 -25
  207. package/dist/esm/Search.js +7 -7
  208. package/dist/esm/Segment.js +363 -338
  209. package/dist/esm/SeriesListingDeck.js +22 -21
  210. package/dist/esm/{SeriesSlider-05ecb544.js → SeriesSlider-a866bb21.js} +28 -28
  211. package/dist/esm/SideFooter.js +22 -22
  212. package/dist/esm/SocialIcons.js +7 -7
  213. package/dist/esm/{SocialSearchComponent-47815365.js → SocialSearchComponent-03c3e869.js} +28 -28
  214. package/dist/esm/SocialShare.js +25 -25
  215. package/dist/esm/TaxonomyCard.js +51 -51
  216. package/dist/esm/TaxonomyDescription.js +19 -19
  217. package/dist/esm/TemplateNormal.js +34 -33
  218. package/dist/esm/ThumbnailCard.js +10 -10
  219. package/dist/esm/Ustream.js +19 -19
  220. package/dist/esm/VerticalHero.js +13 -13
  221. package/dist/esm/VideoProgramLandingPage.js +35 -35
  222. package/dist/esm/VideoSeriesCard.js +18 -18
  223. package/dist/esm/VideoSeriesFilter.js +7 -7
  224. package/dist/esm/VideoSeriesLandingPage.js +20 -19
  225. package/dist/esm/VideoSeriesListing.js +55 -54
  226. package/dist/esm/View.js +185 -185
  227. package/dist/esm/YahooHero.js +25 -25
  228. package/dist/esm/YoutubeGroup.js +39 -39
  229. package/dist/esm/{asyncToGenerator-fc1c2e29.js → asyncToGenerator-4877b617.js} +1 -1
  230. package/dist/esm/{brightcove-react-player-loader.es-4abff0b1.js → brightcove-react-player-loader.es-83f53e4e.js} +6 -7
  231. package/dist/esm/events-6c3a7a63.js +467 -0
  232. package/dist/esm/{extends-eb69e8ac.js → extends-6f2fcc99.js} +1 -1
  233. package/dist/esm/faundadb.js +2 -2
  234. package/dist/esm/getRelatedArticle.js +127 -63
  235. package/dist/esm/getRootDocGroup.js +1 -1
  236. package/dist/esm/getSerializers.js +14 -14
  237. package/dist/esm/{getTargeting-9cb7e014.js → getTargeting-bd800589.js} +10 -10
  238. package/dist/esm/getTargeting.js +2 -2
  239. package/dist/esm/{index-1819118a.js → index-41a678ea.js} +41 -487
  240. package/dist/esm/{index-6c12bdd5.js → index-5f7e79e7.js} +4 -4
  241. package/dist/esm/{index-51a80699.js → index-73819142.js} +19 -20
  242. package/dist/esm/index-aaa2dae0.js +85 -0
  243. package/dist/esm/{index-fa2ffe86.js → index-ef6d5dcf.js} +1 -1
  244. package/dist/esm/{index-295b6942.js → index-f2a0d400.js} +1061 -826
  245. package/dist/esm/{index.es-c6222053.js → index.es-29c1cef5.js} +10 -28
  246. package/dist/esm/{index.esm-3fdda599.js → index.esm-29e48d38.js} +15 -6
  247. package/dist/esm/{index.esm-a8ff922c.js → index.esm-cf08bf18.js} +12 -5
  248. package/dist/esm/{index.esm-c6715e80.js → index.esm-f8aaeeeb.js} +6 -3
  249. package/dist/esm/{index.esm-8ee5ff72.js → index.esm-fd746768.js} +18 -17
  250. package/dist/esm/index.js +55 -55
  251. package/dist/esm/inherits-77d5e4fc.js +101 -0
  252. package/dist/esm/{inherits-0d8cda6e.js → inherits-cf8dde54.js} +2 -2
  253. package/dist/esm/{lodash-ec8c6b48.js → lodash-17fdfebb.js} +22 -71
  254. package/dist/esm/{main-747e7d25.js → main-e4a934b2.js} +52 -87
  255. package/dist/esm/{md5-4e42248e.js → md5-9be0e905.js} +1 -1
  256. package/dist/esm/{moment-b6f49411.js → moment-e2f9b20c.js} +8 -10
  257. package/dist/esm/{react-social-icons-3822f1ce.js → react-social-icons-a7d5c5c7.js} +5 -5
  258. package/dist/esm/timeDifferenceCalc.js +1 -1
  259. package/dist/esm/{typeof-af9c50d8.js → typeof-6435ba1c.js} +1 -1
  260. package/dist/esm/urlFor.js +1 -1
  261. package/dist/esm/{visibility-sensor-f40c2564.js → visibility-sensor-72fd8f8b.js} +2 -2
  262. package/package.json +111 -110
  263. package/dist/cjs/ConferenceBanner-6c9e718a.js +0 -24
@@ -9,355 +9,380 @@ require('./core.get-iterator-method-f62321d4.js');
9
9
  require('./web.dom.iterable-a0e279c1.js');
10
10
  var asyncToGenerator = require('./asyncToGenerator-140e5f89.js');
11
11
 
12
- require("babel-polyfill");
12
+ require('babel-polyfill');
13
13
 
14
14
  var Segment = {
15
- identify: function identify(eKey) {
16
- if (!eKey) {
17
- throw new Error('eKey is not present');
18
- }
15
+ identify: function identify(eKey) {
16
+ if (!eKey) {
17
+ throw new Error('eKey is not present');
18
+ }
19
19
 
20
- if (typeof analytics === 'undefined') {
21
- console.error('Segment not initialized', analytics);
22
- return;
23
- }
20
+ if (typeof analytics === 'undefined') {
21
+ console.error('Segment not initialized', analytics);
22
+ return;
23
+ }
24
24
 
25
- var buff = Buffer.from(eKey, 'base64');
26
- var email = buff.toString('ascii');
25
+ var buff = Buffer.from(eKey, 'base64');
26
+ var email = buff.toString('ascii');
27
27
 
28
- analytics.identify(eKey, {
29
- email: email
30
- });
31
- },
32
- getURL: function getURL(url) {
33
- var data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
28
+ analytics.identify(eKey, {
29
+ email: email
30
+ });
31
+ },
32
+ getURL: function getURL(url) {
33
+ var data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
34
34
 
35
- if (!data || !data.needSegmentSupport) {
36
- return url;
37
- }
35
+ if (!data || !data.needSegmentSupport) {
36
+ return url;
37
+ }
38
38
 
39
- if (typeof analytics === 'undefined') {
40
- console.error('segment not defined');
41
- return url;
42
- }
39
+ if (typeof analytics === 'undefined') {
40
+ console.error('segment not defined');
41
+ return url;
42
+ }
43
43
 
44
- if (!analytics || typeof analytics.user !== 'function') {
45
- console.error('segment not defined: user function');
46
- return url;
47
- }
44
+ if (!analytics || typeof analytics.user !== 'function') {
45
+ console.error('segment not defined: user function');
46
+ return url;
47
+ }
48
48
 
49
- var user = analytics.user();
50
- if (!user) {
51
- console.log('segment user not defined');
52
- return url;
53
- }
49
+ var user = analytics.user();
50
+ if (!user) {
51
+ console.log('segment user not defined');
52
+ return url;
53
+ }
54
54
 
55
- var anonymouseId = user.anonymousId();
56
- //const eKey = Beam.proc_eKey(Beam.proc_url())
57
- var eKey = user._getId();
58
- if (eKey) {
59
- url += (url.includes('?') ? '&' : '?') + 'ekey=' + eKey;
60
- } else {
61
- url += (url.includes('?') ? '&' : '?') + 'anonymousid=' + anonymouseId;
62
- }
55
+ var anonymouseId = user.anonymousId();
56
+ //const eKey = Beam.proc_eKey(Beam.proc_url())
57
+ var eKey = user._getId();
58
+ if (eKey) {
59
+ url += (url.includes('?') ? '&' : '?') + 'ekey=' + eKey;
60
+ } else {
61
+ url += (url.includes('?') ? '&' : '?') + 'anonymousid=' + anonymouseId;
62
+ }
63
63
 
64
- return url;
65
- },
66
- getIDs: function getIDs() {
67
- var _this = this;
68
-
69
- return asyncToGenerator._asyncToGenerator( /*#__PURE__*/asyncToGenerator.regenerator.mark(function _callee() {
70
- var res, json;
71
- return asyncToGenerator.regenerator.wrap(function _callee$(_context) {
72
- while (1) {
73
- switch (_context.prev = _context.next) {
74
- case 0:
75
- _context.next = 2;
76
- return fetch('https://beam.mjhlifesciences.com/api/beam/id', {
77
- headers: {
78
- 'Content-Type': 'application/json',
79
- Accept: 'application/json'
80
- },
81
- method: 'post',
82
- credentials: 'include'
83
- });
84
-
85
- case 2:
86
- res = _context.sent;
87
- _context.next = 5;
88
- return res.json();
89
-
90
- case 5:
91
- json = _context.sent;
92
- return _context.abrupt('return', json);
93
-
94
- case 7:
95
- case 'end':
96
- return _context.stop();
97
- }
98
- }
99
- }, _callee, _this);
100
- }))();
101
- },
102
- pageview: function pageview(domain) {
103
- var _this2 = this;
104
-
105
- return asyncToGenerator._asyncToGenerator( /*#__PURE__*/asyncToGenerator.regenerator.mark(function _callee2() {
106
- var result, beam_id, session_id;
107
- return asyncToGenerator.regenerator.wrap(function _callee2$(_context2) {
108
- while (1) {
109
- switch (_context2.prev = _context2.next) {
110
- case 0:
111
- if (!(typeof analytics === 'undefined')) {
112
- _context2.next = 3;
113
- break;
114
- }
115
-
116
- console.error('Segment not initialized', window);
117
- return _context2.abrupt('return');
118
-
119
- case 3:
120
- _context2.next = 5;
121
- return _this2.getIDs();
122
-
123
- case 5:
124
- result = _context2.sent;
125
- beam_id = result.beam_id ? result.beam_id : '';
126
- session_id = result.session_id ? result.session_id : '';
127
-
128
-
129
- analytics.track('pageviews', {
130
- beamid: beam_id,
131
- sessionid: session_id,
132
- category: '',
133
- domain: domain
134
- });
135
-
136
- case 9:
137
- case 'end':
138
- return _context2.stop();
139
- }
140
- }
141
- }, _callee2, _this2);
142
- }))();
143
- },
144
- report_video_event: function report_video_event(action, deviceType, duration, current, segmentData) {
145
- var videoType = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 'Youtube';
146
- var brightCovePlayerID = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : '';
147
-
148
- var _this3 = this;
149
-
150
- var brightCoveAccountID = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : '';
151
- var brightCoveVideoID = arguments.length > 8 && arguments[8] !== undefined ? arguments[8] : '';
152
- return asyncToGenerator._asyncToGenerator( /*#__PURE__*/asyncToGenerator.regenerator.mark(function _callee3() {
153
- var result, beam_id, session_id, domain, data;
154
- return asyncToGenerator.regenerator.wrap(function _callee3$(_context3) {
155
- while (1) {
156
- switch (_context3.prev = _context3.next) {
157
- case 0:
158
- if (!(typeof analytics === 'undefined')) {
159
- _context3.next = 3;
160
- break;
161
- }
162
-
163
- console.error('Segment not initialized');
164
- return _context3.abrupt('return');
165
-
166
- case 3:
167
- _context3.next = 5;
168
- return _this3.getIDs();
169
-
170
- case 5:
171
- result = _context3.sent;
172
- beam_id = result.beam_id ? result.beam_id : '';
173
- session_id = result.session_id ? result.session_id : '';
174
- domain = typeof window !== 'undefined' && window.location ? window.location.hostname : '';
175
- data = {
176
- beamid: beam_id,
177
- sessionid: session_id,
178
- domain: domain,
179
- Devicetype: deviceType,
180
- videoid: brightCoveVideoID,
181
- title: '',
182
- category: '',
183
- videoplayer: videoType,
184
- totalduration: duration,
185
- currentduration: current,
186
- segment: segmentData,
187
- queue: Math.floor(duration / 10),
188
- brightCovePlayerID: brightCovePlayerID,
189
- brightCoveAccountID: brightCoveAccountID
190
- };
191
-
192
-
193
- console.log('Segment ' + videoType, action, data);
194
-
195
- analytics.track(action, data);
196
-
197
- case 12:
198
- case 'end':
199
- return _context3.stop();
200
- }
201
- }
202
- }, _callee3, _this3);
203
- }))();
204
- },
205
- report_ad_event: function report_ad_event(action, deviceType, duration) {
206
- var adType = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 'brightcove';
207
- var adId = arguments[4];
208
-
209
- var _this4 = this;
210
-
211
- var brightCovePlayerID = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : '';
212
- var brightCoveAccountID = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : '';
213
- return asyncToGenerator._asyncToGenerator( /*#__PURE__*/asyncToGenerator.regenerator.mark(function _callee4() {
214
- var result, beam_id, session_id, domain, data;
215
- return asyncToGenerator.regenerator.wrap(function _callee4$(_context4) {
216
- while (1) {
217
- switch (_context4.prev = _context4.next) {
218
- case 0:
219
- if (!(typeof analytics === 'undefined')) {
220
- _context4.next = 3;
221
- break;
222
- }
223
-
224
- console.error('Segment not initialized');
225
- return _context4.abrupt('return');
226
-
227
- case 3:
228
- _context4.next = 5;
229
- return _this4.getIDs();
230
-
231
- case 5:
232
- result = _context4.sent;
233
- beam_id = result.beam_id ? result.beam_id : '';
234
- session_id = result.session_id ? result.session_id : '';
235
- domain = typeof window !== 'undefined' && window.location ? window.location.hostname : '';
236
- data = {
237
- beamid: beam_id,
238
- sessionid: session_id,
239
- domain: domain,
240
- Devicetype: deviceType,
241
- title: '',
242
- category: '',
243
- adType: adType,
244
- totalduration: duration,
245
- adId: adId,
246
- brightCovePlayerID: brightCovePlayerID,
247
- brightCoveAccountID: brightCoveAccountID
248
- };
249
-
250
-
251
- console.log('Segment ' + adType, action, data);
252
-
253
- analytics.track(action, data);
254
-
255
- case 12:
256
- case 'end':
257
- return _context4.stop();
258
- }
259
- }
260
- }, _callee4, _this4);
261
- }))();
262
- },
263
- adClicked: function adClicked(domain, advertiserid, campaignid, creativeid, itemid, size, isemptyline, sourceAgnosticCreativeId, sourceAgnosticlineId) {
264
- var _this5 = this;
265
-
266
- return asyncToGenerator._asyncToGenerator( /*#__PURE__*/asyncToGenerator.regenerator.mark(function _callee5() {
267
- var result, beam_id, session_id;
268
- return asyncToGenerator.regenerator.wrap(function _callee5$(_context5) {
269
- while (1) {
270
- switch (_context5.prev = _context5.next) {
271
- case 0:
272
- if (!(typeof analytics === 'undefined')) {
273
- _context5.next = 3;
274
- break;
275
- }
276
-
277
- console.error('Segment not initialized');
278
- return _context5.abrupt('return');
279
-
280
- case 3:
281
- _context5.next = 5;
282
- return _this5.getIDs();
283
-
284
- case 5:
285
- result = _context5.sent;
286
- beam_id = result.beam_id ? result.beam_id : '';
287
- session_id = result.session_id ? result.session_id : '';
288
-
289
-
290
- analytics.track('Ad Clicked', {
291
- beamid: beam_id,
292
- sessionid: session_id,
293
- advertiserid: advertiserid,
294
- campaignid: campaignid,
295
- creativeid: creativeid,
296
- itemid: itemid,
297
- size: size,
298
- isemptyline: isemptyline,
299
- sourceAgnosticCreativeId: sourceAgnosticCreativeId,
300
- sourceAgnosticlineId: sourceAgnosticlineId,
301
- domain: domain
302
- });
303
-
304
- case 9:
305
- case 'end':
306
- return _context5.stop();
307
- }
308
- }
309
- }, _callee5, _this5);
310
- }))();
311
- },
312
- adViewed: function adViewed(domain, advertiserid, campaignid, creativeid, itemid, size, isemptyline, sourceAgnosticCreativeId, sourceAgnosticlineId) {
313
- var _this6 = this;
314
-
315
- return asyncToGenerator._asyncToGenerator( /*#__PURE__*/asyncToGenerator.regenerator.mark(function _callee6() {
316
- var result, beam_id, session_id;
317
- return asyncToGenerator.regenerator.wrap(function _callee6$(_context6) {
318
- while (1) {
319
- switch (_context6.prev = _context6.next) {
320
- case 0:
321
- if (!(typeof analytics === 'undefined')) {
322
- _context6.next = 3;
323
- break;
324
- }
325
-
326
- console.error('Segment not initialized');
327
- return _context6.abrupt('return');
328
-
329
- case 3:
330
- _context6.next = 5;
331
- return _this6.getIDs();
332
-
333
- case 5:
334
- result = _context6.sent;
335
- beam_id = result.beam_id ? result.beam_id : '';
336
- session_id = result.session_id ? result.session_id : '';
337
-
338
-
339
- analytics.track('Impression Viewed', {
340
- beamid: beam_id,
341
- sessionid: session_id,
342
- advertiserid: advertiserid,
343
- campaignid: campaignid,
344
- creativeid: creativeid,
345
- itemid: itemid,
346
- size: size,
347
- isemptyline: isemptyline,
348
- sourceAgnosticCreativeId: sourceAgnosticCreativeId,
349
- sourceAgnosticlineId: sourceAgnosticlineId,
350
- domain: domain
351
- });
352
-
353
- case 9:
354
- case 'end':
355
- return _context6.stop();
356
- }
357
- }
358
- }, _callee6, _this6);
359
- }))();
64
+ return url;
65
+ },
66
+ getIDs: function getIDs() {
67
+ var _this = this;
68
+
69
+ return asyncToGenerator._asyncToGenerator( /*#__PURE__*/asyncToGenerator.regenerator.mark(function _callee() {
70
+ var res, json;
71
+ return asyncToGenerator.regenerator.wrap(function _callee$(_context) {
72
+ while (1) {
73
+ switch (_context.prev = _context.next) {
74
+ case 0:
75
+ _context.next = 2;
76
+ return fetch('https://beam.mjhlifesciences.com/api/beam/id', {
77
+ headers: {
78
+ 'Content-Type': 'application/json',
79
+ Accept: 'application/json'
80
+ },
81
+ method: 'post',
82
+ credentials: 'include'
83
+ });
84
+
85
+ case 2:
86
+ res = _context.sent;
87
+ _context.next = 5;
88
+ return res.json();
89
+
90
+ case 5:
91
+ json = _context.sent;
92
+ return _context.abrupt('return', json);
93
+
94
+ case 7:
95
+ case 'end':
96
+ return _context.stop();
97
+ }
98
+ }
99
+ }, _callee, _this);
100
+ }))();
101
+ },
102
+ getMeta: function getMeta(metaName) {
103
+ var metas = document.getElementsByTagName('meta');
104
+ for (var i = 0; i < metas.length; i++) {
105
+ if (metas[i].getAttribute('name') === metaName) {
106
+ return metas[i].getAttribute('content');
107
+ }
360
108
  }
109
+
110
+ return '';
111
+ },
112
+ pageview: function pageview(domain) {
113
+ var _this2 = this;
114
+
115
+ return asyncToGenerator._asyncToGenerator( /*#__PURE__*/asyncToGenerator.regenerator.mark(function _callee2() {
116
+ var result, beam_id, session_id;
117
+ return asyncToGenerator.regenerator.wrap(function _callee2$(_context2) {
118
+ while (1) {
119
+ switch (_context2.prev = _context2.next) {
120
+ case 0:
121
+ if (!(typeof analytics === 'undefined')) {
122
+ _context2.next = 3;
123
+ break;
124
+ }
125
+
126
+ console.error('Segment not initialized', window);
127
+ return _context2.abrupt('return');
128
+
129
+ case 3:
130
+ _context2.next = 5;
131
+ return _this2.getIDs();
132
+
133
+ case 5:
134
+ result = _context2.sent;
135
+ beam_id = result.beam_id ? result.beam_id : '';
136
+ session_id = result.session_id ? result.session_id : '';
137
+
138
+ analytics.page({
139
+ keywords: _this2.getMeta('keywords')
140
+ });
141
+ analytics.track('pageviews', {
142
+ beamid: beam_id,
143
+ sessionid: session_id,
144
+ category: '',
145
+ domain: domain,
146
+ keywords: _this2.getMeta('keywords')
147
+ });
148
+
149
+ case 10:
150
+ case 'end':
151
+ return _context2.stop();
152
+ }
153
+ }
154
+ }, _callee2, _this2);
155
+ }))();
156
+ },
157
+ report_video_event: function report_video_event(action, deviceType, duration, current, segmentData) {
158
+ var videoType = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 'Youtube';
159
+ var brightCovePlayerID = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : '';
160
+
161
+ var _this3 = this;
162
+
163
+ var brightCoveAccountID = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : '';
164
+ var brightCoveVideoID = arguments.length > 8 && arguments[8] !== undefined ? arguments[8] : '';
165
+ return asyncToGenerator._asyncToGenerator( /*#__PURE__*/asyncToGenerator.regenerator.mark(function _callee3() {
166
+ var result, beam_id, session_id, domain, data;
167
+ return asyncToGenerator.regenerator.wrap(function _callee3$(_context3) {
168
+ while (1) {
169
+ switch (_context3.prev = _context3.next) {
170
+ case 0:
171
+ if (!(typeof analytics === 'undefined')) {
172
+ _context3.next = 3;
173
+ break;
174
+ }
175
+
176
+ console.error('Segment not initialized');
177
+ return _context3.abrupt('return');
178
+
179
+ case 3:
180
+ _context3.next = 5;
181
+ return _this3.getIDs();
182
+
183
+ case 5:
184
+ result = _context3.sent;
185
+ beam_id = result.beam_id ? result.beam_id : '';
186
+ session_id = result.session_id ? result.session_id : '';
187
+ domain = typeof window !== 'undefined' && window.location ? window.location.hostname : '';
188
+ data = {
189
+ beamid: beam_id,
190
+ sessionid: session_id,
191
+ domain: domain,
192
+ Devicetype: deviceType,
193
+ videoid: brightCoveVideoID,
194
+ title: '',
195
+ category: '',
196
+ videoplayer: videoType,
197
+ totalduration: duration,
198
+ currentduration: current,
199
+ segment: segmentData,
200
+ queue: Math.floor(duration / 10),
201
+ brightCovePlayerID: brightCovePlayerID,
202
+ brightCoveAccountID: brightCoveAccountID,
203
+ keywords: _this3.getMeta('keywords')
204
+ };
205
+
206
+
207
+ console.log('Segment ' + videoType, action, data);
208
+ analytics.page({
209
+ keywords: _this3.getMeta('keywords')
210
+ });
211
+ analytics.track(action, data);
212
+
213
+ case 13:
214
+ case 'end':
215
+ return _context3.stop();
216
+ }
217
+ }
218
+ }, _callee3, _this3);
219
+ }))();
220
+ },
221
+ report_ad_event: function report_ad_event(action, deviceType, duration) {
222
+ var adType = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 'brightcove';
223
+ var adId = arguments[4];
224
+
225
+ var _this4 = this;
226
+
227
+ var brightCovePlayerID = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : '';
228
+ var brightCoveAccountID = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : '';
229
+ return asyncToGenerator._asyncToGenerator( /*#__PURE__*/asyncToGenerator.regenerator.mark(function _callee4() {
230
+ var result, beam_id, session_id, domain, data;
231
+ return asyncToGenerator.regenerator.wrap(function _callee4$(_context4) {
232
+ while (1) {
233
+ switch (_context4.prev = _context4.next) {
234
+ case 0:
235
+ if (!(typeof analytics === 'undefined')) {
236
+ _context4.next = 3;
237
+ break;
238
+ }
239
+
240
+ console.error('Segment not initialized');
241
+ return _context4.abrupt('return');
242
+
243
+ case 3:
244
+ _context4.next = 5;
245
+ return _this4.getIDs();
246
+
247
+ case 5:
248
+ result = _context4.sent;
249
+ beam_id = result.beam_id ? result.beam_id : '';
250
+ session_id = result.session_id ? result.session_id : '';
251
+ domain = typeof window !== 'undefined' && window.location ? window.location.hostname : '';
252
+ data = {
253
+ beamid: beam_id,
254
+ sessionid: session_id,
255
+ domain: domain,
256
+ Devicetype: deviceType,
257
+ title: '',
258
+ category: '',
259
+ adType: adType,
260
+ totalduration: duration,
261
+ adId: adId,
262
+ brightCovePlayerID: brightCovePlayerID,
263
+ brightCoveAccountID: brightCoveAccountID,
264
+ keywords: _this4.getMeta('keywords')
265
+ };
266
+
267
+
268
+ console.log('Segment ' + adType, action, data);
269
+ analytics.page({
270
+ keywords: _this4.getMeta('keywords')
271
+ });
272
+ analytics.track(action, data);
273
+
274
+ case 13:
275
+ case 'end':
276
+ return _context4.stop();
277
+ }
278
+ }
279
+ }, _callee4, _this4);
280
+ }))();
281
+ },
282
+ adClicked: function adClicked(domain, advertiserid, campaignid, creativeid, itemid, size, isemptyline, sourceAgnosticCreativeId, sourceAgnosticlineId) {
283
+ var _this5 = this;
284
+
285
+ return asyncToGenerator._asyncToGenerator( /*#__PURE__*/asyncToGenerator.regenerator.mark(function _callee5() {
286
+ var result, beam_id, session_id;
287
+ return asyncToGenerator.regenerator.wrap(function _callee5$(_context5) {
288
+ while (1) {
289
+ switch (_context5.prev = _context5.next) {
290
+ case 0:
291
+ if (!(typeof analytics === 'undefined')) {
292
+ _context5.next = 3;
293
+ break;
294
+ }
295
+
296
+ console.error('Segment not initialized');
297
+ return _context5.abrupt('return');
298
+
299
+ case 3:
300
+ _context5.next = 5;
301
+ return _this5.getIDs();
302
+
303
+ case 5:
304
+ result = _context5.sent;
305
+ beam_id = result.beam_id ? result.beam_id : '';
306
+ session_id = result.session_id ? result.session_id : '';
307
+
308
+ analytics.page({
309
+ keywords: _this5.getMeta('keywords')
310
+ });
311
+ analytics.track('Ad Clicked', {
312
+ beamid: beam_id,
313
+ sessionid: session_id,
314
+ advertiserid: advertiserid,
315
+ campaignid: campaignid,
316
+ creativeid: creativeid,
317
+ itemid: itemid,
318
+ size: size,
319
+ isemptyline: isemptyline,
320
+ sourceAgnosticCreativeId: sourceAgnosticCreativeId,
321
+ sourceAgnosticlineId: sourceAgnosticlineId,
322
+ domain: domain,
323
+ keywords: _this5.getMeta('keywords')
324
+ });
325
+
326
+ case 10:
327
+ case 'end':
328
+ return _context5.stop();
329
+ }
330
+ }
331
+ }, _callee5, _this5);
332
+ }))();
333
+ },
334
+ adViewed: function adViewed(domain, advertiserid, campaignid, creativeid, itemid, size, isemptyline, sourceAgnosticCreativeId, sourceAgnosticlineId) {
335
+ var _this6 = this;
336
+
337
+ return asyncToGenerator._asyncToGenerator( /*#__PURE__*/asyncToGenerator.regenerator.mark(function _callee6() {
338
+ var result, beam_id, session_id;
339
+ return asyncToGenerator.regenerator.wrap(function _callee6$(_context6) {
340
+ while (1) {
341
+ switch (_context6.prev = _context6.next) {
342
+ case 0:
343
+ if (!(typeof analytics === 'undefined')) {
344
+ _context6.next = 3;
345
+ break;
346
+ }
347
+
348
+ console.error('Segment not initialized');
349
+ return _context6.abrupt('return');
350
+
351
+ case 3:
352
+ _context6.next = 5;
353
+ return _this6.getIDs();
354
+
355
+ case 5:
356
+ result = _context6.sent;
357
+ beam_id = result.beam_id ? result.beam_id : '';
358
+ session_id = result.session_id ? result.session_id : '';
359
+
360
+ analytics.page({
361
+ keywords: _this6.getMeta('keywords')
362
+ });
363
+ analytics.track('Impression Viewed', {
364
+ beamid: beam_id,
365
+ sessionid: session_id,
366
+ advertiserid: advertiserid,
367
+ campaignid: campaignid,
368
+ creativeid: creativeid,
369
+ itemid: itemid,
370
+ size: size,
371
+ isemptyline: isemptyline,
372
+ sourceAgnosticCreativeId: sourceAgnosticCreativeId,
373
+ sourceAgnosticlineId: sourceAgnosticlineId,
374
+ domain: domain,
375
+ keywords: _this6.getMeta('keywords')
376
+ });
377
+
378
+ case 10:
379
+ case 'end':
380
+ return _context6.stop();
381
+ }
382
+ }
383
+ }, _callee6, _this6);
384
+ }))();
385
+ }
361
386
  };
362
387
 
363
388
  module.exports = Segment;