@mjhls/mjh-framework 1.0.850-affiliatefix-v1 → 1.0.850-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +168 -168
- package/dist/cjs/AD.js +9 -10
- package/dist/cjs/AD300x250.js +30 -31
- package/dist/cjs/AD300x250x600.js +30 -31
- package/dist/cjs/AD728x90.js +33 -34
- package/dist/cjs/ADFloatingFooter.js +32 -33
- package/dist/cjs/ADFooter.js +14 -15
- package/dist/cjs/ADGutter.js +32 -33
- package/dist/cjs/{ADInfeed-859820d9.js → ADInfeed-98c71bcd.js} +13 -15
- package/dist/cjs/ADSkyscraper.js +32 -33
- package/dist/cjs/ADSponsoredResources.js +32 -33
- package/dist/cjs/ADWebcast.js +32 -33
- package/dist/cjs/ADWelcome.js +33 -34
- package/dist/cjs/{ADlgInfeed-da3a36a6.js → ADlgInfeed-9de32585.js} +10 -11
- package/dist/cjs/AccordionPanel.js +29 -31
- package/dist/cjs/AdSlot.js +101 -34
- package/dist/cjs/AdSlotsProvider.js +33 -25
- package/dist/cjs/AlgoliaSearch.js +1080 -1076
- package/dist/cjs/AlphabeticList.js +25 -26
- package/dist/cjs/ArticleCarousel.js +23 -24
- package/dist/cjs/ArticleProgramLandingPage.js +58 -60
- package/dist/cjs/ArticleSeriesLandingPage.js +40 -41
- package/dist/cjs/ArticleSeriesListing.js +61 -62
- package/dist/cjs/AuthWrapper.js +423 -1739
- package/dist/cjs/{AuthorComponent-c21aac7f.js → AuthorComponent-bb831b74.js} +13 -14
- package/dist/cjs/Beam.js +8 -8
- package/dist/cjs/{BlockContent-36e54d77.js → BlockContent-091a991f.js} +55 -56
- package/dist/cjs/Breadcrumbs.js +27 -29
- package/dist/cjs/CMEDeck.js +83 -83
- package/dist/cjs/Column1.js +11 -14
- package/dist/cjs/Column2.js +33 -36
- package/dist/cjs/Column3.js +59 -62
- package/dist/cjs/ConferenceArticleCard.js +37 -38
- package/dist/cjs/ConferenceBanner-4a16fddc.js +23 -0
- package/dist/cjs/DeckContent.js +103 -107
- package/dist/cjs/DeckQueue.js +90 -94
- package/dist/cjs/{Dfp-93399f8c.js → Dfp-26baccf1.js} +34 -35
- package/dist/cjs/EventsDeck.js +152 -159
- package/dist/cjs/ExternalResources.js +79 -81
- package/dist/cjs/Feature.js +24 -26
- package/dist/cjs/ForbesHero.js +42 -43
- package/dist/cjs/GridContent.js +304 -190
- package/dist/cjs/GridHero.js +44 -45
- package/dist/cjs/GroupDeck.js +59 -60
- package/dist/cjs/HamMagazine.js +141 -146
- package/dist/cjs/Header.js +12 -14
- package/dist/cjs/Hero.js +12 -13
- package/dist/cjs/HighlightenVideo.js +17 -18
- package/dist/cjs/HorizontalArticleListing.js +71 -73
- package/dist/cjs/HorizontalHero.js +25 -26
- package/dist/cjs/IssueContentDeck.js +73 -78
- package/dist/cjs/IssueDeck.js +72 -77
- package/dist/cjs/IssueLanding.js +92 -96
- package/dist/cjs/KMTracker.js +15 -15
- package/dist/cjs/LeftNav.js +39 -41
- package/dist/cjs/MasterDeck.js +80 -81
- package/dist/cjs/MediaSeriesLanding.js +1138 -1230
- package/dist/cjs/NavDvm.js +74 -79
- package/dist/cjs/{NavFooter-3dcd99a8.js → NavFooter-76c913e3.js} +14 -15
- package/dist/cjs/NavMagazine.js +148 -153
- package/dist/cjs/NavNative.js +145 -153
- package/dist/cjs/OncliveHero.js +19 -19
- package/dist/cjs/OncliveLargeHero.js +72 -73
- package/dist/cjs/PageFilter.js +14 -15
- package/dist/cjs/PartnerDetailListing.js +106 -115
- package/dist/cjs/PdfDownload.js +9 -10
- package/dist/cjs/PopUpModal.js +19 -21
- package/dist/cjs/PubSection.js +40 -43
- package/dist/cjs/PubToc.js +15 -16
- package/dist/cjs/PublicationDeck.js +62 -67
- package/dist/cjs/PublicationLanding.js +135 -139
- package/dist/cjs/QueueDeckExpanded.js +2172 -1167
- package/dist/cjs/RecentNews.js +22 -23
- package/dist/cjs/RelatedContent.js +54 -55
- package/dist/cjs/RelatedTopicsDropdown.js +29 -32
- package/dist/cjs/RolesDeck.js +27 -32
- package/dist/cjs/Search.js +18 -22
- package/dist/cjs/Segment.js +368 -343
- package/dist/cjs/SeriesListingDeck.js +38 -38
- package/dist/cjs/{SeriesSlider-34c6cc2b.js → SeriesSlider-8bbc989f.js} +39 -40
- package/dist/cjs/SetCookie.js +1 -1
- package/dist/cjs/SideFooter.js +38 -39
- package/dist/cjs/SocialIcons.js +9 -10
- package/dist/cjs/{SocialSearchComponent-948138c7.js → SocialSearchComponent-cea213aa.js} +36 -40
- package/dist/cjs/SocialShare.js +29 -31
- package/dist/cjs/TaxonomyCard.js +59 -64
- package/dist/cjs/TaxonomyDescription.js +54 -56
- package/dist/cjs/TemplateNormal.js +74 -75
- package/dist/cjs/ThumbnailCard.js +21 -23
- package/dist/cjs/Ustream.js +30 -31
- package/dist/cjs/VerticalHero.js +16 -17
- package/dist/cjs/VideoProgramLandingPage.js +73 -78
- package/dist/cjs/VideoSeriesCard.js +33 -34
- package/dist/cjs/VideoSeriesFilter.js +18 -18
- package/dist/cjs/VideoSeriesLandingPage.js +50 -51
- package/dist/cjs/VideoSeriesListing.js +82 -81
- package/dist/cjs/View.js +342 -266
- package/dist/cjs/YahooHero.js +41 -42
- package/dist/cjs/YoutubeGroup.js +66 -67
- package/dist/cjs/{_is-array-6128bd56.js → _is-array-754e012d.js} +6 -6
- package/dist/cjs/{_iter-detect-55a5657a.js → _iter-detect-60b2f026.js} +8 -8
- package/dist/cjs/{_object-pie-083f2dd6.js → _object-pie-68c5bcbc.js} +4 -4
- package/dist/cjs/{_object-sap-a175b4a9.js → _object-sap-5e74ba08.js} +1 -1
- package/dist/cjs/{_object-to-array-8fe5a54f.js → _object-to-array-5762f850.js} +2 -2
- package/dist/cjs/{_to-object-6de10e57.js → _to-object-329a650b.js} +8 -8
- package/dist/cjs/{asyncToGenerator-58c289d9.js → asyncToGenerator-140e5f89.js} +32 -32
- package/dist/cjs/{brightcove-react-player-loader.es-a195642e.js → brightcove-react-player-loader.es-156bd4d6.js} +9 -11
- package/dist/cjs/{core.get-iterator-method-f474eacc.js → core.get-iterator-method-f62321d4.js} +2 -2
- package/dist/cjs/{debounce-d4a2369b.js → debounce-529c8d06.js} +2 -2
- package/dist/cjs/{define-property-c88be878.js → define-property-f4d12f4e.js} +6 -6
- package/dist/cjs/{defineProperty-0cb76d99.js → defineProperty-55548b25.js} +1 -1
- package/dist/cjs/{entities-3f9d0f2f.js → entities-310b46ee.js} +1 -1
- package/dist/cjs/{eq-5fc26c07.js → eq-bb2843ed.js} +1 -1
- package/dist/cjs/{es6.string.iterator-c2573ffd.js → es6.string.iterator-cc0bbaa4.js} +6 -6
- package/dist/cjs/{extends-29bdbc6d.js → extends-0a918631.js} +7 -7
- package/dist/cjs/faundadb.js +327 -10
- package/dist/cjs/{get-5839e5b5.js → get-adbb11e3.js} +21 -21
- package/dist/cjs/getQuery.js +2 -2
- package/dist/cjs/getRelatedArticle.js +28 -445
- package/dist/cjs/getRootDocGroup.js +6 -6
- package/dist/cjs/getSerializers.js +44 -45
- package/dist/cjs/{getTargeting-be6168ad.js → getTargeting-f1821260.js} +26 -17
- package/dist/cjs/getTargeting.js +8 -8
- package/dist/{esm/iconBase-ccc56b97.js → cjs/iconBase-68959171.js} +8 -2
- package/dist/cjs/{index-f86bb269.js → index-3294d3bc.js} +45 -44
- package/dist/cjs/{index-060c5d65.js → index-4151deb3.js} +1615 -1009
- package/dist/cjs/{index-eadd5035.js → index-96b3db50.js} +15 -17
- package/dist/cjs/{index-fc2f1ca2.js → index-98e01cb9.js} +12 -13
- package/dist/cjs/{index-efca863c.js → index-be0c82be.js} +30 -36
- package/dist/cjs/{index-50be6759.js → index-e2e62963.js} +10 -26
- package/dist/cjs/{index.es-f3e47207.js → index.es-9110add6.js} +12 -31
- package/dist/cjs/{index.esm-2bb721c8.js → index.esm-4d410430.js} +21 -21
- package/dist/cjs/{index.esm-00a6aade.js → index.esm-90433435.js} +16 -7
- package/dist/cjs/{index.esm-c1e16606.js → index.esm-e32d3e8e.js} +7 -4
- package/dist/cjs/{index.esm-f27f80d9.js → index.esm-ff47db6f.js} +13 -6
- package/dist/cjs/index.js +158 -170
- package/dist/cjs/{inherits-c2065b95.js → inherits-9953db94.js} +22 -22
- package/dist/cjs/{isSymbol-03abbdf0.js → isSymbol-04666465.js} +15 -15
- package/dist/cjs/keys-a586b7a0.js +25 -0
- package/dist/cjs/{lodash-f0783643.js → lodash-fc2922d0.js} +31 -128
- package/dist/cjs/main-02daeefe.js +862 -0
- package/dist/cjs/{moment-aca40de1.js → moment-575fe24c.js} +9 -11
- package/dist/cjs/{react-social-icons-af932527.js → react-social-icons-f7f48f71.js} +27 -28
- package/dist/cjs/{slicedToArray-5d1bc3b3.js → slicedToArray-8f385299.js} +14 -14
- package/dist/cjs/{smoothscroll-99df7f93.js → smoothscroll-5054361f.js} +1 -1
- package/dist/cjs/stringify-7c5aff47.js +17 -0
- package/dist/cjs/timeDifferenceCalc.js +1 -1
- package/dist/cjs/{toConsumableArray-ddb70795.js → toConsumableArray-9a3476fe.js} +9 -9
- package/dist/cjs/{toNumber-5e1fac58.js → toNumber-36d1e7e5.js} +5 -40
- package/dist/cjs/{typeof-88a668c5.js → typeof-725500bc.js} +36 -36
- package/dist/cjs/urlFor.js +3 -3
- package/dist/cjs/{ustream-api-b2b9092f.js → ustream-api-d092dc31.js} +4 -4
- package/dist/cjs/{visibility-sensor-eb2c5b69.js → visibility-sensor-ad5e3116.js} +5 -7
- package/dist/cjs/{web.dom.iterable-46657b5c.js → web.dom.iterable-a0e279c1.js} +3 -3
- package/dist/esm/AD.js +1 -1
- package/dist/esm/AD300x250.js +24 -24
- package/dist/esm/AD300x250x600.js +24 -24
- package/dist/esm/AD728x90.js +27 -27
- package/dist/esm/ADFloatingFooter.js +23 -23
- package/dist/esm/ADFooter.js +6 -6
- package/dist/esm/ADGutter.js +23 -23
- package/dist/esm/{ADInfeed-4bf3b2f9.js → ADInfeed-bbdd5398.js} +6 -6
- package/dist/esm/ADSkyscraper.js +23 -23
- package/dist/esm/ADSponsoredResources.js +23 -23
- package/dist/esm/ADWebcast.js +23 -23
- package/dist/esm/ADWelcome.js +20 -20
- package/dist/esm/{ADlgInfeed-a3377c4a.js → ADlgInfeed-4473ee3b.js} +4 -4
- package/dist/esm/AccordionPanel.js +8 -8
- package/dist/esm/AdSlot.js +92 -24
- package/dist/esm/AdSlotsProvider.js +27 -17
- package/dist/esm/AlgoliaSearch.js +530 -525
- package/dist/esm/AlphabeticList.js +10 -10
- package/dist/esm/ArticleCarousel.js +17 -17
- package/dist/esm/ArticleProgramLandingPage.js +49 -50
- package/dist/esm/ArticleSeriesLandingPage.js +32 -32
- package/dist/esm/ArticleSeriesListing.js +34 -34
- package/dist/esm/AuthWrapper.js +396 -1711
- package/dist/esm/{AuthorComponent-30aeba69.js → AuthorComponent-34b16174.js} +1 -1
- package/dist/esm/Beam.js +8 -8
- package/dist/esm/{BlockContent-c99c9a8d.js → BlockContent-e9b4ddcf.js} +34 -34
- package/dist/esm/Breadcrumbs.js +7 -7
- package/dist/esm/CMEDeck.js +24 -24
- package/dist/esm/Column1.js +4 -4
- package/dist/esm/Column2.js +21 -21
- package/dist/esm/Column3.js +39 -39
- package/dist/esm/ConferenceArticleCard.js +22 -22
- package/dist/esm/DeckContent.js +57 -57
- package/dist/esm/DeckQueue.js +50 -50
- package/dist/esm/{Dfp-2c43d2a0.js → Dfp-b7236041.js} +15 -15
- package/dist/esm/EventsDeck.js +67 -67
- package/dist/esm/ExternalResources.js +47 -48
- package/dist/esm/Feature.js +4 -4
- package/dist/esm/ForbesHero.js +12 -12
- package/dist/esm/GridContent.js +200 -82
- package/dist/esm/GridHero.js +13 -13
- package/dist/esm/GroupDeck.js +14 -14
- package/dist/esm/HamMagazine.js +39 -39
- package/dist/esm/Hero.js +4 -4
- package/dist/esm/HighlightenVideo.js +2 -2
- package/dist/esm/HorizontalArticleListing.js +46 -47
- package/dist/esm/HorizontalHero.js +5 -5
- package/dist/esm/IssueContentDeck.js +27 -27
- package/dist/esm/IssueDeck.js +37 -37
- package/dist/esm/IssueLanding.js +81 -84
- package/dist/esm/KMTracker.js +15 -15
- package/dist/esm/LeftNav.js +22 -22
- package/dist/esm/MasterDeck.js +45 -45
- package/dist/esm/MediaSeriesLanding.js +662 -751
- package/dist/esm/NavDvm.js +16 -16
- package/dist/esm/NavMagazine.js +44 -44
- package/dist/esm/NavNative.js +49 -49
- package/dist/esm/OncliveHero.js +5 -4
- package/dist/esm/OncliveLargeHero.js +13 -13
- package/dist/esm/PageFilter.js +6 -6
- package/dist/esm/PartnerDetailListing.js +55 -63
- package/dist/esm/PdfDownload.js +2 -2
- package/dist/esm/PopUpModal.js +6 -6
- package/dist/esm/PubSection.js +32 -34
- package/dist/esm/PubToc.js +8 -8
- package/dist/esm/PublicationDeck.js +24 -24
- package/dist/esm/PublicationLanding.js +76 -76
- package/dist/esm/QueueDeckExpanded.js +2102 -1097
- package/dist/esm/RecentNews.js +4 -4
- package/dist/esm/RelatedContent.js +35 -35
- package/dist/esm/RelatedTopicsDropdown.js +10 -10
- package/dist/esm/RolesDeck.js +12 -12
- package/dist/esm/Search.js +8 -8
- package/dist/esm/Segment.js +368 -343
- package/dist/esm/SeriesListingDeck.js +20 -20
- package/dist/esm/{SeriesSlider-5d5c08f4.js → SeriesSlider-a866bb21.js} +14 -14
- package/dist/esm/SetCookie.js +1 -1
- package/dist/esm/SideFooter.js +17 -17
- package/dist/esm/{SocialSearchComponent-db963c3e.js → SocialSearchComponent-03c3e869.js} +12 -12
- package/dist/esm/TaxonomyCard.js +25 -25
- package/dist/esm/TaxonomyDescription.js +45 -46
- package/dist/esm/TemplateNormal.js +50 -50
- package/dist/esm/ThumbnailCard.js +7 -7
- package/dist/esm/Ustream.js +14 -14
- package/dist/esm/VerticalHero.js +3 -3
- package/dist/esm/VideoProgramLandingPage.js +53 -54
- package/dist/esm/VideoSeriesCard.js +14 -14
- package/dist/esm/VideoSeriesFilter.js +9 -9
- package/dist/esm/VideoSeriesLandingPage.js +38 -38
- package/dist/esm/VideoSeriesListing.js +39 -37
- package/dist/esm/View.js +173 -93
- package/dist/esm/YahooHero.js +15 -15
- package/dist/esm/YoutubeGroup.js +26 -26
- package/dist/esm/{_is-array-3e99e06e.js → _is-array-58e95429.js} +6 -6
- package/dist/esm/{_iter-detect-7e5e5ce2.js → _iter-detect-5d49a330.js} +8 -8
- package/dist/esm/{_object-pie-133f504a.js → _object-pie-33c40e79.js} +4 -4
- package/dist/esm/{_object-sap-f353c2a9.js → _object-sap-964b6feb.js} +1 -1
- package/dist/esm/{_object-to-array-0f197f89.js → _object-to-array-7e804fce.js} +2 -2
- package/dist/esm/{_to-object-b50e61c3.js → _to-object-a4107da3.js} +9 -9
- package/dist/esm/{asyncToGenerator-7f8f9219.js → asyncToGenerator-4877b617.js} +33 -33
- package/dist/esm/{brightcove-react-player-loader.es-57a70a56.js → brightcove-react-player-loader.es-83f53e4e.js} +4 -5
- package/dist/esm/{core.get-iterator-method-133dfacd.js → core.get-iterator-method-e1de7503.js} +2 -2
- package/dist/esm/{debounce-533d9748.js → debounce-9207d8ee.js} +2 -2
- package/dist/esm/{define-property-fe54dc9f.js → define-property-8af5f002.js} +6 -6
- package/dist/esm/{defineProperty-f5ff6f5a.js → defineProperty-94fd8bfc.js} +1 -1
- package/dist/esm/{entities-932b50cf.js → entities-7cc3bf45.js} +1 -1
- package/dist/esm/{eq-bdcbf886.js → eq-b470f743.js} +1 -1
- package/dist/esm/{es6.string.iterator-bc33758b.js → es6.string.iterator-c990c18c.js} +7 -7
- package/dist/esm/{extends-60e0e1c6.js → extends-6f2fcc99.js} +7 -7
- package/dist/esm/faundadb.js +325 -8
- package/dist/esm/{get-3c308da4.js → get-1e515072.js} +21 -21
- package/dist/esm/getQuery.js +2 -2
- package/dist/esm/getRelatedArticle.js +28 -445
- package/dist/esm/getRootDocGroup.js +6 -6
- package/dist/esm/getSerializers.js +44 -45
- package/dist/esm/{getTargeting-68291ce9.js → getTargeting-bd800589.js} +25 -16
- package/dist/esm/getTargeting.js +8 -8
- package/dist/{cjs/iconBase-be4097c0.js → esm/iconBase-602d52fe.js} +8 -33
- package/dist/esm/{index-f0fc23eb.js → index-41a678ea.js} +4 -4
- package/dist/esm/{index-755f2cc2.js → index-5f7e79e7.js} +6 -6
- package/dist/esm/{index-0dbff1d1.js → index-73819142.js} +30 -36
- package/dist/esm/{index-98ca9cec.js → index-aaa2dae0.js} +11 -26
- package/dist/esm/{index-01d53c17.js → index-d6dc592a.js} +1261 -648
- package/dist/esm/{index-79cfd25c.js → index-ef6d5dcf.js} +45 -44
- package/dist/esm/{index.es-a6137319.js → index.es-29c1cef5.js} +5 -23
- package/dist/esm/{index.esm-f6156a57.js → index.esm-29e48d38.js} +16 -7
- package/dist/esm/{index.esm-d4932dea.js → index.esm-cf08bf18.js} +13 -6
- package/dist/esm/{index.esm-9b042655.js → index.esm-f8aaeeeb.js} +7 -4
- package/dist/esm/{index.esm-37268dca.js → index.esm-fd746768.js} +5 -4
- package/dist/esm/index.js +117 -125
- package/dist/esm/{inherits-a41fe93f.js → inherits-cf8dde54.js} +19 -19
- package/dist/esm/{isSymbol-a7e9aafe.js → isSymbol-1981418f.js} +15 -15
- package/dist/esm/{keys-7a3adabf.js → keys-8eda7a5c.js} +6 -6
- package/dist/esm/{lodash-f97fd99a.js → lodash-17fdfebb.js} +31 -128
- package/dist/esm/main-e4a934b2.js +851 -0
- package/dist/esm/{moment-bc12cb97.js → moment-e2f9b20c.js} +9 -11
- package/dist/esm/{react-social-icons-9be47857.js → react-social-icons-a7d5c5c7.js} +16 -16
- package/dist/esm/{slicedToArray-be2f7a22.js → slicedToArray-641f241f.js} +14 -14
- package/dist/esm/{smoothscroll-fa4e3f8c.js → smoothscroll-0cd4c7a6.js} +1 -1
- package/dist/esm/stringify-4330ccdc.js +15 -0
- package/dist/esm/timeDifferenceCalc.js +1 -1
- package/dist/esm/{toConsumableArray-6d9a4616.js → toConsumableArray-43aa614d.js} +9 -9
- package/dist/esm/{toNumber-5aeba6e7.js → toNumber-2f7a84cd.js} +5 -40
- package/dist/esm/{typeof-a286cf0c.js → typeof-6435ba1c.js} +36 -36
- package/dist/esm/urlFor.js +1 -1
- package/dist/esm/{ustream-api-33a866b6.js → ustream-api-9a50644d.js} +4 -4
- package/dist/esm/{web.dom.iterable-4109ff68.js → web.dom.iterable-4439f05a.js} +3 -3
- package/package.json +116 -110
- package/dist/cjs/Auth.js +0 -3652
- package/dist/cjs/ConferenceBanner-6c9e718a.js +0 -24
- package/dist/cjs/index-bd6c9f56.js +0 -211
- package/dist/cjs/keys-7f2c2108.js +0 -25
- package/dist/cjs/main-f1c77adb.js +0 -973
- package/dist/cjs/md5-e1ca5797.js +0 -323
- package/dist/cjs/stringify-c9ac1214.js +0 -17
- package/dist/cjs/typeof-1358762e.js +0 -33
- package/dist/cjs/util-6f784d85.js +0 -576
- package/dist/esm/Auth.js +0 -3632
- package/dist/esm/index-db3bb315.js +0 -207
- package/dist/esm/main-d4165069.js +0 -961
- package/dist/esm/md5-4e42248e.js +0 -321
- package/dist/esm/stringify-59c8f690.js +0 -15
- package/dist/esm/typeof-2f07d0e8.js +0 -30
- package/dist/esm/util-3ab476bf.js +0 -574
|
@@ -1,50 +1,1107 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var
|
|
3
|
+
function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
|
|
4
|
+
|
|
5
|
+
var _commonjsHelpers = require('./_commonjsHelpers-06173234.js');
|
|
6
|
+
require('./_to-object-329a650b.js');
|
|
7
|
+
require('./es6.string.iterator-cc0bbaa4.js');
|
|
8
|
+
require('./_library-dd23b178.js');
|
|
9
|
+
require('./_iter-detect-60b2f026.js');
|
|
10
|
+
var toConsumableArray = require('./toConsumableArray-9a3476fe.js');
|
|
11
|
+
require('./core.get-iterator-method-f62321d4.js');
|
|
12
|
+
require('./_object-pie-68c5bcbc.js');
|
|
13
|
+
var _extends = require('./extends-0a918631.js');
|
|
14
|
+
require('./web.dom.iterable-a0e279c1.js');
|
|
6
15
|
var React = require('react');
|
|
7
|
-
var
|
|
8
|
-
var urlFor = require('./urlFor.js');
|
|
9
|
-
var index_es = require('./index.es-f3e47207.js');
|
|
10
|
-
var moment = require('./moment-aca40de1.js');
|
|
11
|
-
var visibilitySensor = require('./visibility-sensor-eb2c5b69.js');
|
|
12
|
-
var index$1 = require('./index-fc2f1ca2.js');
|
|
13
|
-
var Router = require('next/router');
|
|
14
|
-
var index = require('./index-eadd5035.js');
|
|
15
|
-
var main = require('./main-f1c77adb.js');
|
|
16
|
-
var entities = require('./entities-3f9d0f2f.js');
|
|
17
|
-
var ADInfeed = require('./ADInfeed-859820d9.js');
|
|
18
|
-
var AuthorComponent = require('./AuthorComponent-c21aac7f.js');
|
|
19
|
-
var lodash = require('./lodash-f0783643.js');
|
|
20
|
-
var ADlgInfeed = require('./ADlgInfeed-da3a36a6.js');
|
|
21
|
-
var getContentCategory = require('./getContentCategory-f38a4c00.js');
|
|
22
|
-
var timeDifferenceCalc = require('./timeDifferenceCalc.js');
|
|
23
|
-
require('./_commonjsHelpers-06173234.js');
|
|
24
|
-
require('./web.dom.iterable-46657b5c.js');
|
|
25
|
-
require('./es6.string.iterator-c2573ffd.js');
|
|
26
|
-
require('./_to-object-6de10e57.js');
|
|
27
|
-
require('./core.get-iterator-method-f474eacc.js');
|
|
28
|
-
require('./_iter-detect-55a5657a.js');
|
|
29
|
-
require('./_object-pie-083f2dd6.js');
|
|
30
|
-
require('./index-efca863c.js');
|
|
31
|
-
require('react-dom');
|
|
16
|
+
var React__default = _interopDefault(React);
|
|
32
17
|
require('./events-1b438fe7.js');
|
|
18
|
+
var index = require('./index-98e01cb9.js');
|
|
33
19
|
require('prop-types');
|
|
34
20
|
require('react-bootstrap/Card');
|
|
35
|
-
require('./
|
|
36
|
-
require('
|
|
37
|
-
|
|
38
|
-
require('./
|
|
39
|
-
require('./
|
|
40
|
-
require('./
|
|
41
|
-
require('
|
|
42
|
-
require('./
|
|
21
|
+
var moment = require('./moment-575fe24c.js');
|
|
22
|
+
var Router = require('next/router');
|
|
23
|
+
var Router__default = _interopDefault(Router);
|
|
24
|
+
require('./isSymbol-04666465.js');
|
|
25
|
+
require('./debounce-529c8d06.js');
|
|
26
|
+
require('./toNumber-36d1e7e5.js');
|
|
27
|
+
require('react-dom');
|
|
28
|
+
require('./index-be0c82be.js');
|
|
29
|
+
var urlFor = require('./urlFor.js');
|
|
30
|
+
var index$2 = require('./index-96b3db50.js');
|
|
31
|
+
var main = require('./main-02daeefe.js');
|
|
32
|
+
var entities = require('./entities-310b46ee.js');
|
|
33
|
+
var slicedToArray = require('./slicedToArray-8f385299.js');
|
|
34
|
+
require('./stringify-7c5aff47.js');
|
|
35
|
+
var asyncToGenerator = require('./asyncToGenerator-140e5f89.js');
|
|
43
36
|
require('./Segment.js');
|
|
37
|
+
require('./Beam.js');
|
|
38
|
+
require('./AdSlot.js');
|
|
39
|
+
var ADInfeed = require('./ADInfeed-98c71bcd.js');
|
|
40
|
+
var lodash = require('./lodash-fc2922d0.js');
|
|
41
|
+
var ADlgInfeed = require('./ADlgInfeed-9de32585.js');
|
|
42
|
+
var getContentCategory = require('./getContentCategory-f38a4c00.js');
|
|
43
|
+
var AuthorComponent = require('./AuthorComponent-bb831b74.js');
|
|
44
|
+
var reactBootstrap = require('react-bootstrap');
|
|
45
|
+
var timeDifferenceCalc = require('./timeDifferenceCalc.js');
|
|
46
|
+
|
|
47
|
+
var reactPaginate = _commonjsHelpers.createCommonjsModule(function (module, exports) {
|
|
48
|
+
!function(e,a){module.exports=a(React__default);}(_commonjsHelpers.commonjsGlobal,(function(e){return function(e){var a={};function t(r){if(a[r])return a[r].exports;var n=a[r]={i:r,l:!1,exports:{}};return e[r].call(n.exports,n,n.exports,t),n.l=!0,n.exports}return t.m=e,t.c=a,t.d=function(e,a,r){t.o(e,a)||Object.defineProperty(e,a,{enumerable:!0,get:r});},t.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0});},t.t=function(e,a){if(1&a&&(e=t(e)),8&a)return e;if(4&a&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(t.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&a&&"string"!=typeof e)for(var n in e)t.d(r,n,function(a){return e[a]}.bind(null,n));return r},t.n=function(e){var a=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(a,"a",a),a},t.o=function(e,a){return Object.prototype.hasOwnProperty.call(e,a)},t.p="",t(t.s=4)}([function(e,a,t){e.exports=t(2)();},function(a,t){a.exports=e;},function(e,a,t){var r=t(3);function n(){}function i(){}i.resetWarningCache=n,e.exports=function(){function e(e,a,t,n,i,s){if(s!==r){var l=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw l.name="Invariant Violation",l}}function a(){return e}e.isRequired=e;var t={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:a,element:e,elementType:e,instanceOf:a,node:e,objectOf:a,oneOf:a,oneOfType:a,shape:a,exact:a,checkPropTypes:i,resetWarningCache:n};return t.PropTypes=t,t};},function(e,a,t){e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";},function(e,a,t){t.r(a);var r=t(1),n=t.n(r),i=t(0),s=t.n(i);function l(){return (l=Object.assign||function(e){for(var a=1;a<arguments.length;a++){var t=arguments[a];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);}return e}).apply(this,arguments)}var o=function(e){var a=e.pageClassName,t=e.pageLinkClassName,r=e.page,i=e.selected,s=e.activeClassName,o=e.activeLinkClassName,u=e.getEventListener,c=e.pageSelectedHandler,p=e.href,f=e.extraAriaContext,g=e.pageLabelBuilder,d=e.ariaLabel||"Page "+r+(f?" "+f:""),b=null;return i&&(b="page",d=e.ariaLabel||"Page "+r+" is your current page",a=void 0!==a?a+" "+s:s,void 0!==t?void 0!==o&&(t=t+" "+o):t=o),n.a.createElement("li",{className:a},n.a.createElement("a",l({role:"button",className:t,href:p,tabIndex:"0","aria-label":d,"aria-current":b,onKeyPress:c},u(c)),g(r)))};o.propTypes={pageSelectedHandler:s.a.func.isRequired,selected:s.a.bool.isRequired,pageClassName:s.a.string,pageLinkClassName:s.a.string,activeClassName:s.a.string,activeLinkClassName:s.a.string,extraAriaContext:s.a.string,href:s.a.string,ariaLabel:s.a.string,page:s.a.number.isRequired,getEventListener:s.a.func.isRequired,pageLabelBuilder:s.a.func.isRequired};var u=o;function c(){return (c=Object.assign||function(e){for(var a=1;a<arguments.length;a++){var t=arguments[a];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);}return e}).apply(this,arguments)}var p=function(e){var a=e.breakLabel,t=e.breakClassName,r=e.breakLinkClassName,i=e.breakHandler,s=e.getEventListener,l=t||"break";return n.a.createElement("li",{className:l},n.a.createElement("a",c({className:r,role:"button",tabIndex:"0",onKeyPress:i},s(i)),a))};p.propTypes={breakLabel:s.a.oneOfType([s.a.string,s.a.node]),breakClassName:s.a.string,breakLinkClassName:s.a.string,breakHandler:s.a.func.isRequired,getEventListener:s.a.func.isRequired};var f=p;function g(e){return (g="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function d(){return (d=Object.assign||function(e){for(var a=1;a<arguments.length;a++){var t=arguments[a];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);}return e}).apply(this,arguments)}function b(e,a){for(var t=0;t<a.length;t++){var r=a[t];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r);}}function v(e,a){return (v=Object.setPrototypeOf||function(e,a){return e.__proto__=a,e})(e,a)}function m(e){var a=function(){if("undefined"==typeof Reflect||!Reflect.construct)return !1;if(Reflect.construct.sham)return !1;if("function"==typeof Proxy)return !0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return !1}}();return function(){var t,r=C(e);if(a){var n=C(this).constructor;t=Reflect.construct(r,arguments,n);}else t=r.apply(this,arguments);return h(this,t)}}function h(e,a){return !a||"object"!==g(a)&&"function"!=typeof a?y(e):a}function y(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function C(e){return (C=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function P(e,a,t){return a in e?Object.defineProperty(e,a,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[a]=t,e}var k=function(e){!function(e,a){if("function"!=typeof a&&null!==a)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(a&&a.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),a&&v(e,a);}(s,e);var a,t,i=m(s);function s(e){var a,t;return function(e,a){if(!(e instanceof a))throw new TypeError("Cannot call a class as a function")}(this,s),P(y(a=i.call(this,e)),"handlePreviousPage",(function(e){var t=a.state.selected;e.preventDefault?e.preventDefault():e.returnValue=!1,t>0&&a.handlePageSelected(t-1,e);})),P(y(a),"handleNextPage",(function(e){var t=a.state.selected,r=a.props.pageCount;e.preventDefault?e.preventDefault():e.returnValue=!1,t<r-1&&a.handlePageSelected(t+1,e);})),P(y(a),"handlePageSelected",(function(e,t){t.preventDefault?t.preventDefault():t.returnValue=!1,a.state.selected!==e?(a.setState({selected:e}),a.callCallback(e)):a.callActiveCallback(e);})),P(y(a),"getEventListener",(function(e){return P({},a.props.eventListener,e)})),P(y(a),"handleBreakClick",(function(e,t){t.preventDefault?t.preventDefault():t.returnValue=!1;var r=a.state.selected;a.handlePageSelected(r<e?a.getForwardJump():a.getBackwardJump(),t);})),P(y(a),"callCallback",(function(e){void 0!==a.props.onPageChange&&"function"==typeof a.props.onPageChange&&a.props.onPageChange({selected:e});})),P(y(a),"callActiveCallback",(function(e){void 0!==a.props.onPageActive&&"function"==typeof a.props.onPageActive&&a.props.onPageActive({selected:e});})),P(y(a),"pagination",(function(){var e=[],t=a.props,r=t.pageRangeDisplayed,i=t.pageCount,s=t.marginPagesDisplayed,l=t.breakLabel,o=t.breakClassName,u=t.breakLinkClassName,c=a.state.selected;if(i<=r)for(var p=0;p<i;p++)e.push(a.getPageElement(p));else {var g,d,b,v=r/2,m=r-v;c>i-r/2?v=r-(m=i-c):c<r/2&&(m=r-(v=c));var h=function(e){return a.getPageElement(e)};for(g=0;g<i;g++)(d=g+1)<=s||d>i-s||g>=c-v&&g<=c+m?e.push(h(g)):l&&e[e.length-1]!==b&&(b=n.a.createElement(f,{key:g,breakLabel:l,breakClassName:o,breakLinkClassName:u,breakHandler:a.handleBreakClick.bind(null,g),getEventListener:a.getEventListener}),e.push(b));}return e})),t=e.initialPage?e.initialPage:e.forcePage?e.forcePage:0,a.state={selected:t},a}return a=s,(t=[{key:"componentDidMount",value:function(){var e=this.props,a=e.initialPage,t=e.disableInitialCallback,r=e.extraAriaContext;void 0===a||t||this.callCallback(a),r&&console.warn("DEPRECATED (react-paginate): The extraAriaContext prop is deprecated. You should now use the ariaLabelBuilder instead.");}},{key:"componentDidUpdate",value:function(e){void 0!==this.props.forcePage&&this.props.forcePage!==e.forcePage&&this.setState({selected:this.props.forcePage});}},{key:"getForwardJump",value:function(){var e=this.state.selected,a=this.props,t=a.pageCount,r=e+a.pageRangeDisplayed;return r>=t?t-1:r}},{key:"getBackwardJump",value:function(){var e=this.state.selected-this.props.pageRangeDisplayed;return e<0?0:e}},{key:"hrefBuilder",value:function(e){var a=this.props,t=a.hrefBuilder,r=a.pageCount;if(t&&e!==this.state.selected&&e>=0&&e<r)return t(e+1)}},{key:"ariaLabelBuilder",value:function(e){var a=e===this.state.selected;if(this.props.ariaLabelBuilder&&e>=0&&e<this.props.pageCount){var t=this.props.ariaLabelBuilder(e+1,a);return this.props.extraAriaContext&&!a&&(t=t+" "+this.props.extraAriaContext),t}}},{key:"getPageElement",value:function(e){var a=this.state.selected,t=this.props,r=t.pageClassName,i=t.pageLinkClassName,s=t.activeClassName,l=t.activeLinkClassName,o=t.extraAriaContext,c=t.pageLabelBuilder;return n.a.createElement(u,{key:e,pageSelectedHandler:this.handlePageSelected.bind(null,e),selected:a===e,pageClassName:r,pageLinkClassName:i,activeClassName:s,activeLinkClassName:l,extraAriaContext:o,href:this.hrefBuilder(e),ariaLabel:this.ariaLabelBuilder(e),page:e+1,pageLabelBuilder:c,getEventListener:this.getEventListener})}},{key:"render",value:function(){var e=this.props,a=e.disabledClassName,t=e.pageCount,r=e.containerClassName,i=e.previousLabel,s=e.previousClassName,l=e.previousLinkClassName,o=e.previousAriaLabel,u=e.prevRel,c=e.nextLabel,p=e.nextClassName,f=e.nextLinkClassName,g=e.nextAriaLabel,b=e.nextRel,v=this.state.selected,m=s+(0===v?" ".concat(a):""),h=p+(v===t-1?" ".concat(a):""),y=0===v?"true":"false",C=v===t-1?"true":"false";return n.a.createElement("ul",{className:r},n.a.createElement("li",{className:m},n.a.createElement("a",d({className:l,href:this.hrefBuilder(v-1),tabIndex:"0",role:"button",onKeyPress:this.handlePreviousPage,"aria-disabled":y,"aria-label":o,rel:u},this.getEventListener(this.handlePreviousPage)),i)),this.pagination(),n.a.createElement("li",{className:h},n.a.createElement("a",d({className:f,href:this.hrefBuilder(v+1),tabIndex:"0",role:"button",onKeyPress:this.handleNextPage,"aria-disabled":C,"aria-label":g,rel:b},this.getEventListener(this.handleNextPage)),c)))}}])&&b(a.prototype,t),s}(r.Component);P(k,"propTypes",{pageCount:s.a.number.isRequired,pageRangeDisplayed:s.a.number.isRequired,marginPagesDisplayed:s.a.number.isRequired,previousLabel:s.a.node,previousAriaLabel:s.a.string,prevRel:s.a.string,nextLabel:s.a.node,nextAriaLabel:s.a.string,nextRel:s.a.string,breakLabel:s.a.oneOfType([s.a.string,s.a.node]),hrefBuilder:s.a.func,onPageChange:s.a.func,onPageActive:s.a.func,initialPage:s.a.number,forcePage:s.a.number,disableInitialCallback:s.a.bool,containerClassName:s.a.string,pageClassName:s.a.string,pageLinkClassName:s.a.string,pageLabelBuilder:s.a.func,activeClassName:s.a.string,activeLinkClassName:s.a.string,previousClassName:s.a.string,nextClassName:s.a.string,previousLinkClassName:s.a.string,nextLinkClassName:s.a.string,disabledClassName:s.a.string,breakClassName:s.a.string,breakLinkClassName:s.a.string,extraAriaContext:s.a.string,ariaLabelBuilder:s.a.func,eventListener:s.a.string}),P(k,"defaultProps",{pageCount:10,pageRangeDisplayed:2,marginPagesDisplayed:3,activeClassName:"selected",previousLabel:"Previous",previousClassName:"previous",previousAriaLabel:"Previous page",prevRel:"prev",nextLabel:"Next",nextClassName:"next",nextAriaLabel:"Next page",nextRel:"next",breakLabel:"...",disabledClassName:"disabled",disableInitialCallback:!1,pageLabelBuilder:function(e){return e},eventListener:"onClick"});a.default=k;}])}));
|
|
49
|
+
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
var ReactPaginate = _commonjsHelpers.unwrapExports(reactPaginate);
|
|
53
|
+
var reactPaginate_1 = reactPaginate.ReactPaginate;
|
|
54
|
+
|
|
55
|
+
var has = Object.prototype.hasOwnProperty;
|
|
56
|
+
|
|
57
|
+
function dequal(foo, bar) {
|
|
58
|
+
var ctor, len;
|
|
59
|
+
if (foo === bar) return true;
|
|
60
|
+
|
|
61
|
+
if (foo && bar && (ctor=foo.constructor) === bar.constructor) {
|
|
62
|
+
if (ctor === Date) return foo.getTime() === bar.getTime();
|
|
63
|
+
if (ctor === RegExp) return foo.toString() === bar.toString();
|
|
64
|
+
|
|
65
|
+
if (ctor === Array) {
|
|
66
|
+
if ((len=foo.length) === bar.length) {
|
|
67
|
+
while (len-- && dequal(foo[len], bar[len]));
|
|
68
|
+
}
|
|
69
|
+
return len === -1;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
if (!ctor || typeof foo === 'object') {
|
|
73
|
+
len = 0;
|
|
74
|
+
for (ctor in foo) {
|
|
75
|
+
if (has.call(foo, ctor) && ++len && !has.call(bar, ctor)) return false;
|
|
76
|
+
if (!(ctor in bar) || !dequal(foo[ctor], bar[ctor])) return false;
|
|
77
|
+
}
|
|
78
|
+
return Object.keys(bar).length === len;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
return foo !== foo && bar !== bar;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
// use WeakMap to store the object->key mapping
|
|
86
|
+
// so the objects can be garbage collected.
|
|
87
|
+
// WeakMap uses a hashtable under the hood, so the lookup
|
|
88
|
+
// complexity is almost O(1).
|
|
89
|
+
var table = new WeakMap();
|
|
90
|
+
// counter of the key
|
|
91
|
+
var counter = 0;
|
|
92
|
+
// hashes an array of objects and returns a string
|
|
93
|
+
function hash(args) {
|
|
94
|
+
if (!args.length)
|
|
95
|
+
return '';
|
|
96
|
+
var key = 'arg';
|
|
97
|
+
for (var i = 0; i < args.length; ++i) {
|
|
98
|
+
if (args[i] === null) {
|
|
99
|
+
key += '@null';
|
|
100
|
+
continue;
|
|
101
|
+
}
|
|
102
|
+
var _hash = void 0;
|
|
103
|
+
if (typeof args[i] !== 'object' && typeof args[i] !== 'function') {
|
|
104
|
+
// need to consider the case that args[i] is a string:
|
|
105
|
+
// args[i] _hash
|
|
106
|
+
// "undefined" -> '"undefined"'
|
|
107
|
+
// undefined -> 'undefined'
|
|
108
|
+
// 123 -> '123'
|
|
109
|
+
// "null" -> '"null"'
|
|
110
|
+
if (typeof args[i] === 'string') {
|
|
111
|
+
_hash = '"' + args[i] + '"';
|
|
112
|
+
}
|
|
113
|
+
else {
|
|
114
|
+
_hash = String(args[i]);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
else {
|
|
118
|
+
if (!table.has(args[i])) {
|
|
119
|
+
_hash = counter;
|
|
120
|
+
table.set(args[i], counter++);
|
|
121
|
+
}
|
|
122
|
+
else {
|
|
123
|
+
_hash = table.get(args[i]);
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
key += '@' + _hash;
|
|
127
|
+
}
|
|
128
|
+
return key;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
var Cache = /** @class */ (function () {
|
|
132
|
+
function Cache(initialData) {
|
|
133
|
+
if (initialData === void 0) { initialData = {}; }
|
|
134
|
+
this.cache = new Map(Object.entries(initialData));
|
|
135
|
+
this.subs = [];
|
|
136
|
+
}
|
|
137
|
+
Cache.prototype.get = function (key) {
|
|
138
|
+
var _key = this.serializeKey(key)[0];
|
|
139
|
+
return this.cache.get(_key);
|
|
140
|
+
};
|
|
141
|
+
Cache.prototype.set = function (key, value) {
|
|
142
|
+
var _key = this.serializeKey(key)[0];
|
|
143
|
+
this.cache.set(_key, value);
|
|
144
|
+
this.notify();
|
|
145
|
+
};
|
|
146
|
+
Cache.prototype.keys = function () {
|
|
147
|
+
return Array.from(this.cache.keys());
|
|
148
|
+
};
|
|
149
|
+
Cache.prototype.has = function (key) {
|
|
150
|
+
var _key = this.serializeKey(key)[0];
|
|
151
|
+
return this.cache.has(_key);
|
|
152
|
+
};
|
|
153
|
+
Cache.prototype.clear = function () {
|
|
154
|
+
this.cache.clear();
|
|
155
|
+
this.notify();
|
|
156
|
+
};
|
|
157
|
+
Cache.prototype.delete = function (key) {
|
|
158
|
+
var _key = this.serializeKey(key)[0];
|
|
159
|
+
this.cache.delete(_key);
|
|
160
|
+
this.notify();
|
|
161
|
+
};
|
|
162
|
+
// TODO: introduce namespace for the cache
|
|
163
|
+
Cache.prototype.serializeKey = function (key) {
|
|
164
|
+
var args = null;
|
|
165
|
+
if (typeof key === 'function') {
|
|
166
|
+
try {
|
|
167
|
+
key = key();
|
|
168
|
+
}
|
|
169
|
+
catch (err) {
|
|
170
|
+
// dependencies not ready
|
|
171
|
+
key = '';
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
if (Array.isArray(key)) {
|
|
175
|
+
// args array
|
|
176
|
+
args = key;
|
|
177
|
+
key = hash(key);
|
|
178
|
+
}
|
|
179
|
+
else {
|
|
180
|
+
// convert null to ''
|
|
181
|
+
key = String(key || '');
|
|
182
|
+
}
|
|
183
|
+
var errorKey = key ? 'err@' + key : '';
|
|
184
|
+
var isValidatingKey = key ? 'validating@' + key : '';
|
|
185
|
+
return [key, args, errorKey, isValidatingKey];
|
|
186
|
+
};
|
|
187
|
+
Cache.prototype.subscribe = function (listener) {
|
|
188
|
+
var _this = this;
|
|
189
|
+
if (typeof listener !== 'function') {
|
|
190
|
+
throw new Error('Expected the listener to be a function.');
|
|
191
|
+
}
|
|
192
|
+
var isSubscribed = true;
|
|
193
|
+
this.subs.push(listener);
|
|
194
|
+
return function () {
|
|
195
|
+
if (!isSubscribed)
|
|
196
|
+
return;
|
|
197
|
+
isSubscribed = false;
|
|
198
|
+
var index = _this.subs.indexOf(listener);
|
|
199
|
+
if (index > -1) {
|
|
200
|
+
_this.subs[index] = _this.subs[_this.subs.length - 1];
|
|
201
|
+
_this.subs.length--;
|
|
202
|
+
}
|
|
203
|
+
};
|
|
204
|
+
};
|
|
205
|
+
// Notify Cache subscribers about a change in the cache
|
|
206
|
+
Cache.prototype.notify = function () {
|
|
207
|
+
for (var _i = 0, _a = this.subs; _i < _a.length; _i++) {
|
|
208
|
+
var listener = _a[_i];
|
|
209
|
+
listener();
|
|
210
|
+
}
|
|
211
|
+
};
|
|
212
|
+
return Cache;
|
|
213
|
+
}());
|
|
214
|
+
|
|
215
|
+
/**
|
|
216
|
+
* Due to bug https://bugs.chromium.org/p/chromium/issues/detail?id=678075,
|
|
217
|
+
* it's not reliable to detect if the browser is currently online or offline
|
|
218
|
+
* based on `navigator.onLine`.
|
|
219
|
+
* As a work around, we always assume it's online on first load, and change
|
|
220
|
+
* the status upon `online` or `offline` events.
|
|
221
|
+
*/
|
|
222
|
+
var online = true;
|
|
223
|
+
var isOnline = function () { return online; };
|
|
224
|
+
var isDocumentVisible = function () {
|
|
225
|
+
if (typeof document !== 'undefined' &&
|
|
226
|
+
document.visibilityState !== undefined) {
|
|
227
|
+
return document.visibilityState !== 'hidden';
|
|
228
|
+
}
|
|
229
|
+
// always assume it's visible
|
|
230
|
+
return true;
|
|
231
|
+
};
|
|
232
|
+
var fetcher = function (url) { return fetch(url).then(function (res) { return res.json(); }); };
|
|
233
|
+
var registerOnFocus = function (cb) {
|
|
234
|
+
if (typeof window !== 'undefined' &&
|
|
235
|
+
window.addEventListener !== undefined &&
|
|
236
|
+
typeof document !== 'undefined' &&
|
|
237
|
+
document.addEventListener !== undefined) {
|
|
238
|
+
// focus revalidate
|
|
239
|
+
document.addEventListener('visibilitychange', function () { return cb(); }, false);
|
|
240
|
+
window.addEventListener('focus', function () { return cb(); }, false);
|
|
241
|
+
}
|
|
242
|
+
};
|
|
243
|
+
var registerOnReconnect = function (cb) {
|
|
244
|
+
if (typeof window !== 'undefined' && window.addEventListener !== undefined) {
|
|
245
|
+
// reconnect revalidate
|
|
246
|
+
window.addEventListener('online', function () {
|
|
247
|
+
online = true;
|
|
248
|
+
cb();
|
|
249
|
+
}, false);
|
|
250
|
+
// nothing to revalidate, just update the status
|
|
251
|
+
window.addEventListener('offline', function () { return (online = false); }, false);
|
|
252
|
+
}
|
|
253
|
+
};
|
|
254
|
+
var webPreset = {
|
|
255
|
+
isOnline: isOnline,
|
|
256
|
+
isDocumentVisible: isDocumentVisible,
|
|
257
|
+
fetcher: fetcher,
|
|
258
|
+
registerOnFocus: registerOnFocus,
|
|
259
|
+
registerOnReconnect: registerOnReconnect
|
|
260
|
+
};
|
|
261
|
+
|
|
262
|
+
var __assign = (undefined && undefined.__assign) || function () {
|
|
263
|
+
__assign = Object.assign || function(t) {
|
|
264
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
265
|
+
s = arguments[i];
|
|
266
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
267
|
+
t[p] = s[p];
|
|
268
|
+
}
|
|
269
|
+
return t;
|
|
270
|
+
};
|
|
271
|
+
return __assign.apply(this, arguments);
|
|
272
|
+
};
|
|
273
|
+
// cache
|
|
274
|
+
var cache = new Cache();
|
|
275
|
+
// error retry
|
|
276
|
+
function onErrorRetry(_, __, config, revalidate, opts) {
|
|
277
|
+
if (!config.isDocumentVisible()) {
|
|
278
|
+
// if it's hidden, stop
|
|
279
|
+
// it will auto revalidate when focus
|
|
280
|
+
return;
|
|
281
|
+
}
|
|
282
|
+
if (typeof config.errorRetryCount === 'number' &&
|
|
283
|
+
opts.retryCount > config.errorRetryCount) {
|
|
284
|
+
return;
|
|
285
|
+
}
|
|
286
|
+
// exponential backoff
|
|
287
|
+
var count = Math.min(opts.retryCount, 8);
|
|
288
|
+
var timeout = ~~((Math.random() + 0.5) * (1 << count)) * config.errorRetryInterval;
|
|
289
|
+
setTimeout(revalidate, timeout, opts);
|
|
290
|
+
}
|
|
291
|
+
// client side: need to adjust the config
|
|
292
|
+
// based on the browser status
|
|
293
|
+
// slow connection (<= 70Kbps)
|
|
294
|
+
var slowConnection = typeof window !== 'undefined' &&
|
|
295
|
+
// @ts-ignore
|
|
296
|
+
navigator['connection'] &&
|
|
297
|
+
// @ts-ignore
|
|
298
|
+
['slow-2g', '2g'].indexOf(navigator['connection'].effectiveType) !== -1;
|
|
299
|
+
// config
|
|
300
|
+
var defaultConfig = __assign({
|
|
301
|
+
// events
|
|
302
|
+
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);
|
|
303
|
+
|
|
304
|
+
var IS_SERVER = typeof window === 'undefined' ||
|
|
305
|
+
// @ts-ignore
|
|
306
|
+
!!(typeof Deno !== 'undefined' && Deno && Deno.version && Deno.version.deno);
|
|
307
|
+
// polyfill for requestAnimationFrame
|
|
308
|
+
var rAF = IS_SERVER
|
|
309
|
+
? null
|
|
310
|
+
: window['requestAnimationFrame']
|
|
311
|
+
? function (f) { return window['requestAnimationFrame'](f); }
|
|
312
|
+
: function (f) { return setTimeout(f, 1); };
|
|
313
|
+
// React currently throws a warning when using useLayoutEffect on the server.
|
|
314
|
+
// To get around it, we can conditionally useEffect on the server (no-op) and
|
|
315
|
+
// useLayoutEffect in the browser.
|
|
316
|
+
var useIsomorphicLayoutEffect = IS_SERVER ? React.useEffect : React.useLayoutEffect;
|
|
317
|
+
|
|
318
|
+
var SWRConfigContext = React.createContext({});
|
|
319
|
+
SWRConfigContext.displayName = 'SWRConfigContext';
|
|
320
|
+
|
|
321
|
+
var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
322
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
323
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
324
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
325
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
326
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
327
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
328
|
+
});
|
|
329
|
+
};
|
|
330
|
+
var __generator = (undefined && undefined.__generator) || function (thisArg, body) {
|
|
331
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
332
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
333
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
334
|
+
function step(op) {
|
|
335
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
336
|
+
while (_) try {
|
|
337
|
+
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;
|
|
338
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
339
|
+
switch (op[0]) {
|
|
340
|
+
case 0: case 1: t = op; break;
|
|
341
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
342
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
343
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
344
|
+
default:
|
|
345
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
346
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
347
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
348
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
349
|
+
if (t[2]) _.ops.pop();
|
|
350
|
+
_.trys.pop(); continue;
|
|
351
|
+
}
|
|
352
|
+
op = body.call(thisArg, _);
|
|
353
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
354
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
355
|
+
}
|
|
356
|
+
};
|
|
357
|
+
// global state managers
|
|
358
|
+
var CONCURRENT_PROMISES = {};
|
|
359
|
+
var CONCURRENT_PROMISES_TS = {};
|
|
360
|
+
var FOCUS_REVALIDATORS = {};
|
|
361
|
+
var RECONNECT_REVALIDATORS = {};
|
|
362
|
+
var CACHE_REVALIDATORS = {};
|
|
363
|
+
var MUTATION_TS = {};
|
|
364
|
+
var MUTATION_END_TS = {};
|
|
365
|
+
// generate strictly increasing timestamps
|
|
366
|
+
var now = (function () {
|
|
367
|
+
var ts = 0;
|
|
368
|
+
return function () { return ++ts; };
|
|
369
|
+
})();
|
|
370
|
+
// setup DOM events listeners for `focus` and `reconnect` actions
|
|
371
|
+
if (!IS_SERVER) {
|
|
372
|
+
var revalidate_1 = function (revalidators) {
|
|
373
|
+
if (!defaultConfig.isDocumentVisible() || !defaultConfig.isOnline())
|
|
374
|
+
return;
|
|
375
|
+
for (var key in revalidators) {
|
|
376
|
+
if (revalidators[key][0])
|
|
377
|
+
revalidators[key][0]();
|
|
378
|
+
}
|
|
379
|
+
};
|
|
380
|
+
if (typeof defaultConfig.registerOnFocus === 'function') {
|
|
381
|
+
defaultConfig.registerOnFocus(function () { return revalidate_1(FOCUS_REVALIDATORS); });
|
|
382
|
+
}
|
|
383
|
+
if (typeof defaultConfig.registerOnReconnect === 'function') {
|
|
384
|
+
defaultConfig.registerOnReconnect(function () { return revalidate_1(RECONNECT_REVALIDATORS); });
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
var trigger = function (_key, shouldRevalidate) {
|
|
388
|
+
if (shouldRevalidate === void 0) { shouldRevalidate = true; }
|
|
389
|
+
// we are ignoring the second argument which correspond to the arguments
|
|
390
|
+
// the fetcher will receive when key is an array
|
|
391
|
+
var _a = cache.serializeKey(_key), key = _a[0], keyErr = _a[2], keyValidating = _a[3];
|
|
392
|
+
if (!key)
|
|
393
|
+
return Promise.resolve();
|
|
394
|
+
var updaters = CACHE_REVALIDATORS[key];
|
|
395
|
+
if (key && updaters) {
|
|
396
|
+
var currentData = cache.get(key);
|
|
397
|
+
var currentError = cache.get(keyErr);
|
|
398
|
+
var currentIsValidating = cache.get(keyValidating);
|
|
399
|
+
var promises = [];
|
|
400
|
+
for (var i = 0; i < updaters.length; ++i) {
|
|
401
|
+
promises.push(updaters[i](shouldRevalidate, currentData, currentError, currentIsValidating, i > 0));
|
|
402
|
+
}
|
|
403
|
+
// return new updated value
|
|
404
|
+
return Promise.all(promises).then(function () { return cache.get(key); });
|
|
405
|
+
}
|
|
406
|
+
return Promise.resolve(cache.get(key));
|
|
407
|
+
};
|
|
408
|
+
var broadcastState = function (key, data, error, isValidating) {
|
|
409
|
+
var updaters = CACHE_REVALIDATORS[key];
|
|
410
|
+
if (key && updaters) {
|
|
411
|
+
for (var i = 0; i < updaters.length; ++i) {
|
|
412
|
+
updaters[i](false, data, error, isValidating);
|
|
413
|
+
}
|
|
414
|
+
}
|
|
415
|
+
};
|
|
416
|
+
var mutate = function (_key, _data, shouldRevalidate) {
|
|
417
|
+
if (shouldRevalidate === void 0) { shouldRevalidate = true; }
|
|
418
|
+
return __awaiter(void 0, void 0, void 0, function () {
|
|
419
|
+
var _a, key, keyErr, beforeMutationTs, beforeConcurrentPromisesTs, data, error, isAsyncMutation, err_1, shouldAbort, updaters, promises, i;
|
|
420
|
+
return __generator(this, function (_b) {
|
|
421
|
+
switch (_b.label) {
|
|
422
|
+
case 0:
|
|
423
|
+
_a = cache.serializeKey(_key), key = _a[0], keyErr = _a[2];
|
|
424
|
+
if (!key)
|
|
425
|
+
return [2 /*return*/];
|
|
426
|
+
// if there is no new data to update, let's just revalidate the key
|
|
427
|
+
if (typeof _data === 'undefined')
|
|
428
|
+
return [2 /*return*/, trigger(_key, shouldRevalidate)
|
|
429
|
+
// update global timestamps
|
|
430
|
+
];
|
|
431
|
+
// update global timestamps
|
|
432
|
+
MUTATION_TS[key] = now() - 1;
|
|
433
|
+
MUTATION_END_TS[key] = 0;
|
|
434
|
+
beforeMutationTs = MUTATION_TS[key];
|
|
435
|
+
beforeConcurrentPromisesTs = CONCURRENT_PROMISES_TS[key];
|
|
436
|
+
isAsyncMutation = false;
|
|
437
|
+
if (_data && typeof _data === 'function') {
|
|
438
|
+
// `_data` is a function, call it passing current cache value
|
|
439
|
+
try {
|
|
440
|
+
_data = _data(cache.get(key));
|
|
441
|
+
}
|
|
442
|
+
catch (err) {
|
|
443
|
+
// if `_data` function throws an error synchronously, it shouldn't be cached
|
|
444
|
+
_data = undefined;
|
|
445
|
+
error = err;
|
|
446
|
+
}
|
|
447
|
+
}
|
|
448
|
+
if (!(_data && typeof _data.then === 'function')) return [3 /*break*/, 5];
|
|
449
|
+
// `_data` is a promise
|
|
450
|
+
isAsyncMutation = true;
|
|
451
|
+
_b.label = 1;
|
|
452
|
+
case 1:
|
|
453
|
+
_b.trys.push([1, 3, , 4]);
|
|
454
|
+
return [4 /*yield*/, _data];
|
|
455
|
+
case 2:
|
|
456
|
+
data = _b.sent();
|
|
457
|
+
return [3 /*break*/, 4];
|
|
458
|
+
case 3:
|
|
459
|
+
err_1 = _b.sent();
|
|
460
|
+
error = err_1;
|
|
461
|
+
return [3 /*break*/, 4];
|
|
462
|
+
case 4: return [3 /*break*/, 6];
|
|
463
|
+
case 5:
|
|
464
|
+
data = _data;
|
|
465
|
+
_b.label = 6;
|
|
466
|
+
case 6:
|
|
467
|
+
shouldAbort = function () {
|
|
468
|
+
// check if other mutations have occurred since we've started this mutation
|
|
469
|
+
if (beforeMutationTs !== MUTATION_TS[key] ||
|
|
470
|
+
beforeConcurrentPromisesTs !== CONCURRENT_PROMISES_TS[key]) {
|
|
471
|
+
if (error)
|
|
472
|
+
throw error;
|
|
473
|
+
return true;
|
|
474
|
+
}
|
|
475
|
+
};
|
|
476
|
+
// if there's a race we don't update cache or broadcast change, just return the data
|
|
477
|
+
if (shouldAbort())
|
|
478
|
+
return [2 /*return*/, data];
|
|
479
|
+
if (typeof data !== 'undefined') {
|
|
480
|
+
// update cached data
|
|
481
|
+
cache.set(key, data);
|
|
482
|
+
}
|
|
483
|
+
// always update or reset the error
|
|
484
|
+
cache.set(keyErr, error);
|
|
485
|
+
// reset the timestamp to mark the mutation has ended
|
|
486
|
+
MUTATION_END_TS[key] = now() - 1;
|
|
487
|
+
if (!isAsyncMutation) {
|
|
488
|
+
// we skip broadcasting if there's another mutation happened synchronously
|
|
489
|
+
if (shouldAbort())
|
|
490
|
+
return [2 /*return*/, data];
|
|
491
|
+
}
|
|
492
|
+
updaters = CACHE_REVALIDATORS[key];
|
|
493
|
+
if (updaters) {
|
|
494
|
+
promises = [];
|
|
495
|
+
for (i = 0; i < updaters.length; ++i) {
|
|
496
|
+
promises.push(updaters[i](!!shouldRevalidate, data, error, undefined, i > 0));
|
|
497
|
+
}
|
|
498
|
+
// return new updated value
|
|
499
|
+
return [2 /*return*/, Promise.all(promises).then(function () {
|
|
500
|
+
if (error)
|
|
501
|
+
throw error;
|
|
502
|
+
return cache.get(key);
|
|
503
|
+
})];
|
|
504
|
+
}
|
|
505
|
+
// throw error or return data to be used by caller of mutate
|
|
506
|
+
if (error)
|
|
507
|
+
throw error;
|
|
508
|
+
return [2 /*return*/, data];
|
|
509
|
+
}
|
|
510
|
+
});
|
|
511
|
+
});
|
|
512
|
+
};
|
|
513
|
+
function useSWR() {
|
|
514
|
+
var _this = this;
|
|
515
|
+
var args = [];
|
|
516
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
517
|
+
args[_i] = arguments[_i];
|
|
518
|
+
}
|
|
519
|
+
var _key = args[0];
|
|
520
|
+
var config = Object.assign({}, defaultConfig, React.useContext(SWRConfigContext), args.length > 2
|
|
521
|
+
? args[2]
|
|
522
|
+
: args.length === 2 && typeof args[1] === 'object'
|
|
523
|
+
? args[1]
|
|
524
|
+
: {});
|
|
525
|
+
// in typescript args.length > 2 is not same as args.lenth === 3
|
|
526
|
+
// we do a safe type assertion here
|
|
527
|
+
// args.length === 3
|
|
528
|
+
var fn = (args.length > 2
|
|
529
|
+
? args[1]
|
|
530
|
+
: args.length === 2 && typeof args[1] === 'function'
|
|
531
|
+
? args[1]
|
|
532
|
+
: /**
|
|
533
|
+
pass fn as null will disable revalidate
|
|
534
|
+
https://paco.sh/blog/shared-hook-state-with-swr
|
|
535
|
+
*/
|
|
536
|
+
args[1] === null
|
|
537
|
+
? args[1]
|
|
538
|
+
: config.fetcher);
|
|
539
|
+
// we assume `key` as the identifier of the request
|
|
540
|
+
// `key` can change but `fn` shouldn't
|
|
541
|
+
// (because `revalidate` only depends on `key`)
|
|
542
|
+
// `keyErr` is the cache key for error objects
|
|
543
|
+
var _a = cache.serializeKey(_key), key = _a[0], fnArgs = _a[1], keyErr = _a[2], keyValidating = _a[3];
|
|
544
|
+
var configRef = React.useRef(config);
|
|
545
|
+
useIsomorphicLayoutEffect(function () {
|
|
546
|
+
configRef.current = config;
|
|
547
|
+
});
|
|
548
|
+
var willRevalidateOnMount = function () {
|
|
549
|
+
return (config.revalidateOnMount ||
|
|
550
|
+
(!config.initialData && config.revalidateOnMount === undefined));
|
|
551
|
+
};
|
|
552
|
+
var resolveData = function () {
|
|
553
|
+
var cachedData = cache.get(key);
|
|
554
|
+
return typeof cachedData === 'undefined' ? config.initialData : cachedData;
|
|
555
|
+
};
|
|
556
|
+
var resolveIsValidating = function () {
|
|
557
|
+
return !!cache.get(keyValidating) || (key && willRevalidateOnMount());
|
|
558
|
+
};
|
|
559
|
+
var initialData = resolveData();
|
|
560
|
+
var initialError = cache.get(keyErr);
|
|
561
|
+
var initialIsValidating = resolveIsValidating();
|
|
562
|
+
// if a state is accessed (data, error or isValidating),
|
|
563
|
+
// we add the state to dependencies so if the state is
|
|
564
|
+
// updated in the future, we can trigger a rerender
|
|
565
|
+
var stateDependencies = React.useRef({
|
|
566
|
+
data: false,
|
|
567
|
+
error: false,
|
|
568
|
+
isValidating: false
|
|
569
|
+
});
|
|
570
|
+
var stateRef = React.useRef({
|
|
571
|
+
data: initialData,
|
|
572
|
+
error: initialError,
|
|
573
|
+
isValidating: initialIsValidating
|
|
574
|
+
});
|
|
575
|
+
// display the data label in the React DevTools next to SWR hooks
|
|
576
|
+
React.useDebugValue(stateRef.current.data);
|
|
577
|
+
var rerender = React.useState({})[1];
|
|
578
|
+
var dispatch = React.useCallback(function (payload) {
|
|
579
|
+
var shouldUpdateState = false;
|
|
580
|
+
for (var k in payload) {
|
|
581
|
+
// @ts-ignore
|
|
582
|
+
if (stateRef.current[k] === payload[k]) {
|
|
583
|
+
continue;
|
|
584
|
+
}
|
|
585
|
+
// @ts-ignore
|
|
586
|
+
stateRef.current[k] = payload[k];
|
|
587
|
+
// @ts-ignore
|
|
588
|
+
if (stateDependencies.current[k]) {
|
|
589
|
+
shouldUpdateState = true;
|
|
590
|
+
}
|
|
591
|
+
}
|
|
592
|
+
if (shouldUpdateState) {
|
|
593
|
+
// if component is unmounted, should skip rerender
|
|
594
|
+
// if component is not mounted, should skip rerender
|
|
595
|
+
if (unmountedRef.current || !initialMountedRef.current)
|
|
596
|
+
return;
|
|
597
|
+
rerender({});
|
|
598
|
+
}
|
|
599
|
+
},
|
|
600
|
+
// config.suspense isn't allowed to change during the lifecycle
|
|
601
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
602
|
+
[]);
|
|
603
|
+
// error ref inside revalidate (is last request errored?)
|
|
604
|
+
var unmountedRef = React.useRef(false);
|
|
605
|
+
var keyRef = React.useRef(key);
|
|
606
|
+
// check if component is mounted in suspense mode
|
|
607
|
+
var initialMountedRef = React.useRef(false);
|
|
608
|
+
// do unmount check for callbacks
|
|
609
|
+
var eventsCallback = React.useCallback(function (event) {
|
|
610
|
+
var _a;
|
|
611
|
+
var params = [];
|
|
612
|
+
for (var _i = 1; _i < arguments.length; _i++) {
|
|
613
|
+
params[_i - 1] = arguments[_i];
|
|
614
|
+
}
|
|
615
|
+
if (unmountedRef.current)
|
|
616
|
+
return;
|
|
617
|
+
if (!initialMountedRef.current)
|
|
618
|
+
return;
|
|
619
|
+
if (key !== keyRef.current)
|
|
620
|
+
return;
|
|
621
|
+
// @ts-ignore
|
|
622
|
+
(_a = configRef.current)[event].apply(_a, params);
|
|
623
|
+
}, [key]);
|
|
624
|
+
var boundMutate = React.useCallback(function (data, shouldRevalidate) {
|
|
625
|
+
return mutate(keyRef.current, data, shouldRevalidate);
|
|
626
|
+
}, []);
|
|
627
|
+
var addRevalidator = function (revalidators, callback) {
|
|
628
|
+
if (!revalidators[key]) {
|
|
629
|
+
revalidators[key] = [callback];
|
|
630
|
+
}
|
|
631
|
+
else {
|
|
632
|
+
revalidators[key].push(callback);
|
|
633
|
+
}
|
|
634
|
+
return function () {
|
|
635
|
+
var keyedRevalidators = revalidators[key];
|
|
636
|
+
var index = keyedRevalidators.indexOf(callback);
|
|
637
|
+
if (index >= 0) {
|
|
638
|
+
// O(1): faster than splice
|
|
639
|
+
keyedRevalidators[index] =
|
|
640
|
+
keyedRevalidators[keyedRevalidators.length - 1];
|
|
641
|
+
keyedRevalidators.pop();
|
|
642
|
+
}
|
|
643
|
+
};
|
|
644
|
+
};
|
|
645
|
+
// start a revalidation
|
|
646
|
+
var revalidate = React.useCallback(function (revalidateOpts) {
|
|
647
|
+
if (revalidateOpts === void 0) { revalidateOpts = {}; }
|
|
648
|
+
return __awaiter(_this, void 0, void 0, function () {
|
|
649
|
+
var _a, retryCount, _b, dedupe, loading, shouldDeduping, newData, startAt, newState, err_2;
|
|
650
|
+
return __generator(this, function (_c) {
|
|
651
|
+
switch (_c.label) {
|
|
652
|
+
case 0:
|
|
653
|
+
if (!key || !fn)
|
|
654
|
+
return [2 /*return*/, false];
|
|
655
|
+
if (unmountedRef.current)
|
|
656
|
+
return [2 /*return*/, false];
|
|
657
|
+
if (configRef.current.isPaused())
|
|
658
|
+
return [2 /*return*/, false];
|
|
659
|
+
_a = revalidateOpts.retryCount, retryCount = _a === void 0 ? 0 : _a, _b = revalidateOpts.dedupe, dedupe = _b === void 0 ? false : _b;
|
|
660
|
+
loading = true;
|
|
661
|
+
shouldDeduping = typeof CONCURRENT_PROMISES[key] !== 'undefined' && dedupe;
|
|
662
|
+
_c.label = 1;
|
|
663
|
+
case 1:
|
|
664
|
+
_c.trys.push([1, 6, , 7]);
|
|
665
|
+
dispatch({
|
|
666
|
+
isValidating: true
|
|
667
|
+
});
|
|
668
|
+
cache.set(keyValidating, true);
|
|
669
|
+
if (!shouldDeduping) {
|
|
670
|
+
// also update other hooks
|
|
671
|
+
broadcastState(key, stateRef.current.data, stateRef.current.error, true);
|
|
672
|
+
}
|
|
673
|
+
newData = void 0;
|
|
674
|
+
startAt = void 0;
|
|
675
|
+
if (!shouldDeduping) return [3 /*break*/, 3];
|
|
676
|
+
// there's already an ongoing request,
|
|
677
|
+
// this one needs to be deduplicated.
|
|
678
|
+
startAt = CONCURRENT_PROMISES_TS[key];
|
|
679
|
+
return [4 /*yield*/, CONCURRENT_PROMISES[key]];
|
|
680
|
+
case 2:
|
|
681
|
+
newData = _c.sent();
|
|
682
|
+
return [3 /*break*/, 5];
|
|
683
|
+
case 3:
|
|
684
|
+
// if no cache being rendered currently (it shows a blank page),
|
|
685
|
+
// we trigger the loading slow event.
|
|
686
|
+
if (config.loadingTimeout && !cache.get(key)) {
|
|
687
|
+
setTimeout(function () {
|
|
688
|
+
if (loading)
|
|
689
|
+
eventsCallback('onLoadingSlow', key, config);
|
|
690
|
+
}, config.loadingTimeout);
|
|
691
|
+
}
|
|
692
|
+
if (fnArgs !== null) {
|
|
693
|
+
CONCURRENT_PROMISES[key] = fn.apply(void 0, fnArgs);
|
|
694
|
+
}
|
|
695
|
+
else {
|
|
696
|
+
CONCURRENT_PROMISES[key] = fn(key);
|
|
697
|
+
}
|
|
698
|
+
CONCURRENT_PROMISES_TS[key] = startAt = now();
|
|
699
|
+
return [4 /*yield*/, CONCURRENT_PROMISES[key]];
|
|
700
|
+
case 4:
|
|
701
|
+
newData = _c.sent();
|
|
702
|
+
setTimeout(function () {
|
|
703
|
+
delete CONCURRENT_PROMISES[key];
|
|
704
|
+
delete CONCURRENT_PROMISES_TS[key];
|
|
705
|
+
}, config.dedupingInterval);
|
|
706
|
+
// trigger the success event,
|
|
707
|
+
// only do this for the original request.
|
|
708
|
+
eventsCallback('onSuccess', newData, key, config);
|
|
709
|
+
_c.label = 5;
|
|
710
|
+
case 5:
|
|
711
|
+
// if there're other ongoing request(s), started after the current one,
|
|
712
|
+
// we need to ignore the current one to avoid possible race conditions:
|
|
713
|
+
// req1------------------>res1 (current one)
|
|
714
|
+
// req2---------------->res2
|
|
715
|
+
// the request that fired later will always be kept.
|
|
716
|
+
if (CONCURRENT_PROMISES_TS[key] > startAt) {
|
|
717
|
+
return [2 /*return*/, false];
|
|
718
|
+
}
|
|
719
|
+
// if there're other mutations(s), overlapped with the current revalidation:
|
|
720
|
+
// case 1:
|
|
721
|
+
// req------------------>res
|
|
722
|
+
// mutate------>end
|
|
723
|
+
// case 2:
|
|
724
|
+
// req------------>res
|
|
725
|
+
// mutate------>end
|
|
726
|
+
// case 3:
|
|
727
|
+
// req------------------>res
|
|
728
|
+
// mutate-------...---------->
|
|
729
|
+
// we have to ignore the revalidation result (res) because it's no longer fresh.
|
|
730
|
+
// meanwhile, a new revalidation should be triggered when the mutation ends.
|
|
731
|
+
if (MUTATION_TS[key] &&
|
|
732
|
+
// case 1
|
|
733
|
+
(startAt <= MUTATION_TS[key] ||
|
|
734
|
+
// case 2
|
|
735
|
+
startAt <= MUTATION_END_TS[key] ||
|
|
736
|
+
// case 3
|
|
737
|
+
MUTATION_END_TS[key] === 0)) {
|
|
738
|
+
dispatch({ isValidating: false });
|
|
739
|
+
return [2 /*return*/, false];
|
|
740
|
+
}
|
|
741
|
+
cache.set(keyErr, undefined);
|
|
742
|
+
cache.set(keyValidating, false);
|
|
743
|
+
newState = {
|
|
744
|
+
isValidating: false
|
|
745
|
+
};
|
|
746
|
+
if (typeof stateRef.current.error !== 'undefined') {
|
|
747
|
+
// we don't have an error
|
|
748
|
+
newState.error = undefined;
|
|
749
|
+
}
|
|
750
|
+
if (!config.compare(stateRef.current.data, newData)) {
|
|
751
|
+
// deep compare to avoid extra re-render
|
|
752
|
+
// data changed
|
|
753
|
+
newState.data = newData;
|
|
754
|
+
}
|
|
755
|
+
if (!config.compare(cache.get(key), newData)) {
|
|
756
|
+
cache.set(key, newData);
|
|
757
|
+
}
|
|
758
|
+
// merge the new state
|
|
759
|
+
dispatch(newState);
|
|
760
|
+
if (!shouldDeduping) {
|
|
761
|
+
// also update other hooks
|
|
762
|
+
broadcastState(key, newData, newState.error, false);
|
|
763
|
+
}
|
|
764
|
+
return [3 /*break*/, 7];
|
|
765
|
+
case 6:
|
|
766
|
+
err_2 = _c.sent();
|
|
767
|
+
delete CONCURRENT_PROMISES[key];
|
|
768
|
+
delete CONCURRENT_PROMISES_TS[key];
|
|
769
|
+
if (configRef.current.isPaused()) {
|
|
770
|
+
dispatch({
|
|
771
|
+
isValidating: false
|
|
772
|
+
});
|
|
773
|
+
return [2 /*return*/, false];
|
|
774
|
+
}
|
|
775
|
+
cache.set(keyErr, err_2);
|
|
776
|
+
// get a new error
|
|
777
|
+
// don't use deep equal for errors
|
|
778
|
+
if (stateRef.current.error !== err_2) {
|
|
779
|
+
// we keep the stale data
|
|
780
|
+
dispatch({
|
|
781
|
+
isValidating: false,
|
|
782
|
+
error: err_2
|
|
783
|
+
});
|
|
784
|
+
if (!shouldDeduping) {
|
|
785
|
+
// also broadcast to update other hooks
|
|
786
|
+
broadcastState(key, undefined, err_2, false);
|
|
787
|
+
}
|
|
788
|
+
}
|
|
789
|
+
// events and retry
|
|
790
|
+
eventsCallback('onError', err_2, key, config);
|
|
791
|
+
if (config.shouldRetryOnError) {
|
|
792
|
+
// when retrying, we always enable deduping
|
|
793
|
+
eventsCallback('onErrorRetry', err_2, key, config, revalidate, {
|
|
794
|
+
retryCount: retryCount + 1,
|
|
795
|
+
dedupe: true
|
|
796
|
+
});
|
|
797
|
+
}
|
|
798
|
+
return [3 /*break*/, 7];
|
|
799
|
+
case 7:
|
|
800
|
+
loading = false;
|
|
801
|
+
return [2 /*return*/, true];
|
|
802
|
+
}
|
|
803
|
+
});
|
|
804
|
+
});
|
|
805
|
+
},
|
|
806
|
+
// dispatch is immutable, and `eventsCallback`, `fnArgs`, `keyErr`, and `keyValidating` are based on `key`,
|
|
807
|
+
// so we can them from the deps array.
|
|
808
|
+
//
|
|
809
|
+
// FIXME:
|
|
810
|
+
// `fn` and `config` might be changed during the lifecycle,
|
|
811
|
+
// but they might be changed every render like this.
|
|
812
|
+
// useSWR('key', () => fetch('/api/'), { suspense: true })
|
|
813
|
+
// So we omit the values from the deps array
|
|
814
|
+
// even though it might cause unexpected behaviors.
|
|
815
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
816
|
+
[key]);
|
|
817
|
+
// mounted (client side rendering)
|
|
818
|
+
useIsomorphicLayoutEffect(function () {
|
|
819
|
+
if (!key)
|
|
820
|
+
return undefined;
|
|
821
|
+
// after `key` updates, we need to mark it as mounted
|
|
822
|
+
unmountedRef.current = false;
|
|
823
|
+
var isUpdating = initialMountedRef.current;
|
|
824
|
+
initialMountedRef.current = true;
|
|
825
|
+
// after the component is mounted (hydrated),
|
|
826
|
+
// we need to update the data from the cache
|
|
827
|
+
// and trigger a revalidation
|
|
828
|
+
var currentHookData = stateRef.current.data;
|
|
829
|
+
var latestKeyedData = resolveData();
|
|
830
|
+
// update the state if the key changed (not the inital render) or cache updated
|
|
831
|
+
keyRef.current = key;
|
|
832
|
+
if (!config.compare(currentHookData, latestKeyedData)) {
|
|
833
|
+
dispatch({ data: latestKeyedData });
|
|
834
|
+
}
|
|
835
|
+
// revalidate with deduping
|
|
836
|
+
var softRevalidate = function () { return revalidate({ dedupe: true }); };
|
|
837
|
+
// trigger a revalidation
|
|
838
|
+
if (isUpdating || willRevalidateOnMount()) {
|
|
839
|
+
if (typeof latestKeyedData !== 'undefined' && !IS_SERVER) {
|
|
840
|
+
// delay revalidate if there's cache
|
|
841
|
+
// to not block the rendering
|
|
842
|
+
// @ts-ignore it's safe to use requestAnimationFrame in browser
|
|
843
|
+
rAF(softRevalidate);
|
|
844
|
+
}
|
|
845
|
+
else {
|
|
846
|
+
softRevalidate();
|
|
847
|
+
}
|
|
848
|
+
}
|
|
849
|
+
var pending = false;
|
|
850
|
+
var onFocus = function () {
|
|
851
|
+
if (pending || !configRef.current.revalidateOnFocus)
|
|
852
|
+
return;
|
|
853
|
+
pending = true;
|
|
854
|
+
softRevalidate();
|
|
855
|
+
setTimeout(function () { return (pending = false); }, configRef.current.focusThrottleInterval);
|
|
856
|
+
};
|
|
857
|
+
var onReconnect = function () {
|
|
858
|
+
if (configRef.current.revalidateOnReconnect) {
|
|
859
|
+
softRevalidate();
|
|
860
|
+
}
|
|
861
|
+
};
|
|
862
|
+
// register global cache update listener
|
|
863
|
+
var onUpdate = function (shouldRevalidate, updatedData, updatedError, updatedIsValidating, dedupe) {
|
|
864
|
+
if (shouldRevalidate === void 0) { shouldRevalidate = true; }
|
|
865
|
+
if (dedupe === void 0) { dedupe = true; }
|
|
866
|
+
// update hook state
|
|
867
|
+
var newState = {};
|
|
868
|
+
var needUpdate = false;
|
|
869
|
+
if (typeof updatedData !== 'undefined' &&
|
|
870
|
+
!config.compare(stateRef.current.data, updatedData)) {
|
|
871
|
+
newState.data = updatedData;
|
|
872
|
+
needUpdate = true;
|
|
873
|
+
}
|
|
874
|
+
// always update error
|
|
875
|
+
// because it can be `undefined`
|
|
876
|
+
if (stateRef.current.error !== updatedError) {
|
|
877
|
+
newState.error = updatedError;
|
|
878
|
+
needUpdate = true;
|
|
879
|
+
}
|
|
880
|
+
if (typeof updatedIsValidating !== 'undefined' &&
|
|
881
|
+
stateRef.current.isValidating !== updatedIsValidating) {
|
|
882
|
+
newState.isValidating = updatedIsValidating;
|
|
883
|
+
needUpdate = true;
|
|
884
|
+
}
|
|
885
|
+
if (needUpdate) {
|
|
886
|
+
dispatch(newState);
|
|
887
|
+
}
|
|
888
|
+
if (shouldRevalidate) {
|
|
889
|
+
if (dedupe) {
|
|
890
|
+
return softRevalidate();
|
|
891
|
+
}
|
|
892
|
+
else {
|
|
893
|
+
return revalidate();
|
|
894
|
+
}
|
|
895
|
+
}
|
|
896
|
+
return false;
|
|
897
|
+
};
|
|
898
|
+
var unsubFocus = addRevalidator(FOCUS_REVALIDATORS, onFocus);
|
|
899
|
+
var unsubReconnect = addRevalidator(RECONNECT_REVALIDATORS, onReconnect);
|
|
900
|
+
var unsubUpdate = addRevalidator(CACHE_REVALIDATORS, onUpdate);
|
|
901
|
+
return function () {
|
|
902
|
+
// cleanup
|
|
903
|
+
dispatch = function () { return null; };
|
|
904
|
+
// mark it as unmounted
|
|
905
|
+
unmountedRef.current = true;
|
|
906
|
+
unsubFocus();
|
|
907
|
+
unsubReconnect();
|
|
908
|
+
unsubUpdate();
|
|
909
|
+
};
|
|
910
|
+
}, [key, revalidate]);
|
|
911
|
+
useIsomorphicLayoutEffect(function () {
|
|
912
|
+
var timer = null;
|
|
913
|
+
var tick = function () { return __awaiter(_this, void 0, void 0, function () {
|
|
914
|
+
return __generator(this, function (_a) {
|
|
915
|
+
switch (_a.label) {
|
|
916
|
+
case 0:
|
|
917
|
+
if (!(!stateRef.current.error &&
|
|
918
|
+
(configRef.current.refreshWhenHidden ||
|
|
919
|
+
configRef.current.isDocumentVisible()) &&
|
|
920
|
+
(configRef.current.refreshWhenOffline || configRef.current.isOnline()))) return [3 /*break*/, 2];
|
|
921
|
+
// only revalidate when the page is visible
|
|
922
|
+
// if API request errored, we stop polling in this round
|
|
923
|
+
// and let the error retry function handle it
|
|
924
|
+
return [4 /*yield*/, revalidate({ dedupe: true })];
|
|
925
|
+
case 1:
|
|
926
|
+
// only revalidate when the page is visible
|
|
927
|
+
// if API request errored, we stop polling in this round
|
|
928
|
+
// and let the error retry function handle it
|
|
929
|
+
_a.sent();
|
|
930
|
+
_a.label = 2;
|
|
931
|
+
case 2:
|
|
932
|
+
// Read the latest refreshInterval
|
|
933
|
+
if (configRef.current.refreshInterval && timer) {
|
|
934
|
+
timer = setTimeout(tick, configRef.current.refreshInterval);
|
|
935
|
+
}
|
|
936
|
+
return [2 /*return*/];
|
|
937
|
+
}
|
|
938
|
+
});
|
|
939
|
+
}); };
|
|
940
|
+
if (configRef.current.refreshInterval) {
|
|
941
|
+
timer = setTimeout(tick, configRef.current.refreshInterval);
|
|
942
|
+
}
|
|
943
|
+
return function () {
|
|
944
|
+
if (timer) {
|
|
945
|
+
clearTimeout(timer);
|
|
946
|
+
timer = null;
|
|
947
|
+
}
|
|
948
|
+
};
|
|
949
|
+
}, [
|
|
950
|
+
config.refreshInterval,
|
|
951
|
+
config.refreshWhenHidden,
|
|
952
|
+
config.refreshWhenOffline,
|
|
953
|
+
revalidate
|
|
954
|
+
]);
|
|
955
|
+
// suspense
|
|
956
|
+
var latestData;
|
|
957
|
+
var latestError;
|
|
958
|
+
if (config.suspense) {
|
|
959
|
+
// in suspense mode, we can't return empty state
|
|
960
|
+
// (it should be suspended)
|
|
961
|
+
// try to get data and error from cache
|
|
962
|
+
latestData = cache.get(key);
|
|
963
|
+
latestError = cache.get(keyErr);
|
|
964
|
+
if (typeof latestData === 'undefined') {
|
|
965
|
+
latestData = initialData;
|
|
966
|
+
}
|
|
967
|
+
if (typeof latestError === 'undefined') {
|
|
968
|
+
latestError = initialError;
|
|
969
|
+
}
|
|
970
|
+
if (typeof latestData === 'undefined' &&
|
|
971
|
+
typeof latestError === 'undefined') {
|
|
972
|
+
// need to start the request if it hasn't
|
|
973
|
+
if (!CONCURRENT_PROMISES[key]) {
|
|
974
|
+
// trigger revalidate immediately
|
|
975
|
+
// to get the promise
|
|
976
|
+
// in this revalidate, should not rerender
|
|
977
|
+
revalidate();
|
|
978
|
+
}
|
|
979
|
+
if (CONCURRENT_PROMISES[key] &&
|
|
980
|
+
typeof CONCURRENT_PROMISES[key].then === 'function') {
|
|
981
|
+
// if it is a promise
|
|
982
|
+
throw CONCURRENT_PROMISES[key];
|
|
983
|
+
}
|
|
984
|
+
// it's a value, return it directly (override)
|
|
985
|
+
latestData = CONCURRENT_PROMISES[key];
|
|
986
|
+
}
|
|
987
|
+
if (typeof latestData === 'undefined' && latestError) {
|
|
988
|
+
// in suspense mode, throw error if there's no content
|
|
989
|
+
throw latestError;
|
|
990
|
+
}
|
|
991
|
+
}
|
|
992
|
+
// define returned state
|
|
993
|
+
// can be memorized since the state is a ref
|
|
994
|
+
var memoizedState = React.useMemo(function () {
|
|
995
|
+
// revalidate will be deprecated in the 1.x release
|
|
996
|
+
// because mutate() covers the same use case of revalidate().
|
|
997
|
+
// This remains only for backward compatibility
|
|
998
|
+
var state = { revalidate: revalidate, mutate: boundMutate };
|
|
999
|
+
Object.defineProperties(state, {
|
|
1000
|
+
error: {
|
|
1001
|
+
// `key` might be changed in the upcoming hook re-render,
|
|
1002
|
+
// but the previous state will stay
|
|
1003
|
+
// so we need to match the latest key and data (fallback to `initialData`)
|
|
1004
|
+
get: function () {
|
|
1005
|
+
stateDependencies.current.error = true;
|
|
1006
|
+
if (config.suspense) {
|
|
1007
|
+
return latestError;
|
|
1008
|
+
}
|
|
1009
|
+
return keyRef.current === key ? stateRef.current.error : initialError;
|
|
1010
|
+
},
|
|
1011
|
+
enumerable: true
|
|
1012
|
+
},
|
|
1013
|
+
data: {
|
|
1014
|
+
get: function () {
|
|
1015
|
+
stateDependencies.current.data = true;
|
|
1016
|
+
if (config.suspense) {
|
|
1017
|
+
return latestData;
|
|
1018
|
+
}
|
|
1019
|
+
return keyRef.current === key ? stateRef.current.data : initialData;
|
|
1020
|
+
},
|
|
1021
|
+
enumerable: true
|
|
1022
|
+
},
|
|
1023
|
+
isValidating: {
|
|
1024
|
+
get: function () {
|
|
1025
|
+
stateDependencies.current.isValidating = true;
|
|
1026
|
+
return key ? stateRef.current.isValidating : false;
|
|
1027
|
+
},
|
|
1028
|
+
enumerable: true
|
|
1029
|
+
}
|
|
1030
|
+
});
|
|
1031
|
+
return state;
|
|
1032
|
+
// `config.suspense` isn't allowed to change during the lifecycle.
|
|
1033
|
+
// `boundMutate` is immutable, and the immutability of `revalidate` depends on `key`
|
|
1034
|
+
// so we can omit them from the deps array,
|
|
1035
|
+
// but we put it to enable react-hooks/exhaustive-deps rule.
|
|
1036
|
+
// `initialData` and `initialError` are not initial values
|
|
1037
|
+
// because they are changed during the lifecycle
|
|
1038
|
+
// so we should add them in the deps array.
|
|
1039
|
+
}, [
|
|
1040
|
+
revalidate,
|
|
1041
|
+
initialData,
|
|
1042
|
+
initialError,
|
|
1043
|
+
boundMutate,
|
|
1044
|
+
key,
|
|
1045
|
+
config.suspense,
|
|
1046
|
+
latestError,
|
|
1047
|
+
latestData
|
|
1048
|
+
]);
|
|
1049
|
+
return memoizedState;
|
|
1050
|
+
}
|
|
1051
|
+
Object.defineProperty(SWRConfigContext.Provider, 'default', {
|
|
1052
|
+
value: defaultConfig
|
|
1053
|
+
});
|
|
1054
|
+
var SWRConfig = SWRConfigContext.Provider;
|
|
44
1055
|
|
|
45
|
-
|
|
1056
|
+
var __awaiter$1 = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
1057
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
1058
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
1059
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
1060
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
1061
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
1062
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
1063
|
+
});
|
|
1064
|
+
};
|
|
1065
|
+
var __generator$1 = (undefined && undefined.__generator) || function (thisArg, body) {
|
|
1066
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
1067
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
1068
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
1069
|
+
function step(op) {
|
|
1070
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
1071
|
+
while (_) try {
|
|
1072
|
+
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;
|
|
1073
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
1074
|
+
switch (op[0]) {
|
|
1075
|
+
case 0: case 1: t = op; break;
|
|
1076
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
1077
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
1078
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
1079
|
+
default:
|
|
1080
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
1081
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
1082
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
1083
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
1084
|
+
if (t[2]) _.ops.pop();
|
|
1085
|
+
_.trys.pop(); continue;
|
|
1086
|
+
}
|
|
1087
|
+
op = body.call(thisArg, _);
|
|
1088
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
1089
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
1090
|
+
}
|
|
1091
|
+
};
|
|
1092
|
+
var __rest = (undefined && undefined.__rest) || function (s, e) {
|
|
1093
|
+
var t = {};
|
|
1094
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
1095
|
+
t[p] = s[p];
|
|
1096
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
1097
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
1098
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
1099
|
+
t[p[i]] = s[p[i]];
|
|
1100
|
+
}
|
|
1101
|
+
return t;
|
|
1102
|
+
};
|
|
46
1103
|
|
|
47
|
-
var
|
|
1104
|
+
var _this = undefined;
|
|
48
1105
|
|
|
49
1106
|
var renderCardImage = function renderCardImage(row, client) {
|
|
50
1107
|
var imageHeight = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
|
|
@@ -57,109 +1114,129 @@ var renderCardImage = function renderCardImage(row, client) {
|
|
|
57
1114
|
return url;
|
|
58
1115
|
};
|
|
59
1116
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
}
|
|
1117
|
+
// const loadMore = (values, setValues, itemsPerPage) => {
|
|
1118
|
+
// console.log('Values:::', values)
|
|
1119
|
+
// setValues({
|
|
1120
|
+
// page: values.page + 1,
|
|
1121
|
+
// from: values.from + itemsPerPage,
|
|
1122
|
+
// to: values.to + itemsPerPage
|
|
1123
|
+
// })
|
|
1124
|
+
// }
|
|
68
1125
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
1126
|
+
// const loadData = (values, query, client, params, setData, setScrolling, setLastDataSize, pointer, pointerArray) => {
|
|
1127
|
+
// params = {
|
|
1128
|
+
// ...params,
|
|
1129
|
+
// from: values.from,
|
|
1130
|
+
// to: values.to
|
|
1131
|
+
// }
|
|
1132
|
+
// client.fetch(query, params).then((dataArr) => {
|
|
1133
|
+
// if (pointer && pointerArray) {
|
|
1134
|
+
// dataArr = dataArr[pointerArray][pointer]
|
|
1135
|
+
// }
|
|
78
1136
|
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
1137
|
+
// if (!dataArr) {
|
|
1138
|
+
// dataArr = []
|
|
1139
|
+
// }
|
|
82
1140
|
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
});
|
|
1141
|
+
// dataArr = dataArr.map((item) => ({
|
|
1142
|
+
// ...item,
|
|
1143
|
+
// pageNumber: values.page
|
|
1144
|
+
// }))
|
|
88
1145
|
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
});
|
|
100
|
-
};
|
|
1146
|
+
// if (dataArr.length > 0) {
|
|
1147
|
+
// setData((prevData) => [...prevData, ...dataArr])
|
|
1148
|
+
// setLastDataSize(dataArr.length)
|
|
1149
|
+
// setScrolling(true)
|
|
1150
|
+
// } else {
|
|
1151
|
+
// setLastDataSize(0)
|
|
1152
|
+
// setScrolling(false)
|
|
1153
|
+
// }
|
|
1154
|
+
// })
|
|
1155
|
+
// }
|
|
101
1156
|
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
1157
|
+
// const changePageNumber = (pageNumber, seoPaginate, pageview, router, currentPage, setCurrentPage, itemsPerPage, itemIndex) => {
|
|
1158
|
+
// if (seoPaginate) {
|
|
1159
|
+
// let path = router.asPath
|
|
1160
|
+
// let qrIndex = path.indexOf('?')
|
|
1161
|
+
// let pathname = router.pathname
|
|
1162
|
+
// let queryString = ''
|
|
108
1163
|
|
|
109
|
-
|
|
110
|
-
|
|
1164
|
+
// if (qrIndex > 0) {
|
|
1165
|
+
// path = path.substring(1, qrIndex)
|
|
111
1166
|
|
|
112
|
-
|
|
113
|
-
|
|
1167
|
+
// let partialQS = router.asPath.substring(qrIndex + 1)
|
|
1168
|
+
// let partialQSArr = partialQS.split('&')
|
|
114
1169
|
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
1170
|
+
// // exclude page=xxx from query string
|
|
1171
|
+
// partialQSArr.map((item) => {
|
|
1172
|
+
// let itemArr = item.split('=')
|
|
1173
|
+
// let key = itemArr[0]
|
|
1174
|
+
// let val = itemArr[1]
|
|
120
1175
|
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
1176
|
+
// if (key !== 'page') {
|
|
1177
|
+
// queryString += (queryString.length === 0 ? '' : '&') + key + '=' + val
|
|
1178
|
+
// }
|
|
1179
|
+
// })
|
|
1180
|
+
// }
|
|
126
1181
|
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
1182
|
+
// if (queryString.length > 0) {
|
|
1183
|
+
// path += '?' + queryString
|
|
1184
|
+
// }
|
|
130
1185
|
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
1186
|
+
// pageNumber = parseInt(pageNumber)
|
|
1187
|
+
// // const index = Number(itemIndex)
|
|
1188
|
+
// // const perPage = Number(itemsPerPage)
|
|
134
1189
|
|
|
135
|
-
|
|
1190
|
+
// // pageNumber = Math.ceil((index + 1) / perPage)
|
|
136
1191
|
|
|
137
|
-
|
|
138
|
-
|
|
1192
|
+
// if (currentPage !== pageNumber) {
|
|
1193
|
+
// DFPManager.refresh()
|
|
139
1194
|
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
1195
|
+
// setCurrentPage(pageNumber)
|
|
1196
|
+
// if (path[0] !== '/') {
|
|
1197
|
+
// path = '/' + path
|
|
1198
|
+
// }
|
|
144
1199
|
|
|
145
|
-
|
|
1200
|
+
// let newPath = pageNumber === 1 ? `${path}` : `${path}${queryString.length > 0 ? '&' : '?'}page=${pageNumber}`
|
|
146
1201
|
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
1202
|
+
// // if (pageview) {
|
|
1203
|
+
// // pageview(newPath)
|
|
1204
|
+
// // }
|
|
150
1205
|
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
}
|
|
1206
|
+
// router.push(pathname, newPath, {
|
|
1207
|
+
// shallow: true
|
|
1208
|
+
// })
|
|
1209
|
+
// }
|
|
1210
|
+
// }
|
|
1211
|
+
// }
|
|
157
1212
|
|
|
158
1213
|
var checkExternalUrl = function checkExternalUrl(url) {
|
|
159
1214
|
return new RegExp(['http', 'https'].join('|')).test(url);
|
|
160
1215
|
};
|
|
161
1216
|
|
|
162
|
-
var
|
|
1217
|
+
var CardLoader = function CardLoader(_ref) {
|
|
1218
|
+
var data = _ref.data,
|
|
1219
|
+
client = _ref.client,
|
|
1220
|
+
mapping = _ref.mapping,
|
|
1221
|
+
showPublished = _ref.showPublished,
|
|
1222
|
+
defaultImage = _ref.defaultImage,
|
|
1223
|
+
showAuthor = _ref.showAuthor,
|
|
1224
|
+
showCategory = _ref.showCategory,
|
|
1225
|
+
imageHeight = _ref.imageHeight,
|
|
1226
|
+
imageWidth = _ref.imageWidth,
|
|
1227
|
+
imageMaxHeight = _ref.imageMaxHeight,
|
|
1228
|
+
imageFit = _ref.imageFit,
|
|
1229
|
+
rightItems = _ref.rightItems,
|
|
1230
|
+
brandInsightAd = _ref.brandInsightAd,
|
|
1231
|
+
showBI = _ref.showBI,
|
|
1232
|
+
heroContent = _ref.heroContent,
|
|
1233
|
+
lgInfeedAd = _ref.lgInfeedAd,
|
|
1234
|
+
showPubInfo = _ref.showPubInfo,
|
|
1235
|
+
contentCategoryMapping = _ref.contentCategoryMapping,
|
|
1236
|
+
showTimeDiff = _ref.showTimeDiff,
|
|
1237
|
+
showTaxonomies = _ref.showTaxonomies,
|
|
1238
|
+
showIntro = _ref.showIntro;
|
|
1239
|
+
|
|
163
1240
|
var numberOfItemsBeforeAd = 6;
|
|
164
1241
|
var insertBrandInsightAd = function insertBrandInsightAd(arr, index, newElement) {
|
|
165
1242
|
return [].concat(toConsumableArray._toConsumableArray(arr.slice(0, index)), [newElement], toConsumableArray._toConsumableArray(arr.slice(index)));
|
|
@@ -241,425 +1318,860 @@ var cardLoader = function cardLoader(data, client, mapping, values, seoPaginate,
|
|
|
241
1318
|
}
|
|
242
1319
|
}
|
|
243
1320
|
|
|
244
|
-
// 'articleCount' is New parameter to use instead of 'index' while passing to 'changePageNumber()'
|
|
245
|
-
// 'index' was including the indexes for infeed ads along with article count making the page number change before it reaches last article.
|
|
246
|
-
// 'articleCount' will be the indexes of only the articles in the deck.
|
|
247
|
-
|
|
248
|
-
data = data.map(
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
})
|
|
1321
|
+
// // 'articleCount' is New parameter to use instead of 'index' while passing to 'changePageNumber()'
|
|
1322
|
+
// // 'index' was including the indexes for infeed ads along with article count making the page number change before it reaches last article.
|
|
1323
|
+
// // 'articleCount' will be the indexes of only the articles in the deck.
|
|
1324
|
+
// let articleCount = -1
|
|
1325
|
+
// data = data.map((ele, i) => {
|
|
1326
|
+
// if (ele._type === 'lg-infeed') {
|
|
1327
|
+
// // Setting pos as top2 for the first occurence of large infeed ad
|
|
1328
|
+
// // const pos = data.indexOf(data.find((d) => d._type === 'lg-infeed')) === i ? 'top2' : `lg-infeed_${i}`
|
|
1329
|
+
// return { ...ele, slotId: `lg-infeed_${i}`, targeting: { ...ele.targeting, pos: 'lg-infeed' } }
|
|
1330
|
+
// } else if (ele._type === 'article') {
|
|
1331
|
+
// // incrementing 'articleCount' for each article.
|
|
1332
|
+
// ++articleCount
|
|
1333
|
+
// return { ...ele, articleCount: articleCount }
|
|
1334
|
+
// } else {
|
|
1335
|
+
// return ele
|
|
1336
|
+
// }
|
|
1337
|
+
// })
|
|
261
1338
|
|
|
262
1339
|
var featureCount = 0;
|
|
263
|
-
return React__default
|
|
1340
|
+
return React__default.createElement(
|
|
264
1341
|
'div',
|
|
265
1342
|
null,
|
|
266
1343
|
data && data.length > 0 ? dataRemapped ? // For Javascript Enabled Cases
|
|
267
|
-
data.map(function (article, index
|
|
268
|
-
var pageNumber = article.pageNumber || values.page;
|
|
1344
|
+
data.map(function (article, index) {
|
|
269
1345
|
var contentCategoryName = article.contentCategory ? article.contentCategory.name : 'Articles';
|
|
270
1346
|
|
|
271
1347
|
if (article._type === 'feature') {
|
|
272
1348
|
featureCount++;
|
|
273
1349
|
if (article.blank || checkExternalUrl(article.url.current)) {
|
|
274
|
-
return React__default
|
|
275
|
-
|
|
1350
|
+
return React__default.createElement(
|
|
1351
|
+
reactBootstrap.Media,
|
|
276
1352
|
{
|
|
277
|
-
key: article._id ? article._id : index
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
React__default
|
|
1353
|
+
key: article._id ? article._id : index,
|
|
1354
|
+
className: 'feature-media',
|
|
1355
|
+
style: { flexDirection: 'column', marginBottom: '1.25rem', paddingBottom: '1.25rem', borderBottom: '1px solid #ddd' } },
|
|
1356
|
+
(article.thumbnail && article.thumbnail.asset || defaultImage) && React__default.createElement(
|
|
1357
|
+
'a',
|
|
1358
|
+
{ rel: 'noopener', href: article.url.current, target: '_blank', className: 'feature-wrapper' },
|
|
1359
|
+
React__default.createElement(
|
|
1360
|
+
index$2.LazyLoad,
|
|
1361
|
+
{ height: imageHeight, placeholder: React__default.createElement(ImagePlaceholder, null) },
|
|
1362
|
+
article.thumbnail && article.thumbnail.asset ? React__default.createElement('img', { className: 'img-fluid', src: renderCardImage(article, client, imageHeight, imageWidth, imageMaxHeight, imageFit), alt: article.title }) : article.thumbnail ? React__default.createElement('img', { src: article.thumbnail, className: 'mr-3', alt: article.title }) : React__default.createElement('img', { src: defaultImage, src2: article.thumbnail, className: 'mr-3', width: '240', height: '135', alt: article.title })
|
|
1363
|
+
),
|
|
1364
|
+
article.source && React__default.createElement(
|
|
1365
|
+
'div',
|
|
1366
|
+
{ className: 'content-category-label' },
|
|
1367
|
+
React__default.createElement(
|
|
1368
|
+
'div',
|
|
1369
|
+
{ className: 'mb-1 sanityDisplayLabel displayLabelThumb' },
|
|
1370
|
+
article.source
|
|
1371
|
+
)
|
|
1372
|
+
)
|
|
1373
|
+
),
|
|
1374
|
+
React__default.createElement(
|
|
1375
|
+
reactBootstrap.Media.Body,
|
|
284
1376
|
null,
|
|
285
|
-
React__default
|
|
286
|
-
|
|
287
|
-
{
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
1377
|
+
React__default.createElement(
|
|
1378
|
+
'a',
|
|
1379
|
+
{ rel: 'noopener', href: article.url.current, target: '_blank' },
|
|
1380
|
+
article.title && React__default.createElement(
|
|
1381
|
+
'h4',
|
|
1382
|
+
{ className: 'card-title', style: { fontWeight: '500', color: 'var(--gray-dark)', marginBottom: '.5rem' } },
|
|
1383
|
+
article.title
|
|
1384
|
+
)
|
|
1385
|
+
),
|
|
1386
|
+
showPublished && !showTimeDiff && article.published && React__default.createElement(
|
|
1387
|
+
'p',
|
|
1388
|
+
{ className: 'card-text', style: { color: 'var(--dark)', margin: '.25rem 0' } },
|
|
1389
|
+
moment.moment(article.published).format('MMMM DD, YYYY')
|
|
1390
|
+
),
|
|
1391
|
+
showTimeDiff && article.published && React__default.createElement(
|
|
1392
|
+
'p',
|
|
1393
|
+
{ className: 'card-text', style: { color: '#464644', lineHeight: '1.25', fontSize: '.875rem', margin: '.25rem 0' } },
|
|
1394
|
+
showTaxonomies && article.taxonomyMapping && article.taxonomyMapping.map(function (taxonomy, index) {
|
|
1395
|
+
if (index > 3) {
|
|
1396
|
+
return null;
|
|
1397
|
+
}
|
|
1398
|
+
if (index === 3) {
|
|
1399
|
+
return React__default.createElement(
|
|
1400
|
+
React__default.Fragment,
|
|
1401
|
+
null,
|
|
1402
|
+
React__default.createElement(
|
|
1403
|
+
'em',
|
|
1404
|
+
{ style: { marginRight: '.5rem' } },
|
|
1405
|
+
'...'
|
|
1406
|
+
)
|
|
1407
|
+
);
|
|
1408
|
+
}
|
|
1409
|
+
return React__default.createElement(
|
|
1410
|
+
React__default.Fragment,
|
|
1411
|
+
null,
|
|
1412
|
+
React__default.createElement(
|
|
1413
|
+
'em',
|
|
1414
|
+
null,
|
|
1415
|
+
taxonomy.name
|
|
1416
|
+
),
|
|
1417
|
+
' |',
|
|
1418
|
+
' '
|
|
1419
|
+
);
|
|
1420
|
+
}),
|
|
1421
|
+
' ',
|
|
1422
|
+
React__default.createElement(
|
|
1423
|
+
'span',
|
|
1424
|
+
{ style: { display: 'inline-block' } },
|
|
1425
|
+
timeDifferenceCalc(article.published)
|
|
1426
|
+
)
|
|
1427
|
+
),
|
|
1428
|
+
showAuthor && article.authorMapping && article.authorMapping.length > 0 && React__default.createElement(
|
|
1429
|
+
index$2.LazyLoad,
|
|
1430
|
+
{ height: 50 },
|
|
1431
|
+
React__default.createElement(AuthorComponent.AuthorComponent, { key: index.toString(), index: index, authors: article.authorMapping })
|
|
1432
|
+
),
|
|
1433
|
+
!article.thumbnail && !defaultImage && article.source && React__default.createElement(
|
|
1434
|
+
'div',
|
|
1435
|
+
{ className: 'content-category-label' },
|
|
1436
|
+
React__default.createElement(
|
|
1437
|
+
'div',
|
|
1438
|
+
{ className: 'mb-1 sanityDisplayLabel displayLabelThumb' },
|
|
1439
|
+
article.source
|
|
1440
|
+
)
|
|
1441
|
+
),
|
|
1442
|
+
React__default.createElement(
|
|
1443
|
+
'div',
|
|
1444
|
+
{ style: { display: 'flex', alignItems: 'center', justifyContent: 'flex-start' } },
|
|
1445
|
+
showCategory && article.contentCategory && React__default.createElement(
|
|
1446
|
+
'p',
|
|
1447
|
+
{
|
|
1448
|
+
className: 'article-category',
|
|
1449
|
+
style: {
|
|
1450
|
+
background: '#3FB618',
|
|
1451
|
+
color: '#ffffff',
|
|
1452
|
+
marginBottom: '.25rem',
|
|
1453
|
+
display: 'inline-block',
|
|
1454
|
+
padding: '0 .25rem',
|
|
1455
|
+
fontSize: '.8rem'
|
|
1456
|
+
} },
|
|
1457
|
+
getContentCategory.getContentCategory(article.contentCategory.name, contentCategoryMapping)
|
|
1458
|
+
),
|
|
1459
|
+
article.issueSection && article.issueSection.name && React__default.createElement(
|
|
1460
|
+
'p',
|
|
1461
|
+
{
|
|
1462
|
+
className: 'issueSection',
|
|
1463
|
+
style: {
|
|
1464
|
+
background: '#000000',
|
|
1465
|
+
color: '#ffffff',
|
|
1466
|
+
marginBottom: '.25rem',
|
|
1467
|
+
marginLeft: '.25rem',
|
|
1468
|
+
display: 'inline-block',
|
|
1469
|
+
padding: '0 .25rem',
|
|
1470
|
+
fontSize: '.8rem'
|
|
1471
|
+
} },
|
|
1472
|
+
article.issueSection.name
|
|
1473
|
+
)
|
|
1474
|
+
),
|
|
1475
|
+
showPubInfo && (article.issue || article.volume) && React__default.createElement(
|
|
1476
|
+
'div',
|
|
1477
|
+
{ className: 'pubInfo' },
|
|
1478
|
+
article.volume && React__default.createElement(
|
|
1479
|
+
'p',
|
|
1480
|
+
{ className: 'qdeVolume' },
|
|
1481
|
+
article.volume
|
|
1482
|
+
),
|
|
1483
|
+
article.issue && React__default.createElement(
|
|
1484
|
+
'p',
|
|
1485
|
+
{ className: 'qdeIssue' },
|
|
1486
|
+
article.issue
|
|
1487
|
+
)
|
|
1488
|
+
),
|
|
1489
|
+
showIntro && article.summary && React__default.createElement(
|
|
1490
|
+
'p',
|
|
1491
|
+
{ className: 'pt-2 card-text' },
|
|
1492
|
+
entities.clean_html_1(article.summary)
|
|
1493
|
+
)
|
|
1494
|
+
)
|
|
1495
|
+
);
|
|
1496
|
+
} else {
|
|
1497
|
+
return React__default.createElement(
|
|
1498
|
+
reactBootstrap.Media,
|
|
1499
|
+
{
|
|
1500
|
+
key: article._id ? article._id : index,
|
|
1501
|
+
className: 'feature-media',
|
|
1502
|
+
style: { flexDirection: 'column', marginBottom: '1.25rem', paddingBottom: '1.25rem', borderBottom: '1px solid #ddd' } },
|
|
1503
|
+
(article.thumbnail && article.thumbnail.asset || defaultImage) && React__default.createElement(
|
|
1504
|
+
'a',
|
|
1505
|
+
{ href: article.url.current, className: 'feature-wrapper' },
|
|
1506
|
+
React__default.createElement(
|
|
1507
|
+
index$2.LazyLoad,
|
|
1508
|
+
{ height: imageHeight, placeholder: React__default.createElement(ImagePlaceholder, null) },
|
|
1509
|
+
article.thumbnail && article.thumbnail.asset ? React__default.createElement('img', { className: 'img-fluid', src: renderCardImage(article, client, imageHeight, imageWidth, imageMaxHeight, imageFit), alt: article.title }) : article.thumbnail ? React__default.createElement('img', { src: article.thumbnail, className: 'mr-3', alt: article.title }) : React__default.createElement('img', { src: defaultImage, src2: article.thumbnail, className: 'mr-3', width: '240', height: '135', alt: article.title })
|
|
1510
|
+
),
|
|
1511
|
+
article.source && React__default.createElement(
|
|
1512
|
+
'div',
|
|
1513
|
+
{ className: 'content-category-label' },
|
|
1514
|
+
React__default.createElement(
|
|
1515
|
+
'div',
|
|
1516
|
+
{ className: 'mb-1 sanityDisplayLabel displayLabelThumb' },
|
|
1517
|
+
article.source
|
|
1518
|
+
)
|
|
1519
|
+
)
|
|
1520
|
+
),
|
|
1521
|
+
React__default.createElement(
|
|
1522
|
+
reactBootstrap.Media.Body,
|
|
1523
|
+
null,
|
|
1524
|
+
React__default.createElement(
|
|
1525
|
+
'a',
|
|
1526
|
+
{ href: article.url.current },
|
|
1527
|
+
article.title && React__default.createElement(
|
|
1528
|
+
'h4',
|
|
1529
|
+
{ className: 'card-title', style: { fontWeight: '500', color: 'var(--gray-dark)', marginBottom: '.5rem' } },
|
|
1530
|
+
article.title
|
|
1531
|
+
)
|
|
1532
|
+
),
|
|
1533
|
+
showPublished && !showTimeDiff && article.published && React__default.createElement(
|
|
1534
|
+
'p',
|
|
1535
|
+
{ className: 'card-text', style: { color: 'var(--dark)', margin: '.25rem 0' } },
|
|
1536
|
+
moment.moment(article.published).format('MMMM DD, YYYY')
|
|
1537
|
+
),
|
|
1538
|
+
showTimeDiff && article.published && React__default.createElement(
|
|
1539
|
+
'p',
|
|
1540
|
+
{ className: 'card-text', style: { color: '#464644', lineHeight: '1.25', fontSize: '.875rem', margin: '.25rem 0' } },
|
|
1541
|
+
showTaxonomies && article.taxonomyMapping && article.taxonomyMapping.map(function (taxonomy, index) {
|
|
1542
|
+
if (index > 3) {
|
|
1543
|
+
return null;
|
|
1544
|
+
}
|
|
1545
|
+
if (index === 3) {
|
|
1546
|
+
return React__default.createElement(
|
|
1547
|
+
React__default.Fragment,
|
|
1548
|
+
null,
|
|
1549
|
+
React__default.createElement(
|
|
1550
|
+
'em',
|
|
1551
|
+
{ style: { marginRight: '.5rem' } },
|
|
1552
|
+
'...'
|
|
1553
|
+
)
|
|
1554
|
+
);
|
|
1555
|
+
}
|
|
1556
|
+
if (index === 3) {
|
|
1557
|
+
return React__default.createElement(
|
|
1558
|
+
React__default.Fragment,
|
|
1559
|
+
null,
|
|
1560
|
+
React__default.createElement(
|
|
1561
|
+
'em',
|
|
1562
|
+
{ style: { marginRight: '.5rem' } },
|
|
1563
|
+
'...'
|
|
1564
|
+
)
|
|
1565
|
+
);
|
|
1566
|
+
}
|
|
1567
|
+
return React__default.createElement(
|
|
1568
|
+
React__default.Fragment,
|
|
1569
|
+
null,
|
|
1570
|
+
React__default.createElement(
|
|
1571
|
+
'em',
|
|
1572
|
+
null,
|
|
1573
|
+
taxonomy.name
|
|
1574
|
+
),
|
|
1575
|
+
' |',
|
|
1576
|
+
' '
|
|
1577
|
+
);
|
|
1578
|
+
}),
|
|
1579
|
+
' ',
|
|
1580
|
+
React__default.createElement(
|
|
1581
|
+
'span',
|
|
1582
|
+
{ style: { display: 'inline-block' } },
|
|
1583
|
+
timeDifferenceCalc(article.published)
|
|
1584
|
+
)
|
|
1585
|
+
),
|
|
1586
|
+
showAuthor && article.authorMapping && article.authorMapping.length > 0 && React__default.createElement(
|
|
1587
|
+
index$2.LazyLoad,
|
|
1588
|
+
{ height: 50 },
|
|
1589
|
+
React__default.createElement(AuthorComponent.AuthorComponent, { key: index.toString(), index: index, authors: article.authorMapping })
|
|
1590
|
+
),
|
|
1591
|
+
!article.thumbnail && !defaultImage && article.source && React__default.createElement(
|
|
1592
|
+
'div',
|
|
1593
|
+
{ className: 'content-category-label' },
|
|
1594
|
+
React__default.createElement(
|
|
1595
|
+
'div',
|
|
1596
|
+
{ className: 'mb-1 sanityDisplayLabel displayLabelThumb' },
|
|
1597
|
+
article.source
|
|
1598
|
+
)
|
|
1599
|
+
),
|
|
1600
|
+
React__default.createElement(
|
|
1601
|
+
'div',
|
|
1602
|
+
{ style: { display: 'flex', alignItems: 'center', justifyContent: 'flex-start' } },
|
|
1603
|
+
showCategory && article.contentCategory && React__default.createElement(
|
|
1604
|
+
'p',
|
|
1605
|
+
{
|
|
1606
|
+
className: 'article-category',
|
|
1607
|
+
style: {
|
|
1608
|
+
background: '#3FB618',
|
|
1609
|
+
color: '#ffffff',
|
|
1610
|
+
marginBottom: '.25rem',
|
|
1611
|
+
display: 'inline-block',
|
|
1612
|
+
padding: '0 .25rem',
|
|
1613
|
+
fontSize: '.8rem'
|
|
1614
|
+
} },
|
|
1615
|
+
getContentCategory.getContentCategory(article.contentCategory.name, contentCategoryMapping)
|
|
1616
|
+
),
|
|
1617
|
+
article.issueSection && article.issueSection.name && React__default.createElement(
|
|
1618
|
+
'p',
|
|
1619
|
+
{
|
|
1620
|
+
className: 'issueSection',
|
|
1621
|
+
style: {
|
|
1622
|
+
background: '#000000',
|
|
1623
|
+
color: '#ffffff',
|
|
1624
|
+
marginBottom: '.25rem',
|
|
1625
|
+
marginLeft: '.25rem',
|
|
1626
|
+
display: 'inline-block',
|
|
1627
|
+
padding: '0 .25rem',
|
|
1628
|
+
fontSize: '.8rem'
|
|
1629
|
+
} },
|
|
1630
|
+
article.issueSection.name
|
|
1631
|
+
)
|
|
1632
|
+
),
|
|
1633
|
+
showPubInfo && (article.issue || article.volume) && React__default.createElement(
|
|
1634
|
+
'div',
|
|
1635
|
+
{ className: 'pubInfo' },
|
|
1636
|
+
article.volume && React__default.createElement(
|
|
1637
|
+
'p',
|
|
1638
|
+
{ className: 'qdeVolume' },
|
|
1639
|
+
article.volume
|
|
1640
|
+
),
|
|
1641
|
+
article.issue && React__default.createElement(
|
|
1642
|
+
'p',
|
|
1643
|
+
{ className: 'qdeIssue' },
|
|
1644
|
+
article.issue
|
|
1645
|
+
)
|
|
1646
|
+
),
|
|
1647
|
+
showIntro && article.summary && React__default.createElement(
|
|
1648
|
+
'p',
|
|
1649
|
+
{ className: 'pt-2 card-text' },
|
|
1650
|
+
entities.clean_html_1(article.summary)
|
|
1651
|
+
)
|
|
1652
|
+
)
|
|
1653
|
+
);
|
|
1654
|
+
}
|
|
1655
|
+
} else if (article._type === 'lg-infeed' && article.adUnit) {
|
|
1656
|
+
return React__default.createElement(ADlgInfeed.ADlgInfeed, _extends._extends({ index: index }, article));
|
|
1657
|
+
} else if (article._type === 'brandInsightAd' && article.adUnit) {
|
|
1658
|
+
return React__default.createElement(ADInfeed.ADInfeed, { index: index, infeedAd: article });
|
|
1659
|
+
}
|
|
1660
|
+
if ((brandInsightAd ? index > heroContent + featureCount : index + 1 > heroContent + featureCount) && (!article._type || !['lg-infeed', 'brandInsightAd'].includes(article._type))) {
|
|
1661
|
+
return React__default.createElement(
|
|
1662
|
+
React__default.Fragment,
|
|
1663
|
+
{ key: article._id ? article._id : index },
|
|
1664
|
+
React__default.createElement(
|
|
1665
|
+
reactBootstrap.Media,
|
|
1666
|
+
{
|
|
1667
|
+
key: article._id ? article._id : index,
|
|
1668
|
+
style: { flexDirection: 'row', marginBottom: '1.25rem', paddingBottom: '1.25rem', borderBottom: '1px solid #ddd' } },
|
|
1669
|
+
(article.thumbnail && article.thumbnail.asset || defaultImage) && React__default.createElement(
|
|
1670
|
+
'a',
|
|
1671
|
+
{ href: mapping[contentCategoryName] + '/' + article.url.current, className: 'img-wrapper' },
|
|
1672
|
+
React__default.createElement(
|
|
1673
|
+
index$2.LazyLoad,
|
|
1674
|
+
{ height: imageHeight, placeholder: React__default.createElement(ImagePlaceholder, null) },
|
|
1675
|
+
article.thumbnail && article.thumbnail.asset ? React__default.createElement('img', { className: 'mr-3 img-fluid', src: renderCardImage(article, client, imageHeight, imageWidth, imageMaxHeight, imageFit), alt: article.title }) : article.thumbnail ? React__default.createElement('img', { src: article.thumbnail, className: 'mr-3', alt: article.title }) : React__default.createElement('img', { src: defaultImage, src2: article.thumbnail, className: 'mr-3', width: '240', height: '135', alt: article.title })
|
|
1676
|
+
),
|
|
1677
|
+
article.source && React__default.createElement(
|
|
1678
|
+
'div',
|
|
1679
|
+
{ className: 'content-category-label' },
|
|
1680
|
+
React__default.createElement(
|
|
1681
|
+
'div',
|
|
1682
|
+
{ className: 'mb-1 sanityDisplayLabel displayLabelThumb' },
|
|
1683
|
+
article.source
|
|
1684
|
+
)
|
|
1685
|
+
)
|
|
1686
|
+
),
|
|
1687
|
+
React__default.createElement(
|
|
1688
|
+
reactBootstrap.Media.Body,
|
|
1689
|
+
null,
|
|
1690
|
+
React__default.createElement(
|
|
1691
|
+
'a',
|
|
1692
|
+
{ href: mapping[contentCategoryName] + '/' + article.url.current },
|
|
1693
|
+
article.title && React__default.createElement(
|
|
1694
|
+
'h4',
|
|
1695
|
+
{ className: 'card-title', style: { fontWeight: '500', color: 'var(--gray-dark)', marginBottom: '.5rem' } },
|
|
1696
|
+
article.title
|
|
1697
|
+
)
|
|
1698
|
+
),
|
|
1699
|
+
showPublished && !showTimeDiff && article.published && React__default.createElement(
|
|
1700
|
+
'p',
|
|
1701
|
+
{ className: 'card-text', style: { color: 'var(--dark)', margin: '.25rem 0' } },
|
|
1702
|
+
moment.moment(article.published).format('MMMM DD, YYYY')
|
|
1703
|
+
),
|
|
1704
|
+
showTimeDiff && article.published && React__default.createElement(
|
|
1705
|
+
'p',
|
|
1706
|
+
{ className: 'card-text', style: { color: '#464644', lineHeight: '1.25', fontSize: '.875rem', margin: '.25rem 0' } },
|
|
1707
|
+
showTaxonomies && article.taxonomyMapping && article.taxonomyMapping.map(function (taxonomy, index) {
|
|
1708
|
+
if (index > 3) {
|
|
1709
|
+
return null;
|
|
1710
|
+
}
|
|
1711
|
+
if (index === 3) {
|
|
1712
|
+
return React__default.createElement(
|
|
1713
|
+
React__default.Fragment,
|
|
1714
|
+
null,
|
|
1715
|
+
React__default.createElement(
|
|
1716
|
+
'em',
|
|
1717
|
+
{ style: { marginRight: '.5rem' } },
|
|
1718
|
+
'...'
|
|
1719
|
+
)
|
|
1720
|
+
);
|
|
1721
|
+
}
|
|
1722
|
+
return React__default.createElement(
|
|
1723
|
+
React__default.Fragment,
|
|
1724
|
+
null,
|
|
1725
|
+
React__default.createElement(
|
|
1726
|
+
'em',
|
|
1727
|
+
null,
|
|
1728
|
+
taxonomy.name
|
|
1729
|
+
),
|
|
1730
|
+
' |',
|
|
1731
|
+
' '
|
|
1732
|
+
);
|
|
1733
|
+
}),
|
|
1734
|
+
' ',
|
|
1735
|
+
React__default.createElement(
|
|
1736
|
+
'span',
|
|
1737
|
+
{ style: { display: 'inline-block' } },
|
|
1738
|
+
timeDifferenceCalc(article.published)
|
|
1739
|
+
)
|
|
1740
|
+
),
|
|
1741
|
+
React__default.createElement(
|
|
1742
|
+
'div',
|
|
1743
|
+
{ className: 'author-sec', style: { lineHeight: 1.5 } },
|
|
1744
|
+
showAuthor && article.authorMapping && article.authorMapping.length > 0 && React__default.createElement(
|
|
1745
|
+
index$2.LazyLoad,
|
|
1746
|
+
{ height: 50 },
|
|
1747
|
+
React__default.createElement(AuthorComponent.AuthorComponent, { key: index.toString(), index: index, authors: article.authorMapping })
|
|
1748
|
+
)
|
|
1749
|
+
),
|
|
1750
|
+
!article.thumbnail && !defaultImage && article.source && React__default.createElement(
|
|
1751
|
+
'div',
|
|
1752
|
+
{ className: 'content-category-label' },
|
|
1753
|
+
React__default.createElement(
|
|
1754
|
+
'div',
|
|
1755
|
+
{ className: 'mb-1 sanityDisplayLabel displayLabelThumb' },
|
|
1756
|
+
article.source
|
|
1757
|
+
)
|
|
1758
|
+
),
|
|
1759
|
+
React__default.createElement(
|
|
1760
|
+
'div',
|
|
1761
|
+
{ style: { display: 'flex', alignItems: 'center', justifyContent: 'flex-start' } },
|
|
1762
|
+
showCategory && article.contentCategory && React__default.createElement(
|
|
1763
|
+
'p',
|
|
1764
|
+
{
|
|
1765
|
+
className: 'article-category',
|
|
1766
|
+
style: {
|
|
1767
|
+
background: '#3FB618',
|
|
1768
|
+
color: '#ffffff',
|
|
1769
|
+
marginBottom: '.25rem',
|
|
1770
|
+
display: 'inline-block',
|
|
1771
|
+
padding: '0 .25rem',
|
|
1772
|
+
fontSize: '.8rem'
|
|
1773
|
+
} },
|
|
1774
|
+
getContentCategory.getContentCategory(article.contentCategory.name, contentCategoryMapping)
|
|
1775
|
+
),
|
|
1776
|
+
article.issueSection && article.issueSection.name && React__default.createElement(
|
|
1777
|
+
'p',
|
|
1778
|
+
{
|
|
1779
|
+
className: 'issueSection',
|
|
1780
|
+
style: {
|
|
1781
|
+
background: '#000000',
|
|
1782
|
+
color: '#ffffff',
|
|
1783
|
+
marginBottom: '.25rem',
|
|
1784
|
+
marginLeft: '.25rem',
|
|
1785
|
+
display: 'inline-block',
|
|
1786
|
+
padding: '0 .25rem',
|
|
1787
|
+
fontSize: '.8rem'
|
|
1788
|
+
} },
|
|
1789
|
+
article.issueSection.name
|
|
1790
|
+
)
|
|
1791
|
+
),
|
|
1792
|
+
showPubInfo && (article.issue || article.volume) && React__default.createElement(
|
|
1793
|
+
'div',
|
|
1794
|
+
{ className: 'pubInfo' },
|
|
1795
|
+
article.volume && React__default.createElement(
|
|
1796
|
+
'p',
|
|
1797
|
+
{ className: 'qdeVolume' },
|
|
1798
|
+
article.volume
|
|
1799
|
+
),
|
|
1800
|
+
article.issue && React__default.createElement(
|
|
1801
|
+
'p',
|
|
1802
|
+
{ className: 'qdeIssue' },
|
|
1803
|
+
article.issue
|
|
1804
|
+
)
|
|
1805
|
+
),
|
|
1806
|
+
showIntro && article.summary && React__default.createElement(
|
|
1807
|
+
'p',
|
|
1808
|
+
{ className: 'pt-2 card-text' },
|
|
1809
|
+
entities.clean_html_1(article.summary)
|
|
1810
|
+
)
|
|
1811
|
+
)
|
|
1812
|
+
),
|
|
1813
|
+
React__default.createElement(
|
|
1814
|
+
'div',
|
|
1815
|
+
null,
|
|
1816
|
+
main.main_36 && rightItems && (index + 1) % numberOfItemsBeforeAd === 0 && renderMobileAd(index, numberOfItemsBeforeAd, rightItems)
|
|
1817
|
+
)
|
|
1818
|
+
);
|
|
1819
|
+
} else return null;
|
|
1820
|
+
}) :
|
|
1821
|
+
// For Javascript Disabled Cases
|
|
1822
|
+
React__default.createElement(
|
|
1823
|
+
'noscript',
|
|
1824
|
+
null,
|
|
1825
|
+
data.map(function (article, index) {
|
|
1826
|
+
var contentCategoryName = article.contentCategory ? article.contentCategory.name : 'Articles';
|
|
1827
|
+
|
|
1828
|
+
if (article._type === 'feature') {
|
|
1829
|
+
featureCount++;
|
|
1830
|
+
if (article.blank || checkExternalUrl(article.url.current)) {
|
|
1831
|
+
return React__default.createElement(
|
|
1832
|
+
reactBootstrap.Media,
|
|
1833
|
+
{
|
|
1834
|
+
key: article._id ? article._id : index,
|
|
1835
|
+
className: 'feature-media',
|
|
1836
|
+
style: { flexDirection: 'column', marginBottom: '1.25rem', paddingBottom: '1.25rem', borderBottom: '1px solid #ddd' } },
|
|
1837
|
+
(article.thumbnail && article.thumbnail.asset || defaultImage) && React__default.createElement(
|
|
1838
|
+
'a',
|
|
1839
|
+
{ rel: 'noopener', href: article.url.current, target: '_blank', className: 'feature-wrapper' },
|
|
1840
|
+
React__default.createElement(
|
|
1841
|
+
index$2.LazyLoad,
|
|
1842
|
+
{ height: imageHeight, placeholder: React__default.createElement(ImagePlaceholder, null) },
|
|
1843
|
+
article.thumbnail && article.thumbnail.asset ? React__default.createElement('img', { className: 'img-fluid', src: renderCardImage(article, client, imageHeight, imageWidth, imageMaxHeight, imageFit), alt: article.title }) : article.thumbnail ? React__default.createElement('img', { src: article.thumbnail, className: 'mr-3', alt: article.title }) : React__default.createElement('img', { src: defaultImage, src2: article.thumbnail, className: 'mr-3', width: '240', height: '135', alt: article.title })
|
|
1844
|
+
),
|
|
1845
|
+
article.source && React__default.createElement(
|
|
1846
|
+
'div',
|
|
1847
|
+
{ className: 'content-category-label' },
|
|
1848
|
+
React__default.createElement(
|
|
1849
|
+
'div',
|
|
1850
|
+
{ className: 'mb-1 sanityDisplayLabel displayLabelThumb' },
|
|
1851
|
+
article.source
|
|
1852
|
+
)
|
|
1853
|
+
)
|
|
1854
|
+
),
|
|
1855
|
+
React__default.createElement(
|
|
1856
|
+
reactBootstrap.Media.Body,
|
|
1857
|
+
null,
|
|
1858
|
+
React__default.createElement(
|
|
292
1859
|
'a',
|
|
293
|
-
{ rel: 'noopener', href: article.url.current, target: '_blank'
|
|
294
|
-
React__default
|
|
295
|
-
|
|
296
|
-
{
|
|
297
|
-
article.
|
|
1860
|
+
{ rel: 'noopener', href: article.url.current, target: '_blank' },
|
|
1861
|
+
article.title && React__default.createElement(
|
|
1862
|
+
'h4',
|
|
1863
|
+
{ className: 'card-title', style: { fontWeight: '500', color: 'var(--gray-dark)', marginBottom: '.5rem' } },
|
|
1864
|
+
article.title
|
|
1865
|
+
)
|
|
1866
|
+
),
|
|
1867
|
+
showPublished && article.published && React__default.createElement(
|
|
1868
|
+
'p',
|
|
1869
|
+
{ className: 'card-text', style: { color: 'var(--dark)', marginBottom: '.25rem' } },
|
|
1870
|
+
moment.moment(article.published).format('MMMM DD, YYYY')
|
|
1871
|
+
),
|
|
1872
|
+
showTimeDiff && article.published && React__default.createElement(
|
|
1873
|
+
'p',
|
|
1874
|
+
{ className: 'card-text', style: { color: '#464644', lineHeight: '1.25', fontSize: '.875rem', margin: '.25rem 0' } },
|
|
1875
|
+
showTaxonomies && article.taxonomyMapping && article.taxonomyMapping.map(function (taxonomy, index) {
|
|
1876
|
+
if (index > 3) {
|
|
1877
|
+
return null;
|
|
1878
|
+
}
|
|
1879
|
+
if (index === 3) {
|
|
1880
|
+
return React__default.createElement(
|
|
1881
|
+
React__default.Fragment,
|
|
1882
|
+
null,
|
|
1883
|
+
React__default.createElement(
|
|
1884
|
+
'em',
|
|
1885
|
+
{ style: { marginRight: '.5rem' } },
|
|
1886
|
+
'...'
|
|
1887
|
+
)
|
|
1888
|
+
);
|
|
1889
|
+
}
|
|
1890
|
+
return React__default.createElement(
|
|
1891
|
+
React__default.Fragment,
|
|
1892
|
+
null,
|
|
1893
|
+
React__default.createElement(
|
|
1894
|
+
'em',
|
|
1895
|
+
null,
|
|
1896
|
+
taxonomy.name
|
|
1897
|
+
),
|
|
1898
|
+
' |',
|
|
1899
|
+
' '
|
|
1900
|
+
);
|
|
1901
|
+
}),
|
|
1902
|
+
' ',
|
|
1903
|
+
React__default.createElement(
|
|
1904
|
+
'span',
|
|
1905
|
+
{ style: { display: 'inline-block' } },
|
|
1906
|
+
timeDifferenceCalc(article.published)
|
|
1907
|
+
)
|
|
1908
|
+
),
|
|
1909
|
+
showAuthor && article.authorMapping && article.authorMapping.length > 0 && React__default.createElement(
|
|
1910
|
+
index$2.LazyLoad,
|
|
1911
|
+
{ height: 50 },
|
|
1912
|
+
React__default.createElement(AuthorComponent.AuthorComponent, { key: index.toString(), index: index, authors: article.authorMapping })
|
|
1913
|
+
),
|
|
1914
|
+
!article.thumbnail && !defaultImage && article.source && React__default.createElement(
|
|
1915
|
+
'div',
|
|
1916
|
+
{ className: 'content-category-label' },
|
|
1917
|
+
React__default.createElement(
|
|
1918
|
+
'div',
|
|
1919
|
+
{ className: 'mb-1 sanityDisplayLabel displayLabelThumb' },
|
|
1920
|
+
article.source
|
|
1921
|
+
)
|
|
1922
|
+
),
|
|
1923
|
+
React__default.createElement(
|
|
1924
|
+
'div',
|
|
1925
|
+
{ style: { display: 'flex', alignItems: 'center', justifyContent: 'flex-start' } },
|
|
1926
|
+
showCategory && article.contentCategory && React__default.createElement(
|
|
1927
|
+
'p',
|
|
1928
|
+
{
|
|
1929
|
+
className: 'article-category',
|
|
1930
|
+
style: {
|
|
1931
|
+
background: '#3FB618',
|
|
1932
|
+
color: '#ffffff',
|
|
1933
|
+
marginBottom: '.25rem',
|
|
1934
|
+
display: 'inline-block',
|
|
1935
|
+
padding: '0 .25rem',
|
|
1936
|
+
fontSize: '.8rem'
|
|
1937
|
+
} },
|
|
1938
|
+
getContentCategory.getContentCategory(article.contentCategory.name, contentCategoryMapping)
|
|
1939
|
+
),
|
|
1940
|
+
article.issueSection && article.issueSection.name && React__default.createElement(
|
|
1941
|
+
'p',
|
|
1942
|
+
{
|
|
1943
|
+
className: 'issueSection',
|
|
1944
|
+
style: {
|
|
1945
|
+
background: '#000000',
|
|
1946
|
+
color: '#ffffff',
|
|
1947
|
+
marginBottom: '.25rem',
|
|
1948
|
+
marginLeft: '.25rem',
|
|
1949
|
+
display: 'inline-block',
|
|
1950
|
+
padding: '0 .25rem',
|
|
1951
|
+
fontSize: '.8rem'
|
|
1952
|
+
} },
|
|
1953
|
+
article.issueSection.name
|
|
1954
|
+
)
|
|
1955
|
+
),
|
|
1956
|
+
showPubInfo && (article.issue || article.volume) && React__default.createElement(
|
|
1957
|
+
'div',
|
|
1958
|
+
{ className: 'pubInfo' },
|
|
1959
|
+
article.volume && React__default.createElement(
|
|
1960
|
+
'p',
|
|
1961
|
+
{ className: 'qdeVolume' },
|
|
1962
|
+
article.volume
|
|
298
1963
|
),
|
|
299
|
-
article.
|
|
1964
|
+
article.issue && React__default.createElement(
|
|
1965
|
+
'p',
|
|
1966
|
+
{ className: 'qdeIssue' },
|
|
1967
|
+
article.issue
|
|
1968
|
+
)
|
|
1969
|
+
),
|
|
1970
|
+
showIntro && article.summary && React__default.createElement(
|
|
1971
|
+
'p',
|
|
1972
|
+
{ className: 'pt-2 card-text' },
|
|
1973
|
+
entities.clean_html_1(article.summary)
|
|
1974
|
+
)
|
|
1975
|
+
)
|
|
1976
|
+
);
|
|
1977
|
+
} else {
|
|
1978
|
+
return React__default.createElement(
|
|
1979
|
+
reactBootstrap.Media,
|
|
1980
|
+
{
|
|
1981
|
+
key: article._id ? article._id : index,
|
|
1982
|
+
className: 'feature-media',
|
|
1983
|
+
style: { flexDirection: 'column', marginBottom: '1.25rem', paddingBottom: '1.25rem', borderBottom: '1px solid #ddd' } },
|
|
1984
|
+
(article.thumbnail && article.thumbnail.asset || defaultImage) && React__default.createElement(
|
|
1985
|
+
'a',
|
|
1986
|
+
{ href: article.url.current, className: 'feature-wrapper' },
|
|
1987
|
+
React__default.createElement(
|
|
1988
|
+
index$2.LazyLoad,
|
|
1989
|
+
{ height: imageHeight, placeholder: React__default.createElement(ImagePlaceholder, null) },
|
|
1990
|
+
article.thumbnail && article.thumbnail.asset ? React__default.createElement('img', { className: 'img-fluid', src: renderCardImage(article, client, imageHeight, imageWidth, imageMaxHeight, imageFit), alt: article.title }) : article.thumbnail ? React__default.createElement('img', { src: article.thumbnail, className: 'mr-3', alt: article.title }) : React__default.createElement('img', { src: defaultImage, src2: article.thumbnail, className: 'mr-3', width: '240', height: '135', alt: article.title })
|
|
1991
|
+
),
|
|
1992
|
+
article.source && React__default.createElement(
|
|
1993
|
+
'div',
|
|
1994
|
+
{ className: 'content-category-label' },
|
|
1995
|
+
React__default.createElement(
|
|
1996
|
+
'div',
|
|
1997
|
+
{ className: 'mb-1 sanityDisplayLabel displayLabelThumb' },
|
|
1998
|
+
article.source
|
|
1999
|
+
)
|
|
2000
|
+
)
|
|
2001
|
+
),
|
|
2002
|
+
React__default.createElement(
|
|
2003
|
+
reactBootstrap.Media.Body,
|
|
2004
|
+
null,
|
|
2005
|
+
React__default.createElement(
|
|
2006
|
+
'a',
|
|
2007
|
+
{ href: article.url.current },
|
|
2008
|
+
article.title && React__default.createElement(
|
|
2009
|
+
'h4',
|
|
2010
|
+
{ className: 'card-title', style: { fontWeight: '500', color: 'var(--gray-dark)', marginBottom: '.5rem' } },
|
|
2011
|
+
article.title
|
|
2012
|
+
)
|
|
2013
|
+
),
|
|
2014
|
+
showPublished && article.published && React__default.createElement(
|
|
2015
|
+
'p',
|
|
2016
|
+
{ className: 'card-text', style: { color: 'var(--dark)', marginBottom: '.25rem' } },
|
|
2017
|
+
moment.moment(article.published).format('MMMM DD, YYYY')
|
|
2018
|
+
),
|
|
2019
|
+
showTimeDiff && article.published && React__default.createElement(
|
|
2020
|
+
'p',
|
|
2021
|
+
{ className: 'card-text', style: { color: '#464644', lineHeight: '1.25', fontSize: '.875rem', margin: '.25rem 0' } },
|
|
2022
|
+
showTaxonomies && article.taxonomyMapping && article.taxonomyMapping.map(function (taxonomy, index) {
|
|
2023
|
+
if (index > 3) {
|
|
2024
|
+
return null;
|
|
2025
|
+
}
|
|
2026
|
+
if (index === 3) {
|
|
2027
|
+
return React__default.createElement(
|
|
2028
|
+
React__default.Fragment,
|
|
2029
|
+
null,
|
|
2030
|
+
React__default.createElement(
|
|
2031
|
+
'em',
|
|
2032
|
+
{ style: { marginRight: '.5rem' } },
|
|
2033
|
+
'...'
|
|
2034
|
+
)
|
|
2035
|
+
);
|
|
2036
|
+
}
|
|
2037
|
+
return React__default.createElement(
|
|
2038
|
+
React__default.Fragment,
|
|
2039
|
+
null,
|
|
2040
|
+
React__default.createElement(
|
|
2041
|
+
'em',
|
|
2042
|
+
null,
|
|
2043
|
+
taxonomy.name
|
|
2044
|
+
),
|
|
2045
|
+
' |',
|
|
2046
|
+
' '
|
|
2047
|
+
);
|
|
2048
|
+
}),
|
|
2049
|
+
' ',
|
|
2050
|
+
React__default.createElement(
|
|
2051
|
+
'span',
|
|
2052
|
+
{ style: { display: 'inline-block' } },
|
|
2053
|
+
timeDifferenceCalc(article.published)
|
|
2054
|
+
)
|
|
2055
|
+
),
|
|
2056
|
+
showAuthor && article.authorMapping && article.authorMapping.length > 0 && React__default.createElement(
|
|
2057
|
+
index$2.LazyLoad,
|
|
2058
|
+
{ height: 50 },
|
|
2059
|
+
React__default.createElement(AuthorComponent.AuthorComponent, { key: index.toString(), index: index, authors: article.authorMapping })
|
|
2060
|
+
),
|
|
2061
|
+
!article.thumbnail && !defaultImage && article.source && React__default.createElement(
|
|
2062
|
+
'div',
|
|
2063
|
+
{ className: 'content-category-label' },
|
|
2064
|
+
React__default.createElement(
|
|
300
2065
|
'div',
|
|
301
|
-
{ className: '
|
|
302
|
-
|
|
303
|
-
'div',
|
|
304
|
-
{ className: 'mb-1 sanityDisplayLabel displayLabelThumb' },
|
|
305
|
-
article.source
|
|
306
|
-
)
|
|
2066
|
+
{ className: 'mb-1 sanityDisplayLabel displayLabelThumb' },
|
|
2067
|
+
article.source
|
|
307
2068
|
)
|
|
308
2069
|
),
|
|
309
|
-
React__default
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
React__default
|
|
313
|
-
'a',
|
|
314
|
-
{ rel: 'noopener', href: article.url.current, target: '_blank' },
|
|
315
|
-
article.title && React__default['default'].createElement(
|
|
316
|
-
'h4',
|
|
317
|
-
{ className: 'card-title', style: { fontWeight: '500', color: 'var(--gray-dark)', marginBottom: '.5rem' } },
|
|
318
|
-
article.title
|
|
319
|
-
)
|
|
320
|
-
),
|
|
321
|
-
showPublished && !showTimeDiff && article.published && React__default['default'].createElement(
|
|
322
|
-
'p',
|
|
323
|
-
{ className: 'card-text', style: { color: 'var(--dark)', margin: '.25rem 0' } },
|
|
324
|
-
moment.moment(article.published).format('MMMM DD, YYYY')
|
|
325
|
-
),
|
|
326
|
-
showTimeDiff && article.published && React__default['default'].createElement(
|
|
2070
|
+
React__default.createElement(
|
|
2071
|
+
'div',
|
|
2072
|
+
{ style: { display: 'flex', alignItems: 'center', justifyContent: 'flex-start' } },
|
|
2073
|
+
showCategory && article.contentCategory && React__default.createElement(
|
|
327
2074
|
'p',
|
|
328
|
-
{
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
{ style: { marginRight: '.5rem' } },
|
|
340
|
-
'...'
|
|
341
|
-
)
|
|
342
|
-
);
|
|
343
|
-
}
|
|
344
|
-
return React__default['default'].createElement(
|
|
345
|
-
React__default['default'].Fragment,
|
|
346
|
-
null,
|
|
347
|
-
React__default['default'].createElement(
|
|
348
|
-
'em',
|
|
349
|
-
null,
|
|
350
|
-
taxonomy.name
|
|
351
|
-
),
|
|
352
|
-
' |',
|
|
353
|
-
' '
|
|
354
|
-
);
|
|
355
|
-
}),
|
|
356
|
-
' ',
|
|
357
|
-
React__default['default'].createElement(
|
|
358
|
-
'span',
|
|
359
|
-
{ style: { display: 'inline-block' } },
|
|
360
|
-
timeDifferenceCalc(article.published)
|
|
361
|
-
)
|
|
362
|
-
),
|
|
363
|
-
showAuthor && article.authorMapping && article.authorMapping.length > 0 && React__default['default'].createElement(
|
|
364
|
-
index.LazyLoad,
|
|
365
|
-
{ height: 50 },
|
|
366
|
-
React__default['default'].createElement(AuthorComponent.AuthorComponent, { key: index$1.toString(), index: index$1, authors: article.authorMapping })
|
|
367
|
-
),
|
|
368
|
-
!article.thumbnail && !defaultImage && article.source && React__default['default'].createElement(
|
|
369
|
-
'div',
|
|
370
|
-
{ className: 'content-category-label' },
|
|
371
|
-
React__default['default'].createElement(
|
|
372
|
-
'div',
|
|
373
|
-
{ className: 'mb-1 sanityDisplayLabel displayLabelThumb' },
|
|
374
|
-
article.source
|
|
375
|
-
)
|
|
376
|
-
),
|
|
377
|
-
React__default['default'].createElement(
|
|
378
|
-
'div',
|
|
379
|
-
{ style: { display: 'flex', alignItems: 'center', justifyContent: 'flex-start' } },
|
|
380
|
-
showCategory && article.contentCategory && React__default['default'].createElement(
|
|
381
|
-
'p',
|
|
382
|
-
{
|
|
383
|
-
className: 'article-category',
|
|
384
|
-
style: {
|
|
385
|
-
background: '#3FB618',
|
|
386
|
-
color: '#ffffff',
|
|
387
|
-
marginBottom: '.25rem',
|
|
388
|
-
display: 'inline-block',
|
|
389
|
-
padding: '0 .25rem',
|
|
390
|
-
fontSize: '.8rem'
|
|
391
|
-
} },
|
|
392
|
-
getContentCategory.getContentCategory(article.contentCategory.name, contentCategoryMapping)
|
|
393
|
-
),
|
|
394
|
-
article.issueSection && article.issueSection.name && React__default['default'].createElement(
|
|
395
|
-
'p',
|
|
396
|
-
{
|
|
397
|
-
className: 'issueSection',
|
|
398
|
-
style: {
|
|
399
|
-
background: '#000000',
|
|
400
|
-
color: '#ffffff',
|
|
401
|
-
marginBottom: '.25rem',
|
|
402
|
-
marginLeft: '.25rem',
|
|
403
|
-
display: 'inline-block',
|
|
404
|
-
padding: '0 .25rem',
|
|
405
|
-
fontSize: '.8rem'
|
|
406
|
-
} },
|
|
407
|
-
article.issueSection.name
|
|
408
|
-
)
|
|
409
|
-
),
|
|
410
|
-
showPubInfo && (article.issue || article.volume) && React__default['default'].createElement(
|
|
411
|
-
'div',
|
|
412
|
-
{ className: 'pubInfo' },
|
|
413
|
-
article.volume && React__default['default'].createElement(
|
|
414
|
-
'p',
|
|
415
|
-
{ className: 'qdeVolume' },
|
|
416
|
-
article.volume
|
|
417
|
-
),
|
|
418
|
-
article.issue && React__default['default'].createElement(
|
|
419
|
-
'p',
|
|
420
|
-
{ className: 'qdeIssue' },
|
|
421
|
-
article.issue
|
|
422
|
-
)
|
|
2075
|
+
{
|
|
2076
|
+
className: 'article-category',
|
|
2077
|
+
style: {
|
|
2078
|
+
background: '#3FB618',
|
|
2079
|
+
color: '#ffffff',
|
|
2080
|
+
marginBottom: '.25rem',
|
|
2081
|
+
display: 'inline-block',
|
|
2082
|
+
padding: '0 .25rem',
|
|
2083
|
+
fontSize: '.8rem'
|
|
2084
|
+
} },
|
|
2085
|
+
getContentCategory.getContentCategory(article.contentCategory.name, contentCategoryMapping)
|
|
423
2086
|
),
|
|
424
|
-
|
|
2087
|
+
article.issueSection && article.issueSection.name && React__default.createElement(
|
|
425
2088
|
'p',
|
|
426
|
-
{
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
partialVisibility: true,
|
|
439
|
-
onChange: function onChange(isVisible) {
|
|
440
|
-
isVisible && changePageNumber(pageNumber, seoPaginate, pageview, router, currentPage, setCurrentPage);
|
|
441
|
-
} },
|
|
442
|
-
React__default['default'].createElement(
|
|
443
|
-
React__default['default'].Fragment,
|
|
444
|
-
null,
|
|
445
|
-
React__default['default'].createElement(
|
|
446
|
-
reactBootstrap.Media,
|
|
447
|
-
{
|
|
448
|
-
key: article._id ? article._id : index$1,
|
|
449
|
-
className: 'feature-media',
|
|
450
|
-
style: { flexDirection: 'column', marginBottom: '1.25rem', paddingBottom: '1.25rem', borderBottom: '1px solid #ddd' } },
|
|
451
|
-
(article.thumbnail && article.thumbnail.asset || defaultImage) && React__default['default'].createElement(
|
|
452
|
-
'a',
|
|
453
|
-
{ href: article.url.current, className: 'feature-wrapper' },
|
|
454
|
-
React__default['default'].createElement(
|
|
455
|
-
index.LazyLoad,
|
|
456
|
-
{ height: imageHeight, placeholder: React__default['default'].createElement(ImagePlaceholder, null) },
|
|
457
|
-
article.thumbnail && article.thumbnail.asset ? React__default['default'].createElement('img', { className: 'img-fluid', src: renderCardImage(article, client, imageHeight, imageWidth, imageMaxHeight, imageFit), alt: article.title }) : article.thumbnail ? React__default['default'].createElement('img', { src: article.thumbnail, className: 'mr-3', alt: article.title }) : React__default['default'].createElement('img', { src: defaultImage, src2: article.thumbnail, className: 'mr-3', width: '240', height: '135', alt: article.title })
|
|
458
|
-
),
|
|
459
|
-
article.source && React__default['default'].createElement(
|
|
460
|
-
'div',
|
|
461
|
-
{ className: 'content-category-label' },
|
|
462
|
-
React__default['default'].createElement(
|
|
463
|
-
'div',
|
|
464
|
-
{ className: 'mb-1 sanityDisplayLabel displayLabelThumb' },
|
|
465
|
-
article.source
|
|
466
|
-
)
|
|
2089
|
+
{
|
|
2090
|
+
className: 'issueSection',
|
|
2091
|
+
style: {
|
|
2092
|
+
background: '#000000',
|
|
2093
|
+
color: '#ffffff',
|
|
2094
|
+
marginBottom: '.25rem',
|
|
2095
|
+
marginLeft: '.25rem',
|
|
2096
|
+
display: 'inline-block',
|
|
2097
|
+
padding: '0 .25rem',
|
|
2098
|
+
fontSize: '.8rem'
|
|
2099
|
+
} },
|
|
2100
|
+
article.issueSection.name
|
|
467
2101
|
)
|
|
468
2102
|
),
|
|
469
|
-
React__default
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
React__default
|
|
473
|
-
'a',
|
|
474
|
-
{ href: article.url.current },
|
|
475
|
-
article.title && React__default['default'].createElement(
|
|
476
|
-
'h4',
|
|
477
|
-
{ className: 'card-title', style: { fontWeight: '500', color: 'var(--gray-dark)', marginBottom: '.5rem' } },
|
|
478
|
-
article.title
|
|
479
|
-
)
|
|
480
|
-
),
|
|
481
|
-
showPublished && !showTimeDiff && article.published && React__default['default'].createElement(
|
|
482
|
-
'p',
|
|
483
|
-
{ className: 'card-text', style: { color: 'var(--dark)', margin: '.25rem 0' } },
|
|
484
|
-
moment.moment(article.published).format('MMMM DD, YYYY')
|
|
485
|
-
),
|
|
486
|
-
showTimeDiff && article.published && React__default['default'].createElement(
|
|
2103
|
+
showPubInfo && (article.issue || article.volume) && React__default.createElement(
|
|
2104
|
+
'div',
|
|
2105
|
+
{ className: 'pubInfo' },
|
|
2106
|
+
article.volume && React__default.createElement(
|
|
487
2107
|
'p',
|
|
488
|
-
{ className: '
|
|
489
|
-
|
|
490
|
-
if (index > 3) {
|
|
491
|
-
return null;
|
|
492
|
-
}
|
|
493
|
-
if (index === 3) {
|
|
494
|
-
return React__default['default'].createElement(
|
|
495
|
-
React__default['default'].Fragment,
|
|
496
|
-
null,
|
|
497
|
-
React__default['default'].createElement(
|
|
498
|
-
'em',
|
|
499
|
-
{ style: { marginRight: '.5rem' } },
|
|
500
|
-
'...'
|
|
501
|
-
)
|
|
502
|
-
);
|
|
503
|
-
}
|
|
504
|
-
if (index === 3) {
|
|
505
|
-
return React__default['default'].createElement(
|
|
506
|
-
React__default['default'].Fragment,
|
|
507
|
-
null,
|
|
508
|
-
React__default['default'].createElement(
|
|
509
|
-
'em',
|
|
510
|
-
{ style: { marginRight: '.5rem' } },
|
|
511
|
-
'...'
|
|
512
|
-
)
|
|
513
|
-
);
|
|
514
|
-
}
|
|
515
|
-
return React__default['default'].createElement(
|
|
516
|
-
React__default['default'].Fragment,
|
|
517
|
-
null,
|
|
518
|
-
React__default['default'].createElement(
|
|
519
|
-
'em',
|
|
520
|
-
null,
|
|
521
|
-
taxonomy.name
|
|
522
|
-
),
|
|
523
|
-
' |',
|
|
524
|
-
' '
|
|
525
|
-
);
|
|
526
|
-
}),
|
|
527
|
-
' ',
|
|
528
|
-
React__default['default'].createElement(
|
|
529
|
-
'span',
|
|
530
|
-
{ style: { display: 'inline-block' } },
|
|
531
|
-
timeDifferenceCalc(article.published)
|
|
532
|
-
)
|
|
533
|
-
),
|
|
534
|
-
showAuthor && article.authorMapping && article.authorMapping.length > 0 && React__default['default'].createElement(
|
|
535
|
-
index.LazyLoad,
|
|
536
|
-
{ height: 50 },
|
|
537
|
-
React__default['default'].createElement(AuthorComponent.AuthorComponent, { key: index$1.toString(), index: index$1, authors: article.authorMapping })
|
|
538
|
-
),
|
|
539
|
-
!article.thumbnail && !defaultImage && article.source && React__default['default'].createElement(
|
|
540
|
-
'div',
|
|
541
|
-
{ className: 'content-category-label' },
|
|
542
|
-
React__default['default'].createElement(
|
|
543
|
-
'div',
|
|
544
|
-
{ className: 'mb-1 sanityDisplayLabel displayLabelThumb' },
|
|
545
|
-
article.source
|
|
546
|
-
)
|
|
547
|
-
),
|
|
548
|
-
React__default['default'].createElement(
|
|
549
|
-
'div',
|
|
550
|
-
{ style: { display: 'flex', alignItems: 'center', justifyContent: 'flex-start' } },
|
|
551
|
-
showCategory && article.contentCategory && React__default['default'].createElement(
|
|
552
|
-
'p',
|
|
553
|
-
{
|
|
554
|
-
className: 'article-category',
|
|
555
|
-
style: {
|
|
556
|
-
background: '#3FB618',
|
|
557
|
-
color: '#ffffff',
|
|
558
|
-
marginBottom: '.25rem',
|
|
559
|
-
display: 'inline-block',
|
|
560
|
-
padding: '0 .25rem',
|
|
561
|
-
fontSize: '.8rem'
|
|
562
|
-
} },
|
|
563
|
-
getContentCategory.getContentCategory(article.contentCategory.name, contentCategoryMapping)
|
|
564
|
-
),
|
|
565
|
-
article.issueSection && article.issueSection.name && React__default['default'].createElement(
|
|
566
|
-
'p',
|
|
567
|
-
{
|
|
568
|
-
className: 'issueSection',
|
|
569
|
-
style: {
|
|
570
|
-
background: '#000000',
|
|
571
|
-
color: '#ffffff',
|
|
572
|
-
marginBottom: '.25rem',
|
|
573
|
-
marginLeft: '.25rem',
|
|
574
|
-
display: 'inline-block',
|
|
575
|
-
padding: '0 .25rem',
|
|
576
|
-
fontSize: '.8rem'
|
|
577
|
-
} },
|
|
578
|
-
article.issueSection.name
|
|
579
|
-
)
|
|
580
|
-
),
|
|
581
|
-
showPubInfo && (article.issue || article.volume) && React__default['default'].createElement(
|
|
582
|
-
'div',
|
|
583
|
-
{ className: 'pubInfo' },
|
|
584
|
-
article.volume && React__default['default'].createElement(
|
|
585
|
-
'p',
|
|
586
|
-
{ className: 'qdeVolume' },
|
|
587
|
-
article.volume
|
|
588
|
-
),
|
|
589
|
-
article.issue && React__default['default'].createElement(
|
|
590
|
-
'p',
|
|
591
|
-
{ className: 'qdeIssue' },
|
|
592
|
-
article.issue
|
|
593
|
-
)
|
|
2108
|
+
{ className: 'qdeVolume' },
|
|
2109
|
+
article.volume
|
|
594
2110
|
),
|
|
595
|
-
|
|
2111
|
+
article.issue && React__default.createElement(
|
|
596
2112
|
'p',
|
|
597
|
-
{ className: '
|
|
598
|
-
|
|
2113
|
+
{ className: 'qdeIssue' },
|
|
2114
|
+
article.issue
|
|
599
2115
|
)
|
|
2116
|
+
),
|
|
2117
|
+
showIntro && article.summary && React__default.createElement(
|
|
2118
|
+
'p',
|
|
2119
|
+
{ className: 'pt-2 card-text' },
|
|
2120
|
+
entities.clean_html_1(article.summary)
|
|
600
2121
|
)
|
|
601
2122
|
)
|
|
602
|
-
)
|
|
603
|
-
|
|
2123
|
+
);
|
|
2124
|
+
}
|
|
2125
|
+
} else if (article._type === 'lg-infeed' && article.adUnit) {
|
|
2126
|
+
return React__default.createElement(ADlgInfeed.ADlgInfeed, _extends._extends({ index: index }, article));
|
|
2127
|
+
} else if (article._type === 'brandInsightAd' && article.adUnit) {
|
|
2128
|
+
return React__default.createElement(ADInfeed.ADInfeed, { index: index, infeedAd: article });
|
|
604
2129
|
}
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
if ((brandInsightAd ? index$1 > heroContent + featureCount : index$1 + 1 > heroContent + featureCount) && (!article._type || !['lg-infeed', 'brandInsightAd'].includes(article._type))) {
|
|
611
|
-
return React__default['default'].createElement(
|
|
612
|
-
visibilitySensor.VisibilitySensor,
|
|
613
|
-
{
|
|
614
|
-
key: article._id ? article._id : index$1,
|
|
615
|
-
onChange: function onChange(isVisible) {
|
|
616
|
-
// Passing 'articleCount' instead of index because index will be including the indexes of ads whereas articleCount will be having index of artilce only.
|
|
617
|
-
isVisible && changePageNumber(pageNumber, seoPaginate, pageview, router, currentPage, setCurrentPage, itemsPerPage, article.articleCount ? article.articleCount : index$1);
|
|
618
|
-
} },
|
|
619
|
-
React__default['default'].createElement(
|
|
620
|
-
React__default['default'].Fragment,
|
|
621
|
-
null,
|
|
622
|
-
React__default['default'].createElement(
|
|
2130
|
+
if ((brandInsightAd ? index > heroContent + featureCount : index + 1 > heroContent + featureCount) && (!article._type || !['lg-infeed', 'brandInsightAd'].includes(article._type))) {
|
|
2131
|
+
return React__default.createElement(
|
|
2132
|
+
React__default.Fragment,
|
|
2133
|
+
{ key: article._id ? article._id : index },
|
|
2134
|
+
React__default.createElement(
|
|
623
2135
|
reactBootstrap.Media,
|
|
624
2136
|
{
|
|
625
|
-
key: article._id ? article._id : index
|
|
2137
|
+
key: article._id ? article._id : index,
|
|
626
2138
|
style: { flexDirection: 'row', marginBottom: '1.25rem', paddingBottom: '1.25rem', borderBottom: '1px solid #ddd' } },
|
|
627
|
-
(article.thumbnail && article.thumbnail.asset || defaultImage) && React__default
|
|
2139
|
+
(article.thumbnail && article.thumbnail.asset || defaultImage) && React__default.createElement(
|
|
628
2140
|
'a',
|
|
629
2141
|
{ href: mapping[contentCategoryName] + '/' + article.url.current, className: 'img-wrapper' },
|
|
630
|
-
React__default
|
|
631
|
-
index.LazyLoad,
|
|
632
|
-
{ height: imageHeight, placeholder: React__default
|
|
633
|
-
article.thumbnail && article.thumbnail.asset ? React__default
|
|
2142
|
+
React__default.createElement(
|
|
2143
|
+
index$2.LazyLoad,
|
|
2144
|
+
{ height: imageHeight, placeholder: React__default.createElement(ImagePlaceholder, null) },
|
|
2145
|
+
article.thumbnail && article.thumbnail.asset ? React__default.createElement('img', { className: 'mr-3 img-fluid', src: renderCardImage(article, client, imageHeight, imageWidth, imageMaxHeight, imageFit), alt: article.title }) : article.thumbnail ? React__default.createElement('img', { src: article.thumbnail, className: 'mr-3', alt: article.title }) : React__default.createElement('img', { src: defaultImage, src2: article.thumbnail, className: 'mr-3', width: '240', height: '135', alt: article.title })
|
|
634
2146
|
),
|
|
635
|
-
article.source && React__default
|
|
2147
|
+
article.source && React__default.createElement(
|
|
636
2148
|
'div',
|
|
637
2149
|
{ className: 'content-category-label' },
|
|
638
|
-
React__default
|
|
2150
|
+
React__default.createElement(
|
|
639
2151
|
'div',
|
|
640
2152
|
{ className: 'mb-1 sanityDisplayLabel displayLabelThumb' },
|
|
641
2153
|
article.source
|
|
642
2154
|
)
|
|
643
2155
|
)
|
|
644
2156
|
),
|
|
645
|
-
React__default
|
|
2157
|
+
React__default.createElement(
|
|
646
2158
|
reactBootstrap.Media.Body,
|
|
647
2159
|
null,
|
|
648
|
-
React__default
|
|
2160
|
+
React__default.createElement(
|
|
649
2161
|
'a',
|
|
650
2162
|
{ href: mapping[contentCategoryName] + '/' + article.url.current },
|
|
651
|
-
article.title && React__default
|
|
2163
|
+
article.title && React__default.createElement(
|
|
652
2164
|
'h4',
|
|
653
2165
|
{ className: 'card-title', style: { fontWeight: '500', color: 'var(--gray-dark)', marginBottom: '.5rem' } },
|
|
654
2166
|
article.title
|
|
655
2167
|
)
|
|
656
2168
|
),
|
|
657
|
-
showPublished &&
|
|
2169
|
+
showPublished && article.published && React__default.createElement(
|
|
658
2170
|
'p',
|
|
659
|
-
{ className: 'card-text', style: { color: 'var(--dark)',
|
|
2171
|
+
{ className: 'card-text', style: { color: 'var(--dark)', marginBottom: '.25rem' } },
|
|
660
2172
|
moment.moment(article.published).format('MMMM DD, YYYY')
|
|
661
2173
|
),
|
|
662
|
-
showTimeDiff && article.published && React__default
|
|
2174
|
+
showTimeDiff && article.published && React__default.createElement(
|
|
663
2175
|
'p',
|
|
664
2176
|
{ className: 'card-text', style: { color: '#464644', lineHeight: '1.25', fontSize: '.875rem', margin: '.25rem 0' } },
|
|
665
2177
|
showTaxonomies && article.taxonomyMapping && article.taxonomyMapping.map(function (taxonomy, index) {
|
|
@@ -667,20 +2179,20 @@ var cardLoader = function cardLoader(data, client, mapping, values, seoPaginate,
|
|
|
667
2179
|
return null;
|
|
668
2180
|
}
|
|
669
2181
|
if (index === 3) {
|
|
670
|
-
return React__default
|
|
671
|
-
React__default
|
|
2182
|
+
return React__default.createElement(
|
|
2183
|
+
React__default.Fragment,
|
|
672
2184
|
null,
|
|
673
|
-
React__default
|
|
2185
|
+
React__default.createElement(
|
|
674
2186
|
'em',
|
|
675
2187
|
{ style: { marginRight: '.5rem' } },
|
|
676
2188
|
'...'
|
|
677
2189
|
)
|
|
678
2190
|
);
|
|
679
2191
|
}
|
|
680
|
-
return React__default
|
|
681
|
-
React__default
|
|
2192
|
+
return React__default.createElement(
|
|
2193
|
+
React__default.Fragment,
|
|
682
2194
|
null,
|
|
683
|
-
React__default
|
|
2195
|
+
React__default.createElement(
|
|
684
2196
|
'em',
|
|
685
2197
|
null,
|
|
686
2198
|
taxonomy.name
|
|
@@ -690,34 +2202,34 @@ var cardLoader = function cardLoader(data, client, mapping, values, seoPaginate,
|
|
|
690
2202
|
);
|
|
691
2203
|
}),
|
|
692
2204
|
' ',
|
|
693
|
-
React__default
|
|
2205
|
+
React__default.createElement(
|
|
694
2206
|
'span',
|
|
695
2207
|
{ style: { display: 'inline-block' } },
|
|
696
2208
|
timeDifferenceCalc(article.published)
|
|
697
2209
|
)
|
|
698
2210
|
),
|
|
699
|
-
React__default
|
|
2211
|
+
React__default.createElement(
|
|
700
2212
|
'div',
|
|
701
2213
|
{ className: 'author-sec', style: { lineHeight: 1.5 } },
|
|
702
|
-
showAuthor && article.authorMapping && article.authorMapping.length > 0 && React__default
|
|
703
|
-
index.LazyLoad,
|
|
2214
|
+
showAuthor && article.authorMapping && article.authorMapping.length > 0 && React__default.createElement(
|
|
2215
|
+
index$2.LazyLoad,
|
|
704
2216
|
{ height: 50 },
|
|
705
|
-
React__default
|
|
2217
|
+
React__default.createElement(AuthorComponent.AuthorComponent, { key: index.toString(), index: index, authors: article.authorMapping })
|
|
706
2218
|
)
|
|
707
2219
|
),
|
|
708
|
-
!article.thumbnail && !defaultImage && article.source && React__default
|
|
2220
|
+
!article.thumbnail && !defaultImage && article.source && React__default.createElement(
|
|
709
2221
|
'div',
|
|
710
2222
|
{ className: 'content-category-label' },
|
|
711
|
-
React__default
|
|
2223
|
+
React__default.createElement(
|
|
712
2224
|
'div',
|
|
713
2225
|
{ className: 'mb-1 sanityDisplayLabel displayLabelThumb' },
|
|
714
2226
|
article.source
|
|
715
2227
|
)
|
|
716
2228
|
),
|
|
717
|
-
React__default
|
|
2229
|
+
React__default.createElement(
|
|
718
2230
|
'div',
|
|
719
2231
|
{ style: { display: 'flex', alignItems: 'center', justifyContent: 'flex-start' } },
|
|
720
|
-
showCategory && article.contentCategory && React__default
|
|
2232
|
+
showCategory && article.contentCategory && React__default.createElement(
|
|
721
2233
|
'p',
|
|
722
2234
|
{
|
|
723
2235
|
className: 'article-category',
|
|
@@ -731,7 +2243,7 @@ var cardLoader = function cardLoader(data, client, mapping, values, seoPaginate,
|
|
|
731
2243
|
} },
|
|
732
2244
|
getContentCategory.getContentCategory(article.contentCategory.name, contentCategoryMapping)
|
|
733
2245
|
),
|
|
734
|
-
article.issueSection && article.issueSection.name && React__default
|
|
2246
|
+
article.issueSection && article.issueSection.name && React__default.createElement(
|
|
735
2247
|
'p',
|
|
736
2248
|
{
|
|
737
2249
|
className: 'issueSection',
|
|
@@ -747,556 +2259,49 @@ var cardLoader = function cardLoader(data, client, mapping, values, seoPaginate,
|
|
|
747
2259
|
article.issueSection.name
|
|
748
2260
|
)
|
|
749
2261
|
),
|
|
750
|
-
showPubInfo && (article.issue || article.volume) && React__default
|
|
2262
|
+
showPubInfo && (article.issue || article.volume) && React__default.createElement(
|
|
751
2263
|
'div',
|
|
752
2264
|
{ className: 'pubInfo' },
|
|
753
|
-
article.volume && React__default
|
|
2265
|
+
article.volume && React__default.createElement(
|
|
754
2266
|
'p',
|
|
755
2267
|
{ className: 'qdeVolume' },
|
|
756
2268
|
article.volume
|
|
757
2269
|
),
|
|
758
|
-
article.issue && React__default
|
|
2270
|
+
article.issue && React__default.createElement(
|
|
759
2271
|
'p',
|
|
760
2272
|
{ className: 'qdeIssue' },
|
|
761
2273
|
article.issue
|
|
762
2274
|
)
|
|
763
2275
|
),
|
|
764
|
-
showIntro && article.summary && React__default
|
|
2276
|
+
showIntro && article.summary && React__default.createElement(
|
|
765
2277
|
'p',
|
|
766
2278
|
{ className: 'pt-2 card-text' },
|
|
767
2279
|
entities.clean_html_1(article.summary)
|
|
768
2280
|
)
|
|
769
2281
|
)
|
|
770
2282
|
),
|
|
771
|
-
React__default
|
|
2283
|
+
React__default.createElement(
|
|
772
2284
|
'div',
|
|
773
2285
|
null,
|
|
774
|
-
main.
|
|
775
|
-
)
|
|
776
|
-
)
|
|
777
|
-
);
|
|
778
|
-
} else return null;
|
|
779
|
-
}) :
|
|
780
|
-
// For Javascript Disabled Cases
|
|
781
|
-
React__default['default'].createElement(
|
|
782
|
-
'noscript',
|
|
783
|
-
null,
|
|
784
|
-
data.map(function (article, index$1) {
|
|
785
|
-
var pageNumber = article.pageNumber || values.page;
|
|
786
|
-
var contentCategoryName = article.contentCategory ? article.contentCategory.name : 'Articles';
|
|
787
|
-
|
|
788
|
-
if (article._type === 'feature') {
|
|
789
|
-
featureCount++;
|
|
790
|
-
if (article.blank || checkExternalUrl(article.url.current)) {
|
|
791
|
-
return React__default['default'].createElement(
|
|
792
|
-
visibilitySensor.VisibilitySensor,
|
|
793
|
-
{
|
|
794
|
-
key: article._id ? article._id : index$1,
|
|
795
|
-
partialVisibility: true,
|
|
796
|
-
onChange: function onChange(isVisible) {
|
|
797
|
-
isVisible && changePageNumber(pageNumber, seoPaginate, pageview, router, currentPage, setCurrentPage);
|
|
798
|
-
} },
|
|
799
|
-
React__default['default'].createElement(
|
|
800
|
-
React__default['default'].Fragment,
|
|
801
|
-
null,
|
|
802
|
-
React__default['default'].createElement(
|
|
803
|
-
reactBootstrap.Media,
|
|
804
|
-
{
|
|
805
|
-
key: article._id ? article._id : index$1,
|
|
806
|
-
className: 'feature-media',
|
|
807
|
-
style: { flexDirection: 'column', marginBottom: '1.25rem', paddingBottom: '1.25rem', borderBottom: '1px solid #ddd' } },
|
|
808
|
-
(article.thumbnail && article.thumbnail.asset || defaultImage) && React__default['default'].createElement(
|
|
809
|
-
'a',
|
|
810
|
-
{ rel: 'noopener', href: article.url.current, target: '_blank', className: 'feature-wrapper' },
|
|
811
|
-
React__default['default'].createElement(
|
|
812
|
-
index.LazyLoad,
|
|
813
|
-
{ height: imageHeight, placeholder: React__default['default'].createElement(ImagePlaceholder, null) },
|
|
814
|
-
article.thumbnail && article.thumbnail.asset ? React__default['default'].createElement('img', { className: 'img-fluid', src: renderCardImage(article, client, imageHeight, imageWidth, imageMaxHeight, imageFit), alt: article.title }) : article.thumbnail ? React__default['default'].createElement('img', { src: article.thumbnail, className: 'mr-3', alt: article.title }) : React__default['default'].createElement('img', { src: defaultImage, src2: article.thumbnail, className: 'mr-3', width: '240', height: '135', alt: article.title })
|
|
815
|
-
),
|
|
816
|
-
article.source && React__default['default'].createElement(
|
|
817
|
-
'div',
|
|
818
|
-
{ className: 'content-category-label' },
|
|
819
|
-
React__default['default'].createElement(
|
|
820
|
-
'div',
|
|
821
|
-
{ className: 'mb-1 sanityDisplayLabel displayLabelThumb' },
|
|
822
|
-
article.source
|
|
823
|
-
)
|
|
824
|
-
)
|
|
825
|
-
),
|
|
826
|
-
React__default['default'].createElement(
|
|
827
|
-
reactBootstrap.Media.Body,
|
|
828
|
-
null,
|
|
829
|
-
React__default['default'].createElement(
|
|
830
|
-
'a',
|
|
831
|
-
{ rel: 'noopener', href: article.url.current, target: '_blank' },
|
|
832
|
-
article.title && React__default['default'].createElement(
|
|
833
|
-
'h4',
|
|
834
|
-
{ className: 'card-title', style: { fontWeight: '500', color: 'var(--gray-dark)', marginBottom: '.5rem' } },
|
|
835
|
-
article.title
|
|
836
|
-
)
|
|
837
|
-
),
|
|
838
|
-
showPublished && article.published && React__default['default'].createElement(
|
|
839
|
-
'p',
|
|
840
|
-
{ className: 'card-text', style: { color: 'var(--dark)', marginBottom: '.25rem' } },
|
|
841
|
-
moment.moment(article.published).format('MMMM DD, YYYY')
|
|
842
|
-
),
|
|
843
|
-
showTimeDiff && article.published && React__default['default'].createElement(
|
|
844
|
-
'p',
|
|
845
|
-
{ className: 'card-text', style: { color: '#464644', lineHeight: '1.25', fontSize: '.875rem', margin: '.25rem 0' } },
|
|
846
|
-
showTaxonomies && article.taxonomyMapping && article.taxonomyMapping.map(function (taxonomy, index) {
|
|
847
|
-
if (index > 3) {
|
|
848
|
-
return null;
|
|
849
|
-
}
|
|
850
|
-
if (index === 3) {
|
|
851
|
-
return React__default['default'].createElement(
|
|
852
|
-
React__default['default'].Fragment,
|
|
853
|
-
null,
|
|
854
|
-
React__default['default'].createElement(
|
|
855
|
-
'em',
|
|
856
|
-
{ style: { marginRight: '.5rem' } },
|
|
857
|
-
'...'
|
|
858
|
-
)
|
|
859
|
-
);
|
|
860
|
-
}
|
|
861
|
-
return React__default['default'].createElement(
|
|
862
|
-
React__default['default'].Fragment,
|
|
863
|
-
null,
|
|
864
|
-
React__default['default'].createElement(
|
|
865
|
-
'em',
|
|
866
|
-
null,
|
|
867
|
-
taxonomy.name
|
|
868
|
-
),
|
|
869
|
-
' |',
|
|
870
|
-
' '
|
|
871
|
-
);
|
|
872
|
-
}),
|
|
873
|
-
' ',
|
|
874
|
-
React__default['default'].createElement(
|
|
875
|
-
'span',
|
|
876
|
-
{ style: { display: 'inline-block' } },
|
|
877
|
-
timeDifferenceCalc(article.published)
|
|
878
|
-
)
|
|
879
|
-
),
|
|
880
|
-
showAuthor && article.authorMapping && article.authorMapping.length > 0 && React__default['default'].createElement(
|
|
881
|
-
index.LazyLoad,
|
|
882
|
-
{ height: 50 },
|
|
883
|
-
React__default['default'].createElement(AuthorComponent.AuthorComponent, { key: index$1.toString(), index: index$1, authors: article.authorMapping })
|
|
884
|
-
),
|
|
885
|
-
!article.thumbnail && !defaultImage && article.source && React__default['default'].createElement(
|
|
886
|
-
'div',
|
|
887
|
-
{ className: 'content-category-label' },
|
|
888
|
-
React__default['default'].createElement(
|
|
889
|
-
'div',
|
|
890
|
-
{ className: 'mb-1 sanityDisplayLabel displayLabelThumb' },
|
|
891
|
-
article.source
|
|
892
|
-
)
|
|
893
|
-
),
|
|
894
|
-
React__default['default'].createElement(
|
|
895
|
-
'div',
|
|
896
|
-
{ style: { display: 'flex', alignItems: 'center', justifyContent: 'flex-start' } },
|
|
897
|
-
showCategory && article.contentCategory && React__default['default'].createElement(
|
|
898
|
-
'p',
|
|
899
|
-
{
|
|
900
|
-
className: 'article-category',
|
|
901
|
-
style: {
|
|
902
|
-
background: '#3FB618',
|
|
903
|
-
color: '#ffffff',
|
|
904
|
-
marginBottom: '.25rem',
|
|
905
|
-
display: 'inline-block',
|
|
906
|
-
padding: '0 .25rem',
|
|
907
|
-
fontSize: '.8rem'
|
|
908
|
-
} },
|
|
909
|
-
getContentCategory.getContentCategory(article.contentCategory.name, contentCategoryMapping)
|
|
910
|
-
),
|
|
911
|
-
article.issueSection && article.issueSection.name && React__default['default'].createElement(
|
|
912
|
-
'p',
|
|
913
|
-
{
|
|
914
|
-
className: 'issueSection',
|
|
915
|
-
style: {
|
|
916
|
-
background: '#000000',
|
|
917
|
-
color: '#ffffff',
|
|
918
|
-
marginBottom: '.25rem',
|
|
919
|
-
marginLeft: '.25rem',
|
|
920
|
-
display: 'inline-block',
|
|
921
|
-
padding: '0 .25rem',
|
|
922
|
-
fontSize: '.8rem'
|
|
923
|
-
} },
|
|
924
|
-
article.issueSection.name
|
|
925
|
-
)
|
|
926
|
-
),
|
|
927
|
-
showPubInfo && (article.issue || article.volume) && React__default['default'].createElement(
|
|
928
|
-
'div',
|
|
929
|
-
{ className: 'pubInfo' },
|
|
930
|
-
article.volume && React__default['default'].createElement(
|
|
931
|
-
'p',
|
|
932
|
-
{ className: 'qdeVolume' },
|
|
933
|
-
article.volume
|
|
934
|
-
),
|
|
935
|
-
article.issue && React__default['default'].createElement(
|
|
936
|
-
'p',
|
|
937
|
-
{ className: 'qdeIssue' },
|
|
938
|
-
article.issue
|
|
939
|
-
)
|
|
940
|
-
),
|
|
941
|
-
showIntro && article.summary && React__default['default'].createElement(
|
|
942
|
-
'p',
|
|
943
|
-
{ className: 'pt-2 card-text' },
|
|
944
|
-
entities.clean_html_1(article.summary)
|
|
945
|
-
)
|
|
946
|
-
)
|
|
947
|
-
)
|
|
948
|
-
)
|
|
949
|
-
);
|
|
950
|
-
} else {
|
|
951
|
-
return React__default['default'].createElement(
|
|
952
|
-
visibilitySensor.VisibilitySensor,
|
|
953
|
-
{
|
|
954
|
-
key: article._id ? article._id : index$1,
|
|
955
|
-
partialVisibility: true,
|
|
956
|
-
onChange: function onChange(isVisible) {
|
|
957
|
-
isVisible && changePageNumber(pageNumber, seoPaginate, pageview, router, currentPage, setCurrentPage);
|
|
958
|
-
} },
|
|
959
|
-
React__default['default'].createElement(
|
|
960
|
-
React__default['default'].Fragment,
|
|
961
|
-
null,
|
|
962
|
-
React__default['default'].createElement(
|
|
963
|
-
reactBootstrap.Media,
|
|
964
|
-
{
|
|
965
|
-
key: article._id ? article._id : index$1,
|
|
966
|
-
className: 'feature-media',
|
|
967
|
-
style: { flexDirection: 'column', marginBottom: '1.25rem', paddingBottom: '1.25rem', borderBottom: '1px solid #ddd' } },
|
|
968
|
-
(article.thumbnail && article.thumbnail.asset || defaultImage) && React__default['default'].createElement(
|
|
969
|
-
'a',
|
|
970
|
-
{ href: article.url.current, className: 'feature-wrapper' },
|
|
971
|
-
React__default['default'].createElement(
|
|
972
|
-
index.LazyLoad,
|
|
973
|
-
{ height: imageHeight, placeholder: React__default['default'].createElement(ImagePlaceholder, null) },
|
|
974
|
-
article.thumbnail && article.thumbnail.asset ? React__default['default'].createElement('img', { className: 'img-fluid', src: renderCardImage(article, client, imageHeight, imageWidth, imageMaxHeight, imageFit), alt: article.title }) : article.thumbnail ? React__default['default'].createElement('img', { src: article.thumbnail, className: 'mr-3', alt: article.title }) : React__default['default'].createElement('img', { src: defaultImage, src2: article.thumbnail, className: 'mr-3', width: '240', height: '135', alt: article.title })
|
|
975
|
-
),
|
|
976
|
-
article.source && React__default['default'].createElement(
|
|
977
|
-
'div',
|
|
978
|
-
{ className: 'content-category-label' },
|
|
979
|
-
React__default['default'].createElement(
|
|
980
|
-
'div',
|
|
981
|
-
{ className: 'mb-1 sanityDisplayLabel displayLabelThumb' },
|
|
982
|
-
article.source
|
|
983
|
-
)
|
|
984
|
-
)
|
|
985
|
-
),
|
|
986
|
-
React__default['default'].createElement(
|
|
987
|
-
reactBootstrap.Media.Body,
|
|
988
|
-
null,
|
|
989
|
-
React__default['default'].createElement(
|
|
990
|
-
'a',
|
|
991
|
-
{ href: article.url.current },
|
|
992
|
-
article.title && React__default['default'].createElement(
|
|
993
|
-
'h4',
|
|
994
|
-
{ className: 'card-title', style: { fontWeight: '500', color: 'var(--gray-dark)', marginBottom: '.5rem' } },
|
|
995
|
-
article.title
|
|
996
|
-
)
|
|
997
|
-
),
|
|
998
|
-
showPublished && article.published && React__default['default'].createElement(
|
|
999
|
-
'p',
|
|
1000
|
-
{ className: 'card-text', style: { color: 'var(--dark)', marginBottom: '.25rem' } },
|
|
1001
|
-
moment.moment(article.published).format('MMMM DD, YYYY')
|
|
1002
|
-
),
|
|
1003
|
-
showTimeDiff && article.published && React__default['default'].createElement(
|
|
1004
|
-
'p',
|
|
1005
|
-
{ className: 'card-text', style: { color: '#464644', lineHeight: '1.25', fontSize: '.875rem', margin: '.25rem 0' } },
|
|
1006
|
-
showTaxonomies && article.taxonomyMapping && article.taxonomyMapping.map(function (taxonomy, index) {
|
|
1007
|
-
if (index > 3) {
|
|
1008
|
-
return null;
|
|
1009
|
-
}
|
|
1010
|
-
if (index === 3) {
|
|
1011
|
-
return React__default['default'].createElement(
|
|
1012
|
-
React__default['default'].Fragment,
|
|
1013
|
-
null,
|
|
1014
|
-
React__default['default'].createElement(
|
|
1015
|
-
'em',
|
|
1016
|
-
{ style: { marginRight: '.5rem' } },
|
|
1017
|
-
'...'
|
|
1018
|
-
)
|
|
1019
|
-
);
|
|
1020
|
-
}
|
|
1021
|
-
return React__default['default'].createElement(
|
|
1022
|
-
React__default['default'].Fragment,
|
|
1023
|
-
null,
|
|
1024
|
-
React__default['default'].createElement(
|
|
1025
|
-
'em',
|
|
1026
|
-
null,
|
|
1027
|
-
taxonomy.name
|
|
1028
|
-
),
|
|
1029
|
-
' |',
|
|
1030
|
-
' '
|
|
1031
|
-
);
|
|
1032
|
-
}),
|
|
1033
|
-
' ',
|
|
1034
|
-
React__default['default'].createElement(
|
|
1035
|
-
'span',
|
|
1036
|
-
{ style: { display: 'inline-block' } },
|
|
1037
|
-
timeDifferenceCalc(article.published)
|
|
1038
|
-
)
|
|
1039
|
-
),
|
|
1040
|
-
showAuthor && article.authorMapping && article.authorMapping.length > 0 && React__default['default'].createElement(
|
|
1041
|
-
index.LazyLoad,
|
|
1042
|
-
{ height: 50 },
|
|
1043
|
-
React__default['default'].createElement(AuthorComponent.AuthorComponent, { key: index$1.toString(), index: index$1, authors: article.authorMapping })
|
|
1044
|
-
),
|
|
1045
|
-
!article.thumbnail && !defaultImage && article.source && React__default['default'].createElement(
|
|
1046
|
-
'div',
|
|
1047
|
-
{ className: 'content-category-label' },
|
|
1048
|
-
React__default['default'].createElement(
|
|
1049
|
-
'div',
|
|
1050
|
-
{ className: 'mb-1 sanityDisplayLabel displayLabelThumb' },
|
|
1051
|
-
article.source
|
|
1052
|
-
)
|
|
1053
|
-
),
|
|
1054
|
-
React__default['default'].createElement(
|
|
1055
|
-
'div',
|
|
1056
|
-
{ style: { display: 'flex', alignItems: 'center', justifyContent: 'flex-start' } },
|
|
1057
|
-
showCategory && article.contentCategory && React__default['default'].createElement(
|
|
1058
|
-
'p',
|
|
1059
|
-
{
|
|
1060
|
-
className: 'article-category',
|
|
1061
|
-
style: {
|
|
1062
|
-
background: '#3FB618',
|
|
1063
|
-
color: '#ffffff',
|
|
1064
|
-
marginBottom: '.25rem',
|
|
1065
|
-
display: 'inline-block',
|
|
1066
|
-
padding: '0 .25rem',
|
|
1067
|
-
fontSize: '.8rem'
|
|
1068
|
-
} },
|
|
1069
|
-
getContentCategory.getContentCategory(article.contentCategory.name, contentCategoryMapping)
|
|
1070
|
-
),
|
|
1071
|
-
article.issueSection && article.issueSection.name && React__default['default'].createElement(
|
|
1072
|
-
'p',
|
|
1073
|
-
{
|
|
1074
|
-
className: 'issueSection',
|
|
1075
|
-
style: {
|
|
1076
|
-
background: '#000000',
|
|
1077
|
-
color: '#ffffff',
|
|
1078
|
-
marginBottom: '.25rem',
|
|
1079
|
-
marginLeft: '.25rem',
|
|
1080
|
-
display: 'inline-block',
|
|
1081
|
-
padding: '0 .25rem',
|
|
1082
|
-
fontSize: '.8rem'
|
|
1083
|
-
} },
|
|
1084
|
-
article.issueSection.name
|
|
1085
|
-
)
|
|
1086
|
-
),
|
|
1087
|
-
showPubInfo && (article.issue || article.volume) && React__default['default'].createElement(
|
|
1088
|
-
'div',
|
|
1089
|
-
{ className: 'pubInfo' },
|
|
1090
|
-
article.volume && React__default['default'].createElement(
|
|
1091
|
-
'p',
|
|
1092
|
-
{ className: 'qdeVolume' },
|
|
1093
|
-
article.volume
|
|
1094
|
-
),
|
|
1095
|
-
article.issue && React__default['default'].createElement(
|
|
1096
|
-
'p',
|
|
1097
|
-
{ className: 'qdeIssue' },
|
|
1098
|
-
article.issue
|
|
1099
|
-
)
|
|
1100
|
-
),
|
|
1101
|
-
showIntro && article.summary && React__default['default'].createElement(
|
|
1102
|
-
'p',
|
|
1103
|
-
{ className: 'pt-2 card-text' },
|
|
1104
|
-
entities.clean_html_1(article.summary)
|
|
1105
|
-
)
|
|
1106
|
-
)
|
|
1107
|
-
)
|
|
1108
|
-
)
|
|
1109
|
-
);
|
|
1110
|
-
}
|
|
1111
|
-
} else if (article._type === 'lg-infeed' && article.adUnit) {
|
|
1112
|
-
return React__default['default'].createElement(ADlgInfeed.ADlgInfeed, _extends._extends({ index: index$1 }, article));
|
|
1113
|
-
} else if (article._type === 'brandInsightAd' && article.adUnit) {
|
|
1114
|
-
return React__default['default'].createElement(ADInfeed.ADInfeed, { index: index$1, infeedAd: article });
|
|
1115
|
-
}
|
|
1116
|
-
if ((brandInsightAd ? index$1 > heroContent + featureCount : index$1 + 1 > heroContent + featureCount) && (!article._type || !['lg-infeed', 'brandInsightAd'].includes(article._type))) {
|
|
1117
|
-
return React__default['default'].createElement(
|
|
1118
|
-
visibilitySensor.VisibilitySensor,
|
|
1119
|
-
{
|
|
1120
|
-
key: article._id ? article._id : index$1,
|
|
1121
|
-
onChange: function onChange(isVisible) {
|
|
1122
|
-
// Passing 'articleCount' instead of index because index will be including the indexes of ads whereas articleCount will be having index of artilce only.
|
|
1123
|
-
isVisible && changePageNumber(pageNumber, seoPaginate, pageview, router, currentPage, setCurrentPage, itemsPerPage, article.articleCount ? article.articleCount : index$1);
|
|
1124
|
-
} },
|
|
1125
|
-
React__default['default'].createElement(
|
|
1126
|
-
React__default['default'].Fragment,
|
|
1127
|
-
null,
|
|
1128
|
-
React__default['default'].createElement(
|
|
1129
|
-
reactBootstrap.Media,
|
|
1130
|
-
{
|
|
1131
|
-
key: article._id ? article._id : index$1,
|
|
1132
|
-
style: { flexDirection: 'row', marginBottom: '1.25rem', paddingBottom: '1.25rem', borderBottom: '1px solid #ddd' } },
|
|
1133
|
-
(article.thumbnail && article.thumbnail.asset || defaultImage) && React__default['default'].createElement(
|
|
1134
|
-
'a',
|
|
1135
|
-
{ href: mapping[contentCategoryName] + '/' + article.url.current, className: 'img-wrapper' },
|
|
1136
|
-
React__default['default'].createElement(
|
|
1137
|
-
index.LazyLoad,
|
|
1138
|
-
{ height: imageHeight, placeholder: React__default['default'].createElement(ImagePlaceholder, null) },
|
|
1139
|
-
article.thumbnail && article.thumbnail.asset ? React__default['default'].createElement('img', { className: 'mr-3 img-fluid', src: renderCardImage(article, client, imageHeight, imageWidth, imageMaxHeight, imageFit), alt: article.title }) : article.thumbnail ? React__default['default'].createElement('img', { src: article.thumbnail, className: 'mr-3', alt: article.title }) : React__default['default'].createElement('img', { src: defaultImage, src2: article.thumbnail, className: 'mr-3', width: '240', height: '135', alt: article.title })
|
|
1140
|
-
),
|
|
1141
|
-
article.source && React__default['default'].createElement(
|
|
1142
|
-
'div',
|
|
1143
|
-
{ className: 'content-category-label' },
|
|
1144
|
-
React__default['default'].createElement(
|
|
1145
|
-
'div',
|
|
1146
|
-
{ className: 'mb-1 sanityDisplayLabel displayLabelThumb' },
|
|
1147
|
-
article.source
|
|
1148
|
-
)
|
|
1149
|
-
)
|
|
1150
|
-
),
|
|
1151
|
-
React__default['default'].createElement(
|
|
1152
|
-
reactBootstrap.Media.Body,
|
|
1153
|
-
null,
|
|
1154
|
-
React__default['default'].createElement(
|
|
1155
|
-
'a',
|
|
1156
|
-
{ href: mapping[contentCategoryName] + '/' + article.url.current },
|
|
1157
|
-
article.title && React__default['default'].createElement(
|
|
1158
|
-
'h4',
|
|
1159
|
-
{ className: 'card-title', style: { fontWeight: '500', color: 'var(--gray-dark)', marginBottom: '.5rem' } },
|
|
1160
|
-
article.title
|
|
1161
|
-
)
|
|
1162
|
-
),
|
|
1163
|
-
showPublished && article.published && React__default['default'].createElement(
|
|
1164
|
-
'p',
|
|
1165
|
-
{ className: 'card-text', style: { color: 'var(--dark)', marginBottom: '.25rem' } },
|
|
1166
|
-
moment.moment(article.published).format('MMMM DD, YYYY')
|
|
1167
|
-
),
|
|
1168
|
-
showTimeDiff && article.published && React__default['default'].createElement(
|
|
1169
|
-
'p',
|
|
1170
|
-
{ className: 'card-text', style: { color: '#464644', lineHeight: '1.25', fontSize: '.875rem', margin: '.25rem 0' } },
|
|
1171
|
-
showTaxonomies && article.taxonomyMapping && article.taxonomyMapping.map(function (taxonomy, index) {
|
|
1172
|
-
if (index > 3) {
|
|
1173
|
-
return null;
|
|
1174
|
-
}
|
|
1175
|
-
if (index === 3) {
|
|
1176
|
-
return React__default['default'].createElement(
|
|
1177
|
-
React__default['default'].Fragment,
|
|
1178
|
-
null,
|
|
1179
|
-
React__default['default'].createElement(
|
|
1180
|
-
'em',
|
|
1181
|
-
{ style: { marginRight: '.5rem' } },
|
|
1182
|
-
'...'
|
|
1183
|
-
)
|
|
1184
|
-
);
|
|
1185
|
-
}
|
|
1186
|
-
return React__default['default'].createElement(
|
|
1187
|
-
React__default['default'].Fragment,
|
|
1188
|
-
null,
|
|
1189
|
-
React__default['default'].createElement(
|
|
1190
|
-
'em',
|
|
1191
|
-
null,
|
|
1192
|
-
taxonomy.name
|
|
1193
|
-
),
|
|
1194
|
-
' |',
|
|
1195
|
-
' '
|
|
1196
|
-
);
|
|
1197
|
-
}),
|
|
1198
|
-
' ',
|
|
1199
|
-
React__default['default'].createElement(
|
|
1200
|
-
'span',
|
|
1201
|
-
{ style: { display: 'inline-block' } },
|
|
1202
|
-
timeDifferenceCalc(article.published)
|
|
1203
|
-
)
|
|
1204
|
-
),
|
|
1205
|
-
React__default['default'].createElement(
|
|
1206
|
-
'div',
|
|
1207
|
-
{ className: 'author-sec', style: { lineHeight: 1.5 } },
|
|
1208
|
-
showAuthor && article.authorMapping && article.authorMapping.length > 0 && React__default['default'].createElement(
|
|
1209
|
-
index.LazyLoad,
|
|
1210
|
-
{ height: 50 },
|
|
1211
|
-
React__default['default'].createElement(AuthorComponent.AuthorComponent, { key: index$1.toString(), index: index$1, authors: article.authorMapping })
|
|
1212
|
-
)
|
|
1213
|
-
),
|
|
1214
|
-
!article.thumbnail && !defaultImage && article.source && React__default['default'].createElement(
|
|
1215
|
-
'div',
|
|
1216
|
-
{ className: 'content-category-label' },
|
|
1217
|
-
React__default['default'].createElement(
|
|
1218
|
-
'div',
|
|
1219
|
-
{ className: 'mb-1 sanityDisplayLabel displayLabelThumb' },
|
|
1220
|
-
article.source
|
|
1221
|
-
)
|
|
1222
|
-
),
|
|
1223
|
-
React__default['default'].createElement(
|
|
1224
|
-
'div',
|
|
1225
|
-
{ style: { display: 'flex', alignItems: 'center', justifyContent: 'flex-start' } },
|
|
1226
|
-
showCategory && article.contentCategory && React__default['default'].createElement(
|
|
1227
|
-
'p',
|
|
1228
|
-
{
|
|
1229
|
-
className: 'article-category',
|
|
1230
|
-
style: {
|
|
1231
|
-
background: '#3FB618',
|
|
1232
|
-
color: '#ffffff',
|
|
1233
|
-
marginBottom: '.25rem',
|
|
1234
|
-
display: 'inline-block',
|
|
1235
|
-
padding: '0 .25rem',
|
|
1236
|
-
fontSize: '.8rem'
|
|
1237
|
-
} },
|
|
1238
|
-
getContentCategory.getContentCategory(article.contentCategory.name, contentCategoryMapping)
|
|
1239
|
-
),
|
|
1240
|
-
article.issueSection && article.issueSection.name && React__default['default'].createElement(
|
|
1241
|
-
'p',
|
|
1242
|
-
{
|
|
1243
|
-
className: 'issueSection',
|
|
1244
|
-
style: {
|
|
1245
|
-
background: '#000000',
|
|
1246
|
-
color: '#ffffff',
|
|
1247
|
-
marginBottom: '.25rem',
|
|
1248
|
-
marginLeft: '.25rem',
|
|
1249
|
-
display: 'inline-block',
|
|
1250
|
-
padding: '0 .25rem',
|
|
1251
|
-
fontSize: '.8rem'
|
|
1252
|
-
} },
|
|
1253
|
-
article.issueSection.name
|
|
1254
|
-
)
|
|
1255
|
-
),
|
|
1256
|
-
showPubInfo && (article.issue || article.volume) && React__default['default'].createElement(
|
|
1257
|
-
'div',
|
|
1258
|
-
{ className: 'pubInfo' },
|
|
1259
|
-
article.volume && React__default['default'].createElement(
|
|
1260
|
-
'p',
|
|
1261
|
-
{ className: 'qdeVolume' },
|
|
1262
|
-
article.volume
|
|
1263
|
-
),
|
|
1264
|
-
article.issue && React__default['default'].createElement(
|
|
1265
|
-
'p',
|
|
1266
|
-
{ className: 'qdeIssue' },
|
|
1267
|
-
article.issue
|
|
1268
|
-
)
|
|
1269
|
-
),
|
|
1270
|
-
showIntro && article.summary && React__default['default'].createElement(
|
|
1271
|
-
'p',
|
|
1272
|
-
{ className: 'pt-2 card-text' },
|
|
1273
|
-
entities.clean_html_1(article.summary)
|
|
1274
|
-
)
|
|
1275
|
-
)
|
|
1276
|
-
),
|
|
1277
|
-
React__default['default'].createElement(
|
|
1278
|
-
'div',
|
|
1279
|
-
null,
|
|
1280
|
-
main.main_43 && rightItems && (index$1 + 1) % numberOfItemsBeforeAd === 0 && renderMobileAd(index$1, numberOfItemsBeforeAd, rightItems)
|
|
1281
|
-
)
|
|
2286
|
+
main.main_36 && rightItems && (index + 1) % numberOfItemsBeforeAd === 0 && renderMobileAd(index, numberOfItemsBeforeAd, rightItems)
|
|
1282
2287
|
)
|
|
1283
2288
|
);
|
|
1284
2289
|
} else return null;
|
|
1285
2290
|
})
|
|
1286
|
-
) : React__default
|
|
2291
|
+
) : React__default.createElement(
|
|
1287
2292
|
'div',
|
|
1288
2293
|
null,
|
|
1289
|
-
React__default
|
|
2294
|
+
React__default.createElement(
|
|
1290
2295
|
'h5',
|
|
1291
2296
|
null,
|
|
1292
|
-
React__default
|
|
2297
|
+
React__default.createElement(
|
|
1293
2298
|
'em',
|
|
1294
2299
|
null,
|
|
1295
2300
|
'New content coming soon, please check back later.'
|
|
1296
2301
|
)
|
|
1297
2302
|
)
|
|
1298
2303
|
),
|
|
1299
|
-
React__default
|
|
2304
|
+
React__default.createElement(
|
|
1300
2305
|
'style',
|
|
1301
2306
|
{ jsx: 'true' },
|
|
1302
2307
|
'\n .displayLabelThumb {\n margin: 0 auto;\n margin-top: -1.25rem;\n background-color: white;\n position: relative;\n }\n .content-category-label {\n margin: 0.5rem 0;\n display: block;\n }\n .sanityDisplayLabel {\n margin: 0.5rem 0;\n border: 1px solid black;\n width: fit-content;\n width: -moz-fit-content;\n padding: 5px;\n color: #484848;\n border-radius: 2px;\n }\n .feature-media > .media-body {\n -webkit-box-flex: none;\n -ms-flex: none;\n flex: none;\n }\n .img-wrapper img {\n max-height: 240px;\n height: auto;\n width: 100%;\n object-fit: contain;\n }\n .feature-wrapper {\n height: 100%;\n width: 100%;\n }\n .feature-wrapper img {\n width: 100%;\n margin-bottom: 1em;\n }\n @media only screen and (min-width: 768px) {\n .img-wrapper > img {\n padding-right: 1em;\n }\n }\n @media only screen and (max-width: 767px) {\n .sanityDisplayLabel {\n max-width: 100%;\n }\n .img-wrapper {\n width: 100%;\n }\n .img-wrapper img {\n padding-bottom: 1em;\n }\n .media {\n flex-direction: column !important;\n }\n }\n '
|
|
@@ -1305,11 +2310,11 @@ var cardLoader = function cardLoader(data, client, mapping, values, seoPaginate,
|
|
|
1305
2310
|
};
|
|
1306
2311
|
|
|
1307
2312
|
var ImagePlaceholder = function ImagePlaceholder() {
|
|
1308
|
-
return React__default
|
|
1309
|
-
React__default
|
|
2313
|
+
return React__default.createElement(
|
|
2314
|
+
React__default.Fragment,
|
|
1310
2315
|
null,
|
|
1311
|
-
React__default
|
|
1312
|
-
React__default
|
|
2316
|
+
React__default.createElement('div', { className: 'queuedeck-exp-image-placeholder' }),
|
|
2317
|
+
React__default.createElement(
|
|
1313
2318
|
'style',
|
|
1314
2319
|
{ jsx: 'true' },
|
|
1315
2320
|
'\n .queuedeck-exp-image-placeholder {\n width: 240px;\n height: 0;\n padding-top: calc(240px * 9 / 16);\n margin: 0 1rem 0 0;\n }\n @media only screen and (max-width: 767px) {\n .queuedeck-exp-image-placeholder {\n width: 100%;\n height: 0;\n padding-top: calc(100% * 9 / 16);\n margin: 0 0 1rem 0;\n }\n }\n '
|
|
@@ -1319,7 +2324,7 @@ var ImagePlaceholder = function ImagePlaceholder() {
|
|
|
1319
2324
|
|
|
1320
2325
|
var renderMobileAd = function renderMobileAd(index, numberOfItemsBeforeAd, rightItems) {
|
|
1321
2326
|
var i = ((index + 1) / numberOfItemsBeforeAd - 1) % rightItems.length;
|
|
1322
|
-
return React__default
|
|
2327
|
+
return React__default.createElement(
|
|
1323
2328
|
'div',
|
|
1324
2329
|
{ style: { display: 'flex', flex: '1 0 auto' } },
|
|
1325
2330
|
rightItems[i].component
|
|
@@ -1334,6 +2339,46 @@ var usePrevious = function usePrevious(value) {
|
|
|
1334
2339
|
return ref.current;
|
|
1335
2340
|
};
|
|
1336
2341
|
|
|
2342
|
+
var Pagination = function Pagination(_ref2) {
|
|
2343
|
+
var totalPostsCount = _ref2.totalPostsCount,
|
|
2344
|
+
itemsPerPage = _ref2.itemsPerPage,
|
|
2345
|
+
currentPage = _ref2.currentPage,
|
|
2346
|
+
handlePageChange = _ref2.handlePageChange,
|
|
2347
|
+
dataLength = _ref2.dataLength;
|
|
2348
|
+
|
|
2349
|
+
var pageCount = Math.ceil(totalPostsCount / itemsPerPage);
|
|
2350
|
+
return React__default.createElement(
|
|
2351
|
+
'div',
|
|
2352
|
+
null,
|
|
2353
|
+
React__default.createElement(ReactPaginate, {
|
|
2354
|
+
pageCount: pageCount,
|
|
2355
|
+
marginPagesDisplayed: 1,
|
|
2356
|
+
pageRangeDisplayed: main.main_36 ? 3 : 9,
|
|
2357
|
+
initialPage: currentPage - 1,
|
|
2358
|
+
disableInitialCallback: true,
|
|
2359
|
+
onPageChange: function onPageChange(_ref3) {
|
|
2360
|
+
var selected = _ref3.selected;
|
|
2361
|
+
return handlePageChange(selected + 1);
|
|
2362
|
+
},
|
|
2363
|
+
hrefBuilder: function hrefBuilder(page) {
|
|
2364
|
+
return page === 1 ? '/' : '?page=' + page;
|
|
2365
|
+
},
|
|
2366
|
+
previousLabel: '<',
|
|
2367
|
+
nextLabel: '>',
|
|
2368
|
+
containerClassName: 'pagination-container',
|
|
2369
|
+
previousLinkClassName: 'previous',
|
|
2370
|
+
nextLinkClassName: 'next',
|
|
2371
|
+
disabledClassName: 'disbaled',
|
|
2372
|
+
activeClassName: 'active'
|
|
2373
|
+
}),
|
|
2374
|
+
React__default.createElement(
|
|
2375
|
+
'style',
|
|
2376
|
+
{ jsx: 'true' },
|
|
2377
|
+
'\n .pagination-container {\n list-style: none;\n display: flex;\n justify-content: center;\n margin: 3rem 0 3rem 0;\n padding-left: 0;\n }\n .pagination-container a {\n padding: 10px;\n border: 1px solid #dee2e6;\n }\n .pagination-container a:hover {\n text-decoration: none;\n background-color: #e9ecef;\n border-color: #dee2e6;\n }\n .pagination-container .active a {\n color: #fff;\n background-color: var(--primary);\n border-color: #007bff;\n }\n .pagination-container .previous a {\n border-radius: 5px 0 0 5px;\n }\n .pagination-container .next a {\n border-radius: 0 5px 5px 0;\n }\n @media only screen and (max-width: 768px) {\n .pagination-container {\n margin-bottom: 6rem;\n }\n }\n '
|
|
2378
|
+
)
|
|
2379
|
+
);
|
|
2380
|
+
};
|
|
2381
|
+
|
|
1337
2382
|
var QueueDeckExpanded = function QueueDeckExpanded(props) {
|
|
1338
2383
|
var router = Router.useRouter();
|
|
1339
2384
|
|
|
@@ -1349,15 +2394,12 @@ var QueueDeckExpanded = function QueueDeckExpanded(props) {
|
|
|
1349
2394
|
}, [router]);
|
|
1350
2395
|
|
|
1351
2396
|
var initialData = props.dataRecord,
|
|
2397
|
+
initialCurrentPage = props.currentPage,
|
|
1352
2398
|
client = props.client,
|
|
1353
2399
|
params = props.params,
|
|
1354
2400
|
query = props.query,
|
|
1355
|
-
autoScroll = props.autoScroll,
|
|
1356
|
-
pointer = props.pointer,
|
|
1357
|
-
pointerArray = props.pointerArray,
|
|
1358
2401
|
mapping = props.mapping,
|
|
1359
2402
|
seoPaginate = props.seoPaginate,
|
|
1360
|
-
pageview = props.pageview,
|
|
1361
2403
|
defaultImage = props.defaultImage,
|
|
1362
2404
|
showAuthor = props.showAuthor,
|
|
1363
2405
|
showCategory = props.showCategory,
|
|
@@ -1382,160 +2424,123 @@ var QueueDeckExpanded = function QueueDeckExpanded(props) {
|
|
|
1382
2424
|
_props$showIntro = props.showIntro,
|
|
1383
2425
|
showIntro = _props$showIntro === undefined ? true : _props$showIntro,
|
|
1384
2426
|
_props$contentCategor = props.contentCategoryMapping,
|
|
1385
|
-
contentCategoryMapping = _props$contentCategor === undefined ? [] : _props$contentCategor
|
|
1386
|
-
var initialCurrentPage = props.currentPage,
|
|
2427
|
+
contentCategoryMapping = _props$contentCategor === undefined ? [] : _props$contentCategor,
|
|
1387
2428
|
showPublished = props.showPublished;
|
|
1388
2429
|
|
|
1389
|
-
var _useState3 = React.useState(
|
|
2430
|
+
var _useState3 = React.useState(initialCurrentPage || 1),
|
|
1390
2431
|
_useState4 = slicedToArray._slicedToArray(_useState3, 2),
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
var _useState5 = React.useState(true),
|
|
1395
|
-
_useState6 = slicedToArray._slicedToArray(_useState5, 2),
|
|
1396
|
-
scrolling = _useState6[0],
|
|
1397
|
-
setScrolling = _useState6[1];
|
|
1398
|
-
|
|
1399
|
-
var _useState7 = React.useState(initialCurrentPage || 1),
|
|
1400
|
-
_useState8 = slicedToArray._slicedToArray(_useState7, 2),
|
|
1401
|
-
currentPage = _useState8[0],
|
|
1402
|
-
setCurrentPage = _useState8[1];
|
|
1403
|
-
|
|
1404
|
-
var _useState9 = React.useState(initialData ? initialData.length : 0),
|
|
1405
|
-
_useState10 = slicedToArray._slicedToArray(_useState9, 2),
|
|
1406
|
-
lastDataSize = _useState10[0],
|
|
1407
|
-
setLastDataSize = _useState10[1];
|
|
1408
|
-
|
|
1409
|
-
var _useState11 = React.useState({
|
|
1410
|
-
from: params ? params.from : 0,
|
|
1411
|
-
to: params ? params.to : 0,
|
|
1412
|
-
page: initialCurrentPage ? initialCurrentPage : 1
|
|
1413
|
-
}),
|
|
1414
|
-
_useState12 = slicedToArray._slicedToArray(_useState11, 2),
|
|
1415
|
-
values = _useState12[0],
|
|
1416
|
-
setValues = _useState12[1];
|
|
1417
|
-
|
|
1418
|
-
var itemsPerPage = params && params.itemsPerPage ? params.itemsPerPage : 10;
|
|
1419
|
-
|
|
1420
|
-
var prevValues = usePrevious(values);
|
|
1421
|
-
|
|
1422
|
-
var renderManualPagination = function renderManualPagination(currentPage) {
|
|
1423
|
-
if (lastDataSize < itemsPerPage) {
|
|
1424
|
-
return null;
|
|
1425
|
-
}
|
|
2432
|
+
currentPage = _useState4[0],
|
|
2433
|
+
setCurrentPage = _useState4[1];
|
|
1426
2434
|
|
|
1427
|
-
|
|
1428
|
-
'div',
|
|
1429
|
-
{ className: 'd-flex justify-content-between' },
|
|
1430
|
-
currentPage && currentPage > 1 && React__default['default'].createElement(
|
|
1431
|
-
'a',
|
|
1432
|
-
{ href: '?page=' + (currentPage - 1) },
|
|
1433
|
-
'<< Previous'
|
|
1434
|
-
),
|
|
1435
|
-
React__default['default'].createElement(
|
|
1436
|
-
'a',
|
|
1437
|
-
{ href: '?page=' + (currentPage + 1) },
|
|
1438
|
-
'Next >>'
|
|
1439
|
-
)
|
|
1440
|
-
);
|
|
1441
|
-
};
|
|
2435
|
+
var itemsPerPage = params && params.itemsPerPage ? params.itemsPerPage : params && params.from && params.to ? params.to - params.from : 10;
|
|
1442
2436
|
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
}, [initialData]);
|
|
2437
|
+
var fetcher = function () {
|
|
2438
|
+
var _ref4 = asyncToGenerator._asyncToGenerator( /*#__PURE__*/asyncToGenerator.regenerator.mark(function _callee(currentPage) {
|
|
2439
|
+
var start, params;
|
|
2440
|
+
return asyncToGenerator.regenerator.wrap(function _callee$(_context) {
|
|
2441
|
+
while (1) {
|
|
2442
|
+
switch (_context.prev = _context.next) {
|
|
2443
|
+
case 0:
|
|
2444
|
+
start = (currentPage - 1) * itemsPerPage;
|
|
2445
|
+
params = _extends._extends({}, params, {
|
|
2446
|
+
from: start,
|
|
2447
|
+
to: start + itemsPerPage
|
|
2448
|
+
});
|
|
2449
|
+
_context.next = 4;
|
|
2450
|
+
return client.fetch(query, params);
|
|
1458
2451
|
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
if (values.page !== prevValues.page && values.from !== prevValues.from && values.to !== prevValues.to) {
|
|
1462
|
-
loadData(values, query, client, params, setData, setScrolling, setLastDataSize, pointer, pointerArray);
|
|
1463
|
-
}
|
|
1464
|
-
}
|
|
1465
|
-
}, [values, prevValues, query, client, params, setData, setScrolling, setLastDataSize, pointer, pointerArray]);
|
|
2452
|
+
case 4:
|
|
2453
|
+
return _context.abrupt('return', _context.sent);
|
|
1466
2454
|
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
2455
|
+
case 5:
|
|
2456
|
+
case 'end':
|
|
2457
|
+
return _context.stop();
|
|
2458
|
+
}
|
|
2459
|
+
}
|
|
2460
|
+
}, _callee, _this);
|
|
2461
|
+
}));
|
|
1473
2462
|
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
2463
|
+
return function fetcher(_x5) {
|
|
2464
|
+
return _ref4.apply(this, arguments);
|
|
2465
|
+
};
|
|
2466
|
+
}();
|
|
2467
|
+
|
|
2468
|
+
var onLoadDataSuccess = function onLoadDataSuccess() {
|
|
2469
|
+
document.body.scrollTop = 0;
|
|
2470
|
+
document.documentElement.scrollTop = 0;
|
|
2471
|
+
seoPaginate && seoPagination(currentPage);
|
|
2472
|
+
index.lib_3.refresh();
|
|
2473
|
+
};
|
|
2474
|
+
|
|
2475
|
+
var _useSWR = useSWR([currentPage], fetcher, { initialData: initialData, onSuccess: onLoadDataSuccess }),
|
|
2476
|
+
data = _useSWR.data;
|
|
2477
|
+
|
|
2478
|
+
var handlePageChange = function handlePageChange(selectedPage) {
|
|
2479
|
+
setCurrentPage(selectedPage);
|
|
2480
|
+
};
|
|
2481
|
+
|
|
2482
|
+
var seoPagination = function seoPagination(pageNumber) {
|
|
2483
|
+
var path = router.asPath;
|
|
2484
|
+
var qrIndex = path.indexOf('?');
|
|
2485
|
+
var pathname = router.pathname;
|
|
2486
|
+
var queryString = '';
|
|
2487
|
+
if (qrIndex > 0) {
|
|
2488
|
+
path = path.substring(1, qrIndex);
|
|
2489
|
+
var partialQS = router.asPath.substring(qrIndex + 1);
|
|
2490
|
+
var partialQSArr = partialQS.split('&');
|
|
2491
|
+
// exclude page=xxx from query string
|
|
2492
|
+
partialQSArr.map(function (item) {
|
|
2493
|
+
var itemArr = item.split('=');
|
|
2494
|
+
var key = itemArr[0];
|
|
2495
|
+
var val = itemArr[1];
|
|
2496
|
+
if (key !== 'page') queryString += (queryString.length === 0 ? '' : '&') + key + '=' + val;
|
|
2497
|
+
});
|
|
2498
|
+
}
|
|
2499
|
+
if (queryString.length > 0) path += '?' + queryString;
|
|
2500
|
+
pageNumber = parseInt(pageNumber);
|
|
2501
|
+
if (path[0] !== '/') path = '/' + path;
|
|
2502
|
+
var newPath = pageNumber === 1 ? '' + path : '' + path + (queryString.length > 0 ? '&' : '?') + 'page=' + pageNumber;
|
|
2503
|
+
router.push(pathname, newPath, {
|
|
2504
|
+
shallow: true
|
|
2505
|
+
});
|
|
2506
|
+
};
|
|
1481
2507
|
|
|
1482
|
-
return React__default
|
|
2508
|
+
return React__default.createElement(
|
|
1483
2509
|
'div',
|
|
1484
2510
|
null,
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
null,
|
|
1488
|
-
React__default['default'].createElement(
|
|
1489
|
-
index_es.InfiniteScroll,
|
|
1490
|
-
{ dataLength: data && data.length, next: function next() {
|
|
1491
|
-
return loadMore(values, setValues, itemsPerPage);
|
|
1492
|
-
}, hasMore: scrolling, scrollThreshold: 0.9 },
|
|
1493
|
-
React__default['default'].createElement(
|
|
1494
|
-
reactBootstrap.Container,
|
|
1495
|
-
null,
|
|
1496
|
-
cardLoader(data, client, mapping, values, seoPaginate, pageview, router, currentPage, setCurrentPage, showPublished, defaultImage, showAuthor, showCategory, imageHeight, imageWidth, imageMaxHeight, imageFit, rightItems, brandInsightAd, showBI, itemsPerPage, heroContent, lgInfeedAd, showPubInfo, contentCategoryMapping, showTimeDiff, showTaxonomies, showIntro)
|
|
1497
|
-
)
|
|
1498
|
-
),
|
|
1499
|
-
React__default['default'].createElement(
|
|
1500
|
-
'noscript',
|
|
1501
|
-
null,
|
|
1502
|
-
renderManualPagination(currentPage)
|
|
1503
|
-
)
|
|
1504
|
-
) : React__default['default'].createElement(
|
|
1505
|
-
React__default['default'].Fragment,
|
|
2511
|
+
React__default.createElement(
|
|
2512
|
+
reactBootstrap.Container,
|
|
1506
2513
|
null,
|
|
1507
|
-
React__default
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
renderManualPagination(currentPage)
|
|
1538
|
-
)
|
|
2514
|
+
React__default.createElement(CardLoader, {
|
|
2515
|
+
data: data,
|
|
2516
|
+
client: client,
|
|
2517
|
+
mapping: mapping,
|
|
2518
|
+
showPublished: showPublished,
|
|
2519
|
+
defaultImage: defaultImage,
|
|
2520
|
+
showAuthor: showAuthor,
|
|
2521
|
+
showCategory: showCategory,
|
|
2522
|
+
imageHeight: imageHeight,
|
|
2523
|
+
imageWidth: imageWidth,
|
|
2524
|
+
imageMaxHeight: imageMaxHeight,
|
|
2525
|
+
imageFit: imageFit,
|
|
2526
|
+
rightItems: rightItems,
|
|
2527
|
+
brandInsightAd: brandInsightAd,
|
|
2528
|
+
showBI: showBI,
|
|
2529
|
+
heroContent: heroContent,
|
|
2530
|
+
lgInfeedAd: lgInfeedAd,
|
|
2531
|
+
showPubInfo: showPubInfo,
|
|
2532
|
+
contentCategoryMapping: contentCategoryMapping,
|
|
2533
|
+
showTimeDif: showTimeDiff,
|
|
2534
|
+
showTaxonomies: showTaxonomies,
|
|
2535
|
+
showIntro: showIntro
|
|
2536
|
+
}),
|
|
2537
|
+
React__default.createElement(Pagination, {
|
|
2538
|
+
totalPostsCount: props.totalPostsCount,
|
|
2539
|
+
itemsPerPage: props.params.itemsPerPage,
|
|
2540
|
+
currentPage: props.currentPage,
|
|
2541
|
+
handlePageChange: handlePageChange,
|
|
2542
|
+
dataLength: data.length
|
|
2543
|
+
})
|
|
1539
2544
|
)
|
|
1540
2545
|
);
|
|
1541
2546
|
};
|