@mjhls/mjh-framework 1.0.109-8.bc2 → 1.0.109
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 +5 -1
- package/dist/index.es.js +20606 -0
- package/dist/index.es.js.map +1 -0
- package/dist/index.js +20644 -0
- package/dist/index.js.map +1 -0
- package/package.json +26 -55
- package/dist/cjs/AD.js +0 -32
- package/dist/cjs/AD300x250.js +0 -95
- package/dist/cjs/AD300x250x600.js +0 -112
- package/dist/cjs/AD728x90.js +0 -109
- package/dist/cjs/ADFloatingFooter.js +0 -151
- package/dist/cjs/ADFooter.js +0 -53
- package/dist/cjs/ADGutter.js +0 -123
- package/dist/cjs/ADInfeed-7c075eda.js +0 -75
- package/dist/cjs/ADSkyscraper.js +0 -125
- package/dist/cjs/ADSponsoredResources.js +0 -122
- package/dist/cjs/ADWebcast.js +0 -127
- package/dist/cjs/ADWelcome.js +0 -166
- package/dist/cjs/ADlgInfeed-d4f556bd.js +0 -69
- package/dist/cjs/AccordionPanel.js +0 -94
- package/dist/cjs/AdSlot.js +0 -283
- package/dist/cjs/AdSlotsProvider.js +0 -184
- package/dist/cjs/AlgoliaSearch.js +0 -15221
- package/dist/cjs/AlphabeticList.js +0 -134
- package/dist/cjs/ArticleCarousel.js +0 -45
- package/dist/cjs/ArticleProgramLandingPage.js +0 -186
- package/dist/cjs/ArticleSeriesLandingPage.js +0 -162
- package/dist/cjs/ArticleSeriesListing.js +0 -314
- package/dist/cjs/AuthWrapper.js +0 -1526
- package/dist/cjs/AuthorComponent-7d00f6d5.js +0 -96
- package/dist/cjs/Beam.js +0 -405
- package/dist/cjs/BlockContent-96b44364.js +0 -916
- package/dist/cjs/Breadcrumbs.js +0 -117
- package/dist/cjs/CEDeckSupabase.js +0 -444
- package/dist/cjs/CMEDeck.js +0 -444
- package/dist/cjs/Column1.js +0 -36
- package/dist/cjs/Column2.js +0 -73
- package/dist/cjs/Column3.js +0 -140
- package/dist/cjs/ConferenceArticleCard.js +0 -94
- package/dist/cjs/ConferenceBanner-213003ce.js +0 -24
- package/dist/cjs/ContentCardPaginated.js +0 -416
- package/dist/cjs/DeckContent.js +0 -507
- package/dist/cjs/DeckQueue.js +0 -402
- package/dist/cjs/DeckQueuePaginated.js +0 -347
- package/dist/cjs/Dfp-67646058.js +0 -103
- package/dist/cjs/EventsDeck.js +0 -856
- package/dist/cjs/ExternalResources.js +0 -220
- package/dist/cjs/Feature.js +0 -132
- package/dist/cjs/ForbesHero.js +0 -138
- package/dist/cjs/GridContent.js +0 -828
- package/dist/cjs/GridContentPaginated.js +0 -703
- package/dist/cjs/GridHero.js +0 -148
- package/dist/cjs/GroupDeck.js +0 -314
- package/dist/cjs/HamMagazine.js +0 -664
- package/dist/cjs/Header.js +0 -65
- package/dist/cjs/HealthCareProfessionalModal.js +0 -78
- package/dist/cjs/Hero.js +0 -49
- package/dist/cjs/HighlightenVideo.js +0 -69
- package/dist/cjs/HorizontalArticleListing.js +0 -167
- package/dist/cjs/HorizontalHero.js +0 -112
- package/dist/cjs/ImageSlider-7c995858.js +0 -2808
- package/dist/cjs/IssueContentDeck.js +0 -242
- package/dist/cjs/IssueDeck.js +0 -267
- package/dist/cjs/IssueLanding.js +0 -176
- package/dist/cjs/KMTracker.js +0 -27
- package/dist/cjs/LeftNav.js +0 -153
- package/dist/cjs/MasterDeck.js +0 -555
- package/dist/cjs/MasterDeckPaginated.js +0 -468
- package/dist/cjs/MediaSeriesCard.js +0 -134
- package/dist/cjs/MediaSeriesLanding.js +0 -507
- package/dist/cjs/MediaSeriesLandingPaginated.js +0 -532
- package/dist/cjs/NavDvm.js +0 -278
- package/dist/cjs/NavFooter-b7b16d48.js +0 -72
- package/dist/cjs/NavMagazine.js +0 -615
- package/dist/cjs/NavNative.js +0 -880
- package/dist/cjs/OncliveHero.js +0 -80
- package/dist/cjs/OncliveLargeHero.js +0 -242
- package/dist/cjs/PageFilter.js +0 -72
- package/dist/cjs/Pagination-6359861a.js +0 -97
- package/dist/cjs/PartnerDetailListing.js +0 -374
- package/dist/cjs/PartnerDetailListingPaginated.js +0 -365
- package/dist/cjs/PdfDownload.js +0 -28
- package/dist/cjs/PixelTracking.js +0 -191
- package/dist/cjs/PodcastsLanding.js +0 -234
- package/dist/cjs/PopUpModal.js +0 -58
- package/dist/cjs/PtceDeck.js +0 -150
- package/dist/cjs/PubSection.js +0 -120
- package/dist/cjs/PubToc.js +0 -88
- package/dist/cjs/PublicationDeck.js +0 -184
- package/dist/cjs/PublicationFeature-4b68e0db.js +0 -130
- package/dist/cjs/PublicationLanding.js +0 -826
- package/dist/cjs/QueueDeckExpanded.js +0 -1540
- package/dist/cjs/QueueDeckExpandedPaginated.js +0 -1387
- package/dist/cjs/RecentNews.js +0 -91
- package/dist/cjs/RelatedContent.js +0 -115
- package/dist/cjs/RelatedTopicsDropdown.js +0 -90
- package/dist/cjs/RolesDeck.js +0 -94
- package/dist/cjs/Schema.js +0 -102
- package/dist/cjs/Search.js +0 -66
- package/dist/cjs/Segment.js +0 -458
- package/dist/cjs/SeriesListingDeck.js +0 -247
- package/dist/cjs/SeriesSlider-086a8319.js +0 -332
- package/dist/cjs/SetCookie.js +0 -10
- package/dist/cjs/SideFooter.js +0 -152
- package/dist/cjs/SocialIcons.js +0 -103
- package/dist/cjs/SocialSearchComponent-d7e5d3a6.js +0 -213
- package/dist/cjs/SocialShare.js +0 -74
- package/dist/cjs/TaxonomyCard.js +0 -256
- package/dist/cjs/TaxonomyDescription.js +0 -208
- package/dist/cjs/TemplateNormal.js +0 -204
- package/dist/cjs/ThumbnailCard.js +0 -60
- package/dist/cjs/Tooltip-b8516cbf.js +0 -9541
- package/dist/cjs/Ustream.js +0 -157
- package/dist/cjs/VerticalHero.js +0 -75
- package/dist/cjs/VideoProgramLandingPage.js +0 -262
- package/dist/cjs/VideoSeriesCard.js +0 -88
- package/dist/cjs/VideoSeriesFilter.js +0 -129
- package/dist/cjs/VideoSeriesLandingPage.js +0 -178
- package/dist/cjs/VideoSeriesListing.js +0 -421
- package/dist/cjs/View.js +0 -2835
- package/dist/cjs/YahooHero.js +0 -127
- package/dist/cjs/YoutubeGroup.js +0 -372
- package/dist/cjs/_commonjsHelpers-06173234.js +0 -25
- package/dist/cjs/_is-array-54228b29.js +0 -74
- package/dist/cjs/_iter-detect-b1df62f0.js +0 -52
- package/dist/cjs/_library-dd23b178.js +0 -5
- package/dist/cjs/_object-sap-d1978572.js +0 -16
- package/dist/cjs/_object-to-array-9337ba83.js +0 -25
- package/dist/cjs/_set-species-0c7864a2.js +0 -55
- package/dist/cjs/asyncToGenerator-65df6bf8.js +0 -1347
- package/dist/cjs/brightcove-react-player-loader.es-35faab67.js +0 -2232
- package/dist/cjs/checkSisterSite-c3a4ac98.js +0 -19
- package/dist/cjs/core.get-iterator-method-5643aa10.js +0 -584
- package/dist/cjs/debounce-d4a2369b.js +0 -216
- package/dist/cjs/define-property-e8404b64.js +0 -20
- package/dist/cjs/defineProperty-19580e93.js +0 -71
- package/dist/cjs/defineProperty-9673846a.js +0 -34
- package/dist/cjs/entities-df1aed86.js +0 -510
- package/dist/cjs/eq-5fc26c07.js +0 -79
- package/dist/cjs/extends-be0d85bc.js +0 -100
- package/dist/cjs/faundadb.js +0 -765
- package/dist/cjs/get-5839e5b5.js +0 -920
- package/dist/cjs/getContentCategory-f38a4c00.js +0 -11
- package/dist/cjs/getKeywords.js +0 -46
- package/dist/cjs/getPtceActivities.js +0 -90
- package/dist/cjs/getQuery.js +0 -27
- package/dist/cjs/getRelatedArticle.js +0 -766
- package/dist/cjs/getRootDocGroup.js +0 -63
- package/dist/cjs/getSerializers.js +0 -66
- package/dist/cjs/getSeriesDetail.js +0 -40
- package/dist/cjs/getTIData.js +0 -93
- package/dist/cjs/getTargeting-5b954783.js +0 -164
- package/dist/cjs/getTargeting.js +0 -12
- package/dist/cjs/iconBase-be4097c0.js +0 -104
- package/dist/cjs/index-187c967e.js +0 -54
- package/dist/cjs/index-3177f564.js +0 -1573
- package/dist/cjs/index-65621b6c.js +0 -613
- package/dist/cjs/index-7435b964.js +0 -1683
- package/dist/cjs/index-a26637a3.js +0 -11764
- package/dist/cjs/index-d48b231c.js +0 -556
- package/dist/cjs/index-ff83a88b.js +0 -104
- package/dist/cjs/index.es-1ab8dda7.js +0 -445
- package/dist/cjs/index.esm-2ea9e9ff.js +0 -98
- package/dist/cjs/index.esm-c1e16606.js +0 -13
- package/dist/cjs/index.esm-d51c9ac6.js +0 -25
- package/dist/cjs/index.esm-d81454e7.js +0 -19
- package/dist/cjs/index.js +0 -638
- package/dist/cjs/inherits-e47b5342.js +0 -188
- package/dist/cjs/isSymbol-03abbdf0.js +0 -209
- package/dist/cjs/js.cookie-a511c430.js +0 -160
- package/dist/cjs/keys-e982b3fa.js +0 -25
- package/dist/cjs/lodash-f0783643.js +0 -17195
- package/dist/cjs/main-ae8472f3.js +0 -969
- package/dist/cjs/moment-f730814d.js +0 -5684
- package/dist/cjs/react-social-icons-2c5c389a.js +0 -616
- package/dist/cjs/slicedToArray-067dd3bc.js +0 -95
- package/dist/cjs/smoothscroll-99df7f93.js +0 -438
- package/dist/cjs/stringify-f7a37a8d.js +0 -17
- package/dist/cjs/style-inject.es-dcee06b6.js +0 -30
- package/dist/cjs/timeDifferenceCalc.js +0 -39
- package/dist/cjs/toConsumableArray-d7797c2b.js +0 -74
- package/dist/cjs/toNumber-5e1fac58.js +0 -104
- package/dist/cjs/typeof-220bbf73.js +0 -382
- package/dist/cjs/urlFor.js +0 -66
- package/dist/cjs/urlForFile-5084fc48.js +0 -29
- package/dist/cjs/ustream-api-3819e4aa.js +0 -106
- package/dist/cjs/visibility-sensor-56020df6.js +0 -597
- package/dist/cjs/web.dom.iterable-d98303e0.js +0 -50
- package/dist/esm/AD.js +0 -26
- package/dist/esm/AD300x250.js +0 -89
- package/dist/esm/AD300x250x600.js +0 -106
- package/dist/esm/AD728x90.js +0 -103
- package/dist/esm/ADFloatingFooter.js +0 -145
- package/dist/esm/ADFooter.js +0 -47
- package/dist/esm/ADGutter.js +0 -117
- package/dist/esm/ADInfeed-3442c999.js +0 -68
- package/dist/esm/ADSkyscraper.js +0 -119
- package/dist/esm/ADSponsoredResources.js +0 -116
- package/dist/esm/ADWebcast.js +0 -121
- package/dist/esm/ADWelcome.js +0 -160
- package/dist/esm/ADlgInfeed-30649360.js +0 -63
- package/dist/esm/AccordionPanel.js +0 -87
- package/dist/esm/AdSlot.js +0 -276
- package/dist/esm/AdSlotsProvider.js +0 -177
- package/dist/esm/AlgoliaSearch.js +0 -15214
- package/dist/esm/AlphabeticList.js +0 -128
- package/dist/esm/ArticleCarousel.js +0 -39
- package/dist/esm/ArticleProgramLandingPage.js +0 -180
- package/dist/esm/ArticleSeriesLandingPage.js +0 -156
- package/dist/esm/ArticleSeriesListing.js +0 -307
- package/dist/esm/AuthWrapper.js +0 -1520
- package/dist/esm/AuthorComponent-d9653ae5.js +0 -90
- package/dist/esm/Beam.js +0 -403
- package/dist/esm/BlockContent-1e73bd2c.js +0 -909
- package/dist/esm/Breadcrumbs.js +0 -110
- package/dist/esm/CEDeckSupabase.js +0 -438
- package/dist/esm/CMEDeck.js +0 -438
- package/dist/esm/Column1.js +0 -28
- package/dist/esm/Column2.js +0 -65
- package/dist/esm/Column3.js +0 -132
- package/dist/esm/ConferenceArticleCard.js +0 -88
- package/dist/esm/ConferenceBanner-8792ebd2.js +0 -18
- package/dist/esm/ContentCardPaginated.js +0 -405
- package/dist/esm/DeckContent.js +0 -497
- package/dist/esm/DeckQueue.js +0 -392
- package/dist/esm/DeckQueuePaginated.js +0 -336
- package/dist/esm/Dfp-3b6eb620.js +0 -96
- package/dist/esm/EventsDeck.js +0 -843
- package/dist/esm/ExternalResources.js +0 -213
- package/dist/esm/Feature.js +0 -125
- package/dist/esm/ForbesHero.js +0 -132
- package/dist/esm/GridContent.js +0 -818
- package/dist/esm/GridContentPaginated.js +0 -692
- package/dist/esm/GridHero.js +0 -142
- package/dist/esm/GroupDeck.js +0 -308
- package/dist/esm/HamMagazine.js +0 -651
- package/dist/esm/Header.js +0 -54
- package/dist/esm/HealthCareProfessionalModal.js +0 -70
- package/dist/esm/Hero.js +0 -43
- package/dist/esm/HighlightenVideo.js +0 -63
- package/dist/esm/HorizontalArticleListing.js +0 -161
- package/dist/esm/HorizontalHero.js +0 -106
- package/dist/esm/ImageSlider-75f7b81a.js +0 -2799
- package/dist/esm/IssueContentDeck.js +0 -232
- package/dist/esm/IssueDeck.js +0 -257
- package/dist/esm/IssueLanding.js +0 -170
- package/dist/esm/KMTracker.js +0 -25
- package/dist/esm/LeftNav.js +0 -143
- package/dist/esm/MasterDeck.js +0 -548
- package/dist/esm/MasterDeckPaginated.js +0 -460
- package/dist/esm/MediaSeriesCard.js +0 -128
- package/dist/esm/MediaSeriesLanding.js +0 -500
- package/dist/esm/MediaSeriesLandingPaginated.js +0 -525
- package/dist/esm/NavDvm.js +0 -265
- package/dist/esm/NavFooter-4bcffccb.js +0 -66
- package/dist/esm/NavMagazine.js +0 -602
- package/dist/esm/NavNative.js +0 -864
- package/dist/esm/OncliveHero.js +0 -74
- package/dist/esm/OncliveLargeHero.js +0 -236
- package/dist/esm/PageFilter.js +0 -66
- package/dist/esm/Pagination-9fe9f61d.js +0 -90
- package/dist/esm/PartnerDetailListing.js +0 -368
- package/dist/esm/PartnerDetailListingPaginated.js +0 -359
- package/dist/esm/PdfDownload.js +0 -22
- package/dist/esm/PixelTracking.js +0 -182
- package/dist/esm/PodcastsLanding.js +0 -227
- package/dist/esm/PopUpModal.js +0 -51
- package/dist/esm/PtceDeck.js +0 -144
- package/dist/esm/PubSection.js +0 -114
- package/dist/esm/PubToc.js +0 -82
- package/dist/esm/PublicationDeck.js +0 -174
- package/dist/esm/PublicationFeature-6c334891.js +0 -121
- package/dist/esm/PublicationLanding.js +0 -816
- package/dist/esm/QueueDeckExpanded.js +0 -1534
- package/dist/esm/QueueDeckExpandedPaginated.js +0 -1381
- package/dist/esm/RecentNews.js +0 -85
- package/dist/esm/RelatedContent.js +0 -109
- package/dist/esm/RelatedTopicsDropdown.js +0 -82
- package/dist/esm/RolesDeck.js +0 -84
- package/dist/esm/Schema.js +0 -96
- package/dist/esm/Search.js +0 -57
- package/dist/esm/Segment.js +0 -456
- package/dist/esm/SeriesListingDeck.js +0 -241
- package/dist/esm/SeriesSlider-acbdf4c9.js +0 -326
- package/dist/esm/SetCookie.js +0 -8
- package/dist/esm/SideFooter.js +0 -146
- package/dist/esm/SocialIcons.js +0 -97
- package/dist/esm/SocialSearchComponent-9e65c8d6.js +0 -204
- package/dist/esm/SocialShare.js +0 -67
- package/dist/esm/TaxonomyCard.js +0 -246
- package/dist/esm/TaxonomyDescription.js +0 -201
- package/dist/esm/TemplateNormal.js +0 -197
- package/dist/esm/ThumbnailCard.js +0 -53
- package/dist/esm/Tooltip-fe0ed92d.js +0 -9532
- package/dist/esm/Ustream.js +0 -151
- package/dist/esm/VerticalHero.js +0 -69
- package/dist/esm/VideoProgramLandingPage.js +0 -253
- package/dist/esm/VideoSeriesCard.js +0 -82
- package/dist/esm/VideoSeriesFilter.js +0 -123
- package/dist/esm/VideoSeriesLandingPage.js +0 -172
- package/dist/esm/VideoSeriesListing.js +0 -414
- package/dist/esm/View.js +0 -2825
- package/dist/esm/YahooHero.js +0 -121
- package/dist/esm/YoutubeGroup.js +0 -366
- package/dist/esm/_commonjsHelpers-0c4b6f40.js +0 -19
- package/dist/esm/_is-array-68c79b29.js +0 -71
- package/dist/esm/_iter-detect-2f89237f.js +0 -48
- package/dist/esm/_library-528f1934.js +0 -3
- package/dist/esm/_object-sap-14bd8e96.js +0 -14
- package/dist/esm/_object-to-array-9dfdfb29.js +0 -23
- package/dist/esm/_set-species-7d3317b7.js +0 -50
- package/dist/esm/asyncToGenerator-1ebeb135.js +0 -1343
- package/dist/esm/brightcove-react-player-loader.es-a2422c4b.js +0 -2226
- package/dist/esm/checkSisterSite-a7218fda.js +0 -17
- package/dist/esm/core.get-iterator-method-95db387d.js +0 -547
- package/dist/esm/debounce-533d9748.js +0 -214
- package/dist/esm/define-property-433c51d3.js +0 -18
- package/dist/esm/defineProperty-e5afb9eb.js +0 -32
- package/dist/esm/defineProperty-e8022d1e.js +0 -66
- package/dist/esm/entities-6d9154b4.js +0 -507
- package/dist/esm/eq-bdcbf886.js +0 -76
- package/dist/esm/extends-2f4448b8.js +0 -94
- package/dist/esm/faundadb.js +0 -754
- package/dist/esm/get-3c308da4.js +0 -918
- package/dist/esm/getContentCategory-15dcc413.js +0 -9
- package/dist/esm/getKeywords.js +0 -44
- package/dist/esm/getPtceActivities.js +0 -88
- package/dist/esm/getQuery.js +0 -25
- package/dist/esm/getRelatedArticle.js +0 -764
- package/dist/esm/getRootDocGroup.js +0 -61
- package/dist/esm/getSerializers.js +0 -60
- package/dist/esm/getSeriesDetail.js +0 -38
- package/dist/esm/getTIData.js +0 -91
- package/dist/esm/getTargeting-b62a177c.js +0 -161
- package/dist/esm/getTargeting.js +0 -6
- package/dist/esm/iconBase-ccc56b97.js +0 -81
- package/dist/esm/index-3f5c03b2.js +0 -553
- package/dist/esm/index-4550ef23.js +0 -1571
- package/dist/esm/index-5cc7b406.js +0 -1674
- package/dist/esm/index-755f2cc2.js +0 -605
- package/dist/esm/index-a68bfe70.js +0 -11743
- package/dist/esm/index-c7e2ac95.js +0 -52
- package/dist/esm/index-c8d5e72b.js +0 -99
- package/dist/esm/index.es-a6137319.js +0 -439
- package/dist/esm/index.esm-1bd8a0a8.js +0 -18
- package/dist/esm/index.esm-9508070a.js +0 -91
- package/dist/esm/index.esm-9b042655.js +0 -10
- package/dist/esm/index.esm-eb1e8e80.js +0 -14
- package/dist/esm/index.js +0 -531
- package/dist/esm/inherits-96c84cbd.js +0 -179
- package/dist/esm/isSymbol-a7e9aafe.js +0 -203
- package/dist/esm/js.cookie-6874175c.js +0 -158
- package/dist/esm/keys-185288f4.js +0 -23
- package/dist/esm/lodash-f97fd99a.js +0 -17193
- package/dist/esm/main-754d4992.js +0 -956
- package/dist/esm/moment-48faeb9c.js +0 -5682
- package/dist/esm/react-social-icons-9be47857.js +0 -609
- package/dist/esm/slicedToArray-72ed566b.js +0 -92
- package/dist/esm/smoothscroll-fa4e3f8c.js +0 -436
- package/dist/esm/stringify-1e2a5946.js +0 -15
- package/dist/esm/style-inject.es-1f59c1d0.js +0 -28
- package/dist/esm/timeDifferenceCalc.js +0 -37
- package/dist/esm/toConsumableArray-e6f28e5c.js +0 -71
- package/dist/esm/toNumber-5aeba6e7.js +0 -102
- package/dist/esm/typeof-3ab7d3b6.js +0 -378
- package/dist/esm/urlFor.js +0 -64
- package/dist/esm/urlForFile-2e523b67.js +0 -27
- package/dist/esm/ustream-api-63a164b3.js +0 -104
- package/dist/esm/visibility-sensor-72fd8f8b.js +0 -590
- package/dist/esm/web.dom.iterable-3fffc027.js +0 -48
|
@@ -1,764 +0,0 @@
|
|
|
1
|
-
import { _ as _asyncToGenerator, r as regenerator } from './asyncToGenerator-1ebeb135.js';
|
|
2
|
-
import { c as createCommonjsModule, u as unwrapExports, a as commonjsGlobal } from './_commonjsHelpers-0c4b6f40.js';
|
|
3
|
-
import getQuery from './getQuery.js';
|
|
4
|
-
import './core.get-iterator-method-95db387d.js';
|
|
5
|
-
import './web.dom.iterable-3fffc027.js';
|
|
6
|
-
import './_library-528f1934.js';
|
|
7
|
-
import './_set-species-7d3317b7.js';
|
|
8
|
-
import './_iter-detect-2f89237f.js';
|
|
9
|
-
|
|
10
|
-
/*!
|
|
11
|
-
* cookie
|
|
12
|
-
* Copyright(c) 2012-2014 Roman Shtylman
|
|
13
|
-
* Copyright(c) 2015 Douglas Christopher Wilson
|
|
14
|
-
* MIT Licensed
|
|
15
|
-
*/
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* Module exports.
|
|
19
|
-
* @public
|
|
20
|
-
*/
|
|
21
|
-
|
|
22
|
-
var parse_1$1 = parse$1;
|
|
23
|
-
var serialize_1 = serialize;
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* Module variables.
|
|
27
|
-
* @private
|
|
28
|
-
*/
|
|
29
|
-
|
|
30
|
-
var decode = decodeURIComponent;
|
|
31
|
-
var encode = encodeURIComponent;
|
|
32
|
-
|
|
33
|
-
/**
|
|
34
|
-
* RegExp to match field-content in RFC 7230 sec 3.2
|
|
35
|
-
*
|
|
36
|
-
* field-content = field-vchar [ 1*( SP / HTAB ) field-vchar ]
|
|
37
|
-
* field-vchar = VCHAR / obs-text
|
|
38
|
-
* obs-text = %x80-FF
|
|
39
|
-
*/
|
|
40
|
-
|
|
41
|
-
var fieldContentRegExp = /^[\u0009\u0020-\u007e\u0080-\u00ff]+$/;
|
|
42
|
-
|
|
43
|
-
/**
|
|
44
|
-
* Parse a cookie header.
|
|
45
|
-
*
|
|
46
|
-
* Parse the given cookie header string into an object
|
|
47
|
-
* The object has the various cookies as keys(names) => values
|
|
48
|
-
*
|
|
49
|
-
* @param {string} str
|
|
50
|
-
* @param {object} [options]
|
|
51
|
-
* @return {object}
|
|
52
|
-
* @public
|
|
53
|
-
*/
|
|
54
|
-
|
|
55
|
-
function parse$1(str, options) {
|
|
56
|
-
if (typeof str !== 'string') {
|
|
57
|
-
throw new TypeError('argument str must be a string');
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
var obj = {};
|
|
61
|
-
var opt = options || {};
|
|
62
|
-
var pairs = str.split(';');
|
|
63
|
-
var dec = opt.decode || decode;
|
|
64
|
-
|
|
65
|
-
for (var i = 0; i < pairs.length; i++) {
|
|
66
|
-
var pair = pairs[i];
|
|
67
|
-
var index = pair.indexOf('=');
|
|
68
|
-
|
|
69
|
-
// skip things that don't look like key=value
|
|
70
|
-
if (index < 0) {
|
|
71
|
-
continue;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
var key = pair.substring(0, index).trim();
|
|
75
|
-
|
|
76
|
-
// only assign once
|
|
77
|
-
if (undefined == obj[key]) {
|
|
78
|
-
var val = pair.substring(index + 1, pair.length).trim();
|
|
79
|
-
|
|
80
|
-
// quoted values
|
|
81
|
-
if (val[0] === '"') {
|
|
82
|
-
val = val.slice(1, -1);
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
obj[key] = tryDecode(val, dec);
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
return obj;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
/**
|
|
93
|
-
* Serialize data into a cookie header.
|
|
94
|
-
*
|
|
95
|
-
* Serialize the a name value pair into a cookie string suitable for
|
|
96
|
-
* http headers. An optional options object specified cookie parameters.
|
|
97
|
-
*
|
|
98
|
-
* serialize('foo', 'bar', { httpOnly: true })
|
|
99
|
-
* => "foo=bar; httpOnly"
|
|
100
|
-
*
|
|
101
|
-
* @param {string} name
|
|
102
|
-
* @param {string} val
|
|
103
|
-
* @param {object} [options]
|
|
104
|
-
* @return {string}
|
|
105
|
-
* @public
|
|
106
|
-
*/
|
|
107
|
-
|
|
108
|
-
function serialize(name, val, options) {
|
|
109
|
-
var opt = options || {};
|
|
110
|
-
var enc = opt.encode || encode;
|
|
111
|
-
|
|
112
|
-
if (typeof enc !== 'function') {
|
|
113
|
-
throw new TypeError('option encode is invalid');
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
if (!fieldContentRegExp.test(name)) {
|
|
117
|
-
throw new TypeError('argument name is invalid');
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
var value = enc(val);
|
|
121
|
-
|
|
122
|
-
if (value && !fieldContentRegExp.test(value)) {
|
|
123
|
-
throw new TypeError('argument val is invalid');
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
var str = name + '=' + value;
|
|
127
|
-
|
|
128
|
-
if (null != opt.maxAge) {
|
|
129
|
-
var maxAge = opt.maxAge - 0;
|
|
130
|
-
|
|
131
|
-
if (isNaN(maxAge) || !isFinite(maxAge)) {
|
|
132
|
-
throw new TypeError('option maxAge is invalid')
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
str += '; Max-Age=' + Math.floor(maxAge);
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
if (opt.domain) {
|
|
139
|
-
if (!fieldContentRegExp.test(opt.domain)) {
|
|
140
|
-
throw new TypeError('option domain is invalid');
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
str += '; Domain=' + opt.domain;
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
if (opt.path) {
|
|
147
|
-
if (!fieldContentRegExp.test(opt.path)) {
|
|
148
|
-
throw new TypeError('option path is invalid');
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
str += '; Path=' + opt.path;
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
if (opt.expires) {
|
|
155
|
-
if (typeof opt.expires.toUTCString !== 'function') {
|
|
156
|
-
throw new TypeError('option expires is invalid');
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
str += '; Expires=' + opt.expires.toUTCString();
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
if (opt.httpOnly) {
|
|
163
|
-
str += '; HttpOnly';
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
if (opt.secure) {
|
|
167
|
-
str += '; Secure';
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
if (opt.sameSite) {
|
|
171
|
-
var sameSite = typeof opt.sameSite === 'string'
|
|
172
|
-
? opt.sameSite.toLowerCase() : opt.sameSite;
|
|
173
|
-
|
|
174
|
-
switch (sameSite) {
|
|
175
|
-
case true:
|
|
176
|
-
str += '; SameSite=Strict';
|
|
177
|
-
break;
|
|
178
|
-
case 'lax':
|
|
179
|
-
str += '; SameSite=Lax';
|
|
180
|
-
break;
|
|
181
|
-
case 'strict':
|
|
182
|
-
str += '; SameSite=Strict';
|
|
183
|
-
break;
|
|
184
|
-
case 'none':
|
|
185
|
-
str += '; SameSite=None';
|
|
186
|
-
break;
|
|
187
|
-
default:
|
|
188
|
-
throw new TypeError('option sameSite is invalid');
|
|
189
|
-
}
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
return str;
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
/**
|
|
196
|
-
* Try decoding a string using a decoding function.
|
|
197
|
-
*
|
|
198
|
-
* @param {string} str
|
|
199
|
-
* @param {function} decode
|
|
200
|
-
* @private
|
|
201
|
-
*/
|
|
202
|
-
|
|
203
|
-
function tryDecode(str, decode) {
|
|
204
|
-
try {
|
|
205
|
-
return decode(str);
|
|
206
|
-
} catch (e) {
|
|
207
|
-
return str;
|
|
208
|
-
}
|
|
209
|
-
}
|
|
210
|
-
|
|
211
|
-
var cookie = {
|
|
212
|
-
parse: parse_1$1,
|
|
213
|
-
serialize: serialize_1
|
|
214
|
-
};
|
|
215
|
-
|
|
216
|
-
var defaultParseOptions = {
|
|
217
|
-
decodeValues: true,
|
|
218
|
-
map: false,
|
|
219
|
-
silent: false,
|
|
220
|
-
};
|
|
221
|
-
|
|
222
|
-
function isNonEmptyString(str) {
|
|
223
|
-
return typeof str === "string" && !!str.trim();
|
|
224
|
-
}
|
|
225
|
-
|
|
226
|
-
function parseString(setCookieValue, options) {
|
|
227
|
-
var parts = setCookieValue.split(";").filter(isNonEmptyString);
|
|
228
|
-
|
|
229
|
-
var nameValuePairStr = parts.shift();
|
|
230
|
-
var parsed = parseNameValuePair(nameValuePairStr);
|
|
231
|
-
var name = parsed.name;
|
|
232
|
-
var value = parsed.value;
|
|
233
|
-
|
|
234
|
-
options = options
|
|
235
|
-
? Object.assign({}, defaultParseOptions, options)
|
|
236
|
-
: defaultParseOptions;
|
|
237
|
-
|
|
238
|
-
try {
|
|
239
|
-
value = options.decodeValues ? decodeURIComponent(value) : value; // decode cookie value
|
|
240
|
-
} catch (e) {
|
|
241
|
-
console.error(
|
|
242
|
-
"set-cookie-parser encountered an error while decoding a cookie with value '" +
|
|
243
|
-
value +
|
|
244
|
-
"'. Set options.decodeValues to false to disable this feature.",
|
|
245
|
-
e
|
|
246
|
-
);
|
|
247
|
-
}
|
|
248
|
-
|
|
249
|
-
var cookie = {
|
|
250
|
-
name: name,
|
|
251
|
-
value: value,
|
|
252
|
-
};
|
|
253
|
-
|
|
254
|
-
parts.forEach(function (part) {
|
|
255
|
-
var sides = part.split("=");
|
|
256
|
-
var key = sides.shift().trimLeft().toLowerCase();
|
|
257
|
-
var value = sides.join("=");
|
|
258
|
-
if (key === "expires") {
|
|
259
|
-
cookie.expires = new Date(value);
|
|
260
|
-
} else if (key === "max-age") {
|
|
261
|
-
cookie.maxAge = parseInt(value, 10);
|
|
262
|
-
} else if (key === "secure") {
|
|
263
|
-
cookie.secure = true;
|
|
264
|
-
} else if (key === "httponly") {
|
|
265
|
-
cookie.httpOnly = true;
|
|
266
|
-
} else if (key === "samesite") {
|
|
267
|
-
cookie.sameSite = value;
|
|
268
|
-
} else {
|
|
269
|
-
cookie[key] = value;
|
|
270
|
-
}
|
|
271
|
-
});
|
|
272
|
-
|
|
273
|
-
return cookie;
|
|
274
|
-
}
|
|
275
|
-
|
|
276
|
-
function parseNameValuePair(nameValuePairStr) {
|
|
277
|
-
// Parses name-value-pair according to rfc6265bis draft
|
|
278
|
-
|
|
279
|
-
var name = "";
|
|
280
|
-
var value = "";
|
|
281
|
-
var nameValueArr = nameValuePairStr.split("=");
|
|
282
|
-
if (nameValueArr.length > 1) {
|
|
283
|
-
name = nameValueArr.shift();
|
|
284
|
-
value = nameValueArr.join("="); // everything after the first =, joined by a "=" if there was more than one part
|
|
285
|
-
} else {
|
|
286
|
-
value = nameValuePairStr;
|
|
287
|
-
}
|
|
288
|
-
|
|
289
|
-
return { name: name, value: value };
|
|
290
|
-
}
|
|
291
|
-
|
|
292
|
-
function parse(input, options) {
|
|
293
|
-
options = options
|
|
294
|
-
? Object.assign({}, defaultParseOptions, options)
|
|
295
|
-
: defaultParseOptions;
|
|
296
|
-
|
|
297
|
-
if (!input) {
|
|
298
|
-
if (!options.map) {
|
|
299
|
-
return [];
|
|
300
|
-
} else {
|
|
301
|
-
return {};
|
|
302
|
-
}
|
|
303
|
-
}
|
|
304
|
-
|
|
305
|
-
if (input.headers && input.headers["set-cookie"]) {
|
|
306
|
-
// fast-path for node.js (which automatically normalizes header names to lower-case
|
|
307
|
-
input = input.headers["set-cookie"];
|
|
308
|
-
} else if (input.headers) {
|
|
309
|
-
// slow-path for other environments - see #25
|
|
310
|
-
var sch =
|
|
311
|
-
input.headers[
|
|
312
|
-
Object.keys(input.headers).find(function (key) {
|
|
313
|
-
return key.toLowerCase() === "set-cookie";
|
|
314
|
-
})
|
|
315
|
-
];
|
|
316
|
-
// warn if called on a request-like object with a cookie header rather than a set-cookie header - see #34, 36
|
|
317
|
-
if (!sch && input.headers.cookie && !options.silent) {
|
|
318
|
-
console.warn(
|
|
319
|
-
"Warning: set-cookie-parser appears to have been called on a request object. It is designed to parse Set-Cookie headers from responses, not Cookie headers from requests. Set the option {silent: true} to suppress this warning."
|
|
320
|
-
);
|
|
321
|
-
}
|
|
322
|
-
input = sch;
|
|
323
|
-
}
|
|
324
|
-
if (!Array.isArray(input)) {
|
|
325
|
-
input = [input];
|
|
326
|
-
}
|
|
327
|
-
|
|
328
|
-
options = options
|
|
329
|
-
? Object.assign({}, defaultParseOptions, options)
|
|
330
|
-
: defaultParseOptions;
|
|
331
|
-
|
|
332
|
-
if (!options.map) {
|
|
333
|
-
return input.filter(isNonEmptyString).map(function (str) {
|
|
334
|
-
return parseString(str, options);
|
|
335
|
-
});
|
|
336
|
-
} else {
|
|
337
|
-
var cookies = {};
|
|
338
|
-
return input.filter(isNonEmptyString).reduce(function (cookies, str) {
|
|
339
|
-
var cookie = parseString(str, options);
|
|
340
|
-
cookies[cookie.name] = cookie;
|
|
341
|
-
return cookies;
|
|
342
|
-
}, cookies);
|
|
343
|
-
}
|
|
344
|
-
}
|
|
345
|
-
|
|
346
|
-
/*
|
|
347
|
-
Set-Cookie header field-values are sometimes comma joined in one string. This splits them without choking on commas
|
|
348
|
-
that are within a single set-cookie field-value, such as in the Expires portion.
|
|
349
|
-
|
|
350
|
-
This is uncommon, but explicitly allowed - see https://tools.ietf.org/html/rfc2616#section-4.2
|
|
351
|
-
Node.js does this for every header *except* set-cookie - see https://github.com/nodejs/node/blob/d5e363b77ebaf1caf67cd7528224b651c86815c1/lib/_http_incoming.js#L128
|
|
352
|
-
React Native's fetch does this for *every* header, including set-cookie.
|
|
353
|
-
|
|
354
|
-
Based on: https://github.com/google/j2objc/commit/16820fdbc8f76ca0c33472810ce0cb03d20efe25
|
|
355
|
-
Credits to: https://github.com/tomball for original and https://github.com/chrusart for JavaScript implementation
|
|
356
|
-
*/
|
|
357
|
-
function splitCookiesString(cookiesString) {
|
|
358
|
-
if (Array.isArray(cookiesString)) {
|
|
359
|
-
return cookiesString;
|
|
360
|
-
}
|
|
361
|
-
if (typeof cookiesString !== "string") {
|
|
362
|
-
return [];
|
|
363
|
-
}
|
|
364
|
-
|
|
365
|
-
var cookiesStrings = [];
|
|
366
|
-
var pos = 0;
|
|
367
|
-
var start;
|
|
368
|
-
var ch;
|
|
369
|
-
var lastComma;
|
|
370
|
-
var nextStart;
|
|
371
|
-
var cookiesSeparatorFound;
|
|
372
|
-
|
|
373
|
-
function skipWhitespace() {
|
|
374
|
-
while (pos < cookiesString.length && /\s/.test(cookiesString.charAt(pos))) {
|
|
375
|
-
pos += 1;
|
|
376
|
-
}
|
|
377
|
-
return pos < cookiesString.length;
|
|
378
|
-
}
|
|
379
|
-
|
|
380
|
-
function notSpecialChar() {
|
|
381
|
-
ch = cookiesString.charAt(pos);
|
|
382
|
-
|
|
383
|
-
return ch !== "=" && ch !== ";" && ch !== ",";
|
|
384
|
-
}
|
|
385
|
-
|
|
386
|
-
while (pos < cookiesString.length) {
|
|
387
|
-
start = pos;
|
|
388
|
-
cookiesSeparatorFound = false;
|
|
389
|
-
|
|
390
|
-
while (skipWhitespace()) {
|
|
391
|
-
ch = cookiesString.charAt(pos);
|
|
392
|
-
if (ch === ",") {
|
|
393
|
-
// ',' is a cookie separator if we have later first '=', not ';' or ','
|
|
394
|
-
lastComma = pos;
|
|
395
|
-
pos += 1;
|
|
396
|
-
|
|
397
|
-
skipWhitespace();
|
|
398
|
-
nextStart = pos;
|
|
399
|
-
|
|
400
|
-
while (pos < cookiesString.length && notSpecialChar()) {
|
|
401
|
-
pos += 1;
|
|
402
|
-
}
|
|
403
|
-
|
|
404
|
-
// currently special character
|
|
405
|
-
if (pos < cookiesString.length && cookiesString.charAt(pos) === "=") {
|
|
406
|
-
// we found cookies separator
|
|
407
|
-
cookiesSeparatorFound = true;
|
|
408
|
-
// pos is inside the next cookie, so back up and return it.
|
|
409
|
-
pos = nextStart;
|
|
410
|
-
cookiesStrings.push(cookiesString.substring(start, lastComma));
|
|
411
|
-
start = pos;
|
|
412
|
-
} else {
|
|
413
|
-
// in param ',' or param separator ';',
|
|
414
|
-
// we continue from that comma
|
|
415
|
-
pos = lastComma + 1;
|
|
416
|
-
}
|
|
417
|
-
} else {
|
|
418
|
-
pos += 1;
|
|
419
|
-
}
|
|
420
|
-
}
|
|
421
|
-
|
|
422
|
-
if (!cookiesSeparatorFound || pos >= cookiesString.length) {
|
|
423
|
-
cookiesStrings.push(cookiesString.substring(start, cookiesString.length));
|
|
424
|
-
}
|
|
425
|
-
}
|
|
426
|
-
|
|
427
|
-
return cookiesStrings;
|
|
428
|
-
}
|
|
429
|
-
|
|
430
|
-
var setCookie = parse;
|
|
431
|
-
var parse_1 = parse;
|
|
432
|
-
var parseString_1 = parseString;
|
|
433
|
-
var splitCookiesString_1 = splitCookiesString;
|
|
434
|
-
setCookie.parse = parse_1;
|
|
435
|
-
setCookie.parseString = parseString_1;
|
|
436
|
-
setCookie.splitCookiesString = splitCookiesString_1;
|
|
437
|
-
|
|
438
|
-
var utils = createCommonjsModule(function (module, exports) {
|
|
439
|
-
var __assign = (commonjsGlobal && commonjsGlobal.__assign) || function () {
|
|
440
|
-
__assign = Object.assign || function(t) {
|
|
441
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
442
|
-
s = arguments[i];
|
|
443
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
444
|
-
t[p] = s[p];
|
|
445
|
-
}
|
|
446
|
-
return t;
|
|
447
|
-
};
|
|
448
|
-
return __assign.apply(this, arguments);
|
|
449
|
-
};
|
|
450
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
451
|
-
exports.areCookiesEqual = exports.hasSameProperties = exports.createCookie = exports.isBrowser = void 0;
|
|
452
|
-
/**
|
|
453
|
-
* Tells whether we are in a browser or server.
|
|
454
|
-
*/
|
|
455
|
-
function isBrowser() {
|
|
456
|
-
return typeof window !== 'undefined';
|
|
457
|
-
}
|
|
458
|
-
exports.isBrowser = isBrowser;
|
|
459
|
-
/**
|
|
460
|
-
* Create an instance of the Cookie interface
|
|
461
|
-
*/
|
|
462
|
-
function createCookie(name, value, options) {
|
|
463
|
-
var sameSite = options.sameSite;
|
|
464
|
-
if (sameSite === true) {
|
|
465
|
-
sameSite = 'strict';
|
|
466
|
-
}
|
|
467
|
-
if (sameSite === undefined || sameSite === false) {
|
|
468
|
-
sameSite = 'lax';
|
|
469
|
-
}
|
|
470
|
-
var cookieToSet = __assign(__assign({}, options), { sameSite: sameSite });
|
|
471
|
-
delete cookieToSet.encode;
|
|
472
|
-
return __assign({ name: name, value: value }, cookieToSet);
|
|
473
|
-
}
|
|
474
|
-
exports.createCookie = createCookie;
|
|
475
|
-
/**
|
|
476
|
-
* Tells whether given objects have the same properties.
|
|
477
|
-
*/
|
|
478
|
-
function hasSameProperties(a, b) {
|
|
479
|
-
var aProps = Object.getOwnPropertyNames(a);
|
|
480
|
-
var bProps = Object.getOwnPropertyNames(b);
|
|
481
|
-
if (aProps.length !== bProps.length) {
|
|
482
|
-
return false;
|
|
483
|
-
}
|
|
484
|
-
for (var i = 0; i < aProps.length; i++) {
|
|
485
|
-
var propName = aProps[i];
|
|
486
|
-
if (a[propName] !== b[propName]) {
|
|
487
|
-
return false;
|
|
488
|
-
}
|
|
489
|
-
}
|
|
490
|
-
return true;
|
|
491
|
-
}
|
|
492
|
-
exports.hasSameProperties = hasSameProperties;
|
|
493
|
-
/**
|
|
494
|
-
* Compare the cookie and return true if the cookies have equivalent
|
|
495
|
-
* options and the cookies would be overwritten in the browser storage.
|
|
496
|
-
*
|
|
497
|
-
* @param a first Cookie for comparison
|
|
498
|
-
* @param b second Cookie for comparison
|
|
499
|
-
*/
|
|
500
|
-
function areCookiesEqual(a, b) {
|
|
501
|
-
var sameSiteSame = a.sameSite === b.sameSite;
|
|
502
|
-
if (typeof a.sameSite === 'string' && typeof b.sameSite === 'string') {
|
|
503
|
-
sameSiteSame = a.sameSite.toLowerCase() === b.sameSite.toLowerCase();
|
|
504
|
-
}
|
|
505
|
-
return (hasSameProperties(__assign(__assign({}, a), { sameSite: undefined }), __assign(__assign({}, b), { sameSite: undefined })) && sameSiteSame);
|
|
506
|
-
}
|
|
507
|
-
exports.areCookiesEqual = areCookiesEqual;
|
|
508
|
-
/* Functions */
|
|
509
|
-
|
|
510
|
-
});
|
|
511
|
-
|
|
512
|
-
unwrapExports(utils);
|
|
513
|
-
utils.areCookiesEqual;
|
|
514
|
-
utils.hasSameProperties;
|
|
515
|
-
utils.createCookie;
|
|
516
|
-
utils.isBrowser;
|
|
517
|
-
|
|
518
|
-
var dist = createCommonjsModule(function (module, exports) {
|
|
519
|
-
var __assign = (commonjsGlobal && commonjsGlobal.__assign) || function () {
|
|
520
|
-
__assign = Object.assign || function(t) {
|
|
521
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
522
|
-
s = arguments[i];
|
|
523
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
524
|
-
t[p] = s[p];
|
|
525
|
-
}
|
|
526
|
-
return t;
|
|
527
|
-
};
|
|
528
|
-
return __assign.apply(this, arguments);
|
|
529
|
-
};
|
|
530
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
531
|
-
exports.destroyCookie = exports.setCookie = exports.parseCookies = void 0;
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
/**
|
|
536
|
-
* Parses cookies.
|
|
537
|
-
*
|
|
538
|
-
* @param ctx NextJS page or API context, express context, null or undefined.
|
|
539
|
-
* @param options Options that we pass down to `cookie` library.
|
|
540
|
-
*/
|
|
541
|
-
function parseCookies(ctx, options) {
|
|
542
|
-
var _a, _b;
|
|
543
|
-
if ((_b = (_a = ctx === null || ctx === void 0 ? void 0 : ctx.req) === null || _a === void 0 ? void 0 : _a.headers) === null || _b === void 0 ? void 0 : _b.cookie) {
|
|
544
|
-
return cookie.parse(ctx.req.headers.cookie, options);
|
|
545
|
-
}
|
|
546
|
-
if (utils.isBrowser()) {
|
|
547
|
-
return cookie.parse(document.cookie, options);
|
|
548
|
-
}
|
|
549
|
-
return {};
|
|
550
|
-
}
|
|
551
|
-
exports.parseCookies = parseCookies;
|
|
552
|
-
/**
|
|
553
|
-
* Sets a cookie.
|
|
554
|
-
*
|
|
555
|
-
* @param ctx NextJS page or API context, express context, null or undefined.
|
|
556
|
-
* @param name The name of your cookie.
|
|
557
|
-
* @param value The value of your cookie.
|
|
558
|
-
* @param options Options that we pass down to `cookie` library.
|
|
559
|
-
*/
|
|
560
|
-
function setCookie$1(ctx, name, value, options) {
|
|
561
|
-
var _a, _b;
|
|
562
|
-
if (options === void 0) { options = {}; }
|
|
563
|
-
// SSR
|
|
564
|
-
if (((_a = ctx === null || ctx === void 0 ? void 0 : ctx.res) === null || _a === void 0 ? void 0 : _a.getHeader) && ctx.res.setHeader) {
|
|
565
|
-
// Check if response has finished and warn about it.
|
|
566
|
-
if ((_b = ctx === null || ctx === void 0 ? void 0 : ctx.res) === null || _b === void 0 ? void 0 : _b.finished) {
|
|
567
|
-
console.warn("Not setting \"" + name + "\" cookie. Response has finished.");
|
|
568
|
-
console.warn("You should set cookie before res.send()");
|
|
569
|
-
return {};
|
|
570
|
-
}
|
|
571
|
-
/**
|
|
572
|
-
* Load existing cookies from the header and parse them.
|
|
573
|
-
*/
|
|
574
|
-
var cookies = ctx.res.getHeader('Set-Cookie') || [];
|
|
575
|
-
if (typeof cookies === 'string')
|
|
576
|
-
cookies = [cookies];
|
|
577
|
-
if (typeof cookies === 'number')
|
|
578
|
-
cookies = [];
|
|
579
|
-
/**
|
|
580
|
-
* Parse cookies but ignore values - we've already encoded
|
|
581
|
-
* them in the previous call.
|
|
582
|
-
*/
|
|
583
|
-
var parsedCookies = setCookie.parse(cookies, {
|
|
584
|
-
decodeValues: false,
|
|
585
|
-
});
|
|
586
|
-
/**
|
|
587
|
-
* We create the new cookie and make sure that none of
|
|
588
|
-
* the existing cookies match it.
|
|
589
|
-
*/
|
|
590
|
-
var newCookie_1 = utils.createCookie(name, value, options);
|
|
591
|
-
var cookiesToSet_1 = [];
|
|
592
|
-
parsedCookies.forEach(function (parsedCookie) {
|
|
593
|
-
if (!utils.areCookiesEqual(parsedCookie, newCookie_1)) {
|
|
594
|
-
/**
|
|
595
|
-
* We serialize the cookie back to the original format
|
|
596
|
-
* if it isn't the same as the new one.
|
|
597
|
-
*/
|
|
598
|
-
var serializedCookie = cookie.serialize(parsedCookie.name, parsedCookie.value, __assign({
|
|
599
|
-
// we prevent reencoding by default, but you might override it
|
|
600
|
-
encode: function (val) { return val; } }, parsedCookie));
|
|
601
|
-
cookiesToSet_1.push(serializedCookie);
|
|
602
|
-
}
|
|
603
|
-
});
|
|
604
|
-
cookiesToSet_1.push(cookie.serialize(name, value, options));
|
|
605
|
-
// Update the header.
|
|
606
|
-
ctx.res.setHeader('Set-Cookie', cookiesToSet_1);
|
|
607
|
-
}
|
|
608
|
-
// Browser
|
|
609
|
-
if (utils.isBrowser()) {
|
|
610
|
-
if (options && options.httpOnly) {
|
|
611
|
-
throw new Error('Can not set a httpOnly cookie in the browser.');
|
|
612
|
-
}
|
|
613
|
-
document.cookie = cookie.serialize(name, value, options);
|
|
614
|
-
}
|
|
615
|
-
return {};
|
|
616
|
-
}
|
|
617
|
-
exports.setCookie = setCookie$1;
|
|
618
|
-
/**
|
|
619
|
-
* Destroys a cookie with a particular name.
|
|
620
|
-
*
|
|
621
|
-
* @param ctx NextJS page or API context, express context, null or undefined.
|
|
622
|
-
* @param name Cookie name.
|
|
623
|
-
* @param options Options that we pass down to `cookie` library.
|
|
624
|
-
*/
|
|
625
|
-
function destroyCookie(ctx, name, options) {
|
|
626
|
-
/**
|
|
627
|
-
* We forward the request destroy to setCookie function
|
|
628
|
-
* as it is the same function with modified maxAge value.
|
|
629
|
-
*/
|
|
630
|
-
return setCookie$1(ctx, name, '', __assign(__assign({}, (options || {})), { maxAge: -1 }));
|
|
631
|
-
}
|
|
632
|
-
exports.destroyCookie = destroyCookie;
|
|
633
|
-
/* Utility Exports */
|
|
634
|
-
exports.default = {
|
|
635
|
-
set: setCookie$1,
|
|
636
|
-
get: parseCookies,
|
|
637
|
-
destroy: destroyCookie,
|
|
638
|
-
};
|
|
639
|
-
|
|
640
|
-
});
|
|
641
|
-
|
|
642
|
-
unwrapExports(dist);
|
|
643
|
-
dist.destroyCookie;
|
|
644
|
-
var dist_2 = dist.setCookie;
|
|
645
|
-
var dist_3 = dist.parseCookies;
|
|
646
|
-
|
|
647
|
-
var _this = undefined;
|
|
648
|
-
|
|
649
|
-
var getRelatedArticle = function () {
|
|
650
|
-
var _ref = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee() {
|
|
651
|
-
var ctx = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
|
|
652
|
-
var client = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
|
|
653
|
-
var article = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
654
|
-
var prevUrl = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : '/';
|
|
655
|
-
var articleCount = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 0;
|
|
656
|
-
|
|
657
|
-
var _article$url, url, documentGroupMapping, issueGroup, content_placement, references, params, articles, filters, cookies, prevSlugs, query;
|
|
658
|
-
|
|
659
|
-
return regenerator.wrap(function _callee$(_context) {
|
|
660
|
-
while (1) {
|
|
661
|
-
switch (_context.prev = _context.next) {
|
|
662
|
-
case 0:
|
|
663
|
-
_article$url = article.url;
|
|
664
|
-
_article$url = _article$url === undefined ? {
|
|
665
|
-
current: null
|
|
666
|
-
} : _article$url;
|
|
667
|
-
url = _article$url.current, documentGroupMapping = article.documentGroupMapping, issueGroup = article.issueGroup;
|
|
668
|
-
content_placement = article.content_placement;
|
|
669
|
-
references = [];
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
content_placement = content_placement && content_placement.length > 0 && content_placement.filter(function (_ref2) {
|
|
673
|
-
var identifier = _ref2.identifier;
|
|
674
|
-
return identifier !== 'news';
|
|
675
|
-
});
|
|
676
|
-
if (content_placement && content_placement.length > 0) {
|
|
677
|
-
content_placement.forEach(function (_ref3) {
|
|
678
|
-
var path = _ref3.path,
|
|
679
|
-
_id = _ref3._id;
|
|
680
|
-
|
|
681
|
-
if (!_id || typeof _id == 'undefined') {
|
|
682
|
-
return null;
|
|
683
|
-
}
|
|
684
|
-
var prev_url_to_check = prevUrl;
|
|
685
|
-
if (prev_url_to_check.includes('?')) {
|
|
686
|
-
prev_url_to_check = prev_url_to_check.split('?')[0];
|
|
687
|
-
}
|
|
688
|
-
if (prev_url_to_check.endsWith(path) && _id) references.push(_id);
|
|
689
|
-
});
|
|
690
|
-
if (references.length === 0) {
|
|
691
|
-
content_placement.forEach(function (_ref4) {
|
|
692
|
-
var _id = _ref4._id;
|
|
693
|
-
|
|
694
|
-
if (_id) references.push(_id);
|
|
695
|
-
});
|
|
696
|
-
}
|
|
697
|
-
}
|
|
698
|
-
|
|
699
|
-
if (documentGroupMapping && documentGroupMapping.length > 0) {
|
|
700
|
-
documentGroupMapping.forEach(function (_ref5) {
|
|
701
|
-
var _id = _ref5._id;
|
|
702
|
-
|
|
703
|
-
if (_id) references.push(_id);
|
|
704
|
-
});
|
|
705
|
-
}
|
|
706
|
-
|
|
707
|
-
if (issueGroup && issueGroup._id) {
|
|
708
|
-
references.push(issueGroup._id);
|
|
709
|
-
}
|
|
710
|
-
|
|
711
|
-
params = { url: url, index: articleCount };
|
|
712
|
-
articles = null;
|
|
713
|
-
|
|
714
|
-
if (!(references && references.length > 0)) {
|
|
715
|
-
_context.next = 24;
|
|
716
|
-
break;
|
|
717
|
-
}
|
|
718
|
-
|
|
719
|
-
filters = '&& references("' + references.join('","') + '") ';
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
if (ctx && url) {
|
|
723
|
-
cookies = dist_3(ctx);
|
|
724
|
-
prevSlugs = cookies['prevSlugs'];
|
|
725
|
-
|
|
726
|
-
if (!!prevSlugs) {
|
|
727
|
-
if (!prevSlugs.includes(url)) dist_2(ctx, 'prevSlugs', prevSlugs + ',"' + url + '"', {});
|
|
728
|
-
filters = filters + ' && !(url.current in [' + prevSlugs + '])';
|
|
729
|
-
} else dist_2(ctx, 'prevSlugs', '"' + url + '"', {});
|
|
730
|
-
}
|
|
731
|
-
|
|
732
|
-
query = getQuery('related', filters, '', articleCount).replace('&& taxonomyMapping[]._ref in $taxonomy', '');
|
|
733
|
-
_context.prev = 15;
|
|
734
|
-
_context.next = 18;
|
|
735
|
-
return client.fetch(query, params);
|
|
736
|
-
|
|
737
|
-
case 18:
|
|
738
|
-
articles = _context.sent;
|
|
739
|
-
_context.next = 24;
|
|
740
|
-
break;
|
|
741
|
-
|
|
742
|
-
case 21:
|
|
743
|
-
_context.prev = 21;
|
|
744
|
-
_context.t0 = _context['catch'](15);
|
|
745
|
-
|
|
746
|
-
console.error(_context.t0);
|
|
747
|
-
|
|
748
|
-
case 24:
|
|
749
|
-
return _context.abrupt('return', articles);
|
|
750
|
-
|
|
751
|
-
case 25:
|
|
752
|
-
case 'end':
|
|
753
|
-
return _context.stop();
|
|
754
|
-
}
|
|
755
|
-
}
|
|
756
|
-
}, _callee, _this, [[15, 21]]);
|
|
757
|
-
}));
|
|
758
|
-
|
|
759
|
-
return function getRelatedArticle() {
|
|
760
|
-
return _ref.apply(this, arguments);
|
|
761
|
-
};
|
|
762
|
-
}();
|
|
763
|
-
|
|
764
|
-
export { getRelatedArticle as default };
|