@mjhls/mjh-framework 1.0.879 → 1.0.880-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 (309) hide show
  1. package/README.md +1 -1
  2. package/dist/cjs/AD.js +9 -10
  3. package/dist/cjs/AD300x250.js +28 -28
  4. package/dist/cjs/AD300x250x600.js +28 -28
  5. package/dist/cjs/AD728x90.js +31 -31
  6. package/dist/cjs/ADFloatingFooter.js +30 -30
  7. package/dist/cjs/ADFooter.js +12 -13
  8. package/dist/cjs/ADGutter.js +30 -30
  9. package/dist/cjs/{ADInfeed-51a39495.js → ADInfeed-2e48af77.js} +13 -15
  10. package/dist/cjs/ADSkyscraper.js +30 -30
  11. package/dist/cjs/ADSponsoredResources.js +30 -30
  12. package/dist/cjs/ADWebcast.js +30 -30
  13. package/dist/cjs/ADWelcome.js +31 -31
  14. package/dist/cjs/{ADlgInfeed-12db4509.js → ADlgInfeed-c39c7131.js} +10 -11
  15. package/dist/cjs/AccordionPanel.js +27 -29
  16. package/dist/cjs/AdSlot.js +31 -31
  17. package/dist/cjs/AdSlotsProvider.js +910 -18
  18. package/dist/cjs/AlgoliaSearch.js +14023 -61
  19. package/dist/cjs/AlphabeticList.js +23 -24
  20. package/dist/cjs/ArticleCarousel.js +19 -21
  21. package/dist/cjs/ArticleProgramLandingPage.js +59 -60
  22. package/dist/cjs/ArticleSeriesLandingPage.js +39 -44
  23. package/dist/cjs/ArticleSeriesListing.js +59 -60
  24. package/dist/cjs/Auth.js +1504 -680
  25. package/dist/cjs/AuthWrapper.js +266 -308
  26. package/dist/cjs/{AuthorComponent-39b37d84.js → AuthorComponent-02e827ae.js} +13 -14
  27. package/dist/cjs/Beam.js +6 -6
  28. package/dist/cjs/{BlockContent-36e54d77.js → BlockContent-9c6b07ad.js} +55 -56
  29. package/dist/cjs/Breadcrumbs.js +25 -27
  30. package/dist/cjs/CMEDeck.js +82 -81
  31. package/dist/cjs/Column1.js +11 -14
  32. package/dist/cjs/Column2.js +31 -34
  33. package/dist/cjs/Column3.js +57 -59
  34. package/dist/cjs/ConferenceArticleCard.js +26 -28
  35. package/dist/cjs/ConferenceBanner-4a16fddc.js +23 -0
  36. package/dist/cjs/DeckContent.js +93 -97
  37. package/dist/cjs/DeckQueue.js +87 -91
  38. package/dist/cjs/{Dfp-94f8ccdf.js → Dfp-14d2455c.js} +32 -32
  39. package/dist/cjs/EventsDeck.js +133 -140
  40. package/dist/cjs/ExternalResources.js +78 -79
  41. package/dist/cjs/Feature.js +28 -31
  42. package/dist/cjs/ForbesHero.js +41 -43
  43. package/dist/cjs/GridContent.js +232 -237
  44. package/dist/cjs/GridHero.js +43 -45
  45. package/dist/cjs/GroupDeck.js +58 -60
  46. package/dist/cjs/HamMagazine.js +130 -135
  47. package/dist/cjs/Header.js +12 -14
  48. package/dist/cjs/Hero.js +14 -16
  49. package/dist/cjs/HighlightenVideo.js +17 -18
  50. package/dist/cjs/HorizontalArticleListing.js +70 -71
  51. package/dist/cjs/HorizontalHero.js +29 -31
  52. package/dist/cjs/IssueContentDeck.js +71 -77
  53. package/dist/cjs/IssueDeck.js +70 -76
  54. package/dist/cjs/IssueLanding.js +63 -65
  55. package/dist/cjs/LeftNav.js +37 -38
  56. package/dist/cjs/MasterDeck.js +228 -355
  57. package/dist/cjs/MediaSeriesLanding.js +1093 -1185
  58. package/dist/cjs/NavDvm.js +72 -77
  59. package/dist/cjs/{NavFooter-3dcd99a8.js → NavFooter-76c913e3.js} +14 -15
  60. package/dist/cjs/NavMagazine.js +136 -141
  61. package/dist/cjs/NavNative.js +128 -136
  62. package/dist/cjs/OncliveHero.js +23 -24
  63. package/dist/cjs/OncliveLargeHero.js +73 -75
  64. package/dist/cjs/PageFilter.js +12 -13
  65. package/dist/cjs/Pagination-9cb60fba.js +61 -0
  66. package/dist/cjs/PartnerDetailListing.js +3918 -119
  67. package/dist/cjs/PdfDownload.js +9 -10
  68. package/dist/cjs/PopUpModal.js +17 -19
  69. package/dist/cjs/PubSection.js +39 -41
  70. package/dist/cjs/PubToc.js +13 -14
  71. package/dist/cjs/PublicationDeck.js +65 -71
  72. package/dist/cjs/PublicationLanding.js +106 -110
  73. package/dist/cjs/QueueDeckExpanded.js +1002 -1173
  74. package/dist/cjs/RecentNews.js +22 -23
  75. package/dist/cjs/RelatedContent.js +29 -31
  76. package/dist/cjs/RelatedTopicsDropdown.js +19 -22
  77. package/dist/cjs/RolesDeck.js +27 -32
  78. package/dist/cjs/Search.js +16 -20
  79. package/dist/cjs/Segment.js +4 -4
  80. package/dist/cjs/SeriesListingDeck.js +37 -37
  81. package/dist/cjs/{SeriesSlider-f9128638.js → SeriesSlider-ec146338.js} +36 -37
  82. package/dist/cjs/SetCookie.js +1 -1
  83. package/dist/cjs/SideFooter.js +34 -35
  84. package/dist/cjs/SocialIcons.js +9 -10
  85. package/dist/cjs/{SocialSearchComponent-4942ddfc.js → SocialSearchComponent-e8477ca3.js} +36 -40
  86. package/dist/cjs/SocialShare.js +29 -31
  87. package/dist/cjs/TaxonomyCard.js +61 -67
  88. package/dist/cjs/TaxonomyDescription.js +53 -54
  89. package/dist/cjs/TemplateNormal.js +72 -72
  90. package/dist/cjs/ThumbnailCard.js +23 -26
  91. package/dist/cjs/Ustream.js +28 -29
  92. package/dist/cjs/VerticalHero.js +20 -22
  93. package/dist/cjs/VideoProgramLandingPage.js +73 -77
  94. package/dist/cjs/VideoSeriesCard.js +31 -33
  95. package/dist/cjs/VideoSeriesFilter.js +16 -16
  96. package/dist/cjs/VideoSeriesLandingPage.js +49 -52
  97. package/dist/cjs/VideoSeriesListing.js +76 -77
  98. package/dist/cjs/View.js +272 -275
  99. package/dist/cjs/YahooHero.js +40 -42
  100. package/dist/cjs/YoutubeGroup.js +62 -64
  101. package/dist/cjs/{_is-array-54228b29.js → _is-array-aa52fa1e.js} +6 -6
  102. package/dist/cjs/{_iter-detect-b1df62f0.js → _iter-detect-05795553.js} +7 -7
  103. package/dist/cjs/{_object-pie-083f2dd6.js → _object-pie-68c5bcbc.js} +4 -4
  104. package/dist/cjs/{_object-sap-d1978572.js → _object-sap-171b9ea5.js} +1 -1
  105. package/dist/cjs/{_object-to-array-ce86cae7.js → _object-to-array-9bac8737.js} +2 -2
  106. package/dist/cjs/{asyncToGenerator-77821af0.js → asyncToGenerator-df19209d.js} +30 -30
  107. package/dist/cjs/{brightcove-react-player-loader.es-a195642e.js → brightcove-react-player-loader.es-156bd4d6.js} +9 -11
  108. package/dist/cjs/{core.get-iterator-method-5643aa10.js → core.get-iterator-method-f3c44602.js} +35 -35
  109. package/dist/cjs/{debounce-d4a2369b.js → debounce-529c8d06.js} +2 -2
  110. package/dist/cjs/{define-property-e8404b64.js → define-property-21887c62.js} +6 -6
  111. package/dist/cjs/{defineProperty-9673846a.js → defineProperty-77a37684.js} +1 -1
  112. package/dist/cjs/{entities-3f9d0f2f.js → entities-310b46ee.js} +1 -1
  113. package/dist/cjs/{eq-5fc26c07.js → eq-bb2843ed.js} +1 -1
  114. package/dist/cjs/events-1b438fe7.js +469 -0
  115. package/dist/cjs/{extends-7c86182f.js → extends-eed4f016.js} +7 -7
  116. package/dist/cjs/faundadb.js +19 -19
  117. package/dist/cjs/{get-5839e5b5.js → get-adbb11e3.js} +21 -21
  118. package/dist/cjs/getRelatedArticle.js +18 -18
  119. package/dist/cjs/getRootDocGroup.js +6 -6
  120. package/dist/cjs/getSerializers.js +43 -43
  121. package/dist/cjs/{getTargeting-6d59cc5b.js → getTargeting-8874437b.js} +3 -3
  122. package/dist/cjs/getTargeting.js +6 -6
  123. package/dist/{esm/iconBase-ccc56b97.js → cjs/iconBase-68959171.js} +8 -2
  124. package/dist/cjs/{index-aafe16dd.js → index-17c6af5a.js} +1067 -1093
  125. package/dist/cjs/{index-f86bb269.js → index-3294d3bc.js} +45 -44
  126. package/dist/cjs/{index-eadd5035.js → index-96b3db50.js} +15 -17
  127. package/dist/cjs/{index-0e4427c8.js → index-98e01cb9.js} +13 -479
  128. package/dist/cjs/index-e2e62963.js +89 -0
  129. package/dist/cjs/{index.es-f3e47207.js → index.es-9110add6.js} +12 -31
  130. package/dist/cjs/{index.esm-2bb721c8.js → index.esm-4d410430.js} +21 -21
  131. package/dist/cjs/{index.esm-00a6aade.js → index.esm-90433435.js} +16 -7
  132. package/dist/cjs/{index.esm-c1e16606.js → index.esm-e32d3e8e.js} +7 -4
  133. package/dist/cjs/{index.esm-f27f80d9.js → index.esm-ff47db6f.js} +13 -6
  134. package/dist/cjs/index.js +164 -169
  135. package/dist/cjs/inherits-8d29278d.js +110 -0
  136. package/dist/cjs/{inherits-de66ea16.js → inherits-cba9c846.js} +19 -19
  137. package/dist/cjs/{isSymbol-03abbdf0.js → isSymbol-04666465.js} +15 -15
  138. package/dist/cjs/{keys-e982b3fa.js → keys-d207942e.js} +6 -6
  139. package/dist/cjs/{lodash-f0783643.js → lodash-fc2922d0.js} +31 -128
  140. package/dist/cjs/main-02daeefe.js +862 -0
  141. package/dist/cjs/{md5-e1ca5797.js → md5-5039b1a6.js} +1 -1
  142. package/dist/cjs/{moment-aca40de1.js → moment-575fe24c.js} +9 -11
  143. package/dist/cjs/{react-social-icons-af932527.js → react-social-icons-f7f48f71.js} +27 -28
  144. package/dist/cjs/{slicedToArray-067dd3bc.js → slicedToArray-f6d4eaa8.js} +12 -12
  145. package/dist/cjs/{smoothscroll-99df7f93.js → smoothscroll-5054361f.js} +1 -1
  146. package/dist/cjs/{stringify-f7a37a8d.js → stringify-bbc68047.js} +5 -5
  147. package/dist/cjs/timeDifferenceCalc.js +1 -1
  148. package/dist/cjs/{toConsumableArray-d7797c2b.js → toConsumableArray-c9b8a0d0.js} +7 -7
  149. package/dist/cjs/{toNumber-5e1fac58.js → toNumber-36d1e7e5.js} +5 -40
  150. package/dist/cjs/{typeof-567e31ff.js → typeof-5f52cf64.js} +35 -35
  151. package/dist/cjs/{index-efca863c.js → urlFor-3a61226f.js} +88 -37
  152. package/dist/cjs/urlFor.js +5 -59
  153. package/dist/cjs/{ustream-api-3819e4aa.js → ustream-api-9ebe112f.js} +4 -4
  154. package/dist/cjs/{util-6f784d85.js → util-f2c1b65b.js} +1 -1
  155. package/dist/cjs/{visibility-sensor-eb2c5b69.js → visibility-sensor-ad5e3116.js} +5 -7
  156. package/dist/cjs/{web.dom.iterable-d98303e0.js → web.dom.iterable-e34bf324.js} +2 -2
  157. package/dist/esm/AD.js +1 -1
  158. package/dist/esm/AD300x250.js +22 -21
  159. package/dist/esm/AD300x250x600.js +22 -21
  160. package/dist/esm/AD728x90.js +25 -24
  161. package/dist/esm/ADFloatingFooter.js +21 -20
  162. package/dist/esm/ADFooter.js +4 -4
  163. package/dist/esm/ADGutter.js +21 -20
  164. package/dist/esm/{ADInfeed-bba8b026.js → ADInfeed-0c13c803.js} +6 -6
  165. package/dist/esm/ADSkyscraper.js +21 -20
  166. package/dist/esm/ADSponsoredResources.js +21 -20
  167. package/dist/esm/ADWebcast.js +21 -20
  168. package/dist/esm/ADWelcome.js +18 -17
  169. package/dist/esm/{ADlgInfeed-a45afa1d.js → ADlgInfeed-e4e2031a.js} +4 -4
  170. package/dist/esm/AccordionPanel.js +6 -6
  171. package/dist/esm/AdSlot.js +20 -19
  172. package/dist/esm/AdSlotsProvider.js +907 -14
  173. package/dist/esm/AlgoliaSearch.js +13992 -29
  174. package/dist/esm/AlphabeticList.js +8 -8
  175. package/dist/esm/ArticleCarousel.js +13 -14
  176. package/dist/esm/ArticleProgramLandingPage.js +47 -47
  177. package/dist/esm/ArticleSeriesLandingPage.js +29 -33
  178. package/dist/esm/ArticleSeriesListing.js +32 -32
  179. package/dist/esm/Auth.js +1418 -590
  180. package/dist/esm/AuthWrapper.js +244 -285
  181. package/dist/esm/{AuthorComponent-defe68b6.js → AuthorComponent-e6f95c2f.js} +1 -1
  182. package/dist/esm/Beam.js +6 -6
  183. package/dist/esm/{BlockContent-c99c9a8d.js → BlockContent-f4515898.js} +34 -34
  184. package/dist/esm/Breadcrumbs.js +5 -5
  185. package/dist/esm/CMEDeck.js +23 -22
  186. package/dist/esm/Column1.js +4 -4
  187. package/dist/esm/Column2.js +19 -19
  188. package/dist/esm/Column3.js +37 -36
  189. package/dist/esm/ConferenceArticleCard.js +10 -11
  190. package/dist/esm/DeckContent.js +47 -47
  191. package/dist/esm/DeckQueue.js +47 -47
  192. package/dist/esm/{Dfp-4b99f79d.js → Dfp-f867d061.js} +13 -12
  193. package/dist/esm/EventsDeck.js +50 -50
  194. package/dist/esm/ExternalResources.js +46 -46
  195. package/dist/esm/Feature.js +7 -8
  196. package/dist/esm/ForbesHero.js +9 -10
  197. package/dist/esm/GridContent.js +88 -88
  198. package/dist/esm/GridHero.js +10 -11
  199. package/dist/esm/GroupDeck.js +11 -12
  200. package/dist/esm/HamMagazine.js +28 -28
  201. package/dist/esm/Hero.js +6 -7
  202. package/dist/esm/HighlightenVideo.js +2 -2
  203. package/dist/esm/HorizontalArticleListing.js +45 -45
  204. package/dist/esm/HorizontalHero.js +8 -9
  205. package/dist/esm/IssueContentDeck.js +24 -25
  206. package/dist/esm/IssueDeck.js +34 -35
  207. package/dist/esm/IssueLanding.js +52 -53
  208. package/dist/esm/LeftNav.js +20 -19
  209. package/dist/esm/MasterDeck.js +210 -336
  210. package/dist/esm/MediaSeriesLanding.js +643 -732
  211. package/dist/esm/NavDvm.js +14 -14
  212. package/dist/esm/NavMagazine.js +32 -32
  213. package/dist/esm/NavNative.js +32 -32
  214. package/dist/esm/OncliveHero.js +8 -8
  215. package/dist/esm/OncliveLargeHero.js +10 -11
  216. package/dist/esm/PageFilter.js +4 -4
  217. package/dist/esm/Pagination-256b60e5.js +56 -0
  218. package/dist/esm/PartnerDetailListing.js +3861 -62
  219. package/dist/esm/PdfDownload.js +2 -2
  220. package/dist/esm/PopUpModal.js +4 -4
  221. package/dist/esm/PubSection.js +31 -32
  222. package/dist/esm/PubToc.js +6 -6
  223. package/dist/esm/PublicationDeck.js +26 -27
  224. package/dist/esm/PublicationLanding.js +47 -47
  225. package/dist/esm/QueueDeckExpanded.js +945 -1116
  226. package/dist/esm/RecentNews.js +4 -4
  227. package/dist/esm/RelatedContent.js +9 -10
  228. package/dist/esm/RolesDeck.js +12 -12
  229. package/dist/esm/Search.js +6 -6
  230. package/dist/esm/Segment.js +4 -4
  231. package/dist/esm/SeriesListingDeck.js +18 -18
  232. package/dist/esm/{SeriesSlider-98b7a870.js → SeriesSlider-d6561e33.js} +10 -10
  233. package/dist/esm/SetCookie.js +1 -1
  234. package/dist/esm/SideFooter.js +13 -13
  235. package/dist/esm/{SocialSearchComponent-9458fac6.js → SocialSearchComponent-b5be0e6c.js} +12 -12
  236. package/dist/esm/TaxonomyCard.js +26 -27
  237. package/dist/esm/TaxonomyDescription.js +44 -44
  238. package/dist/esm/TemplateNormal.js +48 -47
  239. package/dist/esm/ThumbnailCard.js +9 -10
  240. package/dist/esm/Ustream.js +12 -12
  241. package/dist/esm/VerticalHero.js +6 -7
  242. package/dist/esm/VideoProgramLandingPage.js +51 -51
  243. package/dist/esm/VideoSeriesCard.js +12 -13
  244. package/dist/esm/VideoSeriesFilter.js +7 -7
  245. package/dist/esm/VideoSeriesLandingPage.js +36 -38
  246. package/dist/esm/VideoSeriesListing.js +33 -33
  247. package/dist/esm/View.js +91 -90
  248. package/dist/esm/YahooHero.js +12 -13
  249. package/dist/esm/YoutubeGroup.js +16 -17
  250. package/dist/esm/{_is-array-893ab020.js → _is-array-4df618a6.js} +6 -6
  251. package/dist/esm/{_iter-detect-f089461c.js → _iter-detect-130ee549.js} +7 -7
  252. package/dist/esm/{_object-pie-133f504a.js → _object-pie-33c40e79.js} +4 -4
  253. package/dist/esm/{_object-sap-169d6272.js → _object-sap-8b8ea5a9.js} +1 -1
  254. package/dist/esm/{_object-to-array-50a6b9a3.js → _object-to-array-c54dd835.js} +2 -2
  255. package/dist/esm/{asyncToGenerator-b4dfe691.js → asyncToGenerator-64812e90.js} +31 -31
  256. package/dist/esm/{brightcove-react-player-loader.es-57a70a56.js → brightcove-react-player-loader.es-83f53e4e.js} +4 -5
  257. package/dist/esm/{core.get-iterator-method-e903ff31.js → core.get-iterator-method-86d4db69.js} +36 -36
  258. package/dist/esm/{debounce-533d9748.js → debounce-9207d8ee.js} +2 -2
  259. package/dist/esm/{define-property-99e66838.js → define-property-6d26cb48.js} +6 -6
  260. package/dist/esm/{defineProperty-8fa0bc8d.js → defineProperty-d7d9b577.js} +1 -1
  261. package/dist/esm/{entities-932b50cf.js → entities-7cc3bf45.js} +1 -1
  262. package/dist/esm/{eq-bdcbf886.js → eq-b470f743.js} +1 -1
  263. package/dist/esm/events-6c3a7a63.js +467 -0
  264. package/dist/esm/{extends-dc6a71fd.js → extends-5b1796d4.js} +7 -7
  265. package/dist/esm/faundadb.js +5 -5
  266. package/dist/esm/{get-3c308da4.js → get-1e515072.js} +21 -21
  267. package/dist/esm/getRelatedArticle.js +12 -12
  268. package/dist/esm/getRootDocGroup.js +4 -4
  269. package/dist/esm/getSerializers.js +43 -43
  270. package/dist/esm/{getTargeting-3792eba9.js → getTargeting-277c801e.js} +2 -2
  271. package/dist/esm/getTargeting.js +6 -6
  272. package/dist/{cjs/iconBase-be4097c0.js → esm/iconBase-602d52fe.js} +8 -33
  273. package/dist/esm/{index-5cc7b406.js → index-41a678ea.js} +4 -469
  274. package/dist/esm/{index-755f2cc2.js → index-5f7e79e7.js} +6 -6
  275. package/dist/esm/{index-e57e375a.js → index-a35a5c39.js} +617 -633
  276. package/dist/esm/index-aaa2dae0.js +85 -0
  277. package/dist/esm/{index-79cfd25c.js → index-ef6d5dcf.js} +45 -44
  278. package/dist/esm/{index.es-a6137319.js → index.es-29c1cef5.js} +5 -23
  279. package/dist/esm/{index.esm-f6156a57.js → index.esm-29e48d38.js} +16 -7
  280. package/dist/esm/{index.esm-d4932dea.js → index.esm-cf08bf18.js} +13 -6
  281. package/dist/esm/{index.esm-9b042655.js → index.esm-f8aaeeeb.js} +7 -4
  282. package/dist/esm/{index.esm-37268dca.js → index.esm-fd746768.js} +5 -4
  283. package/dist/esm/index.js +122 -124
  284. package/dist/esm/{inherits-8a801a18.js → inherits-2409637d.js} +18 -18
  285. package/dist/esm/inherits-77d5e4fc.js +101 -0
  286. package/dist/esm/{isSymbol-a7e9aafe.js → isSymbol-1981418f.js} +15 -15
  287. package/dist/esm/{keys-425c8ab0.js → keys-69989821.js} +6 -6
  288. package/dist/esm/{lodash-f97fd99a.js → lodash-17fdfebb.js} +31 -128
  289. package/dist/esm/main-c0612122.js +851 -0
  290. package/dist/esm/{md5-4e42248e.js → md5-9be0e905.js} +1 -1
  291. package/dist/esm/{moment-bc12cb97.js → moment-e2f9b20c.js} +9 -11
  292. package/dist/esm/{react-social-icons-9be47857.js → react-social-icons-a7d5c5c7.js} +16 -16
  293. package/dist/esm/{slicedToArray-ca2c8b8d.js → slicedToArray-67a08c9c.js} +12 -12
  294. package/dist/esm/{smoothscroll-fa4e3f8c.js → smoothscroll-0cd4c7a6.js} +1 -1
  295. package/dist/esm/stringify-70b72959.js +15 -0
  296. package/dist/esm/timeDifferenceCalc.js +1 -1
  297. package/dist/esm/{toConsumableArray-7b1c0e23.js → toConsumableArray-32282905.js} +7 -7
  298. package/dist/esm/{toNumber-5aeba6e7.js → toNumber-2f7a84cd.js} +5 -40
  299. package/dist/esm/{typeof-83d9eb10.js → typeof-c05a82ba.js} +35 -35
  300. package/dist/esm/{index-0dbff1d1.js → urlFor-23b2244b.js} +88 -37
  301. package/dist/esm/urlFor.js +4 -62
  302. package/dist/esm/{ustream-api-41166338.js → ustream-api-4c4fe0ba.js} +4 -4
  303. package/dist/esm/{util-3ab476bf.js → util-7700fc59.js} +1 -1
  304. package/dist/esm/{web.dom.iterable-fdf034f5.js → web.dom.iterable-f8f967cd.js} +2 -2
  305. package/package.json +2 -1
  306. package/dist/cjs/ConferenceBanner-6c9e718a.js +0 -24
  307. package/dist/cjs/main-f1c77adb.js +0 -973
  308. package/dist/esm/main-1894c974.js +0 -961
  309. package/dist/esm/stringify-c21932b3.js +0 -15
package/dist/cjs/Auth.js CHANGED
@@ -2,33 +2,28 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var asyncToGenerator = require('./asyncToGenerator-77821af0.js');
6
- var stringify = require('./stringify-f7a37a8d.js');
7
- var slicedToArray = require('./slicedToArray-067dd3bc.js');
5
+ function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
6
+
7
+ var _commonjsHelpers = require('./_commonjsHelpers-06173234.js');
8
+ require('./core.get-iterator-method-f3c44602.js');
9
+ require('./_library-dd23b178.js');
10
+ require('./_iter-detect-05795553.js');
11
+ require('./_object-pie-68c5bcbc.js');
12
+ var _extends$1 = require('./extends-eed4f016.js');
13
+ require('./web.dom.iterable-e34bf324.js');
8
14
  var React = require('react');
15
+ var React__default = _interopDefault(React);
9
16
  var Router = require('next/router');
10
- var _extends = require('./extends-7c86182f.js');
17
+ var Router__default = _interopDefault(Router);
18
+ var slicedToArray = require('./slicedToArray-f6d4eaa8.js');
19
+ var stringify = require('./stringify-bbc68047.js');
20
+ var asyncToGenerator = require('./asyncToGenerator-df19209d.js');
11
21
  var reactBootstrap = require('react-bootstrap');
12
- var useSWR = require('swr');
13
- var index = require('./index-bd6c9f56.js');
14
- var Local = require('passport-local');
15
- var mysql = require('mysql');
16
- var util = require('./util-6f784d85.js');
17
- var _commonjsHelpers = require('./_commonjsHelpers-06173234.js');
18
- var md5 = require('./md5-e1ca5797.js');
19
- require('./core.get-iterator-method-5643aa10.js');
20
- require('./web.dom.iterable-d98303e0.js');
21
- require('./_library-dd23b178.js');
22
- require('./_iter-detect-b1df62f0.js');
23
- require('./_object-pie-083f2dd6.js');
24
-
25
- function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
26
-
27
- var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
28
- var Router__default = /*#__PURE__*/_interopDefaultLegacy(Router);
29
- var useSWR__default = /*#__PURE__*/_interopDefaultLegacy(useSWR);
30
- var Local__default = /*#__PURE__*/_interopDefaultLegacy(Local);
31
- var mysql__default = /*#__PURE__*/_interopDefaultLegacy(mysql);
22
+ var util = require('./util-f2c1b65b.js');
23
+ var index$5 = require('./index-bd6c9f56.js');
24
+ var Local = _interopDefault(require('passport-local'));
25
+ var mysql = _interopDefault(require('mysql'));
26
+ var md5 = require('./md5-5039b1a6.js');
32
27
 
33
28
  var returnFormField = function returnFormField(_ref) {
34
29
  var name = _ref.name,
@@ -67,21 +62,21 @@ var returnFormField = function returnFormField(_ref) {
67
62
  }
68
63
 
69
64
  if (type == 'text' || type == 'email' || type == 'password' || type == 'number') {
70
- return React__default['default'].createElement(
65
+ return React__default.createElement(
71
66
  reactBootstrap.Form.Group,
72
- _extends._extends({}, opts, { controlId: name }),
73
- React__default['default'].createElement(
67
+ _extends$1._extends({}, opts, { controlId: name }),
68
+ React__default.createElement(
74
69
  reactBootstrap.Form.Label,
75
70
  { kye: name + '_label' },
76
71
  label,
77
- required && React__default['default'].createElement(
72
+ required && React__default.createElement(
78
73
  'span',
79
74
  { style: { color: 'red' } },
80
75
  '*'
81
76
  )
82
77
  ),
83
- React__default['default'].createElement(reactBootstrap.Form.Control, { key: name + '_' + type, type: type, readOnly: readonly, name: name, placeholder: '', defaultValue: default_value, required: required }),
84
- React__default['default'].createElement(
78
+ React__default.createElement(reactBootstrap.Form.Control, { key: name + '_' + type, type: type, readOnly: readonly, name: name, placeholder: '', defaultValue: default_value, required: required }),
79
+ React__default.createElement(
85
80
  reactBootstrap.Form.Control.Feedback,
86
81
  { key: name + '_feedback', type: 'invalid' },
87
82
  errors[name]
@@ -89,28 +84,28 @@ var returnFormField = function returnFormField(_ref) {
89
84
  );
90
85
  }
91
86
  if (type == 'select') {
92
- return React__default['default'].createElement(
87
+ return React__default.createElement(
93
88
  reactBootstrap.Form.Group,
94
- _extends._extends({}, opts, { key: name, controlId: name }),
95
- React__default['default'].createElement(
89
+ _extends$1._extends({}, opts, { key: name, controlId: name }),
90
+ React__default.createElement(
96
91
  reactBootstrap.Form.Label,
97
92
  { key: name + '_' + label },
98
93
  label,
99
- required && React__default['default'].createElement(
94
+ required && React__default.createElement(
100
95
  'span',
101
96
  { key: name + '_required_span', style: { color: 'red' } },
102
97
  '*'
103
98
  )
104
99
  ),
105
- React__default['default'].createElement(
100
+ React__default.createElement(
106
101
  reactBootstrap.Form.Control,
107
102
  { key: name + '_select', as: 'select', name: name, required: required, defaultValue: default_value },
108
- React__default['default'].createElement('option', { value: '', key: name + '_options_empty' }),
103
+ React__default.createElement('option', { value: '', key: name + '_options_empty' }),
109
104
  options.map(function (option, index) {
110
105
  var value = option.value ? option.value : option;
111
106
  var label = option.label ? option.label : option;
112
107
  var key = name + '_options_' + index;
113
- return React__default['default'].createElement(
108
+ return React__default.createElement(
114
109
  'option',
115
110
  { key: key, value: value },
116
111
  label
@@ -121,32 +116,1081 @@ var returnFormField = function returnFormField(_ref) {
121
116
  }
122
117
 
123
118
  if (type == 'radio' || type == 'checkbox') {
124
- return React__default['default'].createElement(
119
+ return React__default.createElement(
125
120
  reactBootstrap.Form.Group,
126
121
  opts,
127
- React__default['default'].createElement(
122
+ React__default.createElement(
128
123
  reactBootstrap.Form.Label,
129
124
  null,
130
125
  label,
131
- required && React__default['default'].createElement(
126
+ required && React__default.createElement(
132
127
  'span',
133
128
  { style: { color: 'red' } },
134
129
  '*'
135
130
  )
136
131
  ),
137
132
  options.map(function (option, index) {
138
- return React__default['default'].createElement(
133
+ return React__default.createElement(
139
134
  reactBootstrap.Form.Check,
140
135
  { type: type, key: index, required: required },
141
- React__default['default'].createElement(reactBootstrap.Form.Check.Input, { type: type, key: type + '_' + index + '_input', defaultChecked: default_value ? default_value === option.value : false, name: name, id: name + '_' + index, value: option.value, required: required }),
142
- React__default['default'].createElement(reactBootstrap.Form.Check.Label, { style: { cursor: 'pointer' }, 'for': name + '_' + index, key: type + '_' + index + '_label', dangerouslySetInnerHTML: { __html: option.label } })
136
+ React__default.createElement(reactBootstrap.Form.Check.Input, { type: type, key: type + '_' + index + '_input', defaultChecked: default_value ? default_value === option.value : false, name: name, id: name + '_' + index, value: option.value, required: required }),
137
+ React__default.createElement(reactBootstrap.Form.Check.Label, { style: { cursor: 'pointer' }, 'for': name + '_' + index, key: type + '_' + index + '_label', dangerouslySetInnerHTML: { __html: option.label } })
143
138
  );
144
139
  })
145
140
  );
146
141
  }
147
142
  };
148
143
 
149
- var _this$4 = undefined;
144
+ var has = Object.prototype.hasOwnProperty;
145
+
146
+ function dequal(foo, bar) {
147
+ var ctor, len;
148
+ if (foo === bar) return true;
149
+
150
+ if (foo && bar && (ctor=foo.constructor) === bar.constructor) {
151
+ if (ctor === Date) return foo.getTime() === bar.getTime();
152
+ if (ctor === RegExp) return foo.toString() === bar.toString();
153
+
154
+ if (ctor === Array) {
155
+ if ((len=foo.length) === bar.length) {
156
+ while (len-- && dequal(foo[len], bar[len]));
157
+ }
158
+ return len === -1;
159
+ }
160
+
161
+ if (!ctor || typeof foo === 'object') {
162
+ len = 0;
163
+ for (ctor in foo) {
164
+ if (has.call(foo, ctor) && ++len && !has.call(bar, ctor)) return false;
165
+ if (!(ctor in bar) || !dequal(foo[ctor], bar[ctor])) return false;
166
+ }
167
+ return Object.keys(bar).length === len;
168
+ }
169
+ }
170
+
171
+ return foo !== foo && bar !== bar;
172
+ }
173
+
174
+ // use WeakMap to store the object->key mapping
175
+ // so the objects can be garbage collected.
176
+ // WeakMap uses a hashtable under the hood, so the lookup
177
+ // complexity is almost O(1).
178
+ var table = new WeakMap();
179
+ // counter of the key
180
+ var counter = 0;
181
+ // hashes an array of objects and returns a string
182
+ function hash(args) {
183
+ if (!args.length)
184
+ return '';
185
+ var key = 'arg';
186
+ for (var i = 0; i < args.length; ++i) {
187
+ if (args[i] === null) {
188
+ key += '@null';
189
+ continue;
190
+ }
191
+ var _hash = void 0;
192
+ if (typeof args[i] !== 'object' && typeof args[i] !== 'function') {
193
+ // need to consider the case that args[i] is a string:
194
+ // args[i] _hash
195
+ // "undefined" -> '"undefined"'
196
+ // undefined -> 'undefined'
197
+ // 123 -> '123'
198
+ // "null" -> '"null"'
199
+ if (typeof args[i] === 'string') {
200
+ _hash = '"' + args[i] + '"';
201
+ }
202
+ else {
203
+ _hash = String(args[i]);
204
+ }
205
+ }
206
+ else {
207
+ if (!table.has(args[i])) {
208
+ _hash = counter;
209
+ table.set(args[i], counter++);
210
+ }
211
+ else {
212
+ _hash = table.get(args[i]);
213
+ }
214
+ }
215
+ key += '@' + _hash;
216
+ }
217
+ return key;
218
+ }
219
+
220
+ var Cache = /** @class */ (function () {
221
+ function Cache(initialData) {
222
+ if (initialData === void 0) { initialData = {}; }
223
+ this.cache = new Map(Object.entries(initialData));
224
+ this.subs = [];
225
+ }
226
+ Cache.prototype.get = function (key) {
227
+ var _key = this.serializeKey(key)[0];
228
+ return this.cache.get(_key);
229
+ };
230
+ Cache.prototype.set = function (key, value) {
231
+ var _key = this.serializeKey(key)[0];
232
+ this.cache.set(_key, value);
233
+ this.notify();
234
+ };
235
+ Cache.prototype.keys = function () {
236
+ return Array.from(this.cache.keys());
237
+ };
238
+ Cache.prototype.has = function (key) {
239
+ var _key = this.serializeKey(key)[0];
240
+ return this.cache.has(_key);
241
+ };
242
+ Cache.prototype.clear = function () {
243
+ this.cache.clear();
244
+ this.notify();
245
+ };
246
+ Cache.prototype.delete = function (key) {
247
+ var _key = this.serializeKey(key)[0];
248
+ this.cache.delete(_key);
249
+ this.notify();
250
+ };
251
+ // TODO: introduce namespace for the cache
252
+ Cache.prototype.serializeKey = function (key) {
253
+ var args = null;
254
+ if (typeof key === 'function') {
255
+ try {
256
+ key = key();
257
+ }
258
+ catch (err) {
259
+ // dependencies not ready
260
+ key = '';
261
+ }
262
+ }
263
+ if (Array.isArray(key)) {
264
+ // args array
265
+ args = key;
266
+ key = hash(key);
267
+ }
268
+ else {
269
+ // convert null to ''
270
+ key = String(key || '');
271
+ }
272
+ var errorKey = key ? 'err@' + key : '';
273
+ var isValidatingKey = key ? 'validating@' + key : '';
274
+ return [key, args, errorKey, isValidatingKey];
275
+ };
276
+ Cache.prototype.subscribe = function (listener) {
277
+ var _this = this;
278
+ if (typeof listener !== 'function') {
279
+ throw new Error('Expected the listener to be a function.');
280
+ }
281
+ var isSubscribed = true;
282
+ this.subs.push(listener);
283
+ return function () {
284
+ if (!isSubscribed)
285
+ return;
286
+ isSubscribed = false;
287
+ var index = _this.subs.indexOf(listener);
288
+ if (index > -1) {
289
+ _this.subs[index] = _this.subs[_this.subs.length - 1];
290
+ _this.subs.length--;
291
+ }
292
+ };
293
+ };
294
+ // Notify Cache subscribers about a change in the cache
295
+ Cache.prototype.notify = function () {
296
+ for (var _i = 0, _a = this.subs; _i < _a.length; _i++) {
297
+ var listener = _a[_i];
298
+ listener();
299
+ }
300
+ };
301
+ return Cache;
302
+ }());
303
+
304
+ /**
305
+ * Due to bug https://bugs.chromium.org/p/chromium/issues/detail?id=678075,
306
+ * it's not reliable to detect if the browser is currently online or offline
307
+ * based on `navigator.onLine`.
308
+ * As a work around, we always assume it's online on first load, and change
309
+ * the status upon `online` or `offline` events.
310
+ */
311
+ var online = true;
312
+ var isOnline = function () { return online; };
313
+ var isDocumentVisible = function () {
314
+ if (typeof document !== 'undefined' &&
315
+ document.visibilityState !== undefined) {
316
+ return document.visibilityState !== 'hidden';
317
+ }
318
+ // always assume it's visible
319
+ return true;
320
+ };
321
+ var fetcher = function (url) { return fetch(url).then(function (res) { return res.json(); }); };
322
+ var registerOnFocus = function (cb) {
323
+ if (typeof window !== 'undefined' &&
324
+ window.addEventListener !== undefined &&
325
+ typeof document !== 'undefined' &&
326
+ document.addEventListener !== undefined) {
327
+ // focus revalidate
328
+ document.addEventListener('visibilitychange', function () { return cb(); }, false);
329
+ window.addEventListener('focus', function () { return cb(); }, false);
330
+ }
331
+ };
332
+ var registerOnReconnect = function (cb) {
333
+ if (typeof window !== 'undefined' && window.addEventListener !== undefined) {
334
+ // reconnect revalidate
335
+ window.addEventListener('online', function () {
336
+ online = true;
337
+ cb();
338
+ }, false);
339
+ // nothing to revalidate, just update the status
340
+ window.addEventListener('offline', function () { return (online = false); }, false);
341
+ }
342
+ };
343
+ var webPreset = {
344
+ isOnline: isOnline,
345
+ isDocumentVisible: isDocumentVisible,
346
+ fetcher: fetcher,
347
+ registerOnFocus: registerOnFocus,
348
+ registerOnReconnect: registerOnReconnect
349
+ };
350
+
351
+ var __assign = (undefined && undefined.__assign) || function () {
352
+ __assign = Object.assign || function(t) {
353
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
354
+ s = arguments[i];
355
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
356
+ t[p] = s[p];
357
+ }
358
+ return t;
359
+ };
360
+ return __assign.apply(this, arguments);
361
+ };
362
+ // cache
363
+ var cache = new Cache();
364
+ // error retry
365
+ function onErrorRetry(_, __, config, revalidate, opts) {
366
+ if (!config.isDocumentVisible()) {
367
+ // if it's hidden, stop
368
+ // it will auto revalidate when focus
369
+ return;
370
+ }
371
+ if (typeof config.errorRetryCount === 'number' &&
372
+ opts.retryCount > config.errorRetryCount) {
373
+ return;
374
+ }
375
+ // exponential backoff
376
+ var count = Math.min(opts.retryCount, 8);
377
+ var timeout = ~~((Math.random() + 0.5) * (1 << count)) * config.errorRetryInterval;
378
+ setTimeout(revalidate, timeout, opts);
379
+ }
380
+ // client side: need to adjust the config
381
+ // based on the browser status
382
+ // slow connection (<= 70Kbps)
383
+ var slowConnection = typeof window !== 'undefined' &&
384
+ // @ts-ignore
385
+ navigator['connection'] &&
386
+ // @ts-ignore
387
+ ['slow-2g', '2g'].indexOf(navigator['connection'].effectiveType) !== -1;
388
+ // config
389
+ var defaultConfig = __assign({
390
+ // events
391
+ onLoadingSlow: function () { }, onSuccess: function () { }, onError: function () { }, onErrorRetry: onErrorRetry, errorRetryInterval: (slowConnection ? 10 : 5) * 1000, focusThrottleInterval: 5 * 1000, dedupingInterval: 2 * 1000, loadingTimeout: (slowConnection ? 5 : 3) * 1000, refreshInterval: 0, revalidateOnFocus: true, revalidateOnReconnect: true, refreshWhenHidden: false, refreshWhenOffline: false, shouldRetryOnError: true, suspense: false, compare: dequal, isPaused: function () { return false; } }, webPreset);
392
+
393
+ var IS_SERVER = typeof window === 'undefined' ||
394
+ // @ts-ignore
395
+ !!(typeof Deno !== 'undefined' && Deno && Deno.version && Deno.version.deno);
396
+ // polyfill for requestAnimationFrame
397
+ var rAF = IS_SERVER
398
+ ? null
399
+ : window['requestAnimationFrame']
400
+ ? function (f) { return window['requestAnimationFrame'](f); }
401
+ : function (f) { return setTimeout(f, 1); };
402
+ // React currently throws a warning when using useLayoutEffect on the server.
403
+ // To get around it, we can conditionally useEffect on the server (no-op) and
404
+ // useLayoutEffect in the browser.
405
+ var useIsomorphicLayoutEffect = IS_SERVER ? React.useEffect : React.useLayoutEffect;
406
+
407
+ var SWRConfigContext = React.createContext({});
408
+ SWRConfigContext.displayName = 'SWRConfigContext';
409
+
410
+ var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
411
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
412
+ return new (P || (P = Promise))(function (resolve, reject) {
413
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
414
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
415
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
416
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
417
+ });
418
+ };
419
+ var __generator = (undefined && undefined.__generator) || function (thisArg, body) {
420
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
421
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
422
+ function verb(n) { return function (v) { return step([n, v]); }; }
423
+ function step(op) {
424
+ if (f) throw new TypeError("Generator is already executing.");
425
+ while (_) try {
426
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
427
+ if (y = 0, t) op = [op[0] & 2, t.value];
428
+ switch (op[0]) {
429
+ case 0: case 1: t = op; break;
430
+ case 4: _.label++; return { value: op[1], done: false };
431
+ case 5: _.label++; y = op[1]; op = [0]; continue;
432
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
433
+ default:
434
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
435
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
436
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
437
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
438
+ if (t[2]) _.ops.pop();
439
+ _.trys.pop(); continue;
440
+ }
441
+ op = body.call(thisArg, _);
442
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
443
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
444
+ }
445
+ };
446
+ // global state managers
447
+ var CONCURRENT_PROMISES = {};
448
+ var CONCURRENT_PROMISES_TS = {};
449
+ var FOCUS_REVALIDATORS = {};
450
+ var RECONNECT_REVALIDATORS = {};
451
+ var CACHE_REVALIDATORS = {};
452
+ var MUTATION_TS = {};
453
+ var MUTATION_END_TS = {};
454
+ // generate strictly increasing timestamps
455
+ var now = (function () {
456
+ var ts = 0;
457
+ return function () { return ++ts; };
458
+ })();
459
+ // setup DOM events listeners for `focus` and `reconnect` actions
460
+ if (!IS_SERVER) {
461
+ var revalidate_1 = function (revalidators) {
462
+ if (!defaultConfig.isDocumentVisible() || !defaultConfig.isOnline())
463
+ return;
464
+ for (var key in revalidators) {
465
+ if (revalidators[key][0])
466
+ revalidators[key][0]();
467
+ }
468
+ };
469
+ if (typeof defaultConfig.registerOnFocus === 'function') {
470
+ defaultConfig.registerOnFocus(function () { return revalidate_1(FOCUS_REVALIDATORS); });
471
+ }
472
+ if (typeof defaultConfig.registerOnReconnect === 'function') {
473
+ defaultConfig.registerOnReconnect(function () { return revalidate_1(RECONNECT_REVALIDATORS); });
474
+ }
475
+ }
476
+ var trigger = function (_key, shouldRevalidate) {
477
+ if (shouldRevalidate === void 0) { shouldRevalidate = true; }
478
+ // we are ignoring the second argument which correspond to the arguments
479
+ // the fetcher will receive when key is an array
480
+ var _a = cache.serializeKey(_key), key = _a[0], keyErr = _a[2], keyValidating = _a[3];
481
+ if (!key)
482
+ return Promise.resolve();
483
+ var updaters = CACHE_REVALIDATORS[key];
484
+ if (key && updaters) {
485
+ var currentData = cache.get(key);
486
+ var currentError = cache.get(keyErr);
487
+ var currentIsValidating = cache.get(keyValidating);
488
+ var promises = [];
489
+ for (var i = 0; i < updaters.length; ++i) {
490
+ promises.push(updaters[i](shouldRevalidate, currentData, currentError, currentIsValidating, i > 0));
491
+ }
492
+ // return new updated value
493
+ return Promise.all(promises).then(function () { return cache.get(key); });
494
+ }
495
+ return Promise.resolve(cache.get(key));
496
+ };
497
+ var broadcastState = function (key, data, error, isValidating) {
498
+ var updaters = CACHE_REVALIDATORS[key];
499
+ if (key && updaters) {
500
+ for (var i = 0; i < updaters.length; ++i) {
501
+ updaters[i](false, data, error, isValidating);
502
+ }
503
+ }
504
+ };
505
+ var mutate = function (_key, _data, shouldRevalidate) {
506
+ if (shouldRevalidate === void 0) { shouldRevalidate = true; }
507
+ return __awaiter(void 0, void 0, void 0, function () {
508
+ var _a, key, keyErr, beforeMutationTs, beforeConcurrentPromisesTs, data, error, isAsyncMutation, err_1, shouldAbort, updaters, promises, i;
509
+ return __generator(this, function (_b) {
510
+ switch (_b.label) {
511
+ case 0:
512
+ _a = cache.serializeKey(_key), key = _a[0], keyErr = _a[2];
513
+ if (!key)
514
+ return [2 /*return*/];
515
+ // if there is no new data to update, let's just revalidate the key
516
+ if (typeof _data === 'undefined')
517
+ return [2 /*return*/, trigger(_key, shouldRevalidate)
518
+ // update global timestamps
519
+ ];
520
+ // update global timestamps
521
+ MUTATION_TS[key] = now() - 1;
522
+ MUTATION_END_TS[key] = 0;
523
+ beforeMutationTs = MUTATION_TS[key];
524
+ beforeConcurrentPromisesTs = CONCURRENT_PROMISES_TS[key];
525
+ isAsyncMutation = false;
526
+ if (_data && typeof _data === 'function') {
527
+ // `_data` is a function, call it passing current cache value
528
+ try {
529
+ _data = _data(cache.get(key));
530
+ }
531
+ catch (err) {
532
+ // if `_data` function throws an error synchronously, it shouldn't be cached
533
+ _data = undefined;
534
+ error = err;
535
+ }
536
+ }
537
+ if (!(_data && typeof _data.then === 'function')) return [3 /*break*/, 5];
538
+ // `_data` is a promise
539
+ isAsyncMutation = true;
540
+ _b.label = 1;
541
+ case 1:
542
+ _b.trys.push([1, 3, , 4]);
543
+ return [4 /*yield*/, _data];
544
+ case 2:
545
+ data = _b.sent();
546
+ return [3 /*break*/, 4];
547
+ case 3:
548
+ err_1 = _b.sent();
549
+ error = err_1;
550
+ return [3 /*break*/, 4];
551
+ case 4: return [3 /*break*/, 6];
552
+ case 5:
553
+ data = _data;
554
+ _b.label = 6;
555
+ case 6:
556
+ shouldAbort = function () {
557
+ // check if other mutations have occurred since we've started this mutation
558
+ if (beforeMutationTs !== MUTATION_TS[key] ||
559
+ beforeConcurrentPromisesTs !== CONCURRENT_PROMISES_TS[key]) {
560
+ if (error)
561
+ throw error;
562
+ return true;
563
+ }
564
+ };
565
+ // if there's a race we don't update cache or broadcast change, just return the data
566
+ if (shouldAbort())
567
+ return [2 /*return*/, data];
568
+ if (typeof data !== 'undefined') {
569
+ // update cached data
570
+ cache.set(key, data);
571
+ }
572
+ // always update or reset the error
573
+ cache.set(keyErr, error);
574
+ // reset the timestamp to mark the mutation has ended
575
+ MUTATION_END_TS[key] = now() - 1;
576
+ if (!isAsyncMutation) {
577
+ // we skip broadcasting if there's another mutation happened synchronously
578
+ if (shouldAbort())
579
+ return [2 /*return*/, data];
580
+ }
581
+ updaters = CACHE_REVALIDATORS[key];
582
+ if (updaters) {
583
+ promises = [];
584
+ for (i = 0; i < updaters.length; ++i) {
585
+ promises.push(updaters[i](!!shouldRevalidate, data, error, undefined, i > 0));
586
+ }
587
+ // return new updated value
588
+ return [2 /*return*/, Promise.all(promises).then(function () {
589
+ if (error)
590
+ throw error;
591
+ return cache.get(key);
592
+ })];
593
+ }
594
+ // throw error or return data to be used by caller of mutate
595
+ if (error)
596
+ throw error;
597
+ return [2 /*return*/, data];
598
+ }
599
+ });
600
+ });
601
+ };
602
+ function useSWR() {
603
+ var _this = this;
604
+ var args = [];
605
+ for (var _i = 0; _i < arguments.length; _i++) {
606
+ args[_i] = arguments[_i];
607
+ }
608
+ var _key = args[0];
609
+ var config = Object.assign({}, defaultConfig, React.useContext(SWRConfigContext), args.length > 2
610
+ ? args[2]
611
+ : args.length === 2 && typeof args[1] === 'object'
612
+ ? args[1]
613
+ : {});
614
+ // in typescript args.length > 2 is not same as args.lenth === 3
615
+ // we do a safe type assertion here
616
+ // args.length === 3
617
+ var fn = (args.length > 2
618
+ ? args[1]
619
+ : args.length === 2 && typeof args[1] === 'function'
620
+ ? args[1]
621
+ : /**
622
+ pass fn as null will disable revalidate
623
+ https://paco.sh/blog/shared-hook-state-with-swr
624
+ */
625
+ args[1] === null
626
+ ? args[1]
627
+ : config.fetcher);
628
+ // we assume `key` as the identifier of the request
629
+ // `key` can change but `fn` shouldn't
630
+ // (because `revalidate` only depends on `key`)
631
+ // `keyErr` is the cache key for error objects
632
+ var _a = cache.serializeKey(_key), key = _a[0], fnArgs = _a[1], keyErr = _a[2], keyValidating = _a[3];
633
+ var configRef = React.useRef(config);
634
+ useIsomorphicLayoutEffect(function () {
635
+ configRef.current = config;
636
+ });
637
+ var willRevalidateOnMount = function () {
638
+ return (config.revalidateOnMount ||
639
+ (!config.initialData && config.revalidateOnMount === undefined));
640
+ };
641
+ var resolveData = function () {
642
+ var cachedData = cache.get(key);
643
+ return typeof cachedData === 'undefined' ? config.initialData : cachedData;
644
+ };
645
+ var resolveIsValidating = function () {
646
+ return !!cache.get(keyValidating) || (key && willRevalidateOnMount());
647
+ };
648
+ var initialData = resolveData();
649
+ var initialError = cache.get(keyErr);
650
+ var initialIsValidating = resolveIsValidating();
651
+ // if a state is accessed (data, error or isValidating),
652
+ // we add the state to dependencies so if the state is
653
+ // updated in the future, we can trigger a rerender
654
+ var stateDependencies = React.useRef({
655
+ data: false,
656
+ error: false,
657
+ isValidating: false
658
+ });
659
+ var stateRef = React.useRef({
660
+ data: initialData,
661
+ error: initialError,
662
+ isValidating: initialIsValidating
663
+ });
664
+ // display the data label in the React DevTools next to SWR hooks
665
+ React.useDebugValue(stateRef.current.data);
666
+ var rerender = React.useState({})[1];
667
+ var dispatch = React.useCallback(function (payload) {
668
+ var shouldUpdateState = false;
669
+ for (var k in payload) {
670
+ // @ts-ignore
671
+ if (stateRef.current[k] === payload[k]) {
672
+ continue;
673
+ }
674
+ // @ts-ignore
675
+ stateRef.current[k] = payload[k];
676
+ // @ts-ignore
677
+ if (stateDependencies.current[k]) {
678
+ shouldUpdateState = true;
679
+ }
680
+ }
681
+ if (shouldUpdateState) {
682
+ // if component is unmounted, should skip rerender
683
+ // if component is not mounted, should skip rerender
684
+ if (unmountedRef.current || !initialMountedRef.current)
685
+ return;
686
+ rerender({});
687
+ }
688
+ },
689
+ // config.suspense isn't allowed to change during the lifecycle
690
+ // eslint-disable-next-line react-hooks/exhaustive-deps
691
+ []);
692
+ // error ref inside revalidate (is last request errored?)
693
+ var unmountedRef = React.useRef(false);
694
+ var keyRef = React.useRef(key);
695
+ // check if component is mounted in suspense mode
696
+ var initialMountedRef = React.useRef(false);
697
+ // do unmount check for callbacks
698
+ var eventsCallback = React.useCallback(function (event) {
699
+ var _a;
700
+ var params = [];
701
+ for (var _i = 1; _i < arguments.length; _i++) {
702
+ params[_i - 1] = arguments[_i];
703
+ }
704
+ if (unmountedRef.current)
705
+ return;
706
+ if (!initialMountedRef.current)
707
+ return;
708
+ if (key !== keyRef.current)
709
+ return;
710
+ // @ts-ignore
711
+ (_a = configRef.current)[event].apply(_a, params);
712
+ }, [key]);
713
+ var boundMutate = React.useCallback(function (data, shouldRevalidate) {
714
+ return mutate(keyRef.current, data, shouldRevalidate);
715
+ }, []);
716
+ var addRevalidator = function (revalidators, callback) {
717
+ if (!revalidators[key]) {
718
+ revalidators[key] = [callback];
719
+ }
720
+ else {
721
+ revalidators[key].push(callback);
722
+ }
723
+ return function () {
724
+ var keyedRevalidators = revalidators[key];
725
+ var index = keyedRevalidators.indexOf(callback);
726
+ if (index >= 0) {
727
+ // O(1): faster than splice
728
+ keyedRevalidators[index] =
729
+ keyedRevalidators[keyedRevalidators.length - 1];
730
+ keyedRevalidators.pop();
731
+ }
732
+ };
733
+ };
734
+ // start a revalidation
735
+ var revalidate = React.useCallback(function (revalidateOpts) {
736
+ if (revalidateOpts === void 0) { revalidateOpts = {}; }
737
+ return __awaiter(_this, void 0, void 0, function () {
738
+ var _a, retryCount, _b, dedupe, loading, shouldDeduping, newData, startAt, newState, err_2;
739
+ return __generator(this, function (_c) {
740
+ switch (_c.label) {
741
+ case 0:
742
+ if (!key || !fn)
743
+ return [2 /*return*/, false];
744
+ if (unmountedRef.current)
745
+ return [2 /*return*/, false];
746
+ if (configRef.current.isPaused())
747
+ return [2 /*return*/, false];
748
+ _a = revalidateOpts.retryCount, retryCount = _a === void 0 ? 0 : _a, _b = revalidateOpts.dedupe, dedupe = _b === void 0 ? false : _b;
749
+ loading = true;
750
+ shouldDeduping = typeof CONCURRENT_PROMISES[key] !== 'undefined' && dedupe;
751
+ _c.label = 1;
752
+ case 1:
753
+ _c.trys.push([1, 6, , 7]);
754
+ dispatch({
755
+ isValidating: true
756
+ });
757
+ cache.set(keyValidating, true);
758
+ if (!shouldDeduping) {
759
+ // also update other hooks
760
+ broadcastState(key, stateRef.current.data, stateRef.current.error, true);
761
+ }
762
+ newData = void 0;
763
+ startAt = void 0;
764
+ if (!shouldDeduping) return [3 /*break*/, 3];
765
+ // there's already an ongoing request,
766
+ // this one needs to be deduplicated.
767
+ startAt = CONCURRENT_PROMISES_TS[key];
768
+ return [4 /*yield*/, CONCURRENT_PROMISES[key]];
769
+ case 2:
770
+ newData = _c.sent();
771
+ return [3 /*break*/, 5];
772
+ case 3:
773
+ // if no cache being rendered currently (it shows a blank page),
774
+ // we trigger the loading slow event.
775
+ if (config.loadingTimeout && !cache.get(key)) {
776
+ setTimeout(function () {
777
+ if (loading)
778
+ eventsCallback('onLoadingSlow', key, config);
779
+ }, config.loadingTimeout);
780
+ }
781
+ if (fnArgs !== null) {
782
+ CONCURRENT_PROMISES[key] = fn.apply(void 0, fnArgs);
783
+ }
784
+ else {
785
+ CONCURRENT_PROMISES[key] = fn(key);
786
+ }
787
+ CONCURRENT_PROMISES_TS[key] = startAt = now();
788
+ return [4 /*yield*/, CONCURRENT_PROMISES[key]];
789
+ case 4:
790
+ newData = _c.sent();
791
+ setTimeout(function () {
792
+ delete CONCURRENT_PROMISES[key];
793
+ delete CONCURRENT_PROMISES_TS[key];
794
+ }, config.dedupingInterval);
795
+ // trigger the success event,
796
+ // only do this for the original request.
797
+ eventsCallback('onSuccess', newData, key, config);
798
+ _c.label = 5;
799
+ case 5:
800
+ // if there're other ongoing request(s), started after the current one,
801
+ // we need to ignore the current one to avoid possible race conditions:
802
+ // req1------------------>res1 (current one)
803
+ // req2---------------->res2
804
+ // the request that fired later will always be kept.
805
+ if (CONCURRENT_PROMISES_TS[key] > startAt) {
806
+ return [2 /*return*/, false];
807
+ }
808
+ // if there're other mutations(s), overlapped with the current revalidation:
809
+ // case 1:
810
+ // req------------------>res
811
+ // mutate------>end
812
+ // case 2:
813
+ // req------------>res
814
+ // mutate------>end
815
+ // case 3:
816
+ // req------------------>res
817
+ // mutate-------...---------->
818
+ // we have to ignore the revalidation result (res) because it's no longer fresh.
819
+ // meanwhile, a new revalidation should be triggered when the mutation ends.
820
+ if (MUTATION_TS[key] &&
821
+ // case 1
822
+ (startAt <= MUTATION_TS[key] ||
823
+ // case 2
824
+ startAt <= MUTATION_END_TS[key] ||
825
+ // case 3
826
+ MUTATION_END_TS[key] === 0)) {
827
+ dispatch({ isValidating: false });
828
+ return [2 /*return*/, false];
829
+ }
830
+ cache.set(keyErr, undefined);
831
+ cache.set(keyValidating, false);
832
+ newState = {
833
+ isValidating: false
834
+ };
835
+ if (typeof stateRef.current.error !== 'undefined') {
836
+ // we don't have an error
837
+ newState.error = undefined;
838
+ }
839
+ if (!config.compare(stateRef.current.data, newData)) {
840
+ // deep compare to avoid extra re-render
841
+ // data changed
842
+ newState.data = newData;
843
+ }
844
+ if (!config.compare(cache.get(key), newData)) {
845
+ cache.set(key, newData);
846
+ }
847
+ // merge the new state
848
+ dispatch(newState);
849
+ if (!shouldDeduping) {
850
+ // also update other hooks
851
+ broadcastState(key, newData, newState.error, false);
852
+ }
853
+ return [3 /*break*/, 7];
854
+ case 6:
855
+ err_2 = _c.sent();
856
+ delete CONCURRENT_PROMISES[key];
857
+ delete CONCURRENT_PROMISES_TS[key];
858
+ if (configRef.current.isPaused()) {
859
+ dispatch({
860
+ isValidating: false
861
+ });
862
+ return [2 /*return*/, false];
863
+ }
864
+ cache.set(keyErr, err_2);
865
+ // get a new error
866
+ // don't use deep equal for errors
867
+ if (stateRef.current.error !== err_2) {
868
+ // we keep the stale data
869
+ dispatch({
870
+ isValidating: false,
871
+ error: err_2
872
+ });
873
+ if (!shouldDeduping) {
874
+ // also broadcast to update other hooks
875
+ broadcastState(key, undefined, err_2, false);
876
+ }
877
+ }
878
+ // events and retry
879
+ eventsCallback('onError', err_2, key, config);
880
+ if (config.shouldRetryOnError) {
881
+ // when retrying, we always enable deduping
882
+ eventsCallback('onErrorRetry', err_2, key, config, revalidate, {
883
+ retryCount: retryCount + 1,
884
+ dedupe: true
885
+ });
886
+ }
887
+ return [3 /*break*/, 7];
888
+ case 7:
889
+ loading = false;
890
+ return [2 /*return*/, true];
891
+ }
892
+ });
893
+ });
894
+ },
895
+ // dispatch is immutable, and `eventsCallback`, `fnArgs`, `keyErr`, and `keyValidating` are based on `key`,
896
+ // so we can them from the deps array.
897
+ //
898
+ // FIXME:
899
+ // `fn` and `config` might be changed during the lifecycle,
900
+ // but they might be changed every render like this.
901
+ // useSWR('key', () => fetch('/api/'), { suspense: true })
902
+ // So we omit the values from the deps array
903
+ // even though it might cause unexpected behaviors.
904
+ // eslint-disable-next-line react-hooks/exhaustive-deps
905
+ [key]);
906
+ // mounted (client side rendering)
907
+ useIsomorphicLayoutEffect(function () {
908
+ if (!key)
909
+ return undefined;
910
+ // after `key` updates, we need to mark it as mounted
911
+ unmountedRef.current = false;
912
+ var isUpdating = initialMountedRef.current;
913
+ initialMountedRef.current = true;
914
+ // after the component is mounted (hydrated),
915
+ // we need to update the data from the cache
916
+ // and trigger a revalidation
917
+ var currentHookData = stateRef.current.data;
918
+ var latestKeyedData = resolveData();
919
+ // update the state if the key changed (not the inital render) or cache updated
920
+ keyRef.current = key;
921
+ if (!config.compare(currentHookData, latestKeyedData)) {
922
+ dispatch({ data: latestKeyedData });
923
+ }
924
+ // revalidate with deduping
925
+ var softRevalidate = function () { return revalidate({ dedupe: true }); };
926
+ // trigger a revalidation
927
+ if (isUpdating || willRevalidateOnMount()) {
928
+ if (typeof latestKeyedData !== 'undefined' && !IS_SERVER) {
929
+ // delay revalidate if there's cache
930
+ // to not block the rendering
931
+ // @ts-ignore it's safe to use requestAnimationFrame in browser
932
+ rAF(softRevalidate);
933
+ }
934
+ else {
935
+ softRevalidate();
936
+ }
937
+ }
938
+ var pending = false;
939
+ var onFocus = function () {
940
+ if (pending || !configRef.current.revalidateOnFocus)
941
+ return;
942
+ pending = true;
943
+ softRevalidate();
944
+ setTimeout(function () { return (pending = false); }, configRef.current.focusThrottleInterval);
945
+ };
946
+ var onReconnect = function () {
947
+ if (configRef.current.revalidateOnReconnect) {
948
+ softRevalidate();
949
+ }
950
+ };
951
+ // register global cache update listener
952
+ var onUpdate = function (shouldRevalidate, updatedData, updatedError, updatedIsValidating, dedupe) {
953
+ if (shouldRevalidate === void 0) { shouldRevalidate = true; }
954
+ if (dedupe === void 0) { dedupe = true; }
955
+ // update hook state
956
+ var newState = {};
957
+ var needUpdate = false;
958
+ if (typeof updatedData !== 'undefined' &&
959
+ !config.compare(stateRef.current.data, updatedData)) {
960
+ newState.data = updatedData;
961
+ needUpdate = true;
962
+ }
963
+ // always update error
964
+ // because it can be `undefined`
965
+ if (stateRef.current.error !== updatedError) {
966
+ newState.error = updatedError;
967
+ needUpdate = true;
968
+ }
969
+ if (typeof updatedIsValidating !== 'undefined' &&
970
+ stateRef.current.isValidating !== updatedIsValidating) {
971
+ newState.isValidating = updatedIsValidating;
972
+ needUpdate = true;
973
+ }
974
+ if (needUpdate) {
975
+ dispatch(newState);
976
+ }
977
+ if (shouldRevalidate) {
978
+ if (dedupe) {
979
+ return softRevalidate();
980
+ }
981
+ else {
982
+ return revalidate();
983
+ }
984
+ }
985
+ return false;
986
+ };
987
+ var unsubFocus = addRevalidator(FOCUS_REVALIDATORS, onFocus);
988
+ var unsubReconnect = addRevalidator(RECONNECT_REVALIDATORS, onReconnect);
989
+ var unsubUpdate = addRevalidator(CACHE_REVALIDATORS, onUpdate);
990
+ return function () {
991
+ // cleanup
992
+ dispatch = function () { return null; };
993
+ // mark it as unmounted
994
+ unmountedRef.current = true;
995
+ unsubFocus();
996
+ unsubReconnect();
997
+ unsubUpdate();
998
+ };
999
+ }, [key, revalidate]);
1000
+ useIsomorphicLayoutEffect(function () {
1001
+ var timer = null;
1002
+ var tick = function () { return __awaiter(_this, void 0, void 0, function () {
1003
+ return __generator(this, function (_a) {
1004
+ switch (_a.label) {
1005
+ case 0:
1006
+ if (!(!stateRef.current.error &&
1007
+ (configRef.current.refreshWhenHidden ||
1008
+ configRef.current.isDocumentVisible()) &&
1009
+ (configRef.current.refreshWhenOffline || configRef.current.isOnline()))) return [3 /*break*/, 2];
1010
+ // only revalidate when the page is visible
1011
+ // if API request errored, we stop polling in this round
1012
+ // and let the error retry function handle it
1013
+ return [4 /*yield*/, revalidate({ dedupe: true })];
1014
+ case 1:
1015
+ // only revalidate when the page is visible
1016
+ // if API request errored, we stop polling in this round
1017
+ // and let the error retry function handle it
1018
+ _a.sent();
1019
+ _a.label = 2;
1020
+ case 2:
1021
+ // Read the latest refreshInterval
1022
+ if (configRef.current.refreshInterval && timer) {
1023
+ timer = setTimeout(tick, configRef.current.refreshInterval);
1024
+ }
1025
+ return [2 /*return*/];
1026
+ }
1027
+ });
1028
+ }); };
1029
+ if (configRef.current.refreshInterval) {
1030
+ timer = setTimeout(tick, configRef.current.refreshInterval);
1031
+ }
1032
+ return function () {
1033
+ if (timer) {
1034
+ clearTimeout(timer);
1035
+ timer = null;
1036
+ }
1037
+ };
1038
+ }, [
1039
+ config.refreshInterval,
1040
+ config.refreshWhenHidden,
1041
+ config.refreshWhenOffline,
1042
+ revalidate
1043
+ ]);
1044
+ // suspense
1045
+ var latestData;
1046
+ var latestError;
1047
+ if (config.suspense) {
1048
+ // in suspense mode, we can't return empty state
1049
+ // (it should be suspended)
1050
+ // try to get data and error from cache
1051
+ latestData = cache.get(key);
1052
+ latestError = cache.get(keyErr);
1053
+ if (typeof latestData === 'undefined') {
1054
+ latestData = initialData;
1055
+ }
1056
+ if (typeof latestError === 'undefined') {
1057
+ latestError = initialError;
1058
+ }
1059
+ if (typeof latestData === 'undefined' &&
1060
+ typeof latestError === 'undefined') {
1061
+ // need to start the request if it hasn't
1062
+ if (!CONCURRENT_PROMISES[key]) {
1063
+ // trigger revalidate immediately
1064
+ // to get the promise
1065
+ // in this revalidate, should not rerender
1066
+ revalidate();
1067
+ }
1068
+ if (CONCURRENT_PROMISES[key] &&
1069
+ typeof CONCURRENT_PROMISES[key].then === 'function') {
1070
+ // if it is a promise
1071
+ throw CONCURRENT_PROMISES[key];
1072
+ }
1073
+ // it's a value, return it directly (override)
1074
+ latestData = CONCURRENT_PROMISES[key];
1075
+ }
1076
+ if (typeof latestData === 'undefined' && latestError) {
1077
+ // in suspense mode, throw error if there's no content
1078
+ throw latestError;
1079
+ }
1080
+ }
1081
+ // define returned state
1082
+ // can be memorized since the state is a ref
1083
+ var memoizedState = React.useMemo(function () {
1084
+ // revalidate will be deprecated in the 1.x release
1085
+ // because mutate() covers the same use case of revalidate().
1086
+ // This remains only for backward compatibility
1087
+ var state = { revalidate: revalidate, mutate: boundMutate };
1088
+ Object.defineProperties(state, {
1089
+ error: {
1090
+ // `key` might be changed in the upcoming hook re-render,
1091
+ // but the previous state will stay
1092
+ // so we need to match the latest key and data (fallback to `initialData`)
1093
+ get: function () {
1094
+ stateDependencies.current.error = true;
1095
+ if (config.suspense) {
1096
+ return latestError;
1097
+ }
1098
+ return keyRef.current === key ? stateRef.current.error : initialError;
1099
+ },
1100
+ enumerable: true
1101
+ },
1102
+ data: {
1103
+ get: function () {
1104
+ stateDependencies.current.data = true;
1105
+ if (config.suspense) {
1106
+ return latestData;
1107
+ }
1108
+ return keyRef.current === key ? stateRef.current.data : initialData;
1109
+ },
1110
+ enumerable: true
1111
+ },
1112
+ isValidating: {
1113
+ get: function () {
1114
+ stateDependencies.current.isValidating = true;
1115
+ return key ? stateRef.current.isValidating : false;
1116
+ },
1117
+ enumerable: true
1118
+ }
1119
+ });
1120
+ return state;
1121
+ // `config.suspense` isn't allowed to change during the lifecycle.
1122
+ // `boundMutate` is immutable, and the immutability of `revalidate` depends on `key`
1123
+ // so we can omit them from the deps array,
1124
+ // but we put it to enable react-hooks/exhaustive-deps rule.
1125
+ // `initialData` and `initialError` are not initial values
1126
+ // because they are changed during the lifecycle
1127
+ // so we should add them in the deps array.
1128
+ }, [
1129
+ revalidate,
1130
+ initialData,
1131
+ initialError,
1132
+ boundMutate,
1133
+ key,
1134
+ config.suspense,
1135
+ latestError,
1136
+ latestData
1137
+ ]);
1138
+ return memoizedState;
1139
+ }
1140
+ Object.defineProperty(SWRConfigContext.Provider, 'default', {
1141
+ value: defaultConfig
1142
+ });
1143
+ var SWRConfig = SWRConfigContext.Provider;
1144
+
1145
+ var __awaiter$1 = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
1146
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
1147
+ return new (P || (P = Promise))(function (resolve, reject) {
1148
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
1149
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
1150
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
1151
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
1152
+ });
1153
+ };
1154
+ var __generator$1 = (undefined && undefined.__generator) || function (thisArg, body) {
1155
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
1156
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
1157
+ function verb(n) { return function (v) { return step([n, v]); }; }
1158
+ function step(op) {
1159
+ if (f) throw new TypeError("Generator is already executing.");
1160
+ while (_) try {
1161
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
1162
+ if (y = 0, t) op = [op[0] & 2, t.value];
1163
+ switch (op[0]) {
1164
+ case 0: case 1: t = op; break;
1165
+ case 4: _.label++; return { value: op[1], done: false };
1166
+ case 5: _.label++; y = op[1]; op = [0]; continue;
1167
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
1168
+ default:
1169
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
1170
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
1171
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
1172
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
1173
+ if (t[2]) _.ops.pop();
1174
+ _.trys.pop(); continue;
1175
+ }
1176
+ op = body.call(thisArg, _);
1177
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
1178
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
1179
+ }
1180
+ };
1181
+ var __rest = (undefined && undefined.__rest) || function (s, e) {
1182
+ var t = {};
1183
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
1184
+ t[p] = s[p];
1185
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
1186
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
1187
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
1188
+ t[p[i]] = s[p[i]];
1189
+ }
1190
+ return t;
1191
+ };
1192
+
1193
+ var _this = undefined;
150
1194
 
151
1195
  var dataHandler = function () {
152
1196
  var _ref = asyncToGenerator._asyncToGenerator( /*#__PURE__*/asyncToGenerator.regenerator.mark(function _callee(api_url, body) {
@@ -212,7 +1256,7 @@ var dataHandler = function () {
212
1256
  return _context.stop();
213
1257
  }
214
1258
  }
215
- }, _callee, _this$4, [[0, 20]]);
1259
+ }, _callee, _this, [[0, 20]]);
216
1260
  }));
217
1261
 
218
1262
  return function dataHandler(_x, _x2) {
@@ -225,7 +1269,7 @@ function useUser() {
225
1269
  redirectTo = _ref.redirectTo,
226
1270
  redirectIfFound = _ref.redirectIfFound;
227
1271
 
228
- var _useSWR = useSWR__default['default']('/api/auth/user', dataHandler),
1272
+ var _useSWR = useSWR('/api/auth/user', dataHandler),
229
1273
  data = _useSWR.data,
230
1274
  error = _useSWR.error;
231
1275
 
@@ -240,7 +1284,7 @@ function useUser() {
240
1284
  redirectTo && !redirectIfFound && !hasUser ||
241
1285
  // If redirectIfFound is also set, redirect if the user was found
242
1286
  redirectIfFound && hasUser) {
243
- Router__default['default'].push(redirectTo);
1287
+ Router__default.push(redirectTo);
244
1288
  }
245
1289
  }, [redirectTo, redirectIfFound, finished, hasUser]);
246
1290
 
@@ -346,43 +1390,43 @@ var LoginForm = function LoginForm(props) {
346
1390
  loading = _useState4[0],
347
1391
  setLoading = _useState4[1];
348
1392
 
349
- return React__default['default'].createElement(
1393
+ return React__default.createElement(
350
1394
  reactBootstrap.Form,
351
1395
  { className: 'login', onSubmit: handleSubmit },
352
- React__default['default'].createElement(
1396
+ React__default.createElement(
353
1397
  'h1',
354
1398
  null,
355
1399
  'Login'
356
1400
  ),
357
- React__default['default'].createElement('hr', null),
1401
+ React__default.createElement('hr', null),
358
1402
  returnFormField({ name: 'email', label: 'Email', type: 'email', required: true }),
359
1403
  returnFormField({ name: 'password', label: 'Password', type: 'password', required: true }),
360
- React__default['default'].createElement('hr', null),
361
- React__default['default'].createElement(
1404
+ React__default.createElement('hr', null),
1405
+ React__default.createElement(
362
1406
  reactBootstrap.Form.Row,
363
1407
  null,
364
- React__default['default'].createElement(
1408
+ React__default.createElement(
365
1409
  reactBootstrap.Form.Group,
366
1410
  { as: reactBootstrap.Col },
367
- React__default['default'].createElement(
1411
+ React__default.createElement(
368
1412
  'a',
369
1413
  { href: '/auth/signup' },
370
1414
  'I don\'t have an account'
371
1415
  )
372
1416
  ),
373
- React__default['default'].createElement(
1417
+ React__default.createElement(
374
1418
  reactBootstrap.Form.Group,
375
1419
  { as: reactBootstrap.Col, className: 'text-right' },
376
- !loading && React__default['default'].createElement(
1420
+ !loading && React__default.createElement(
377
1421
  reactBootstrap.Button,
378
1422
  { type: 'submit' },
379
1423
  'Login'
380
1424
  ),
381
- loading && React__default['default'].createElement(
1425
+ loading && React__default.createElement(
382
1426
  reactBootstrap.Button,
383
1427
  { variant: 'primary', disabled: true },
384
- React__default['default'].createElement(reactBootstrap.Spinner, { as: 'span', animation: 'border', role: 'status', 'aria-hidden': 'true', size: 'sm' }),
385
- React__default['default'].createElement(
1428
+ React__default.createElement(reactBootstrap.Spinner, { as: 'span', animation: 'border', role: 'status', 'aria-hidden': 'true', size: 'sm' }),
1429
+ React__default.createElement(
386
1430
  'span',
387
1431
  { className: 'sr-only' },
388
1432
  'Loading...'
@@ -390,12 +1434,12 @@ var LoginForm = function LoginForm(props) {
390
1434
  )
391
1435
  )
392
1436
  ),
393
- errorMsg && React__default['default'].createElement(
1437
+ errorMsg && React__default.createElement(
394
1438
  'p',
395
1439
  { className: 'error' },
396
1440
  errorMsg
397
1441
  ),
398
- React__default['default'].createElement(
1442
+ React__default.createElement(
399
1443
  'style',
400
1444
  { jsx: 'true'.toString() },
401
1445
  '\n .login {\n margin: 0 auto;\n padding: 1rem;\n border: 1px solid #ccc;\n border-radius: 4px;\n }\n .error {\n color: red;\n margin: 1rem 0 0;\n }\n '
@@ -408,9 +1452,9 @@ var countries = ["United States", "Afghanistan", "Albania", "Algeria", "American
408
1452
 
409
1453
  var states = ['AL', 'AK', 'AS', 'AZ', 'AR', 'CA', 'CO', 'CT', 'DE', 'DC', 'FM', 'FL', 'GA', 'GU', 'HI', 'ID', 'IL', 'IN', 'IA', 'KS', 'KY', 'LA', 'ME', 'MH', 'MD', 'MA', 'MI', 'MN', 'MS', 'MO', 'MT', 'NE', 'NV', 'NH', 'NJ', 'NM', 'NY', 'NC', 'ND', 'MP', 'OH', 'OK', 'OR', 'PW', 'PA', 'PR', 'RI', 'SC', 'SD', 'TN', 'TX', 'UT', 'VT', 'VI', 'VA', 'WA', 'WV', 'WI', 'WY'];
410
1454
 
411
- var _this$3 = undefined;
1455
+ var _this$1 = undefined;
412
1456
 
413
- var SignupForm$1 = function SignupForm(props) {
1457
+ var SignupForm = function SignupForm(props) {
414
1458
  var handleSubmit = function () {
415
1459
  var _ref3 = asyncToGenerator._asyncToGenerator( /*#__PURE__*/asyncToGenerator.regenerator.mark(function _callee3(e) {
416
1460
  var formData, body, _iteratorNormalCompletion, _didIteratorError, _iteratorError, _iterator, _step, key, res;
@@ -571,7 +1615,7 @@ var SignupForm$1 = function SignupForm(props) {
571
1615
  return _context.stop();
572
1616
  }
573
1617
  }
574
- }, _callee, _this$3);
1618
+ }, _callee, _this$1);
575
1619
  }));
576
1620
 
577
1621
  return function loadInitData() {
@@ -638,7 +1682,7 @@ var SignupForm$1 = function SignupForm(props) {
638
1682
  return _context2.stop();
639
1683
  }
640
1684
  }
641
- }, _callee2, _this$3);
1685
+ }, _callee2, _this$1);
642
1686
  }));
643
1687
 
644
1688
  return function handleOccupationChanged(_x) {
@@ -651,29 +1695,29 @@ var SignupForm$1 = function SignupForm(props) {
651
1695
  loading = _useState14[0],
652
1696
  setLoading = _useState14[1];
653
1697
 
654
- return React__default['default'].createElement(
1698
+ return React__default.createElement(
655
1699
  reactBootstrap.Form,
656
1700
  { className: 'login', id: 'signupForm', onSubmit: handleSubmit },
657
- React__default['default'].createElement(
1701
+ React__default.createElement(
658
1702
  'h1',
659
1703
  null,
660
1704
  'Sign Up'
661
1705
  ),
662
- React__default['default'].createElement('hr', null),
1706
+ React__default.createElement('hr', null),
663
1707
  returnFormField({ name: 'email', label: 'Email', type: 'email', required: true }),
664
- React__default['default'].createElement(
1708
+ React__default.createElement(
665
1709
  reactBootstrap.Form.Row,
666
1710
  null,
667
1711
  returnFormField({ name: 'password', label: 'Password', type: 'password', groupType: reactBootstrap.Col, required: true }),
668
1712
  returnFormField({ name: 'rpassword', label: 'Retype Password', type: 'password', groupType: reactBootstrap.Col, required: true })
669
1713
  ),
670
- React__default['default'].createElement(
1714
+ React__default.createElement(
671
1715
  reactBootstrap.Form.Row,
672
1716
  null,
673
1717
  returnFormField({ name: 'first_name', label: 'First Name', type: 'text', groupType: reactBootstrap.Col, required: true }),
674
1718
  returnFormField({ name: 'last_name', label: 'Last Name', type: 'text', groupType: reactBootstrap.Col, required: true })
675
1719
  ),
676
- React__default['default'].createElement(
1720
+ React__default.createElement(
677
1721
  reactBootstrap.Form.Row,
678
1722
  null,
679
1723
  returnFormField({
@@ -687,7 +1731,7 @@ var SignupForm$1 = function SignupForm(props) {
687
1731
  }),
688
1732
  countryUS && returnFormField({ name: 'state', label: 'State', type: 'select', required: true, groupType: reactBootstrap.Col, options: states })
689
1733
  ),
690
- React__default['default'].createElement(
1734
+ React__default.createElement(
691
1735
  reactBootstrap.Form.Row,
692
1736
  null,
693
1737
  countryUS && returnFormField({ name: 'zip', label: 'Working Zip Code', type: 'text', required: true, groupType: reactBootstrap.Col }),
@@ -734,38 +1778,38 @@ var SignupForm$1 = function SignupForm(props) {
734
1778
  required: true,
735
1779
  options: [{ label: 'By registering you agree to our <a href="/terms" style="color:blue">Terms and Conditions</a> and <a href="/privacy" style="color:blue">Privacy Policy</a> and understand that you will be receiving email communications', value: 'Y' }]
736
1780
  }),
737
- React__default['default'].createElement('hr', null),
738
- React__default['default'].createElement(
1781
+ React__default.createElement('hr', null),
1782
+ React__default.createElement(
739
1783
  reactBootstrap.Form.Row,
740
1784
  null,
741
- React__default['default'].createElement(
1785
+ React__default.createElement(
742
1786
  reactBootstrap.Form.Group,
743
1787
  { as: reactBootstrap.Col },
744
- React__default['default'].createElement(
1788
+ React__default.createElement(
745
1789
  'a',
746
1790
  { href: '/auth/login' },
747
1791
  'I already have an account'
748
1792
  )
749
1793
  ),
750
- React__default['default'].createElement(
1794
+ React__default.createElement(
751
1795
  reactBootstrap.Form.Group,
752
1796
  { as: reactBootstrap.Col, className: 'text-right' },
753
- !loading && React__default['default'].createElement(
1797
+ !loading && React__default.createElement(
754
1798
  reactBootstrap.Button,
755
1799
  { type: 'submit' },
756
1800
  'Sign Up'
757
1801
  ),
758
- loading && React__default['default'].createElement(
1802
+ loading && React__default.createElement(
759
1803
  reactBootstrap.Button,
760
1804
  { variant: 'primary', disabled: true },
761
- React__default['default'].createElement(reactBootstrap.Spinner, {
1805
+ React__default.createElement(reactBootstrap.Spinner, {
762
1806
  as: 'span',
763
1807
  animation: 'border',
764
1808
  role: 'status',
765
1809
  'aria-hidden': 'true',
766
1810
  size: 'sm'
767
1811
  }),
768
- React__default['default'].createElement(
1812
+ React__default.createElement(
769
1813
  'span',
770
1814
  { className: 'sr-only' },
771
1815
  'Loading...'
@@ -773,12 +1817,12 @@ var SignupForm$1 = function SignupForm(props) {
773
1817
  )
774
1818
  )
775
1819
  ),
776
- errorMsg && React__default['default'].createElement(
1820
+ errorMsg && React__default.createElement(
777
1821
  'p',
778
1822
  { className: 'error' },
779
1823
  errorMsg
780
1824
  ),
781
- React__default['default'].createElement(
1825
+ React__default.createElement(
782
1826
  'style',
783
1827
  { jsx: 'true'.toString() },
784
1828
  ' \n .login {\n margin: 0 auto;\n padding: 1rem;\n border: 1px solid #ccc;\n border-radius: 4px;\n }\n .error {\n color: red;\n margin: 1rem 0 0;\n }\n '
@@ -788,7 +1832,7 @@ var SignupForm$1 = function SignupForm(props) {
788
1832
 
789
1833
  var _this$2 = undefined;
790
1834
 
791
- var SignupForm = function SignupForm(props) {
1835
+ var SignupForm$1 = function SignupForm(props) {
792
1836
  var handleSubmit = function () {
793
1837
  var _ref3 = asyncToGenerator._asyncToGenerator( /*#__PURE__*/asyncToGenerator.regenerator.mark(function _callee3(e) {
794
1838
  var formData, body, _iteratorNormalCompletion, _didIteratorError, _iteratorError, _iterator, _step, key, res;
@@ -1068,32 +2112,32 @@ var SignupForm = function SignupForm(props) {
1068
2112
  loading = _useState18[0],
1069
2113
  setLoading = _useState18[1];
1070
2114
 
1071
- return React__default['default'].createElement(
2115
+ return React__default.createElement(
1072
2116
  reactBootstrap.Form,
1073
2117
  { className: 'login', id: 'signupForm', onSubmit: handleSubmit },
1074
- React__default['default'].createElement(
2118
+ React__default.createElement(
1075
2119
  'h1',
1076
2120
  null,
1077
2121
  'Profile'
1078
2122
  ),
1079
- React__default['default'].createElement('hr', null),
1080
- userData ? React__default['default'].createElement(
1081
- React__default['default'].Fragment,
2123
+ React__default.createElement('hr', null),
2124
+ userData ? React__default.createElement(
2125
+ React__default.Fragment,
1082
2126
  null,
1083
2127
  returnFormField({ name: 'email', label: 'Email', type: 'email', required: true, readonly: true, default_value: userData.email }),
1084
- React__default['default'].createElement(
2128
+ React__default.createElement(
1085
2129
  reactBootstrap.Form.Row,
1086
2130
  null,
1087
2131
  returnFormField({ name: 'password', label: 'Password', type: 'password', groupType: reactBootstrap.Col, required: false }),
1088
2132
  returnFormField({ name: 'rpassword', label: 'Retype Password', type: 'password', groupType: reactBootstrap.Col, required: false })
1089
2133
  ),
1090
- React__default['default'].createElement(
2134
+ React__default.createElement(
1091
2135
  reactBootstrap.Form.Row,
1092
2136
  null,
1093
2137
  returnFormField({ name: 'first_name', label: 'First Name', type: 'text', groupType: reactBootstrap.Col, required: true, default_value: userData.shared.first_name }),
1094
2138
  returnFormField({ name: 'last_name', label: 'Last Name', type: 'text', groupType: reactBootstrap.Col, required: true, default_value: userData.shared.last_name })
1095
2139
  ),
1096
- React__default['default'].createElement(
2140
+ React__default.createElement(
1097
2141
  reactBootstrap.Form.Row,
1098
2142
  null,
1099
2143
  returnFormField({
@@ -1108,7 +2152,7 @@ var SignupForm = function SignupForm(props) {
1108
2152
  }),
1109
2153
  countryUS && returnFormField({ name: 'state', label: 'State', type: 'select', required: true, groupType: reactBootstrap.Col, options: states, default_value: userData.shared.state })
1110
2154
  ),
1111
- React__default['default'].createElement(
2155
+ React__default.createElement(
1112
2156
  reactBootstrap.Form.Row,
1113
2157
  null,
1114
2158
  countryUS && returnFormField({ name: 'zip', label: 'Working Zip Code', type: 'text', required: true, groupType: reactBootstrap.Col, default_value: userData.shared.zip }),
@@ -1158,29 +2202,29 @@ var SignupForm = function SignupForm(props) {
1158
2202
  required: true,
1159
2203
  options: [{ label: 'By registering you agree to our <a href="/terms">Terms and Conditions</a> and <a href="/privacy">Privacy Policy</a> and understand that you will be receiving email communications', value: 'Y' }]
1160
2204
  }),
1161
- React__default['default'].createElement('hr', null),
1162
- React__default['default'].createElement(
2205
+ React__default.createElement('hr', null),
2206
+ React__default.createElement(
1163
2207
  reactBootstrap.Form.Row,
1164
2208
  null,
1165
- React__default['default'].createElement(
2209
+ React__default.createElement(
1166
2210
  reactBootstrap.Form.Group,
1167
2211
  { as: reactBootstrap.Col },
1168
- !loading && React__default['default'].createElement(
2212
+ !loading && React__default.createElement(
1169
2213
  reactBootstrap.Button,
1170
2214
  { type: 'submit' },
1171
2215
  'Update'
1172
2216
  ),
1173
- loading && React__default['default'].createElement(
2217
+ loading && React__default.createElement(
1174
2218
  reactBootstrap.Button,
1175
2219
  { variant: 'primary', disabled: true },
1176
- React__default['default'].createElement(reactBootstrap.Spinner, {
2220
+ React__default.createElement(reactBootstrap.Spinner, {
1177
2221
  as: 'span',
1178
2222
  animation: 'border',
1179
2223
  role: 'status',
1180
2224
  'aria-hidden': 'true',
1181
2225
  size: 'sm'
1182
2226
  }),
1183
- React__default['default'].createElement(
2227
+ React__default.createElement(
1184
2228
  'span',
1185
2229
  { className: 'sr-only' },
1186
2230
  'Loading...'
@@ -1188,24 +2232,24 @@ var SignupForm = function SignupForm(props) {
1188
2232
  )
1189
2233
  )
1190
2234
  )
1191
- ) : React__default['default'].createElement(reactBootstrap.Spinner, {
2235
+ ) : React__default.createElement(reactBootstrap.Spinner, {
1192
2236
  as: 'span',
1193
2237
  animation: 'border',
1194
2238
  role: 'status',
1195
2239
  'aria-hidden': 'true',
1196
2240
  size: 'sm'
1197
2241
  }),
1198
- errorMsg && React__default['default'].createElement(
2242
+ errorMsg && React__default.createElement(
1199
2243
  'p',
1200
2244
  { className: 'error' },
1201
2245
  errorMsg
1202
2246
  ),
1203
- successMsg && React__default['default'].createElement(
2247
+ successMsg && React__default.createElement(
1204
2248
  'p',
1205
2249
  { className: 'success' },
1206
2250
  successMsg
1207
2251
  ),
1208
- React__default['default'].createElement(
2252
+ React__default.createElement(
1209
2253
  'style',
1210
2254
  { jsx: 'true'.toString() },
1211
2255
  ' \n .login {\n margin: 0 auto;\n padding: 1rem;\n border: 1px solid #ccc;\n border-radius: 4px;\n }\n .error {\n color: red;\n margin: 1rem 0 0;\n }\n .success {\n color: green;\n margin: 1rem 0 0;\n }\n '
@@ -1218,7 +2262,7 @@ var MAX_AGE = 60 * 60 * 8; // 8 hours
1218
2262
 
1219
2263
  function setTokenCookie(res, token, eKey) {
1220
2264
  var cookies_serailized = [];
1221
- cookies_serailized.push(index.serialize_1(TOKEN_NAME, token, {
2265
+ cookies_serailized.push(index$5.serialize_1(TOKEN_NAME, token, {
1222
2266
  //maxAge: MAX_AGE, // we want login cookie to expire when browser
1223
2267
  //expires: new Date(Date.now() + MAX_AGE * 1000),
1224
2268
  //httpOnly: true,
@@ -1227,7 +2271,7 @@ function setTokenCookie(res, token, eKey) {
1227
2271
  //sameSite: 'lax',
1228
2272
  }));
1229
2273
 
1230
- cookies_serailized.push(index.serialize_1('eKey', eKey, {
2274
+ cookies_serailized.push(index$5.serialize_1('eKey', eKey, {
1231
2275
  //maxAge: MAX_AGE, // we want login cookie to expire when browser
1232
2276
  //expires: new Date(Date.now() + MAX_AGE * 1000),
1233
2277
  //httpOnly: true,
@@ -1241,12 +2285,12 @@ function setTokenCookie(res, token, eKey) {
1241
2285
 
1242
2286
  function removeTokenCookie(res) {
1243
2287
  var cookies_serailized = [];
1244
- cookies_serailized.push(index.serialize_1(TOKEN_NAME, '', {
2288
+ cookies_serailized.push(index$5.serialize_1(TOKEN_NAME, '', {
1245
2289
  maxAge: -1,
1246
2290
  expires: new Date(Date.now() - MAX_AGE * 1000),
1247
2291
  path: '/'
1248
2292
  }));
1249
- cookies_serailized.push(index.serialize_1('eKey', '', {
2293
+ cookies_serailized.push(index$5.serialize_1('eKey', '', {
1250
2294
  maxAge: -1,
1251
2295
  expires: new Date(Date.now() - MAX_AGE * 1000),
1252
2296
  path: '/'
@@ -1261,7 +2305,7 @@ function parseCookies(req) {
1261
2305
 
1262
2306
  // For pages we do need to parse the cookies.
1263
2307
  var cookie = req.headers ? req.headers.cookie : null;
1264
- return index.parse_1(cookie || '');
2308
+ return index$5.parse_1(cookie || '');
1265
2309
  }
1266
2310
 
1267
2311
  function getTokenCookie(req) {
@@ -1323,10 +2367,10 @@ var iron = /*#__PURE__*/Object.freeze({
1323
2367
  getSession: getSession
1324
2368
  });
1325
2369
 
1326
- var toStr$5 = Object.prototype.toString;
2370
+ var toStr = Object.prototype.toString;
1327
2371
 
1328
2372
  var isArguments = function isArguments(value) {
1329
- var str = toStr$5.call(value);
2373
+ var str = toStr.call(value);
1330
2374
  var isArgs = str === '[object Arguments]';
1331
2375
  if (!isArgs) {
1332
2376
  isArgs = str !== '[object Array]' &&
@@ -1334,16 +2378,16 @@ var isArguments = function isArguments(value) {
1334
2378
  typeof value === 'object' &&
1335
2379
  typeof value.length === 'number' &&
1336
2380
  value.length >= 0 &&
1337
- toStr$5.call(value.callee) === '[object Function]';
2381
+ toStr.call(value.callee) === '[object Function]';
1338
2382
  }
1339
2383
  return isArgs;
1340
2384
  };
1341
2385
 
1342
- var keysShim$1;
2386
+ var keysShim;
1343
2387
  if (!Object.keys) {
1344
2388
  // modified from https://github.com/es-shims/es5-shim
1345
2389
  var has$1 = Object.prototype.hasOwnProperty;
1346
- var toStr$4 = Object.prototype.toString;
2390
+ var toStr$1 = Object.prototype.toString;
1347
2391
  var isArgs = isArguments; // eslint-disable-line global-require
1348
2392
  var isEnumerable = Object.prototype.propertyIsEnumerable;
1349
2393
  var hasDontEnumBug = !isEnumerable.call({ toString: null }, 'toString');
@@ -1416,11 +2460,11 @@ if (!Object.keys) {
1416
2460
  }
1417
2461
  };
1418
2462
 
1419
- keysShim$1 = function keys(object) {
2463
+ keysShim = function keys(object) {
1420
2464
  var isObject = object !== null && typeof object === 'object';
1421
- var isFunction = toStr$4.call(object) === '[object Function]';
2465
+ var isFunction = toStr$1.call(object) === '[object Function]';
1422
2466
  var isArguments = isArgs(object);
1423
- var isString = isObject && toStr$4.call(object) === '[object String]';
2467
+ var isString = isObject && toStr$1.call(object) === '[object String]';
1424
2468
  var theKeys = [];
1425
2469
 
1426
2470
  if (!isObject && !isFunction && !isArguments) {
@@ -1458,17 +2502,17 @@ if (!Object.keys) {
1458
2502
  return theKeys;
1459
2503
  };
1460
2504
  }
1461
- var implementation$3 = keysShim$1;
2505
+ var implementation = keysShim;
1462
2506
 
1463
- var slice$1 = Array.prototype.slice;
2507
+ var slice = Array.prototype.slice;
1464
2508
 
1465
2509
 
1466
2510
  var origKeys = Object.keys;
1467
- var keysShim = origKeys ? function keys(o) { return origKeys(o); } : implementation$3;
2511
+ var keysShim$1 = origKeys ? function keys(o) { return origKeys(o); } : implementation;
1468
2512
 
1469
2513
  var originalKeys = Object.keys;
1470
2514
 
1471
- keysShim.shim = function shimObjectKeys() {
2515
+ keysShim$1.shim = function shimObjectKeys() {
1472
2516
  if (Object.keys) {
1473
2517
  var keysWorksWithArguments = (function () {
1474
2518
  // Safari 5.0 bug
@@ -1478,27 +2522,27 @@ keysShim.shim = function shimObjectKeys() {
1478
2522
  if (!keysWorksWithArguments) {
1479
2523
  Object.keys = function keys(object) { // eslint-disable-line func-name-matching
1480
2524
  if (isArguments(object)) {
1481
- return originalKeys(slice$1.call(object));
2525
+ return originalKeys(slice.call(object));
1482
2526
  }
1483
2527
  return originalKeys(object);
1484
2528
  };
1485
2529
  }
1486
2530
  } else {
1487
- Object.keys = keysShim;
2531
+ Object.keys = keysShim$1;
1488
2532
  }
1489
- return Object.keys || keysShim;
2533
+ return Object.keys || keysShim$1;
1490
2534
  };
1491
2535
 
1492
- var objectKeys = keysShim;
2536
+ var objectKeys = keysShim$1;
1493
2537
 
1494
- var hasSymbols$4 = typeof Symbol === 'function' && typeof Symbol('foo') === 'symbol';
2538
+ var hasSymbols = typeof Symbol === 'function' && typeof Symbol('foo') === 'symbol';
1495
2539
 
1496
- var toStr$3 = Object.prototype.toString;
2540
+ var toStr$2 = Object.prototype.toString;
1497
2541
  var concat = Array.prototype.concat;
1498
2542
  var origDefineProperty = Object.defineProperty;
1499
2543
 
1500
2544
  var isFunction = function (fn) {
1501
- return typeof fn === 'function' && toStr$3.call(fn) === '[object Function]';
2545
+ return typeof fn === 'function' && toStr$2.call(fn) === '[object Function]';
1502
2546
  };
1503
2547
 
1504
2548
  var arePropertyDescriptorsSupported = function () {
@@ -1535,7 +2579,7 @@ var defineProperty = function (object, name, value, predicate) {
1535
2579
  var defineProperties = function (object, map) {
1536
2580
  var predicates = arguments.length > 2 ? arguments[2] : {};
1537
2581
  var props = objectKeys(map);
1538
- if (hasSymbols$4) {
2582
+ if (hasSymbols) {
1539
2583
  props = concat.call(props, Object.getOwnPropertySymbols(map));
1540
2584
  }
1541
2585
  for (var i = 0; i < props.length; i += 1) {
@@ -1547,59 +2591,6 @@ defineProperties.supportsDescriptors = !!supportsDescriptors;
1547
2591
 
1548
2592
  var defineProperties_1 = defineProperties;
1549
2593
 
1550
- /* eslint no-invalid-this: 1 */
1551
-
1552
- var ERROR_MESSAGE = 'Function.prototype.bind called on incompatible ';
1553
- var slice = Array.prototype.slice;
1554
- var toStr$2 = Object.prototype.toString;
1555
- var funcType = '[object Function]';
1556
-
1557
- var implementation$2 = function bind(that) {
1558
- var target = this;
1559
- if (typeof target !== 'function' || toStr$2.call(target) !== funcType) {
1560
- throw new TypeError(ERROR_MESSAGE + target);
1561
- }
1562
- var args = slice.call(arguments, 1);
1563
-
1564
- var bound;
1565
- var binder = function () {
1566
- if (this instanceof bound) {
1567
- var result = target.apply(
1568
- this,
1569
- args.concat(slice.call(arguments))
1570
- );
1571
- if (Object(result) === result) {
1572
- return result;
1573
- }
1574
- return this;
1575
- } else {
1576
- return target.apply(
1577
- that,
1578
- args.concat(slice.call(arguments))
1579
- );
1580
- }
1581
- };
1582
-
1583
- var boundLength = Math.max(0, target.length - args.length);
1584
- var boundArgs = [];
1585
- for (var i = 0; i < boundLength; i++) {
1586
- boundArgs.push('$' + i);
1587
- }
1588
-
1589
- bound = Function('binder', 'return function (' + boundArgs.join(',') + '){ return binder.apply(this,arguments); }')(binder);
1590
-
1591
- if (target.prototype) {
1592
- var Empty = function Empty() {};
1593
- Empty.prototype = target.prototype;
1594
- bound.prototype = new Empty();
1595
- Empty.prototype = null;
1596
- }
1597
-
1598
- return bound;
1599
- };
1600
-
1601
- var functionBind = Function.prototype.bind || implementation$2;
1602
-
1603
2594
  /* eslint complexity: [2, 18], max-statements: [2, 33] */
1604
2595
  var shams = function hasSymbols() {
1605
2596
  if (typeof Symbol !== 'function' || typeof Object.getOwnPropertySymbols !== 'function') { return false; }
@@ -1623,7 +2614,7 @@ var shams = function hasSymbols() {
1623
2614
 
1624
2615
  var symVal = 42;
1625
2616
  obj[sym] = symVal;
1626
- for (sym in obj) { return false; } // eslint-disable-line no-restricted-syntax, no-unreachable-loop
2617
+ for (sym in obj) { return false; } // eslint-disable-line no-restricted-syntax
1627
2618
  if (typeof Object.keys === 'function' && Object.keys(obj).length !== 0) { return false; }
1628
2619
 
1629
2620
  if (typeof Object.getOwnPropertyNames === 'function' && Object.getOwnPropertyNames(obj).length !== 0) { return false; }
@@ -1641,10 +2632,10 @@ var shams = function hasSymbols() {
1641
2632
  return true;
1642
2633
  };
1643
2634
 
1644
- var origSymbol = typeof Symbol !== 'undefined' && Symbol;
2635
+ var origSymbol = _commonjsHelpers.commonjsGlobal.Symbol;
1645
2636
 
1646
2637
 
1647
- var hasSymbols$3 = function hasNativeSymbols() {
2638
+ var hasSymbols$1 = function hasNativeSymbols() {
1648
2639
  if (typeof origSymbol !== 'function') { return false; }
1649
2640
  if (typeof Symbol !== 'function') { return false; }
1650
2641
  if (typeof origSymbol('foo') !== 'symbol') { return false; }
@@ -1653,34 +2644,79 @@ var hasSymbols$3 = function hasNativeSymbols() {
1653
2644
  return shams();
1654
2645
  };
1655
2646
 
1656
- var src = functionBind.call(Function.call, Object.prototype.hasOwnProperty);
2647
+ /* eslint no-invalid-this: 1 */
1657
2648
 
1658
- var undefined$1;
2649
+ var ERROR_MESSAGE = 'Function.prototype.bind called on incompatible ';
2650
+ var slice$1 = Array.prototype.slice;
2651
+ var toStr$3 = Object.prototype.toString;
2652
+ var funcType = '[object Function]';
1659
2653
 
1660
- var $SyntaxError$1 = SyntaxError;
1661
- var $Function = Function;
1662
- var $TypeError$5 = TypeError;
2654
+ var implementation$1 = function bind(that) {
2655
+ var target = this;
2656
+ if (typeof target !== 'function' || toStr$3.call(target) !== funcType) {
2657
+ throw new TypeError(ERROR_MESSAGE + target);
2658
+ }
2659
+ var args = slice$1.call(arguments, 1);
1663
2660
 
1664
- // eslint-disable-next-line consistent-return
1665
- var getEvalledConstructor = function (expressionSyntax) {
1666
- try {
1667
- return $Function('"use strict"; return (' + expressionSyntax + ').constructor;')();
1668
- } catch (e) {}
2661
+ var bound;
2662
+ var binder = function () {
2663
+ if (this instanceof bound) {
2664
+ var result = target.apply(
2665
+ this,
2666
+ args.concat(slice$1.call(arguments))
2667
+ );
2668
+ if (Object(result) === result) {
2669
+ return result;
2670
+ }
2671
+ return this;
2672
+ } else {
2673
+ return target.apply(
2674
+ that,
2675
+ args.concat(slice$1.call(arguments))
2676
+ );
2677
+ }
2678
+ };
2679
+
2680
+ var boundLength = Math.max(0, target.length - args.length);
2681
+ var boundArgs = [];
2682
+ for (var i = 0; i < boundLength; i++) {
2683
+ boundArgs.push('$' + i);
2684
+ }
2685
+
2686
+ bound = Function('binder', 'return function (' + boundArgs.join(',') + '){ return binder.apply(this,arguments); }')(binder);
2687
+
2688
+ if (target.prototype) {
2689
+ var Empty = function Empty() {};
2690
+ Empty.prototype = target.prototype;
2691
+ bound.prototype = new Empty();
2692
+ Empty.prototype = null;
2693
+ }
2694
+
2695
+ return bound;
1669
2696
  };
1670
2697
 
1671
- var $gOPD$2 = Object.getOwnPropertyDescriptor;
1672
- if ($gOPD$2) {
2698
+ var functionBind = Function.prototype.bind || implementation$1;
2699
+
2700
+ /* globals
2701
+ Atomics,
2702
+ SharedArrayBuffer,
2703
+ */
2704
+
2705
+ var undefined$1;
2706
+
2707
+ var $TypeError = TypeError;
2708
+
2709
+ var $gOPD = Object.getOwnPropertyDescriptor;
2710
+ if ($gOPD) {
1673
2711
  try {
1674
- $gOPD$2({}, '');
2712
+ $gOPD({}, '');
1675
2713
  } catch (e) {
1676
- $gOPD$2 = null; // this is IE 8, which has a broken gOPD
2714
+ $gOPD = null; // this is IE 8, which has a broken gOPD
1677
2715
  }
1678
2716
  }
1679
2717
 
1680
- var throwTypeError = function () {
1681
- throw new $TypeError$5();
1682
- };
1683
- var ThrowTypeError = $gOPD$2
2718
+ var throwTypeError = function () { throw new $TypeError(); };
2719
+ var ThrowTypeError = $gOPD
1684
2720
  ? (function () {
1685
2721
  try {
1686
2722
  // eslint-disable-next-line no-unused-expressions, no-caller, no-restricted-properties
@@ -1689,7 +2725,7 @@ var ThrowTypeError = $gOPD$2
1689
2725
  } catch (calleeThrows) {
1690
2726
  try {
1691
2727
  // IE 8 throws on Object.getOwnPropertyDescriptor(arguments, '')
1692
- return $gOPD$2(arguments, 'callee').get;
2728
+ return $gOPD(arguments, 'callee').get;
1693
2729
  } catch (gOPDthrows) {
1694
2730
  return throwTypeError;
1695
2731
  }
@@ -1697,354 +2733,206 @@ var ThrowTypeError = $gOPD$2
1697
2733
  }())
1698
2734
  : throwTypeError;
1699
2735
 
1700
- var hasSymbols$2 = hasSymbols$3();
2736
+ var hasSymbols$2 = hasSymbols$1();
1701
2737
 
1702
2738
  var getProto = Object.getPrototypeOf || function (x) { return x.__proto__; }; // eslint-disable-line no-proto
1703
-
1704
- var needsEval = {};
2739
+ var generatorFunction = undefined$1;
2740
+ var asyncFunction = undefined$1;
2741
+ var asyncGenFunction = undefined$1;
1705
2742
 
1706
2743
  var TypedArray = typeof Uint8Array === 'undefined' ? undefined$1 : getProto(Uint8Array);
1707
2744
 
1708
2745
  var INTRINSICS = {
1709
- '%AggregateError%': typeof AggregateError === 'undefined' ? undefined$1 : AggregateError,
1710
2746
  '%Array%': Array,
1711
2747
  '%ArrayBuffer%': typeof ArrayBuffer === 'undefined' ? undefined$1 : ArrayBuffer,
2748
+ '%ArrayBufferPrototype%': typeof ArrayBuffer === 'undefined' ? undefined$1 : ArrayBuffer.prototype,
1712
2749
  '%ArrayIteratorPrototype%': hasSymbols$2 ? getProto([][Symbol.iterator]()) : undefined$1,
2750
+ '%ArrayPrototype%': Array.prototype,
2751
+ '%ArrayProto_entries%': Array.prototype.entries,
2752
+ '%ArrayProto_forEach%': Array.prototype.forEach,
2753
+ '%ArrayProto_keys%': Array.prototype.keys,
2754
+ '%ArrayProto_values%': Array.prototype.values,
1713
2755
  '%AsyncFromSyncIteratorPrototype%': undefined$1,
1714
- '%AsyncFunction%': needsEval,
1715
- '%AsyncGenerator%': needsEval,
1716
- '%AsyncGeneratorFunction%': needsEval,
1717
- '%AsyncIteratorPrototype%': needsEval,
2756
+ '%AsyncFunction%': asyncFunction,
2757
+ '%AsyncFunctionPrototype%': undefined$1,
2758
+ '%AsyncGenerator%': undefined$1,
2759
+ '%AsyncGeneratorFunction%': asyncGenFunction,
2760
+ '%AsyncGeneratorPrototype%': undefined$1,
2761
+ '%AsyncIteratorPrototype%': undefined$1,
1718
2762
  '%Atomics%': typeof Atomics === 'undefined' ? undefined$1 : Atomics,
1719
- '%BigInt%': typeof BigInt === 'undefined' ? undefined$1 : BigInt,
1720
2763
  '%Boolean%': Boolean,
2764
+ '%BooleanPrototype%': Boolean.prototype,
1721
2765
  '%DataView%': typeof DataView === 'undefined' ? undefined$1 : DataView,
2766
+ '%DataViewPrototype%': typeof DataView === 'undefined' ? undefined$1 : DataView.prototype,
1722
2767
  '%Date%': Date,
2768
+ '%DatePrototype%': Date.prototype,
1723
2769
  '%decodeURI%': decodeURI,
1724
2770
  '%decodeURIComponent%': decodeURIComponent,
1725
2771
  '%encodeURI%': encodeURI,
1726
2772
  '%encodeURIComponent%': encodeURIComponent,
1727
2773
  '%Error%': Error,
2774
+ '%ErrorPrototype%': Error.prototype,
1728
2775
  '%eval%': eval, // eslint-disable-line no-eval
1729
2776
  '%EvalError%': EvalError,
2777
+ '%EvalErrorPrototype%': EvalError.prototype,
1730
2778
  '%Float32Array%': typeof Float32Array === 'undefined' ? undefined$1 : Float32Array,
2779
+ '%Float32ArrayPrototype%': typeof Float32Array === 'undefined' ? undefined$1 : Float32Array.prototype,
1731
2780
  '%Float64Array%': typeof Float64Array === 'undefined' ? undefined$1 : Float64Array,
1732
- '%FinalizationRegistry%': typeof FinalizationRegistry === 'undefined' ? undefined$1 : FinalizationRegistry,
1733
- '%Function%': $Function,
1734
- '%GeneratorFunction%': needsEval,
2781
+ '%Float64ArrayPrototype%': typeof Float64Array === 'undefined' ? undefined$1 : Float64Array.prototype,
2782
+ '%Function%': Function,
2783
+ '%FunctionPrototype%': Function.prototype,
2784
+ '%Generator%': undefined$1,
2785
+ '%GeneratorFunction%': generatorFunction,
2786
+ '%GeneratorPrototype%': undefined$1,
1735
2787
  '%Int8Array%': typeof Int8Array === 'undefined' ? undefined$1 : Int8Array,
2788
+ '%Int8ArrayPrototype%': typeof Int8Array === 'undefined' ? undefined$1 : Int8Array.prototype,
1736
2789
  '%Int16Array%': typeof Int16Array === 'undefined' ? undefined$1 : Int16Array,
2790
+ '%Int16ArrayPrototype%': typeof Int16Array === 'undefined' ? undefined$1 : Int8Array.prototype,
1737
2791
  '%Int32Array%': typeof Int32Array === 'undefined' ? undefined$1 : Int32Array,
2792
+ '%Int32ArrayPrototype%': typeof Int32Array === 'undefined' ? undefined$1 : Int32Array.prototype,
1738
2793
  '%isFinite%': isFinite,
1739
2794
  '%isNaN%': isNaN,
1740
2795
  '%IteratorPrototype%': hasSymbols$2 ? getProto(getProto([][Symbol.iterator]())) : undefined$1,
1741
2796
  '%JSON%': typeof JSON === 'object' ? JSON : undefined$1,
2797
+ '%JSONParse%': typeof JSON === 'object' ? JSON.parse : undefined$1,
1742
2798
  '%Map%': typeof Map === 'undefined' ? undefined$1 : Map,
1743
2799
  '%MapIteratorPrototype%': typeof Map === 'undefined' || !hasSymbols$2 ? undefined$1 : getProto(new Map()[Symbol.iterator]()),
2800
+ '%MapPrototype%': typeof Map === 'undefined' ? undefined$1 : Map.prototype,
1744
2801
  '%Math%': Math,
1745
2802
  '%Number%': Number,
2803
+ '%NumberPrototype%': Number.prototype,
1746
2804
  '%Object%': Object,
2805
+ '%ObjectPrototype%': Object.prototype,
2806
+ '%ObjProto_toString%': Object.prototype.toString,
2807
+ '%ObjProto_valueOf%': Object.prototype.valueOf,
1747
2808
  '%parseFloat%': parseFloat,
1748
2809
  '%parseInt%': parseInt,
1749
2810
  '%Promise%': typeof Promise === 'undefined' ? undefined$1 : Promise,
2811
+ '%PromisePrototype%': typeof Promise === 'undefined' ? undefined$1 : Promise.prototype,
2812
+ '%PromiseProto_then%': typeof Promise === 'undefined' ? undefined$1 : Promise.prototype.then,
2813
+ '%Promise_all%': typeof Promise === 'undefined' ? undefined$1 : Promise.all,
2814
+ '%Promise_reject%': typeof Promise === 'undefined' ? undefined$1 : Promise.reject,
2815
+ '%Promise_resolve%': typeof Promise === 'undefined' ? undefined$1 : Promise.resolve,
1750
2816
  '%Proxy%': typeof Proxy === 'undefined' ? undefined$1 : Proxy,
1751
2817
  '%RangeError%': RangeError,
2818
+ '%RangeErrorPrototype%': RangeError.prototype,
1752
2819
  '%ReferenceError%': ReferenceError,
2820
+ '%ReferenceErrorPrototype%': ReferenceError.prototype,
1753
2821
  '%Reflect%': typeof Reflect === 'undefined' ? undefined$1 : Reflect,
1754
2822
  '%RegExp%': RegExp,
2823
+ '%RegExpPrototype%': RegExp.prototype,
1755
2824
  '%Set%': typeof Set === 'undefined' ? undefined$1 : Set,
1756
2825
  '%SetIteratorPrototype%': typeof Set === 'undefined' || !hasSymbols$2 ? undefined$1 : getProto(new Set()[Symbol.iterator]()),
2826
+ '%SetPrototype%': typeof Set === 'undefined' ? undefined$1 : Set.prototype,
1757
2827
  '%SharedArrayBuffer%': typeof SharedArrayBuffer === 'undefined' ? undefined$1 : SharedArrayBuffer,
2828
+ '%SharedArrayBufferPrototype%': typeof SharedArrayBuffer === 'undefined' ? undefined$1 : SharedArrayBuffer.prototype,
1758
2829
  '%String%': String,
1759
2830
  '%StringIteratorPrototype%': hasSymbols$2 ? getProto(''[Symbol.iterator]()) : undefined$1,
2831
+ '%StringPrototype%': String.prototype,
1760
2832
  '%Symbol%': hasSymbols$2 ? Symbol : undefined$1,
1761
- '%SyntaxError%': $SyntaxError$1,
2833
+ '%SymbolPrototype%': hasSymbols$2 ? Symbol.prototype : undefined$1,
2834
+ '%SyntaxError%': SyntaxError,
2835
+ '%SyntaxErrorPrototype%': SyntaxError.prototype,
1762
2836
  '%ThrowTypeError%': ThrowTypeError,
1763
2837
  '%TypedArray%': TypedArray,
1764
- '%TypeError%': $TypeError$5,
2838
+ '%TypedArrayPrototype%': TypedArray ? TypedArray.prototype : undefined$1,
2839
+ '%TypeError%': $TypeError,
2840
+ '%TypeErrorPrototype%': $TypeError.prototype,
1765
2841
  '%Uint8Array%': typeof Uint8Array === 'undefined' ? undefined$1 : Uint8Array,
2842
+ '%Uint8ArrayPrototype%': typeof Uint8Array === 'undefined' ? undefined$1 : Uint8Array.prototype,
1766
2843
  '%Uint8ClampedArray%': typeof Uint8ClampedArray === 'undefined' ? undefined$1 : Uint8ClampedArray,
2844
+ '%Uint8ClampedArrayPrototype%': typeof Uint8ClampedArray === 'undefined' ? undefined$1 : Uint8ClampedArray.prototype,
1767
2845
  '%Uint16Array%': typeof Uint16Array === 'undefined' ? undefined$1 : Uint16Array,
2846
+ '%Uint16ArrayPrototype%': typeof Uint16Array === 'undefined' ? undefined$1 : Uint16Array.prototype,
1768
2847
  '%Uint32Array%': typeof Uint32Array === 'undefined' ? undefined$1 : Uint32Array,
2848
+ '%Uint32ArrayPrototype%': typeof Uint32Array === 'undefined' ? undefined$1 : Uint32Array.prototype,
1769
2849
  '%URIError%': URIError,
2850
+ '%URIErrorPrototype%': URIError.prototype,
1770
2851
  '%WeakMap%': typeof WeakMap === 'undefined' ? undefined$1 : WeakMap,
1771
- '%WeakRef%': typeof WeakRef === 'undefined' ? undefined$1 : WeakRef,
1772
- '%WeakSet%': typeof WeakSet === 'undefined' ? undefined$1 : WeakSet
1773
- };
1774
-
1775
- var doEval = function doEval(name) {
1776
- var value;
1777
- if (name === '%AsyncFunction%') {
1778
- value = getEvalledConstructor('async function () {}');
1779
- } else if (name === '%GeneratorFunction%') {
1780
- value = getEvalledConstructor('function* () {}');
1781
- } else if (name === '%AsyncGeneratorFunction%') {
1782
- value = getEvalledConstructor('async function* () {}');
1783
- } else if (name === '%AsyncGenerator%') {
1784
- var fn = doEval('%AsyncGeneratorFunction%');
1785
- if (fn) {
1786
- value = fn.prototype;
1787
- }
1788
- } else if (name === '%AsyncIteratorPrototype%') {
1789
- var gen = doEval('%AsyncGenerator%');
1790
- if (gen) {
1791
- value = getProto(gen.prototype);
1792
- }
1793
- }
1794
-
1795
- INTRINSICS[name] = value;
1796
-
1797
- return value;
2852
+ '%WeakMapPrototype%': typeof WeakMap === 'undefined' ? undefined$1 : WeakMap.prototype,
2853
+ '%WeakSet%': typeof WeakSet === 'undefined' ? undefined$1 : WeakSet,
2854
+ '%WeakSetPrototype%': typeof WeakSet === 'undefined' ? undefined$1 : WeakSet.prototype
1798
2855
  };
1799
2856
 
1800
- var LEGACY_ALIASES = {
1801
- '%ArrayBufferPrototype%': ['ArrayBuffer', 'prototype'],
1802
- '%ArrayPrototype%': ['Array', 'prototype'],
1803
- '%ArrayProto_entries%': ['Array', 'prototype', 'entries'],
1804
- '%ArrayProto_forEach%': ['Array', 'prototype', 'forEach'],
1805
- '%ArrayProto_keys%': ['Array', 'prototype', 'keys'],
1806
- '%ArrayProto_values%': ['Array', 'prototype', 'values'],
1807
- '%AsyncFunctionPrototype%': ['AsyncFunction', 'prototype'],
1808
- '%AsyncGenerator%': ['AsyncGeneratorFunction', 'prototype'],
1809
- '%AsyncGeneratorPrototype%': ['AsyncGeneratorFunction', 'prototype', 'prototype'],
1810
- '%BooleanPrototype%': ['Boolean', 'prototype'],
1811
- '%DataViewPrototype%': ['DataView', 'prototype'],
1812
- '%DatePrototype%': ['Date', 'prototype'],
1813
- '%ErrorPrototype%': ['Error', 'prototype'],
1814
- '%EvalErrorPrototype%': ['EvalError', 'prototype'],
1815
- '%Float32ArrayPrototype%': ['Float32Array', 'prototype'],
1816
- '%Float64ArrayPrototype%': ['Float64Array', 'prototype'],
1817
- '%FunctionPrototype%': ['Function', 'prototype'],
1818
- '%Generator%': ['GeneratorFunction', 'prototype'],
1819
- '%GeneratorPrototype%': ['GeneratorFunction', 'prototype', 'prototype'],
1820
- '%Int8ArrayPrototype%': ['Int8Array', 'prototype'],
1821
- '%Int16ArrayPrototype%': ['Int16Array', 'prototype'],
1822
- '%Int32ArrayPrototype%': ['Int32Array', 'prototype'],
1823
- '%JSONParse%': ['JSON', 'parse'],
1824
- '%JSONStringify%': ['JSON', 'stringify'],
1825
- '%MapPrototype%': ['Map', 'prototype'],
1826
- '%NumberPrototype%': ['Number', 'prototype'],
1827
- '%ObjectPrototype%': ['Object', 'prototype'],
1828
- '%ObjProto_toString%': ['Object', 'prototype', 'toString'],
1829
- '%ObjProto_valueOf%': ['Object', 'prototype', 'valueOf'],
1830
- '%PromisePrototype%': ['Promise', 'prototype'],
1831
- '%PromiseProto_then%': ['Promise', 'prototype', 'then'],
1832
- '%Promise_all%': ['Promise', 'all'],
1833
- '%Promise_reject%': ['Promise', 'reject'],
1834
- '%Promise_resolve%': ['Promise', 'resolve'],
1835
- '%RangeErrorPrototype%': ['RangeError', 'prototype'],
1836
- '%ReferenceErrorPrototype%': ['ReferenceError', 'prototype'],
1837
- '%RegExpPrototype%': ['RegExp', 'prototype'],
1838
- '%SetPrototype%': ['Set', 'prototype'],
1839
- '%SharedArrayBufferPrototype%': ['SharedArrayBuffer', 'prototype'],
1840
- '%StringPrototype%': ['String', 'prototype'],
1841
- '%SymbolPrototype%': ['Symbol', 'prototype'],
1842
- '%SyntaxErrorPrototype%': ['SyntaxError', 'prototype'],
1843
- '%TypedArrayPrototype%': ['TypedArray', 'prototype'],
1844
- '%TypeErrorPrototype%': ['TypeError', 'prototype'],
1845
- '%Uint8ArrayPrototype%': ['Uint8Array', 'prototype'],
1846
- '%Uint8ClampedArrayPrototype%': ['Uint8ClampedArray', 'prototype'],
1847
- '%Uint16ArrayPrototype%': ['Uint16Array', 'prototype'],
1848
- '%Uint32ArrayPrototype%': ['Uint32Array', 'prototype'],
1849
- '%URIErrorPrototype%': ['URIError', 'prototype'],
1850
- '%WeakMapPrototype%': ['WeakMap', 'prototype'],
1851
- '%WeakSetPrototype%': ['WeakSet', 'prototype']
1852
- };
1853
-
1854
-
1855
-
1856
- var $concat$2 = functionBind.call(Function.call, Array.prototype.concat);
1857
- var $spliceApply = functionBind.call(Function.apply, Array.prototype.splice);
2857
+
1858
2858
  var $replace = functionBind.call(Function.call, String.prototype.replace);
1859
- var $strSlice = functionBind.call(Function.call, String.prototype.slice);
1860
2859
 
1861
2860
  /* adapted from https://github.com/lodash/lodash/blob/4.17.15/dist/lodash.js#L6735-L6744 */
1862
2861
  var rePropName = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g;
1863
2862
  var reEscapeChar = /\\(\\)?/g; /** Used to match backslashes in property paths. */
1864
2863
  var stringToPath = function stringToPath(string) {
1865
- var first = $strSlice(string, 0, 1);
1866
- var last = $strSlice(string, -1);
1867
- if (first === '%' && last !== '%') {
1868
- throw new $SyntaxError$1('invalid intrinsic syntax, expected closing `%`');
1869
- } else if (last === '%' && first !== '%') {
1870
- throw new $SyntaxError$1('invalid intrinsic syntax, expected opening `%`');
1871
- }
1872
2864
  var result = [];
1873
2865
  $replace(string, rePropName, function (match, number, quote, subString) {
1874
- result[result.length] = quote ? $replace(subString, reEscapeChar, '$1') : number || match;
2866
+ result[result.length] = quote ? $replace(subString, reEscapeChar, '$1') : (number || match);
1875
2867
  });
1876
2868
  return result;
1877
2869
  };
1878
2870
  /* end adaptation */
1879
2871
 
1880
2872
  var getBaseIntrinsic = function getBaseIntrinsic(name, allowMissing) {
1881
- var intrinsicName = name;
1882
- var alias;
1883
- if (src(LEGACY_ALIASES, intrinsicName)) {
1884
- alias = LEGACY_ALIASES[intrinsicName];
1885
- intrinsicName = '%' + alias[0] + '%';
2873
+ if (!(name in INTRINSICS)) {
2874
+ throw new SyntaxError('intrinsic ' + name + ' does not exist!');
1886
2875
  }
1887
2876
 
1888
- if (src(INTRINSICS, intrinsicName)) {
1889
- var value = INTRINSICS[intrinsicName];
1890
- if (value === needsEval) {
1891
- value = doEval(intrinsicName);
1892
- }
1893
- if (typeof value === 'undefined' && !allowMissing) {
1894
- throw new $TypeError$5('intrinsic ' + name + ' exists, but is not available. Please file an issue!');
1895
- }
1896
-
1897
- return {
1898
- alias: alias,
1899
- name: intrinsicName,
1900
- value: value
1901
- };
2877
+ // istanbul ignore if // hopefully this is impossible to test :-)
2878
+ if (typeof INTRINSICS[name] === 'undefined' && !allowMissing) {
2879
+ throw new $TypeError('intrinsic ' + name + ' exists, but is not available. Please file an issue!');
1902
2880
  }
1903
2881
 
1904
- throw new $SyntaxError$1('intrinsic ' + name + ' does not exist!');
2882
+ return INTRINSICS[name];
1905
2883
  };
1906
2884
 
1907
- var getIntrinsic = function GetIntrinsic(name, allowMissing) {
2885
+ var GetIntrinsic = function GetIntrinsic(name, allowMissing) {
1908
2886
  if (typeof name !== 'string' || name.length === 0) {
1909
- throw new $TypeError$5('intrinsic name must be a non-empty string');
2887
+ throw new TypeError('intrinsic name must be a non-empty string');
1910
2888
  }
1911
2889
  if (arguments.length > 1 && typeof allowMissing !== 'boolean') {
1912
- throw new $TypeError$5('"allowMissing" argument must be a boolean');
2890
+ throw new TypeError('"allowMissing" argument must be a boolean');
1913
2891
  }
1914
2892
 
1915
2893
  var parts = stringToPath(name);
1916
- var intrinsicBaseName = parts.length > 0 ? parts[0] : '';
1917
-
1918
- var intrinsic = getBaseIntrinsic('%' + intrinsicBaseName + '%', allowMissing);
1919
- var intrinsicRealName = intrinsic.name;
1920
- var value = intrinsic.value;
1921
- var skipFurtherCaching = false;
1922
-
1923
- var alias = intrinsic.alias;
1924
- if (alias) {
1925
- intrinsicBaseName = alias[0];
1926
- $spliceApply(parts, $concat$2([0, 1], alias));
1927
- }
1928
-
1929
- for (var i = 1, isOwn = true; i < parts.length; i += 1) {
1930
- var part = parts[i];
1931
- var first = $strSlice(part, 0, 1);
1932
- var last = $strSlice(part, -1);
1933
- if (
1934
- (
1935
- (first === '"' || first === "'" || first === '`')
1936
- || (last === '"' || last === "'" || last === '`')
1937
- )
1938
- && first !== last
1939
- ) {
1940
- throw new $SyntaxError$1('property names with quotes must have matching quotes');
1941
- }
1942
- if (part === 'constructor' || !isOwn) {
1943
- skipFurtherCaching = true;
1944
- }
1945
2894
 
1946
- intrinsicBaseName += '.' + part;
1947
- intrinsicRealName = '%' + intrinsicBaseName + '%';
1948
-
1949
- if (src(INTRINSICS, intrinsicRealName)) {
1950
- value = INTRINSICS[intrinsicRealName];
1951
- } else if (value != null) {
1952
- if (!(part in value)) {
1953
- if (!allowMissing) {
1954
- throw new $TypeError$5('base intrinsic for ' + name + ' exists, but the property is not available.');
1955
- }
1956
- return void undefined$1;
1957
- }
1958
- if ($gOPD$2 && (i + 1) >= parts.length) {
1959
- var desc = $gOPD$2(value, part);
1960
- isOwn = !!desc;
1961
-
1962
- // By convention, when a data property is converted to an accessor
1963
- // property to emulate a data property that does not suffer from
1964
- // the override mistake, that accessor's getter is marked with
1965
- // an `originalValue` property. Here, when we detect this, we
1966
- // uphold the illusion by pretending to see that original data
1967
- // property, i.e., returning the value rather than the getter
1968
- // itself.
1969
- if (isOwn && 'get' in desc && !('originalValue' in desc.get)) {
1970
- value = desc.get;
1971
- } else {
1972
- value = value[part];
2895
+ var value = getBaseIntrinsic('%' + (parts.length > 0 ? parts[0] : '') + '%', allowMissing);
2896
+ for (var i = 1; i < parts.length; i += 1) {
2897
+ if (value != null) {
2898
+ if ($gOPD && (i + 1) >= parts.length) {
2899
+ var desc = $gOPD(value, parts[i]);
2900
+ if (!allowMissing && !(parts[i] in value)) {
2901
+ throw new $TypeError('base intrinsic for ' + name + ' exists, but the property is not available.');
1973
2902
  }
2903
+ value = desc ? (desc.get || desc.value) : value[parts[i]];
1974
2904
  } else {
1975
- isOwn = src(value, part);
1976
- value = value[part];
1977
- }
1978
-
1979
- if (isOwn && !skipFurtherCaching) {
1980
- INTRINSICS[intrinsicRealName] = value;
2905
+ value = value[parts[i]];
1981
2906
  }
1982
2907
  }
1983
2908
  }
1984
2909
  return value;
1985
2910
  };
1986
2911
 
1987
- var callBind = _commonjsHelpers.createCommonjsModule(function (module) {
2912
+ var $Function = GetIntrinsic('%Function%');
2913
+ var $apply = $Function.apply;
2914
+ var $call = $Function.call;
1988
2915
 
1989
-
1990
-
1991
-
1992
- var $apply = getIntrinsic('%Function.prototype.apply%');
1993
- var $call = getIntrinsic('%Function.prototype.call%');
1994
- var $reflectApply = getIntrinsic('%Reflect.apply%', true) || functionBind.call($call, $apply);
1995
-
1996
- var $gOPD = getIntrinsic('%Object.getOwnPropertyDescriptor%', true);
1997
- var $defineProperty = getIntrinsic('%Object.defineProperty%', true);
1998
- var $max = getIntrinsic('%Math.max%');
1999
-
2000
- if ($defineProperty) {
2001
- try {
2002
- $defineProperty({}, 'a', { value: 1 });
2003
- } catch (e) {
2004
- // IE 8 has a broken defineProperty
2005
- $defineProperty = null;
2006
- }
2007
- }
2008
-
2009
- module.exports = function callBind(originalFunction) {
2010
- var func = $reflectApply(functionBind, $call, arguments);
2011
- if ($gOPD && $defineProperty) {
2012
- var desc = $gOPD(func, 'length');
2013
- if (desc.configurable) {
2014
- // original length, plus the receiver, minus any additional arguments (after the receiver)
2015
- $defineProperty(
2016
- func,
2017
- 'length',
2018
- { value: 1 + $max(0, originalFunction.length - (arguments.length - 1)) }
2019
- );
2020
- }
2021
- }
2022
- return func;
2916
+ var callBind = function callBind() {
2917
+ return functionBind.apply($call, arguments);
2023
2918
  };
2024
2919
 
2025
- var applyBind = function applyBind() {
2026
- return $reflectApply(functionBind, $apply, arguments);
2920
+ var apply = function applyBind() {
2921
+ return functionBind.apply($apply, arguments);
2027
2922
  };
2923
+ callBind.apply = apply;
2028
2924
 
2029
- if ($defineProperty) {
2030
- $defineProperty(module.exports, 'apply', { value: applyBind });
2031
- } else {
2032
- module.exports.apply = applyBind;
2033
- }
2034
- });
2035
- callBind.apply;
2036
-
2037
- var $indexOf = callBind(getIntrinsic('String.prototype.indexOf'));
2925
+ var $indexOf = callBind(GetIntrinsic('String.prototype.indexOf'));
2038
2926
 
2039
- var callBound$1 = function callBoundIntrinsic(name, allowMissing) {
2040
- var intrinsic = getIntrinsic(name, !!allowMissing);
2041
- if (typeof intrinsic === 'function' && $indexOf(name, '.prototype.') > -1) {
2927
+ var callBound = function callBoundIntrinsic(name, allowMissing) {
2928
+ var intrinsic = GetIntrinsic(name, !!allowMissing);
2929
+ if (typeof intrinsic === 'function' && $indexOf(name, '.prototype.')) {
2042
2930
  return callBind(intrinsic);
2043
2931
  }
2044
2932
  return intrinsic;
2045
2933
  };
2046
2934
 
2047
- var $defineProperty = getIntrinsic('%Object.defineProperty%', true);
2935
+ var $defineProperty = GetIntrinsic('%Object.defineProperty%', true);
2048
2936
 
2049
2937
  if ($defineProperty) {
2050
2938
  try {
@@ -2057,7 +2945,7 @@ if ($defineProperty) {
2057
2945
 
2058
2946
 
2059
2947
 
2060
- var $isEnumerable$1 = callBound$1('Object.prototype.propertyIsEnumerable');
2948
+ var $isEnumerable = callBound('Object.prototype.propertyIsEnumerable');
2061
2949
 
2062
2950
  // eslint-disable-next-line max-params
2063
2951
  var DefineOwnProperty = function DefineOwnProperty(IsDataDescriptor, SameValue, FromPropertyDescriptor, O, P, desc) {
@@ -2071,7 +2959,7 @@ var DefineOwnProperty = function DefineOwnProperty(IsDataDescriptor, SameValue,
2071
2959
  }
2072
2960
 
2073
2961
  // fallback for ES3
2074
- if (P in O && $isEnumerable$1(O, P) !== !!desc['[[Enumerable]]']) {
2962
+ if (P in O && $isEnumerable(O, P) !== !!desc['[[Enumerable]]']) {
2075
2963
  // a non-enumerable existing property
2076
2964
  return false;
2077
2965
  }
@@ -2086,13 +2974,15 @@ var DefineOwnProperty = function DefineOwnProperty(IsDataDescriptor, SameValue,
2086
2974
  return true;
2087
2975
  };
2088
2976
 
2089
- var $TypeError$4 = getIntrinsic('%TypeError%');
2090
- var $SyntaxError = getIntrinsic('%SyntaxError%');
2977
+ var src = functionBind.call(Function.call, Object.prototype.hasOwnProperty);
2978
+
2979
+ var $TypeError$1 = GetIntrinsic('%TypeError%');
2980
+ var $SyntaxError = GetIntrinsic('%SyntaxError%');
2091
2981
 
2092
2982
 
2093
2983
 
2094
2984
  var predicates = {
2095
- // https://262.ecma-international.org/6.0/#sec-property-descriptor-specification-type
2985
+ // https://ecma-international.org/ecma-262/6.0/#sec-property-descriptor-specification-type
2096
2986
  'Property Descriptor': function isPropertyDescriptor(Type, Desc) {
2097
2987
  if (Type(Desc) !== 'Object') {
2098
2988
  return false;
@@ -2115,7 +3005,7 @@ var predicates = {
2115
3005
  var isData = src(Desc, '[[Value]]');
2116
3006
  var IsAccessor = src(Desc, '[[Get]]') || src(Desc, '[[Set]]');
2117
3007
  if (isData && IsAccessor) {
2118
- throw new $TypeError$4('Property Descriptors may not be both accessor and data descriptors');
3008
+ throw new $TypeError$1('Property Descriptors may not be both accessor and data descriptors');
2119
3009
  }
2120
3010
  return true;
2121
3011
  }
@@ -2127,13 +3017,13 @@ var assertRecord = function assertRecord(Type, recordType, argumentName, value)
2127
3017
  throw new $SyntaxError('unknown record type: ' + recordType);
2128
3018
  }
2129
3019
  if (!predicate(Type, value)) {
2130
- throw new $TypeError$4(argumentName + ' must be a ' + recordType);
3020
+ throw new $TypeError$1(argumentName + ' must be a ' + recordType);
2131
3021
  }
2132
3022
  };
2133
3023
 
2134
- // https://262.ecma-international.org/5.1/#sec-8
3024
+ // https://www.ecma-international.org/ecma-262/5.1/#sec-8
2135
3025
 
2136
- var Type$1 = function Type(x) {
3026
+ var Type = function Type(x) {
2137
3027
  if (x === null) {
2138
3028
  return 'Null';
2139
3029
  }
@@ -2154,26 +3044,23 @@ var Type$1 = function Type(x) {
2154
3044
  }
2155
3045
  };
2156
3046
 
2157
- // https://262.ecma-international.org/11.0/#sec-ecmascript-data-types-and-values
3047
+ // https://www.ecma-international.org/ecma-262/6.0/#sec-tostring
2158
3048
 
2159
- var Type = function Type(x) {
3049
+ var Type$1 = function Type$1(x) {
2160
3050
  if (typeof x === 'symbol') {
2161
3051
  return 'Symbol';
2162
3052
  }
2163
- if (typeof x === 'bigint') {
2164
- return 'BigInt';
2165
- }
2166
- return Type$1(x);
3053
+ return Type(x);
2167
3054
  };
2168
3055
 
2169
- // https://ecma-international.org/ecma-262/6.0/#sec-frompropertydescriptor
3056
+ // https://www.ecma-international.org/ecma-262/6.0/#sec-frompropertydescriptor
2170
3057
 
2171
3058
  var FromPropertyDescriptor = function FromPropertyDescriptor(Desc) {
2172
3059
  if (typeof Desc === 'undefined') {
2173
3060
  return Desc;
2174
3061
  }
2175
3062
 
2176
- assertRecord(Type, 'Property Descriptor', 'Desc', Desc);
3063
+ assertRecord(Type$1, 'Property Descriptor', 'Desc', Desc);
2177
3064
 
2178
3065
  var obj = {};
2179
3066
  if ('[[Value]]' in Desc) {
@@ -2197,7 +3084,7 @@ var FromPropertyDescriptor = function FromPropertyDescriptor(Desc) {
2197
3084
  return obj;
2198
3085
  };
2199
3086
 
2200
- var $gOPD$1 = getIntrinsic('%Object.getOwnPropertyDescriptor%');
3087
+ var $gOPD$1 = GetIntrinsic('%Object.getOwnPropertyDescriptor%');
2201
3088
  if ($gOPD$1) {
2202
3089
  try {
2203
3090
  $gOPD$1([], 'length');
@@ -2209,85 +3096,65 @@ if ($gOPD$1) {
2209
3096
 
2210
3097
  var getOwnPropertyDescriptor = $gOPD$1;
2211
3098
 
2212
- var $Array = getIntrinsic('%Array%');
3099
+ var $Array = GetIntrinsic('%Array%');
2213
3100
 
2214
3101
  // eslint-disable-next-line global-require
2215
- var toStr$1 = !$Array.isArray && callBound$1('Object.prototype.toString');
3102
+ var toStr$4 = !$Array.isArray && callBound('Object.prototype.toString');
2216
3103
 
2217
- // https://ecma-international.org/ecma-262/6.0/#sec-isarray
3104
+ // https://www.ecma-international.org/ecma-262/6.0/#sec-isarray
2218
3105
 
2219
3106
  var IsArray = $Array.isArray || function IsArray(argument) {
2220
- return toStr$1(argument) === '[object Array]';
3107
+ return toStr$4(argument) === '[object Array]';
2221
3108
  };
2222
3109
 
2223
- // https://ecma-international.org/ecma-262/6.0/#sec-ispropertykey
3110
+ // https://www.ecma-international.org/ecma-262/6.0/#sec-ispropertykey
2224
3111
 
2225
3112
  var IsPropertyKey = function IsPropertyKey(argument) {
2226
3113
  return typeof argument === 'string' || typeof argument === 'symbol';
2227
3114
  };
2228
3115
 
2229
- var hasSymbols$1 = hasSymbols$3();
2230
- var hasToStringTag$1 = hasSymbols$1 && typeof Symbol.toStringTag === 'symbol';
2231
- var has;
2232
- var $exec;
2233
- var isRegexMarker;
2234
- var badStringifier;
2235
-
2236
- if (hasToStringTag$1) {
2237
- has = callBound$1('Object.prototype.hasOwnProperty');
2238
- $exec = callBound$1('RegExp.prototype.exec');
2239
- isRegexMarker = {};
3116
+ var regexExec = RegExp.prototype.exec;
3117
+ var gOPD = Object.getOwnPropertyDescriptor;
2240
3118
 
2241
- var throwRegexMarker = function () {
2242
- throw isRegexMarker;
2243
- };
2244
- badStringifier = {
2245
- toString: throwRegexMarker,
2246
- valueOf: throwRegexMarker
2247
- };
3119
+ var tryRegexExecCall = function tryRegexExec(value) {
3120
+ try {
3121
+ var lastIndex = value.lastIndex;
3122
+ value.lastIndex = 0; // eslint-disable-line no-param-reassign
2248
3123
 
2249
- if (typeof Symbol.toPrimitive === 'symbol') {
2250
- badStringifier[Symbol.toPrimitive] = throwRegexMarker;
3124
+ regexExec.call(value);
3125
+ return true;
3126
+ } catch (e) {
3127
+ return false;
3128
+ } finally {
3129
+ value.lastIndex = lastIndex; // eslint-disable-line no-param-reassign
2251
3130
  }
2252
- }
2253
-
2254
- var $toString = callBound$1('Object.prototype.toString');
2255
- var gOPD = Object.getOwnPropertyDescriptor;
3131
+ };
3132
+ var toStr$5 = Object.prototype.toString;
2256
3133
  var regexClass = '[object RegExp]';
3134
+ var hasToStringTag = typeof Symbol === 'function' && typeof Symbol.toStringTag === 'symbol';
2257
3135
 
2258
- var isRegex = hasToStringTag$1
2259
- // eslint-disable-next-line consistent-return
2260
- ? function isRegex(value) {
2261
- if (!value || typeof value !== 'object') {
2262
- return false;
2263
- }
2264
-
2265
- var descriptor = gOPD(value, 'lastIndex');
2266
- var hasLastIndexDataProperty = descriptor && has(descriptor, 'value');
2267
- if (!hasLastIndexDataProperty) {
2268
- return false;
2269
- }
3136
+ var isRegex = function isRegex(value) {
3137
+ if (!value || typeof value !== 'object') {
3138
+ return false;
3139
+ }
3140
+ if (!hasToStringTag) {
3141
+ return toStr$5.call(value) === regexClass;
3142
+ }
2270
3143
 
2271
- try {
2272
- $exec(value, badStringifier);
2273
- } catch (e) {
2274
- return e === isRegexMarker;
2275
- }
3144
+ var descriptor = gOPD(value, 'lastIndex');
3145
+ var hasLastIndexDataProperty = descriptor && src(descriptor, 'value');
3146
+ if (!hasLastIndexDataProperty) {
3147
+ return false;
2276
3148
  }
2277
- : function isRegex(value) {
2278
- // In older browsers, typeof regex incorrectly returns 'function'
2279
- if (!value || (typeof value !== 'object' && typeof value !== 'function')) {
2280
- return false;
2281
- }
2282
3149
 
2283
- return $toString(value) === regexClass;
2284
- };
3150
+ return tryRegexExecCall(value);
3151
+ };
2285
3152
 
2286
- // http://262.ecma-international.org/5.1/#sec-9.2
3153
+ // http://www.ecma-international.org/ecma-262/5.1/#sec-9.2
2287
3154
 
2288
3155
  var ToBoolean = function ToBoolean(value) { return !!value; };
2289
3156
 
2290
- var $match = getIntrinsic('%Symbol.match%', true);
3157
+ var $match = GetIntrinsic('%Symbol.match%', true);
2291
3158
 
2292
3159
 
2293
3160
 
@@ -2309,27 +3176,6 @@ var IsRegExp = function IsRegExp(argument) {
2309
3176
  };
2310
3177
 
2311
3178
  var fnToStr = Function.prototype.toString;
2312
- var reflectApply = typeof Reflect === 'object' && Reflect !== null && Reflect.apply;
2313
- var badArrayLike;
2314
- var isCallableMarker;
2315
- if (typeof reflectApply === 'function' && typeof Object.defineProperty === 'function') {
2316
- try {
2317
- badArrayLike = Object.defineProperty({}, 'length', {
2318
- get: function () {
2319
- throw isCallableMarker;
2320
- }
2321
- });
2322
- isCallableMarker = {};
2323
- // eslint-disable-next-line no-throw-literal
2324
- reflectApply(function () { throw 42; }, null, badArrayLike);
2325
- } catch (_) {
2326
- if (_ !== isCallableMarker) {
2327
- reflectApply = null;
2328
- }
2329
- }
2330
- } else {
2331
- reflectApply = null;
2332
- }
2333
3179
 
2334
3180
  var constructorRegex = /^\s*class\b/;
2335
3181
  var isES6ClassFn = function isES6ClassFunction(value) {
@@ -2350,52 +3196,36 @@ var tryFunctionObject = function tryFunctionToStr(value) {
2350
3196
  return false;
2351
3197
  }
2352
3198
  };
2353
- var toStr = Object.prototype.toString;
3199
+ var toStr$6 = Object.prototype.toString;
2354
3200
  var fnClass = '[object Function]';
2355
3201
  var genClass = '[object GeneratorFunction]';
2356
- var hasToStringTag = typeof Symbol === 'function' && typeof Symbol.toStringTag === 'symbol';
2357
- /* globals document: false */
2358
- var documentDotAll = typeof document === 'object' && typeof document.all === 'undefined' && document.all !== undefined ? document.all : {};
2359
-
2360
- var isCallable = reflectApply
2361
- ? function isCallable(value) {
2362
- if (value === documentDotAll) { return true; }
2363
- if (!value) { return false; }
2364
- if (typeof value !== 'function' && typeof value !== 'object') { return false; }
2365
- if (typeof value === 'function' && !value.prototype) { return true; }
2366
- try {
2367
- reflectApply(value, null, badArrayLike);
2368
- } catch (e) {
2369
- if (e !== isCallableMarker) { return false; }
2370
- }
2371
- return !isES6ClassFn(value);
2372
- }
2373
- : function isCallable(value) {
2374
- if (value === documentDotAll) { return true; }
2375
- if (!value) { return false; }
2376
- if (typeof value !== 'function' && typeof value !== 'object') { return false; }
2377
- if (typeof value === 'function' && !value.prototype) { return true; }
2378
- if (hasToStringTag) { return tryFunctionObject(value); }
2379
- if (isES6ClassFn(value)) { return false; }
2380
- var strClass = toStr.call(value);
2381
- return strClass === fnClass || strClass === genClass;
2382
- };
3202
+ var hasToStringTag$1 = typeof Symbol === 'function' && typeof Symbol.toStringTag === 'symbol';
3203
+
3204
+ var isCallable = function isCallable(value) {
3205
+ if (!value) { return false; }
3206
+ if (typeof value !== 'function' && typeof value !== 'object') { return false; }
3207
+ if (typeof value === 'function' && !value.prototype) { return true; }
3208
+ if (hasToStringTag$1) { return tryFunctionObject(value); }
3209
+ if (isES6ClassFn(value)) { return false; }
3210
+ var strClass = toStr$6.call(value);
3211
+ return strClass === fnClass || strClass === genClass;
3212
+ };
2383
3213
 
2384
- // http://262.ecma-international.org/5.1/#sec-9.11
3214
+ // http://www.ecma-international.org/ecma-262/5.1/#sec-9.11
2385
3215
 
2386
3216
  var IsCallable = isCallable;
2387
3217
 
2388
- var $TypeError$3 = getIntrinsic('%TypeError%');
3218
+ var $TypeError$2 = GetIntrinsic('%TypeError%');
2389
3219
 
2390
3220
 
2391
3221
 
2392
3222
 
2393
3223
 
2394
- // https://262.ecma-international.org/5.1/#sec-8.10.5
3224
+ // https://ecma-international.org/ecma-262/5.1/#sec-8.10.5
2395
3225
 
2396
3226
  var ToPropertyDescriptor = function ToPropertyDescriptor(Obj) {
2397
- if (Type(Obj) !== 'Object') {
2398
- throw new $TypeError$3('ToPropertyDescriptor requires an object');
3227
+ if (Type$1(Obj) !== 'Object') {
3228
+ throw new $TypeError$2('ToPropertyDescriptor requires an object');
2399
3229
  }
2400
3230
 
2401
3231
  var desc = {};
@@ -2414,29 +3244,29 @@ var ToPropertyDescriptor = function ToPropertyDescriptor(Obj) {
2414
3244
  if (src(Obj, 'get')) {
2415
3245
  var getter = Obj.get;
2416
3246
  if (typeof getter !== 'undefined' && !IsCallable(getter)) {
2417
- throw new $TypeError$3('getter must be a function');
3247
+ throw new TypeError('getter must be a function');
2418
3248
  }
2419
3249
  desc['[[Get]]'] = getter;
2420
3250
  }
2421
3251
  if (src(Obj, 'set')) {
2422
3252
  var setter = Obj.set;
2423
3253
  if (typeof setter !== 'undefined' && !IsCallable(setter)) {
2424
- throw new $TypeError$3('setter must be a function');
3254
+ throw new $TypeError$2('setter must be a function');
2425
3255
  }
2426
3256
  desc['[[Set]]'] = setter;
2427
3257
  }
2428
3258
 
2429
3259
  if ((src(desc, '[[Get]]') || src(desc, '[[Set]]')) && (src(desc, '[[Value]]') || src(desc, '[[Writable]]'))) {
2430
- throw new $TypeError$3('Invalid property descriptor. Cannot both specify accessors and a value or writable attribute');
3260
+ throw new $TypeError$2('Invalid property descriptor. Cannot both specify accessors and a value or writable attribute');
2431
3261
  }
2432
3262
  return desc;
2433
3263
  };
2434
3264
 
2435
- var $TypeError$2 = getIntrinsic('%TypeError%');
3265
+ var $TypeError$3 = GetIntrinsic('%TypeError%');
2436
3266
 
2437
3267
 
2438
3268
 
2439
- var $isEnumerable = callBound$1('Object.prototype.propertyIsEnumerable');
3269
+ var $isEnumerable$1 = callBound('Object.prototype.propertyIsEnumerable');
2440
3270
 
2441
3271
 
2442
3272
 
@@ -2446,14 +3276,14 @@ var $isEnumerable = callBound$1('Object.prototype.propertyIsEnumerable');
2446
3276
 
2447
3277
 
2448
3278
 
2449
- // https://ecma-international.org/ecma-262/6.0/#sec-ordinarygetownproperty
3279
+ // https://www.ecma-international.org/ecma-262/6.0/#sec-ordinarygetownproperty
2450
3280
 
2451
3281
  var OrdinaryGetOwnProperty = function OrdinaryGetOwnProperty(O, P) {
2452
- if (Type(O) !== 'Object') {
2453
- throw new $TypeError$2('Assertion failed: O must be an Object');
3282
+ if (Type$1(O) !== 'Object') {
3283
+ throw new $TypeError$3('Assertion failed: O must be an Object');
2454
3284
  }
2455
3285
  if (!IsPropertyKey(P)) {
2456
- throw new $TypeError$2('Assertion failed: P must be a Property Key');
3286
+ throw new $TypeError$3('Assertion failed: P must be a Property Key');
2457
3287
  }
2458
3288
  if (!src(O, P)) {
2459
3289
  return void 0;
@@ -2464,7 +3294,7 @@ var OrdinaryGetOwnProperty = function OrdinaryGetOwnProperty(O, P) {
2464
3294
  var regexLastIndex = IsRegExp(O) && P === 'lastIndex';
2465
3295
  return {
2466
3296
  '[[Configurable]]': !(arrayLength || regexLastIndex),
2467
- '[[Enumerable]]': $isEnumerable(O, P),
3297
+ '[[Enumerable]]': $isEnumerable$1(O, P),
2468
3298
  '[[Value]]': O[P],
2469
3299
  '[[Writable]]': true
2470
3300
  };
@@ -2472,14 +3302,14 @@ var OrdinaryGetOwnProperty = function OrdinaryGetOwnProperty(O, P) {
2472
3302
  return ToPropertyDescriptor(getOwnPropertyDescriptor(O, P));
2473
3303
  };
2474
3304
 
2475
- // https://ecma-international.org/ecma-262/6.0/#sec-isdatadescriptor
3305
+ // https://www.ecma-international.org/ecma-262/6.0/#sec-isdatadescriptor
2476
3306
 
2477
3307
  var IsDataDescriptor = function IsDataDescriptor(Desc) {
2478
3308
  if (typeof Desc === 'undefined') {
2479
3309
  return false;
2480
3310
  }
2481
3311
 
2482
- assertRecord(Type, 'Property Descriptor', 'Desc', Desc);
3312
+ assertRecord(Type$1, 'Property Descriptor', 'Desc', Desc);
2483
3313
 
2484
3314
  if (!src(Desc, '[[Value]]') && !src(Desc, '[[Writable]]')) {
2485
3315
  return false;
@@ -2492,14 +3322,14 @@ var isPrimitive = function isPrimitive(value) {
2492
3322
  return value === null || (typeof value !== 'function' && typeof value !== 'object');
2493
3323
  };
2494
3324
 
2495
- var $Object$1 = getIntrinsic('%Object%');
3325
+ var $Object = GetIntrinsic('%Object%');
2496
3326
 
2497
3327
 
2498
3328
 
2499
- var $preventExtensions = $Object$1.preventExtensions;
2500
- var $isExtensible = $Object$1.isExtensible;
3329
+ var $preventExtensions = $Object.preventExtensions;
3330
+ var $isExtensible = $Object.isExtensible;
2501
3331
 
2502
- // https://ecma-international.org/ecma-262/6.0/#sec-isextensible-o
3332
+ // https://www.ecma-international.org/ecma-262/6.0/#sec-isextensible-o
2503
3333
 
2504
3334
  var IsExtensible = $preventExtensions
2505
3335
  ? function IsExtensible(obj) {
@@ -2513,7 +3343,7 @@ var _isNaN = Number.isNaN || function isNaN(a) {
2513
3343
  return a !== a;
2514
3344
  };
2515
3345
 
2516
- // http://262.ecma-international.org/5.1/#sec-9.12
3346
+ // http://www.ecma-international.org/ecma-262/5.1/#sec-9.12
2517
3347
 
2518
3348
  var SameValue = function SameValue(x, y) {
2519
3349
  if (x === y) { // 0 === -0, but they are not identical.
@@ -2523,7 +3353,7 @@ var SameValue = function SameValue(x, y) {
2523
3353
  return _isNaN(x) && _isNaN(y);
2524
3354
  };
2525
3355
 
2526
- var $TypeError$1 = getIntrinsic('%TypeError%');
3356
+ var $TypeError$4 = GetIntrinsic('%TypeError%');
2527
3357
 
2528
3358
 
2529
3359
 
@@ -2535,18 +3365,18 @@ var $TypeError$1 = getIntrinsic('%TypeError%');
2535
3365
 
2536
3366
 
2537
3367
 
2538
- // https://ecma-international.org/ecma-262/6.0/#sec-createdataproperty
3368
+ // https://www.ecma-international.org/ecma-262/6.0/#sec-createdataproperty
2539
3369
 
2540
3370
  var CreateDataProperty = function CreateDataProperty(O, P, V) {
2541
- if (Type(O) !== 'Object') {
2542
- throw new $TypeError$1('Assertion failed: Type(O) is not Object');
3371
+ if (Type$1(O) !== 'Object') {
3372
+ throw new $TypeError$4('Assertion failed: Type(O) is not Object');
2543
3373
  }
2544
3374
  if (!IsPropertyKey(P)) {
2545
- throw new $TypeError$1('Assertion failed: IsPropertyKey(P) is not true');
3375
+ throw new $TypeError$4('Assertion failed: IsPropertyKey(P) is not true');
2546
3376
  }
2547
3377
  var oldDesc = OrdinaryGetOwnProperty(O, P);
2548
- var extensible = !oldDesc || IsExtensible(O);
2549
- var immutable = oldDesc && (!oldDesc['[[Writable]]'] || !oldDesc['[[Configurable]]']);
3378
+ var extensible = oldDesc || IsExtensible(O);
3379
+ var immutable = oldDesc && (!oldDesc.writable || !oldDesc.configurable);
2550
3380
  if (immutable || !extensible) {
2551
3381
  return false;
2552
3382
  }
@@ -2565,44 +3395,44 @@ var CreateDataProperty = function CreateDataProperty(O, P, V) {
2565
3395
  );
2566
3396
  };
2567
3397
 
2568
- var $TypeError = getIntrinsic('%TypeError%');
3398
+ var $TypeError$5 = GetIntrinsic('%TypeError%');
2569
3399
 
2570
- // http://262.ecma-international.org/5.1/#sec-9.10
3400
+ // http://www.ecma-international.org/ecma-262/5.1/#sec-9.10
2571
3401
 
2572
3402
  var CheckObjectCoercible = function CheckObjectCoercible(value, optMessage) {
2573
3403
  if (value == null) {
2574
- throw new $TypeError(optMessage || ('Cannot call method on ' + value));
3404
+ throw new $TypeError$5(optMessage || ('Cannot call method on ' + value));
2575
3405
  }
2576
3406
  return value;
2577
3407
  };
2578
3408
 
2579
3409
  var RequireObjectCoercible = CheckObjectCoercible;
2580
3410
 
2581
- var $Object = getIntrinsic('%Object%');
3411
+ var $Object$1 = GetIntrinsic('%Object%');
2582
3412
 
2583
3413
 
2584
3414
 
2585
- // https://ecma-international.org/ecma-262/6.0/#sec-toobject
3415
+ // https://www.ecma-international.org/ecma-262/6.0/#sec-toobject
2586
3416
 
2587
3417
  var ToObject = function ToObject(value) {
2588
3418
  RequireObjectCoercible(value);
2589
- return $Object(value);
3419
+ return $Object$1(value);
2590
3420
  };
2591
3421
 
2592
- var $gOPD = Object.getOwnPropertyDescriptor;
3422
+ var $gOPD$2 = Object.getOwnPropertyDescriptor;
2593
3423
  var $getOwnNames = Object.getOwnPropertyNames;
2594
3424
  var $getSymbols = Object.getOwnPropertySymbols;
2595
- var $concat$1 = callBound$1('Array.prototype.concat');
2596
- var $reduce = callBound$1('Array.prototype.reduce');
3425
+ var $concat = callBound('Array.prototype.concat');
3426
+ var $reduce = callBound('Array.prototype.reduce');
2597
3427
  var getAll = $getSymbols ? function (obj) {
2598
- return $concat$1($getOwnNames(obj), $getSymbols(obj));
3428
+ return $concat($getOwnNames(obj), $getSymbols(obj));
2599
3429
  } : $getOwnNames;
2600
3430
 
2601
- var isES5$1 = IsCallable($gOPD) && IsCallable($getOwnNames);
3431
+ var isES5 = IsCallable($gOPD$2) && IsCallable($getOwnNames);
2602
3432
 
2603
- var implementation$1 = function getOwnPropertyDescriptors(value) {
3433
+ var implementation$2 = function getOwnPropertyDescriptors(value) {
2604
3434
  RequireObjectCoercible(value);
2605
- if (!isES5$1) {
3435
+ if (!isES5) {
2606
3436
  throw new TypeError('getOwnPropertyDescriptors requires Object.getOwnPropertyDescriptor');
2607
3437
  }
2608
3438
 
@@ -2610,7 +3440,7 @@ var implementation$1 = function getOwnPropertyDescriptors(value) {
2610
3440
  return $reduce(
2611
3441
  getAll(O),
2612
3442
  function (acc, key) {
2613
- var descriptor = $gOPD(O, key);
3443
+ var descriptor = $gOPD$2(O, key);
2614
3444
  if (typeof descriptor !== 'undefined') {
2615
3445
  CreateDataProperty(acc, key, descriptor);
2616
3446
  }
@@ -2620,40 +3450,34 @@ var implementation$1 = function getOwnPropertyDescriptors(value) {
2620
3450
  );
2621
3451
  };
2622
3452
 
2623
- var polyfill$2 = function getPolyfill() {
2624
- return typeof Object.getOwnPropertyDescriptors === 'function' ? Object.getOwnPropertyDescriptors : implementation$1;
3453
+ var polyfill = function getPolyfill() {
3454
+ return typeof Object.getOwnPropertyDescriptors === 'function' ? Object.getOwnPropertyDescriptors : implementation$2;
2625
3455
  };
2626
3456
 
2627
- var shim$1 = function shimGetOwnPropertyDescriptors() {
2628
- var polyfill = polyfill$2();
3457
+ var shim = function shimGetOwnPropertyDescriptors() {
3458
+ var polyfill$1 = polyfill();
2629
3459
  defineProperties_1(
2630
3460
  Object,
2631
- { getOwnPropertyDescriptors: polyfill },
2632
- { getOwnPropertyDescriptors: function () { return Object.getOwnPropertyDescriptors !== polyfill; } }
3461
+ { getOwnPropertyDescriptors: polyfill$1 },
3462
+ { getOwnPropertyDescriptors: function () { return Object.getOwnPropertyDescriptors !== polyfill$1; } }
2633
3463
  );
2634
- return polyfill;
3464
+ return polyfill$1;
2635
3465
  };
2636
3466
 
2637
- var bound = callBind(polyfill$2(), Object);
2638
-
2639
- defineProperties_1(bound, {
2640
- getPolyfill: polyfill$2,
2641
- implementation: implementation$1,
2642
- shim: shim$1
3467
+ defineProperties_1(implementation$2, {
3468
+ getPolyfill: polyfill,
3469
+ implementation: implementation$2,
3470
+ shim: shim
2643
3471
  });
2644
3472
 
2645
- var object_getownpropertydescriptors = bound;
3473
+ var object_getownpropertydescriptors = implementation$2;
2646
3474
 
2647
- // TODO; semver-major: remove
2648
-
2649
- var callBound = callBound$1;
2650
-
2651
- var isES5 = typeof Object.defineProperty === 'function'
3475
+ var isES5$1 = typeof Object.defineProperty === 'function'
2652
3476
  && typeof Object.defineProperties === 'function';
2653
3477
 
2654
3478
  var hasProto = [].__proto__ === Array.prototype; // eslint-disable-line no-proto
2655
3479
 
2656
- if (!isES5 || !hasProto) {
3480
+ if (!isES5$1 || !hasProto) {
2657
3481
  throw new TypeError('util.promisify requires a true ES5 environment, that also supports `__proto__`');
2658
3482
  }
2659
3483
 
@@ -2666,15 +3490,15 @@ if (typeof Promise !== 'function') {
2666
3490
 
2667
3491
 
2668
3492
  var $slice = callBound('Array.prototype.slice');
2669
- var $concat = callBound('Array.prototype.concat');
3493
+ var $concat$1 = callBound('Array.prototype.concat');
2670
3494
  var $forEach = callBound('Array.prototype.forEach');
2671
3495
 
2672
- var hasSymbols = hasSymbols$3();
3496
+ var hasSymbols$3 = hasSymbols$1();
2673
3497
 
2674
- var kCustomPromisifiedSymbol = hasSymbols ? Symbol('util.promisify.custom') : null;
2675
- var kCustomPromisifyArgsSymbol = hasSymbols ? Symbol('customPromisifyArgs') : null;
3498
+ var kCustomPromisifiedSymbol = hasSymbols$3 ? Symbol('util.promisify.custom') : null;
3499
+ var kCustomPromisifyArgsSymbol = hasSymbols$3 ? Symbol('customPromisifyArgs') : null;
2676
3500
 
2677
- var implementation = function promisify(orig) {
3501
+ var implementation$3 = function promisify(orig) {
2678
3502
  if (typeof orig !== 'function') {
2679
3503
  var error = new TypeError('The "original" argument must be of type function');
2680
3504
  error.name = 'TypeError [ERR_INVALID_ARG_TYPE]';
@@ -2682,7 +3506,7 @@ var implementation = function promisify(orig) {
2682
3506
  throw error;
2683
3507
  }
2684
3508
 
2685
- if (hasSymbols && orig[kCustomPromisifiedSymbol]) {
3509
+ if (hasSymbols$3 && orig[kCustomPromisifiedSymbol]) {
2686
3510
  var customFunction = orig[kCustomPromisifiedSymbol];
2687
3511
  if (typeof customFunction !== 'function') {
2688
3512
  throw new TypeError('The [util.promisify.custom] property must be a function');
@@ -2704,7 +3528,7 @@ var implementation = function promisify(orig) {
2704
3528
  var args = $slice(arguments);
2705
3529
  var self = this; // eslint-disable-line no-invalid-this
2706
3530
  return new Promise(function (resolve, reject) {
2707
- orig.apply(self, $concat(args, function (err) {
3531
+ orig.apply(self, $concat$1(args, function (err) {
2708
3532
  var values = arguments.length > 1 ? $slice(arguments, 1) : [];
2709
3533
  if (err) {
2710
3534
  reject(err);
@@ -2734,17 +3558,17 @@ var implementation = function promisify(orig) {
2734
3558
 
2735
3559
  var custom = kCustomPromisifiedSymbol;
2736
3560
  var customPromisifyArgs = kCustomPromisifyArgsSymbol;
2737
- implementation.custom = custom;
2738
- implementation.customPromisifyArgs = customPromisifyArgs;
3561
+ implementation$3.custom = custom;
3562
+ implementation$3.customPromisifyArgs = customPromisifyArgs;
2739
3563
 
2740
3564
  var polyfill$1 = function getPolyfill() {
2741
3565
  if (typeof util.util.promisify === 'function') {
2742
3566
  return util.util.promisify;
2743
3567
  }
2744
- return implementation;
3568
+ return implementation$3;
2745
3569
  };
2746
3570
 
2747
- var shim = function shimUtilPromisify() {
3571
+ var shim$1 = function shimUtilPromisify() {
2748
3572
  var polyfill = polyfill$1();
2749
3573
  if (polyfill !== util.util.promisify) {
2750
3574
  Object.defineProperty(util.util, 'promisify', {
@@ -2757,20 +3581,20 @@ var shim = function shimUtilPromisify() {
2757
3581
  return polyfill;
2758
3582
  };
2759
3583
 
2760
- var polyfill = polyfill$1();
3584
+ var polyfill$2 = polyfill$1();
2761
3585
 
2762
3586
 
2763
3587
  /* eslint-disable no-unused-vars */
2764
3588
  var boundPromisify = function promisify(orig) {
2765
3589
  /* eslint-enable no-unused-vars */
2766
- return polyfill.apply(util.util, arguments);
3590
+ return polyfill$2.apply(util.util, arguments);
2767
3591
  };
2768
3592
  defineProperties_1(boundPromisify, {
2769
- custom: polyfill.custom,
2770
- customPromisifyArgs: polyfill.customPromisifyArgs,
3593
+ custom: polyfill$2.custom,
3594
+ customPromisifyArgs: polyfill$2.customPromisifyArgs,
2771
3595
  getPolyfill: polyfill$1,
2772
- implementation: implementation,
2773
- shim: shim
3596
+ implementation: implementation$3,
3597
+ shim: shim$1
2774
3598
  });
2775
3599
 
2776
3600
  var util_promisify = boundPromisify;
@@ -2789,7 +3613,7 @@ function connect() {
2789
3613
  };
2790
3614
  }
2791
3615
 
2792
- var connection = mysql__default['default'].createConnection(config);
3616
+ var connection = mysql.createConnection(config);
2793
3617
  return {
2794
3618
  query: function query(sql, args) {
2795
3619
  return util.util.promisify(connection.query).call(connection, sql, args);
@@ -2811,16 +3635,16 @@ function connect() {
2811
3635
 
2812
3636
  var db = connect;
2813
3637
 
2814
- var _this$1 = undefined;
3638
+ var _this$3 = undefined;
2815
3639
 
2816
- var config$1 = {
3640
+ var config = {
2817
3641
  host: 'sanity-datasource.cluster-crao688bsrdh.us-east-1.rds.amazonaws.com',
2818
3642
  user: 'nasp',
2819
3643
  password: 'uRNkF9SkfXQs6AKK',
2820
3644
  database: 'user'
2821
3645
  };
2822
3646
 
2823
- var findUser$1 = function () {
3647
+ var findUser = function () {
2824
3648
  var _ref = asyncToGenerator._asyncToGenerator( /*#__PURE__*/asyncToGenerator.regenerator.mark(function _callee(email) {
2825
3649
  var password = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
2826
3650
  var db$1, query, res, user, hash, passwordsMatch, user_shared, occupation_id;
@@ -2832,7 +3656,7 @@ var findUser$1 = function () {
2832
3656
  _context.prev = 1;
2833
3657
 
2834
3658
 
2835
- db$1 = db(config$1);
3659
+ db$1 = db(config);
2836
3660
 
2837
3661
  query = '\n select * \n from user \n where trim(lower(email)) = ?\n ';
2838
3662
  _context.next = 6;
@@ -2928,7 +3752,7 @@ var findUser$1 = function () {
2928
3752
  };
2929
3753
  }();
2930
3754
 
2931
- var updateUser$1 = function () {
3755
+ var updateUser = function () {
2932
3756
  var _ref2 = asyncToGenerator._asyncToGenerator( /*#__PURE__*/asyncToGenerator.regenerator.mark(function _callee2(data) {
2933
3757
  var db$1, query, res, hash, columns, i, column, occupation_name;
2934
3758
  return asyncToGenerator.regenerator.wrap(function _callee2$(_context2) {
@@ -2941,7 +3765,7 @@ var updateUser$1 = function () {
2941
3765
 
2942
3766
  validateUserData(data);
2943
3767
 
2944
- db$1 = db(config$1);
3768
+ db$1 = db(config);
2945
3769
 
2946
3770
  _context2.next = 6;
2947
3771
  return db$1.beginTransaction();
@@ -3048,7 +3872,7 @@ var updateUser$1 = function () {
3048
3872
 
3049
3873
  return _context2.abrupt('return', {
3050
3874
  error: '',
3051
- user: findUser$1(data.email)
3875
+ user: findUser(data.email)
3052
3876
  });
3053
3877
 
3054
3878
  case 45:
@@ -3160,7 +3984,7 @@ var getOccupationNameById = function () {
3160
3984
  return _context3.stop();
3161
3985
  }
3162
3986
  }
3163
- }, _callee3, _this$1);
3987
+ }, _callee3, _this$3);
3164
3988
  }));
3165
3989
 
3166
3990
  return function getOccupationNameById(_x5, _x6) {
@@ -3168,7 +3992,7 @@ var getOccupationNameById = function () {
3168
3992
  };
3169
3993
  }();
3170
3994
 
3171
- var createUser$1 = function () {
3995
+ var createUser = function () {
3172
3996
  var _ref4 = asyncToGenerator._asyncToGenerator( /*#__PURE__*/asyncToGenerator.regenerator.mark(function _callee4(data) {
3173
3997
  var db$1, query, res, hash, columns, i, column, user_id, occupation_name;
3174
3998
  return asyncToGenerator.regenerator.wrap(function _callee4$(_context4) {
@@ -3181,7 +4005,7 @@ var createUser$1 = function () {
3181
4005
 
3182
4006
  validateUserData(data, true);
3183
4007
 
3184
- db$1 = db(config$1);
4008
+ db$1 = db(config);
3185
4009
 
3186
4010
  _context4.next = 6;
3187
4011
  return db$1.beginTransaction();
@@ -3277,7 +4101,7 @@ var createUser$1 = function () {
3277
4101
  case 39:
3278
4102
  return _context4.abrupt('return', {
3279
4103
  error: '',
3280
- user: findUser$1(data.email)
4104
+ user: findUser(data.email)
3281
4105
  });
3282
4106
 
3283
4107
  case 42:
@@ -3315,7 +4139,7 @@ var createUser$1 = function () {
3315
4139
  };
3316
4140
  }();
3317
4141
 
3318
- var createUser = function () {
4142
+ var createUser$1 = function () {
3319
4143
  var _ref = asyncToGenerator._asyncToGenerator( /*#__PURE__*/asyncToGenerator.regenerator.mark(function _callee(data) {
3320
4144
  var res;
3321
4145
  return asyncToGenerator.regenerator.wrap(function _callee$(_context) {
@@ -3323,7 +4147,7 @@ var createUser = function () {
3323
4147
  switch (_context.prev = _context.next) {
3324
4148
  case 0:
3325
4149
  _context.next = 2;
3326
- return createUser$1(data);
4150
+ return createUser(data);
3327
4151
 
3328
4152
  case 2:
3329
4153
  res = _context.sent;
@@ -3351,7 +4175,7 @@ var createUser = function () {
3351
4175
  };
3352
4176
  }();
3353
4177
 
3354
- var updateUser = function () {
4178
+ var updateUser$1 = function () {
3355
4179
  var _ref2 = asyncToGenerator._asyncToGenerator( /*#__PURE__*/asyncToGenerator.regenerator.mark(function _callee2(data) {
3356
4180
  var res;
3357
4181
  return asyncToGenerator.regenerator.wrap(function _callee2$(_context2) {
@@ -3359,7 +4183,7 @@ var updateUser = function () {
3359
4183
  switch (_context2.prev = _context2.next) {
3360
4184
  case 0:
3361
4185
  _context2.next = 2;
3362
- return updateUser$1(data);
4186
+ return updateUser(data);
3363
4187
 
3364
4188
  case 2:
3365
4189
  res = _context2.sent;
@@ -3387,7 +4211,7 @@ var updateUser = function () {
3387
4211
  };
3388
4212
  }();
3389
4213
 
3390
- var findUser = function () {
4214
+ var findUser$1 = function () {
3391
4215
  var _ref3 = asyncToGenerator._asyncToGenerator( /*#__PURE__*/asyncToGenerator.regenerator.mark(function _callee3(_ref4) {
3392
4216
  var email = _ref4.email,
3393
4217
  password = _ref4.password;
@@ -3397,7 +4221,7 @@ var findUser = function () {
3397
4221
  switch (_context3.prev = _context3.next) {
3398
4222
  case 0:
3399
4223
  _context3.next = 2;
3400
- return findUser$1(email, password);
4224
+ return findUser(email, password);
3401
4225
 
3402
4226
  case 2:
3403
4227
  res = _context3.sent;
@@ -3427,17 +4251,17 @@ var findUser = function () {
3427
4251
 
3428
4252
  var user = /*#__PURE__*/Object.freeze({
3429
4253
  __proto__: null,
3430
- createUser: createUser,
3431
- updateUser: updateUser,
3432
- findUser: findUser
4254
+ createUser: createUser$1,
4255
+ updateUser: updateUser$1,
4256
+ findUser: findUser$1
3433
4257
  });
3434
4258
 
3435
- var localStrategy = new Local__default['default'].Strategy({
4259
+ var localStrategy = new Local.Strategy({
3436
4260
  usernameField: 'email',
3437
4261
  passwordField: 'password'
3438
4262
  }, function (email, password, done) {
3439
4263
 
3440
- findUser({ email: email, password: password }).then(function (user) {
4264
+ findUser$1({ email: email, password: password }).then(function (user) {
3441
4265
  done(null, user);
3442
4266
  }).catch(function (error) {
3443
4267
  done(error);
@@ -3449,9 +4273,9 @@ var passportLocal = /*#__PURE__*/Object.freeze({
3449
4273
  localStrategy: localStrategy
3450
4274
  });
3451
4275
 
3452
- var _this = undefined;
4276
+ var _this$4 = undefined;
3453
4277
 
3454
- var config = {
4278
+ var config$1 = {
3455
4279
  host: 'sanity-datasource.cluster-crao688bsrdh.us-east-1.rds.amazonaws.com',
3456
4280
  user: 'nasp',
3457
4281
  password: 'uRNkF9SkfXQs6AKK',
@@ -3465,7 +4289,7 @@ var getOccupation = function () {
3465
4289
  while (1) {
3466
4290
  switch (_context.prev = _context.next) {
3467
4291
  case 0:
3468
- db$1 = db(config);
4292
+ db$1 = db(config$1);
3469
4293
  query = '\n select name as label, id as value\n from occupation\n where type = ?\n ';
3470
4294
  _context.next = 4;
3471
4295
  return db$1.query(query, [type]);
@@ -3483,7 +4307,7 @@ var getOccupation = function () {
3483
4307
  return _context.stop();
3484
4308
  }
3485
4309
  }
3486
- }, _callee, _this);
4310
+ }, _callee, _this$4);
3487
4311
  }));
3488
4312
 
3489
4313
  return function getOccupation(_x) {
@@ -3498,7 +4322,7 @@ var getFieldsAndOptions = function () {
3498
4322
  while (1) {
3499
4323
  switch (_context2.prev = _context2.next) {
3500
4324
  case 0:
3501
- db$1 = db(config);
4325
+ db$1 = db(config$1);
3502
4326
  query = '\n select * \n from field\n where occupation_id = ?\n order by sorting\n ';
3503
4327
  _context2.next = 4;
3504
4328
  return db$1.query(query, [occupation]);
@@ -3546,7 +4370,7 @@ var getFieldsAndOptions = function () {
3546
4370
  return _context2.stop();
3547
4371
  }
3548
4372
  }
3549
- }, _callee2, _this);
4373
+ }, _callee2, _this$4);
3550
4374
  }));
3551
4375
 
3552
4376
  return function getFieldsAndOptions(_x2) {
@@ -3617,8 +4441,8 @@ var ProcessData = (function () {
3617
4441
  })();
3618
4442
 
3619
4443
  var LoginForm_1 = LoginForm;
3620
- var SignupForm_1 = SignupForm$1;
3621
- var ProfileForm_1 = SignupForm;
4444
+ var SignupForm_1 = SignupForm;
4445
+ var ProfileForm_1 = SignupForm$1;
3622
4446
  var AuthCookies_1 = authCookies;
3623
4447
  var AuthHooks_1 = hooks;
3624
4448
  var Iron_1 = iron;