@mjhls/mjh-framework 1.0.844-segment-update-v1 → 1.0.844

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 (287) hide show
  1. package/README.md +168 -168
  2. package/dist/cjs/AD.js +1 -1
  3. package/dist/cjs/AD300x250.js +24 -24
  4. package/dist/cjs/AD300x250x600.js +24 -24
  5. package/dist/cjs/AD728x90.js +27 -27
  6. package/dist/cjs/ADFloatingFooter.js +23 -23
  7. package/dist/cjs/ADFooter.js +6 -6
  8. package/dist/cjs/ADGutter.js +23 -23
  9. package/dist/cjs/{ADInfeed-25d48cc2.js → ADInfeed-9d179b24.js} +4 -4
  10. package/dist/cjs/ADSkyscraper.js +23 -23
  11. package/dist/cjs/ADSponsoredResources.js +23 -23
  12. package/dist/cjs/ADWebcast.js +23 -23
  13. package/dist/cjs/ADWelcome.js +20 -20
  14. package/dist/cjs/{ADlgInfeed-a535a768.js → ADlgInfeed-e1ba988c.js} +4 -4
  15. package/dist/cjs/AccordionPanel.js +8 -8
  16. package/dist/cjs/AdSlot.js +24 -24
  17. package/dist/cjs/AdSlotsProvider.js +13 -13
  18. package/dist/cjs/AlgoliaSearch.js +508 -500
  19. package/dist/cjs/AlphabeticList.js +10 -10
  20. package/dist/cjs/ArticleCarousel.js +17 -17
  21. package/dist/cjs/ArticleProgramLandingPage.js +50 -50
  22. package/dist/cjs/ArticleSeriesLandingPage.js +31 -31
  23. package/dist/cjs/ArticleSeriesListing.js +33 -33
  24. package/dist/cjs/Auth.js +484 -348
  25. package/dist/cjs/AuthWrapper.js +201 -240
  26. package/dist/cjs/{AuthorComponent-ac8972ce.js → AuthorComponent-c21aac7f.js} +1 -1
  27. package/dist/cjs/Beam.js +8 -8
  28. package/dist/cjs/{BlockContent-8b494587.js → BlockContent-36e54d77.js} +34 -34
  29. package/dist/cjs/Breadcrumbs.js +8 -8
  30. package/dist/cjs/CMEDeck.js +24 -24
  31. package/dist/cjs/Column2.js +16 -16
  32. package/dist/cjs/Column3.js +33 -33
  33. package/dist/cjs/ConferenceArticleCard.js +22 -22
  34. package/dist/cjs/DeckContent.js +42 -42
  35. package/dist/cjs/DeckQueue.js +31 -31
  36. package/dist/cjs/{Dfp-391fd124.js → Dfp-93399f8c.js} +15 -15
  37. package/dist/cjs/EventsDeck.js +45 -45
  38. package/dist/cjs/ExternalResources.js +47 -47
  39. package/dist/cjs/Feature.js +4 -4
  40. package/dist/cjs/ForbesHero.js +12 -12
  41. package/dist/cjs/GridContent.js +47 -47
  42. package/dist/cjs/GridHero.js +13 -13
  43. package/dist/cjs/GroupDeck.js +14 -14
  44. package/dist/cjs/HamMagazine.js +36 -36
  45. package/dist/cjs/Hero.js +4 -4
  46. package/dist/cjs/HighlightenVideo.js +2 -2
  47. package/dist/cjs/HorizontalArticleListing.js +47 -47
  48. package/dist/cjs/HorizontalHero.js +4 -4
  49. package/dist/cjs/IssueContentDeck.js +13 -13
  50. package/dist/cjs/IssueDeck.js +16 -16
  51. package/dist/cjs/IssueLanding.js +84 -84
  52. package/dist/cjs/KMTracker.js +15 -15
  53. package/dist/cjs/LeftNav.js +22 -22
  54. package/dist/cjs/MasterDeck.js +41 -41
  55. package/dist/cjs/MediaSeriesLanding.js +509 -465
  56. package/dist/cjs/NavDvm.js +13 -13
  57. package/dist/cjs/NavMagazine.js +40 -40
  58. package/dist/cjs/NavNative.js +41 -41
  59. package/dist/cjs/OncliveHero.js +4 -4
  60. package/dist/cjs/OncliveLargeHero.js +13 -13
  61. package/dist/cjs/PageFilter.js +6 -6
  62. package/dist/cjs/PartnerDetailListing.js +57 -57
  63. package/dist/cjs/PdfDownload.js +1 -1
  64. package/dist/cjs/PopUpModal.js +6 -6
  65. package/dist/cjs/PubSection.js +34 -34
  66. package/dist/cjs/PubToc.js +8 -8
  67. package/dist/cjs/PublicationDeck.js +8 -8
  68. package/dist/cjs/PublicationLanding.js +55 -55
  69. package/dist/cjs/QueueDeckExpanded.js +38 -38
  70. package/dist/cjs/RecentNews.js +3 -3
  71. package/dist/cjs/RelatedContent.js +35 -35
  72. package/dist/cjs/RelatedTopicsDropdown.js +10 -10
  73. package/dist/cjs/Search.js +8 -8
  74. package/dist/cjs/Segment.js +343 -368
  75. package/dist/cjs/SeriesListingDeck.js +20 -20
  76. package/dist/cjs/{SeriesSlider-0d3bf265.js → SeriesSlider-cbab9f0f.js} +14 -14
  77. package/dist/cjs/SetCookie.js +1 -1
  78. package/dist/cjs/SideFooter.js +17 -17
  79. package/dist/cjs/{SocialSearchComponent-19548e2a.js → SocialSearchComponent-ecb4f972.js} +10 -10
  80. package/dist/cjs/TaxonomyCard.js +10 -10
  81. package/dist/cjs/TaxonomyDescription.js +46 -46
  82. package/dist/cjs/TemplateNormal.js +47 -47
  83. package/dist/cjs/ThumbnailCard.js +7 -7
  84. package/dist/cjs/Ustream.js +13 -13
  85. package/dist/cjs/VerticalHero.js +3 -3
  86. package/dist/cjs/VideoProgramLandingPage.js +52 -52
  87. package/dist/cjs/VideoSeriesCard.js +14 -14
  88. package/dist/cjs/VideoSeriesFilter.js +9 -9
  89. package/dist/cjs/VideoSeriesLandingPage.js +37 -37
  90. package/dist/cjs/VideoSeriesListing.js +33 -33
  91. package/dist/cjs/View.js +91 -92
  92. package/dist/cjs/YahooHero.js +15 -15
  93. package/dist/cjs/YoutubeGroup.js +26 -26
  94. package/dist/cjs/{_is-array-754e012d.js → _is-array-6128bd56.js} +6 -6
  95. package/dist/cjs/{_iter-detect-60b2f026.js → _iter-detect-55a5657a.js} +8 -8
  96. package/dist/cjs/{_object-pie-68c5bcbc.js → _object-pie-083f2dd6.js} +4 -4
  97. package/dist/cjs/{_object-sap-5e74ba08.js → _object-sap-a175b4a9.js} +1 -1
  98. package/dist/cjs/{_object-to-array-5762f850.js → _object-to-array-8fe5a54f.js} +2 -2
  99. package/dist/cjs/{_to-object-329a650b.js → _to-object-6de10e57.js} +8 -8
  100. package/dist/cjs/{asyncToGenerator-140e5f89.js → asyncToGenerator-58c289d9.js} +32 -32
  101. package/dist/cjs/{core.get-iterator-method-f62321d4.js → core.get-iterator-method-f474eacc.js} +2 -2
  102. package/dist/cjs/{debounce-529c8d06.js → debounce-d4a2369b.js} +2 -2
  103. package/dist/cjs/{define-property-f4d12f4e.js → define-property-c88be878.js} +6 -6
  104. package/dist/cjs/{defineProperty-55548b25.js → defineProperty-0cb76d99.js} +1 -1
  105. package/dist/cjs/{entities-310b46ee.js → entities-3f9d0f2f.js} +1 -1
  106. package/dist/cjs/{eq-bb2843ed.js → eq-5fc26c07.js} +1 -1
  107. package/dist/cjs/{es6.string.iterator-cc0bbaa4.js → es6.string.iterator-c2573ffd.js} +6 -6
  108. package/dist/cjs/{extends-0a918631.js → extends-29bdbc6d.js} +7 -7
  109. package/dist/cjs/faundadb.js +7 -7
  110. package/dist/cjs/{get-adbb11e3.js → get-5839e5b5.js} +21 -21
  111. package/dist/cjs/getRelatedArticle.js +135 -71
  112. package/dist/cjs/getRootDocGroup.js +6 -6
  113. package/dist/cjs/getSerializers.js +45 -45
  114. package/dist/cjs/{getTargeting-15ad167c.js → getTargeting-be6168ad.js} +11 -11
  115. package/dist/cjs/getTargeting.js +8 -8
  116. package/dist/cjs/{index-ebee04bb.js → index-3cfbe927.js} +163 -163
  117. package/dist/cjs/{index-e2e62963.js → index-8041a4eb.js} +11 -1
  118. package/dist/cjs/{index-9d365128.js → index-eadd5035.js} +7 -7
  119. package/dist/cjs/{index-b5eb3ff8.js → index-efca863c.js} +16 -11
  120. package/dist/cjs/{index-6367b7bf.js → index-f86bb269.js} +35 -35
  121. package/dist/cjs/{index-2cf30c83.js → index-fc2f1ca2.js} +4 -4
  122. package/dist/cjs/{index.esm-3ffa049c.js → index.esm-8123cf40.js} +1 -1
  123. package/dist/cjs/index.js +137 -137
  124. package/dist/cjs/{inherits-0c7830c5.js → inherits-c2065b95.js} +19 -19
  125. package/dist/cjs/{isSymbol-04666465.js → isSymbol-03abbdf0.js} +15 -15
  126. package/dist/cjs/keys-7f2c2108.js +25 -0
  127. package/dist/cjs/{lodash-7fd85bcf.js → lodash-f0783643.js} +58 -10
  128. package/dist/cjs/{main-7b5e57b0.js → main-025fdc78.js} +234 -159
  129. package/dist/cjs/{moment-ca3bd9fb.js → moment-aca40de1.js} +1 -1
  130. package/dist/cjs/{react-social-icons-07939b41.js → react-social-icons-af932527.js} +17 -17
  131. package/dist/cjs/{slicedToArray-8f385299.js → slicedToArray-5d1bc3b3.js} +14 -14
  132. package/dist/cjs/{smoothscroll-5054361f.js → smoothscroll-99df7f93.js} +1 -1
  133. package/dist/cjs/stringify-c9ac1214.js +17 -0
  134. package/dist/cjs/timeDifferenceCalc.js +1 -1
  135. package/dist/cjs/{toConsumableArray-9a3476fe.js → toConsumableArray-ddb70795.js} +9 -9
  136. package/dist/cjs/{toNumber-36d1e7e5.js → toNumber-5e1fac58.js} +40 -5
  137. package/dist/cjs/{typeof-9d7f610f.js → typeof-88a668c5.js} +35 -35
  138. package/dist/cjs/urlFor.js +1 -1
  139. package/dist/cjs/{ustream-api-d092dc31.js → ustream-api-b2b9092f.js} +4 -4
  140. package/dist/cjs/{util-f2c1b65b.js → util-6f784d85.js} +1 -1
  141. package/dist/cjs/{web.dom.iterable-a0e279c1.js → web.dom.iterable-46657b5c.js} +3 -3
  142. package/dist/esm/AD.js +1 -1
  143. package/dist/esm/AD300x250.js +24 -24
  144. package/dist/esm/AD300x250x600.js +24 -24
  145. package/dist/esm/AD728x90.js +27 -27
  146. package/dist/esm/ADFloatingFooter.js +23 -23
  147. package/dist/esm/ADFooter.js +6 -6
  148. package/dist/esm/ADGutter.js +23 -23
  149. package/dist/esm/{ADInfeed-56a3db8b.js → ADInfeed-f20eb524.js} +4 -4
  150. package/dist/esm/ADSkyscraper.js +23 -23
  151. package/dist/esm/ADSponsoredResources.js +23 -23
  152. package/dist/esm/ADWebcast.js +23 -23
  153. package/dist/esm/ADWelcome.js +20 -20
  154. package/dist/esm/{ADlgInfeed-53edb995.js → ADlgInfeed-c85a91b1.js} +4 -4
  155. package/dist/esm/AccordionPanel.js +8 -8
  156. package/dist/esm/AdSlot.js +24 -24
  157. package/dist/esm/AdSlotsProvider.js +13 -13
  158. package/dist/esm/AlgoliaSearch.js +507 -499
  159. package/dist/esm/AlphabeticList.js +10 -10
  160. package/dist/esm/ArticleCarousel.js +17 -17
  161. package/dist/esm/ArticleProgramLandingPage.js +50 -50
  162. package/dist/esm/ArticleSeriesLandingPage.js +31 -31
  163. package/dist/esm/ArticleSeriesListing.js +33 -33
  164. package/dist/esm/Auth.js +484 -348
  165. package/dist/esm/AuthWrapper.js +201 -240
  166. package/dist/esm/{AuthorComponent-8ffd4679.js → AuthorComponent-5ae7409f.js} +1 -1
  167. package/dist/esm/Beam.js +8 -8
  168. package/dist/esm/{BlockContent-d05b5b23.js → BlockContent-52cf21c5.js} +34 -34
  169. package/dist/esm/Breadcrumbs.js +7 -7
  170. package/dist/esm/CMEDeck.js +24 -24
  171. package/dist/esm/Column2.js +16 -16
  172. package/dist/esm/Column3.js +33 -33
  173. package/dist/esm/ConferenceArticleCard.js +22 -22
  174. package/dist/esm/DeckContent.js +42 -42
  175. package/dist/esm/DeckQueue.js +31 -31
  176. package/dist/esm/{Dfp-2f9796e1.js → Dfp-43f121ff.js} +15 -15
  177. package/dist/esm/EventsDeck.js +43 -43
  178. package/dist/esm/ExternalResources.js +47 -47
  179. package/dist/esm/Feature.js +4 -4
  180. package/dist/esm/ForbesHero.js +12 -12
  181. package/dist/esm/GridContent.js +47 -47
  182. package/dist/esm/GridHero.js +13 -13
  183. package/dist/esm/GroupDeck.js +14 -14
  184. package/dist/esm/HamMagazine.js +36 -36
  185. package/dist/esm/Hero.js +4 -4
  186. package/dist/esm/HighlightenVideo.js +2 -2
  187. package/dist/esm/HorizontalArticleListing.js +47 -47
  188. package/dist/esm/HorizontalHero.js +4 -4
  189. package/dist/esm/IssueContentDeck.js +13 -13
  190. package/dist/esm/IssueDeck.js +15 -15
  191. package/dist/esm/IssueLanding.js +84 -84
  192. package/dist/esm/KMTracker.js +15 -15
  193. package/dist/esm/LeftNav.js +22 -22
  194. package/dist/esm/MasterDeck.js +41 -41
  195. package/dist/esm/MediaSeriesLanding.js +509 -465
  196. package/dist/esm/NavDvm.js +13 -13
  197. package/dist/esm/NavMagazine.js +40 -40
  198. package/dist/esm/NavNative.js +39 -39
  199. package/dist/esm/OncliveHero.js +4 -4
  200. package/dist/esm/OncliveLargeHero.js +13 -13
  201. package/dist/esm/PageFilter.js +6 -6
  202. package/dist/esm/PartnerDetailListing.js +57 -57
  203. package/dist/esm/PdfDownload.js +1 -1
  204. package/dist/esm/PopUpModal.js +6 -6
  205. package/dist/esm/PubSection.js +34 -34
  206. package/dist/esm/PubToc.js +8 -8
  207. package/dist/esm/PublicationDeck.js +7 -7
  208. package/dist/esm/PublicationLanding.js +54 -54
  209. package/dist/esm/QueueDeckExpanded.js +38 -38
  210. package/dist/esm/RecentNews.js +3 -3
  211. package/dist/esm/RelatedContent.js +35 -35
  212. package/dist/esm/RelatedTopicsDropdown.js +10 -10
  213. package/dist/esm/Search.js +7 -7
  214. package/dist/esm/Segment.js +343 -368
  215. package/dist/esm/SeriesListingDeck.js +20 -20
  216. package/dist/esm/{SeriesSlider-7d89f4d9.js → SeriesSlider-5c62a578.js} +14 -14
  217. package/dist/esm/SetCookie.js +1 -1
  218. package/dist/esm/SideFooter.js +17 -17
  219. package/dist/esm/{SocialSearchComponent-47815365.js → SocialSearchComponent-cd38ae60.js} +9 -9
  220. package/dist/esm/TaxonomyCard.js +10 -10
  221. package/dist/esm/TaxonomyDescription.js +46 -46
  222. package/dist/esm/TemplateNormal.js +47 -47
  223. package/dist/esm/ThumbnailCard.js +7 -7
  224. package/dist/esm/Ustream.js +13 -13
  225. package/dist/esm/VerticalHero.js +3 -3
  226. package/dist/esm/VideoProgramLandingPage.js +51 -51
  227. package/dist/esm/VideoSeriesCard.js +14 -14
  228. package/dist/esm/VideoSeriesFilter.js +9 -9
  229. package/dist/esm/VideoSeriesLandingPage.js +37 -37
  230. package/dist/esm/VideoSeriesListing.js +33 -33
  231. package/dist/esm/View.js +90 -91
  232. package/dist/esm/YahooHero.js +15 -15
  233. package/dist/esm/YoutubeGroup.js +26 -26
  234. package/dist/esm/{_is-array-58e95429.js → _is-array-3e99e06e.js} +6 -6
  235. package/dist/esm/{_iter-detect-5d49a330.js → _iter-detect-7e5e5ce2.js} +8 -8
  236. package/dist/esm/{_object-pie-33c40e79.js → _object-pie-133f504a.js} +4 -4
  237. package/dist/esm/{_object-sap-964b6feb.js → _object-sap-f353c2a9.js} +1 -1
  238. package/dist/esm/{_object-to-array-7e804fce.js → _object-to-array-0f197f89.js} +2 -2
  239. package/dist/esm/{_to-object-a4107da3.js → _to-object-b50e61c3.js} +9 -9
  240. package/dist/esm/{asyncToGenerator-fc1c2e29.js → asyncToGenerator-7f8f9219.js} +32 -32
  241. package/dist/esm/{core.get-iterator-method-e1de7503.js → core.get-iterator-method-133dfacd.js} +2 -2
  242. package/dist/esm/{debounce-9207d8ee.js → debounce-533d9748.js} +2 -2
  243. package/dist/esm/{define-property-8af5f002.js → define-property-fe54dc9f.js} +6 -6
  244. package/dist/esm/{defineProperty-94fd8bfc.js → defineProperty-f5ff6f5a.js} +1 -1
  245. package/dist/esm/{entities-7cc3bf45.js → entities-932b50cf.js} +1 -1
  246. package/dist/esm/{eq-b470f743.js → eq-bdcbf886.js} +1 -1
  247. package/dist/esm/{es6.string.iterator-c990c18c.js → es6.string.iterator-bc33758b.js} +7 -7
  248. package/dist/esm/{extends-6f2fcc99.js → extends-60e0e1c6.js} +7 -7
  249. package/dist/esm/faundadb.js +7 -7
  250. package/dist/esm/{get-1e515072.js → get-3c308da4.js} +21 -21
  251. package/dist/esm/getRelatedArticle.js +135 -71
  252. package/dist/esm/getRootDocGroup.js +6 -6
  253. package/dist/esm/getSerializers.js +45 -45
  254. package/dist/esm/{getTargeting-82e86707.js → getTargeting-68291ce9.js} +11 -11
  255. package/dist/esm/getTargeting.js +8 -8
  256. package/dist/esm/{index-51a80699.js → index-0dbff1d1.js} +16 -11
  257. package/dist/esm/{index-f7fb1e25.js → index-2446af28.js} +4 -4
  258. package/dist/esm/{index-6c12bdd5.js → index-35bdcc81.js} +6 -6
  259. package/dist/esm/{index-aaa2dae0.js → index-67e1773f.js} +11 -2
  260. package/dist/esm/{index-c00b0bbb.js → index-79cfd25c.js} +35 -35
  261. package/dist/esm/{index-29ef9d83.js → index-d675ae77.js} +160 -160
  262. package/dist/esm/{index.esm-8ee5ff72.js → index.esm-8016b507.js} +1 -1
  263. package/dist/esm/index.js +118 -118
  264. package/dist/esm/{inherits-75d45541.js → inherits-a41fe93f.js} +19 -19
  265. package/dist/esm/{isSymbol-1981418f.js → isSymbol-a7e9aafe.js} +15 -15
  266. package/dist/esm/{keys-8eda7a5c.js → keys-7a3adabf.js} +6 -6
  267. package/dist/esm/{lodash-ec8c6b48.js → lodash-f97fd99a.js} +58 -10
  268. package/dist/esm/{main-747e7d25.js → main-b5c5aac1.js} +228 -153
  269. package/dist/esm/{moment-b6f49411.js → moment-bc12cb97.js} +1 -1
  270. package/dist/esm/{react-social-icons-3822f1ce.js → react-social-icons-91f9716f.js} +16 -16
  271. package/dist/esm/{slicedToArray-641f241f.js → slicedToArray-be2f7a22.js} +14 -14
  272. package/dist/esm/{smoothscroll-0cd4c7a6.js → smoothscroll-fa4e3f8c.js} +1 -1
  273. package/dist/esm/stringify-59c8f690.js +15 -0
  274. package/dist/esm/timeDifferenceCalc.js +1 -1
  275. package/dist/esm/{toConsumableArray-43aa614d.js → toConsumableArray-6d9a4616.js} +9 -9
  276. package/dist/esm/{toNumber-2f7a84cd.js → toNumber-5aeba6e7.js} +40 -5
  277. package/dist/esm/{typeof-af9c50d8.js → typeof-a286cf0c.js} +35 -35
  278. package/dist/esm/urlFor.js +1 -1
  279. package/dist/esm/{ustream-api-9a50644d.js → ustream-api-33a866b6.js} +4 -4
  280. package/dist/esm/{util-7700fc59.js → util-3ab476bf.js} +1 -1
  281. package/dist/esm/{web.dom.iterable-4439f05a.js → web.dom.iterable-4109ff68.js} +3 -3
  282. package/package.json +110 -110
  283. package/dist/cjs/keys-a586b7a0.js +0 -25
  284. package/dist/cjs/stringify-7c5aff47.js +0 -17
  285. package/dist/esm/stringify-4330ccdc.js +0 -15
  286. package/dist/cjs/{brightcove-react-player-loader.es-5c98aec7.js → brightcove-react-player-loader.es-a195642e.js} +1 -1
  287. package/dist/esm/{brightcove-react-player-loader.es-4abff0b1.js → brightcove-react-player-loader.es-b43c695a.js} +1 -1
@@ -1,388 +1,363 @@
1
1
  'use strict';
2
2
 
3
+ var asyncToGenerator = require('./asyncToGenerator-58c289d9.js');
3
4
  require('./_commonjsHelpers-06173234.js');
4
- require('./_to-object-329a650b.js');
5
- require('./es6.string.iterator-cc0bbaa4.js');
5
+ require('./es6.string.iterator-c2573ffd.js');
6
+ require('./_to-object-6de10e57.js');
7
+ require('./web.dom.iterable-46657b5c.js');
6
8
  require('./_library-dd23b178.js');
7
- require('./_iter-detect-60b2f026.js');
8
- require('./core.get-iterator-method-f62321d4.js');
9
- require('./web.dom.iterable-a0e279c1.js');
10
- var asyncToGenerator = require('./asyncToGenerator-140e5f89.js');
9
+ require('./core.get-iterator-method-f474eacc.js');
10
+ require('./_iter-detect-55a5657a.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
- }
19
-
20
- if (typeof analytics === 'undefined') {
21
- console.error('Segment not initialized', analytics);
22
- return;
23
- }
24
-
25
- var buff = Buffer.from(eKey, 'base64');
26
- var email = buff.toString('ascii');
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;
34
-
35
- if (!data || !data.needSegmentSupport) {
36
- return url;
37
- }
38
-
39
- if (typeof analytics === 'undefined') {
40
- console.error('segment not defined');
41
- return url;
42
- }
15
+ identify: function identify(eKey) {
16
+ if (!eKey) {
17
+ throw new Error('eKey is not present');
18
+ }
43
19
 
44
- if (!analytics || typeof analytics.user !== 'function') {
45
- console.error('segment not defined: user function');
46
- return url;
47
- }
20
+ if (typeof analytics === 'undefined') {
21
+ console.error('Segment not initialized', analytics);
22
+ return;
23
+ }
48
24
 
49
- var user = analytics.user();
50
- if (!user) {
51
- console.log('segment user not defined');
52
- return url;
53
- }
25
+ var buff = Buffer.from(eKey, 'base64');
26
+ var email = buff.toString('ascii');
54
27
 
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
- }
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;
63
34
 
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
- }
35
+ if (!data || !data.needSegmentSupport) {
36
+ return url;
98
37
  }
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
- }
108
- }
109
38
 
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
- }
39
+ if (typeof analytics === 'undefined') {
40
+ console.error('segment not defined');
41
+ return url;
217
42
  }
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
- }
43
+
44
+ if (!analytics || typeof analytics.user !== 'function') {
45
+ console.error('segment not defined: user function');
46
+ return url;
278
47
  }
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
- }
48
+
49
+ var user = analytics.user();
50
+ if (!user) {
51
+ console.log('segment user not defined');
52
+ return url;
330
53
  }
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
- }
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;
382
62
  }
383
- }, _callee6, _this6);
384
- }))();
385
- }
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
+ }))();
360
+ }
386
361
  };
387
362
 
388
363
  module.exports = Segment;