@jeromefitz/notion 1.0.0-notion.7 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2021 Nice Group of People, LLC
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # `@jeromefitz/notion`
1
+ # 🚧️ 🚧️ 🚧️ `@jeromefitz/notion` 🚧️ 🚧️ 🚧️
2
2
 
3
3
  Wrapper stuff for [`jeromefitzgerald.com`](https://jeromefitzgerald.com).
4
4
 
@@ -10,7 +10,7 @@ Wrapper stuff for [`jeromefitzgerald.com`](https://jeromefitzgerald.com).
10
10
 
11
11
  This is really a custom thing, so not sure how useful this would be for anyone else.
12
12
 
13
- This will not be ready for production/OSS use until `2.0.0` at the earliest. I would imagine all attempts at documentation will wildy fluctuate.
13
+ This will not be ready for production/OSS use until `3.0.0` at the earliest. I would imagine all attempts at documentation will wildy fluctuate.
14
14
 
15
15
  ## Overview
16
16
 
@@ -44,6 +44,67 @@ You need to pass `config` which informs the package of all the wonderful Notion
44
44
  }
45
45
  ```
46
46
 
47
+ ### Next
48
+
49
+ Will add an `./examples/next/...` to show this with a public facing Notion at some point.
50
+
51
+ Custom setup to get `pathVariables` from `next`:
52
+
53
+ **`[...catchAll]`**:
54
+
55
+ ```tsx
56
+ export const getStaticProps = async ({ preview = false, ...props }) => {
57
+ const { catchAll } = props.params
58
+ // @todo(next) should come from `process.env...`
59
+ // `./pages/api/...` cache = false
60
+ const cache = true
61
+ // @todo(next) should come from `catchAll`
62
+ const clear = false
63
+ const pathVariables = getPathVariables({ config: notionConfig, catchAll })
64
+
65
+ const data = await getCatchAll({ cache, catchAll, clear, pathVariables, preview })
66
+
67
+ return {
68
+ props: { preview, ...data, ...pathVariables, ...props },
69
+ revalidate,
70
+ }
71
+ }
72
+
73
+ export const getStaticPaths = () => {
74
+ return getStaticPathsCatchAll()
75
+ }
76
+ ```
77
+
78
+ **`getCatchAll.ts`**:
79
+
80
+ - Checks against `cache`
81
+ - Based on the `dataType` from `getPathVariables` calls `notion.dataTypes`
82
+ - Sets `data`
83
+ - Checks if should use `plaiceholder` to generate images
84
+ - Creates `cache` if it should
85
+ - Send back
86
+
87
+ **`getStaticPathsCatchAll.ts`**:
88
+
89
+ - Create paths via hard-coded values from configuration for:
90
+ - `PAGES__HOMEPAGE` => `index.ts`
91
+ - `PAGES` => Until we can get a proper query to dynamically generate
92
+ - Create paths to generate via `next` based off of `NOTION[#__database__#].databaseTypes`:
93
+ - `LISTING`
94
+ - `LISTING_BY_DATE`
95
+ - `SLUG`
96
+ - `SLUG_BY_ROUTE`
97
+ - Customizations for date based routing for:
98
+ - `blog` => `./blog/yyyy/mm/dd/blog-title`
99
+ - `events` => `./events/yyyy/mm/dd/events-title`
100
+ - `episodes` => `./podcasts/#__podcast-title__#/#__episode-title#`
101
+
102
+ ### Cache
103
+
104
+ Currently set to `json` files within `next` build. This (currently) causes it to be generated every build.
105
+
106
+ For larger datasets this should move to a Key/Value Store that takes into account `lastEdited` from Notion for anything since the last build. (Or someting like that.)
107
+
47
108
  ### Why
48
109
 
49
110
  `Next` and `Notion` are awesome.
@@ -1,2 +1,112 @@
1
- import '../index-78aac290';
2
- export { D as DATA_TYPES, I as INIT, L as LOOKUP, P as PROPERTIES, a as PROPERTIES_LOOKUP, Q as QUERIES, g as getDataTypes } from '../index-d92e2850';
1
+ import { Property, DataTypes, DataTypesObject } from '../schema/index';
2
+
3
+ /**
4
+ * @note
5
+ * Valid Notion Property Types mapped to Normalizer w/ init info
6
+ */
7
+ declare const PROPERTIES: Record<string, Property>;
8
+ /**
9
+ * @note
10
+ * hyper-specific for the init / see (secret/create/init)
11
+ *
12
+ * 0. Create DB w/o Relations|Rollups
13
+ * 1. Update DB w/ Relations
14
+ * 2. Update DB w/ Relation Naming Preference
15
+ * 3. Update DB w/ Rollups
16
+ */
17
+ declare const INIT: {
18
+ BLOG: Property[];
19
+ EPISODES: Property[];
20
+ EVENTS: Property[];
21
+ PAGES: Property[];
22
+ PEOPLE: Property[];
23
+ PODCASTS: Property[];
24
+ SEO: Property[];
25
+ SHOWS: Property[];
26
+ VENUES: Property[];
27
+ };
28
+ declare const LOOKUP: {
29
+ BLOG: {
30
+ key: any;
31
+ notion: any;
32
+ type: any;
33
+ }[];
34
+ EPISODES: {
35
+ key: any;
36
+ notion: any;
37
+ type: any;
38
+ }[];
39
+ EVENTS: {
40
+ key: any;
41
+ notion: any;
42
+ type: any;
43
+ }[];
44
+ PAGES: {
45
+ key: any;
46
+ notion: any;
47
+ type: any;
48
+ }[];
49
+ PEOPLE: {
50
+ key: any;
51
+ notion: any;
52
+ type: any;
53
+ }[];
54
+ PODCASTS: {
55
+ key: any;
56
+ notion: any;
57
+ type: any;
58
+ }[];
59
+ SEO: {
60
+ key: any;
61
+ notion: any;
62
+ type: any;
63
+ }[];
64
+ SHOWS: {
65
+ key: any;
66
+ notion: any;
67
+ type: any;
68
+ }[];
69
+ VENUES: {
70
+ key: any;
71
+ notion: any;
72
+ type: any;
73
+ }[];
74
+ };
75
+ declare const PROPERTIES_LOOKUP: {
76
+ key: any;
77
+ notion: any;
78
+ type: any;
79
+ }[];
80
+ /**
81
+ * @note(notion) right now we are only using `QUERIES.slug`
82
+ */
83
+ declare const QUERIES: {
84
+ dateBefore: {
85
+ property: string;
86
+ date: {
87
+ before: string;
88
+ };
89
+ };
90
+ dateOnOrAfter: {
91
+ property: string;
92
+ date: {
93
+ on_or_after: string;
94
+ };
95
+ };
96
+ published: {
97
+ property: string;
98
+ checkbox: {
99
+ equals: boolean;
100
+ };
101
+ };
102
+ slug: {
103
+ property: string;
104
+ text: {
105
+ equals: string;
106
+ };
107
+ };
108
+ };
109
+ declare const getDataTypes: DataTypes[];
110
+ declare const DATA_TYPES: DataTypesObject;
111
+
112
+ export { DATA_TYPES, INIT, LOOKUP, PROPERTIES, PROPERTIES_LOOKUP, QUERIES, getDataTypes };
package/index.cjs CHANGED
@@ -1 +1 @@
1
- var Qt=Object.create;var q=Object.defineProperty,qt=Object.defineProperties,zt=Object.getOwnPropertyDescriptor,$t=Object.getOwnPropertyDescriptors,jt=Object.getOwnPropertyNames,Ie=Object.getOwnPropertySymbols,Yt=Object.getPrototypeOf,De=Object.prototype.hasOwnProperty,Zt=Object.prototype.propertyIsEnumerable;var Ce=(e,t,n)=>t in e?q(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,b=(e,t)=>{for(var n in t||(t={}))De.call(t,n)&&Ce(e,n,t[n]);if(Ie)for(var n of Ie(t))Zt.call(t,n)&&Ce(e,n,t[n]);return e},k=(e,t)=>qt(e,$t(t)),ve=e=>q(e,"__esModule",{value:!0});var xe=(e,t)=>{for(var n in t)q(e,n,{get:t[n],enumerable:!0})},Oe=(e,t,n,l)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of jt(t))!De.call(e,r)&&(n||r!=="default")&&q(e,r,{get:()=>t[r],enumerable:!(l=zt(t,r))||l.enumerable});return e},p=(e,t)=>Oe(ve(q(e!=null?Qt(Yt(e)):{},"default",!t&&e&&e.__esModule?{get:()=>e.default,enumerable:!0}:{value:e,enumerable:!0})),e),Kt=(e=>(t,n)=>e&&e.get(t)||(n=Oe(ve({}),t,1),e&&e.set(t,n),n))(typeof WeakMap!="undefined"?new WeakMap:0);var Ne=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)};var G=(e,t,n)=>(Ne(e,t,"read from private field"),n?n.call(e):t.get(e)),Le=(e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)},Ge=(e,t,n,l)=>(Ne(e,t,"write to private field"),l?l.call(e,n):t.set(e,n),n);var $o={};xe($o,{Client:()=>Wt,constants:()=>Y});var Ht=p(require("@notionhq/client"),1);var Y={};xe(Y,{DATA_TYPES:()=>A,INIT:()=>Jt,LOOKUP:()=>ie,PROPERTIES:()=>o,PROPERTIES_LOOKUP:()=>se,QUERIES:()=>B,getDataTypes:()=>ze});var O=p(require("lodash/filter.js"),1),Be=p(require("lodash/map.js"),1),N=({key:e,notion:t,type:n})=>({key:e,notion:t,type:n}),o={addressCity:{init:!0,key:"addressCity",notion:"Address.City",type:"rich_text"},addressLatitude:{init:!0,key:"addressLatitude",notion:"Address.Latitude",type:"number",format:"number"},addressLongitude:{init:!0,key:"addressLongitude",notion:"Address.Longitude",type:"number",format:"number"},addressNeighborhood:{init:!0,key:"addressNeighborhood",notion:"Address.Neighborhood",type:"rich_text"},addressState:{init:!0,key:"addressState",notion:"Address.State",type:"select"},addressStreet:{init:!0,key:"addressStreet",notion:"Address.Street",type:"rich_text"},addressZipCode:{init:!0,key:"addressZipCode",notion:"Address.ZipCode",type:"number",format:"number"},authors:{init:!0,key:"authors",notion:"Authors",type:"people"},categories:{init:!0,key:"categories",notion:"Categories",type:"multi_select"},dateCreated:{init:!1,key:"dateCreated",notion:"Date.Created",type:"created_time"},dateEdited:{init:!1,key:"dateEdited",notion:"Date.Edited",type:"last_edited_time"},dateEvent:{init:!0,key:"dateEvent",notion:"Date.Event",type:"date"},datePublished:{init:!0,key:"datePublished",notion:"Date.Published",type:"date"},dateRecorded:{init:!0,key:"dateRecorded",notion:"Date.Recorded",type:"date"},duration:{init:!0,key:"duration",notion:"Duration",type:"rich_text"},email:{init:!0,key:"email",notion:"Email",type:"rich_text"},episode:{init:!0,key:"episode",notion:"Episode",type:"number",format:"number"},explicit:{init:!0,key:"explicit",notion:"Explicit",type:"checkbox"},festivals:{init:!0,key:"festivals",notion:"Festival",type:"multi_select"},food:{init:!0,key:"food",notion:"Food",type:"rich_text"},isIndexed:{init:!0,key:"isIndexed",notion:"Is.Indexed",type:"checkbox"},isPublished:{init:!0,key:"isPublished",notion:"Is.Published",type:"checkbox"},mp3:{init:!0,key:"mp3",notion:"MP3",type:"files"},name:{init:!0,key:"name",notion:"Name",type:"rich_text"},nameFirst:{init:!0,key:"nameFirst",notion:"Name.First",type:"rich_text"},nameLast:{init:!0,key:"nameLast",notion:"Name.Last",type:"rich_text"},namePreferred:{init:!0,key:"namePreferred",notion:"Name.Preferred",type:"rich_text"},phoneNumber:{init:!0,key:"phoneNumber",notion:"Phone",type:"rich_text"},podcastAuthor:{init:!0,key:"podcastAuthor",notion:"Author",type:"rich_text"},podcastAuthorEmail:{init:!0,key:"podcastAuthorEmail",notion:"Author.Email",type:"rich_text"},relationEpisodes__Podcast:{init:!0,key:"relationEpisodes__Podcast",notion:"Podcasts",type:"relation",relation:{database_id:"Podcasts",synced_property_name:"Episodes"}},relationPodcasts__Episodes:{init:!1,key:"relationPodcasts__Episodes",notion:"Episodes",type:"relation",relation:{database_id:"Episodes",synced_property_name:"Podcasts"}},relationEpisodes__People_Guest:{init:!0,key:"relationEpisodes__People_Guest",notion:"Guest",type:"relation",relation:{database_id:"People",synced_property_name:"Episodes.Guest"}},relationPeople__Episodes_Guest:{init:!1,key:"relationPeople__Episodes_Guest",notion:"Episodes.Guest",type:"relation",relation:{database_id:"Episodes",synced_property_name:"Guest"}},relationEpisodes__People_Sound_Engineer:{init:!0,key:"relationEpisodes__People_Sound_Engineer",notion:"Sound.Engineer",type:"relation",relation:{database_id:"People",synced_property_name:"Episodes.Sound.Engineer"}},relationPeople__Episodes_Sound_Engineer:{init:!1,key:"relationPeople__Episodes_Sound_Engineer",notion:"Episodes.Sound.Engineer",type:"relation",relation:{database_id:"Episodes",synced_property_name:"Sound.Engineer"}},relationEpisodes__People_Thanks:{init:!0,key:"relationEpisodes__People_Thanks",notion:"Thanks",type:"relation",relation:{database_id:"People",synced_property_name:"Episodes.Thanks"}},relationPeople__Episodes_Thanks:{init:!1,key:"relationPeople__Episodes_Thanks",notion:"Episodes.Thanks",type:"relation",relation:{database_id:"Episodes",synced_property_name:"Thanks"}},relationEpisodes__Venues:{init:!0,key:"relationEpisodes__Venues",notion:"Venues",type:"relation",relation:{database_id:"Venues",synced_property_name:"Episodes"}},relationVenues__Episodes:{init:!1,key:"relationVenues__Episodes",notion:"Episodes",type:"relation",relation:{database_id:"Episodes",synced_property_name:"Venues"}},relationEvents__Venues:{init:!0,key:"relationEvents__Venues",notion:"Venues",type:"relation",relation:{database_id:"Venues",synced_property_name:"Events"}},relationVenues__Events:{init:!1,key:"relationVenues__Events",notion:"Events",type:"relation",relation:{database_id:"Events",synced_property_name:"Venues"}},relationEvents__Shows:{init:!0,key:"relationEvents__Shows",notion:"Shows",type:"relation",relation:{database_id:"Shows",synced_property_name:"Events"}},relationShows__Events:{init:!1,key:"relationShows__Events",notion:"Events",type:"relation",relation:{database_id:"Events",synced_property_name:"Shows"}},relationEvents__Shows_Lineup:{init:!0,key:"relationEvents__Shows_Lineup",notion:"Shows.Lineup",type:"relation",relation:{database_id:"Shows",synced_property_name:"Events.Lineup"}},relationShows__Events_Lineup:{init:!1,key:"relationShows__Events_Lineup",notion:"Events.Lineup",type:"relation",relation:{database_id:"Events",synced_property_name:"Shows.Lineup"}},relationShows__People_Cast:{init:!0,key:"relationShows__People_Cast",notion:"Cast",type:"relation",relation:{database_id:"People",synced_property_name:"Shows.Cast"}},relationPeople__Shows_Cast:{init:!1,key:"relationPeople__Shows_Cast",notion:"Shows.Cast",type:"relation",relation:{database_id:"Shows",synced_property_name:"Cast"}},relationShows__People_Cast_Past:{init:!0,key:"relationShows__People_Cast_Past",notion:"Cast.Past",type:"relation",relation:{database_id:"People",synced_property_name:"Shows.Cast.Past"}},relationPeople__Shows_Cast_Past:{init:!1,key:"relationPeople__Shows_Cast_Past",notion:"Shows.Cast.Past",type:"relation",relation:{database_id:"Shows",synced_property_name:"Cast.Past"}},relationShows_People_Crew:{init:!0,key:"relationShows_People_Crew",notion:"Crew",type:"relation",relation:{database_id:"People",synced_property_name:"Shows.Crew"}},relationPeople__Shows_Crew:{init:!0,key:"relationPeople__Shows_Crew",notion:"Shows.Crew",type:"relation",relation:{database_id:"Shows",synced_property_name:"Crew"}},relationShows__People_Director:{init:!0,key:"relationShows__People_Director",notion:"Director",type:"relation",relation:{database_id:"People",synced_property_name:"Shows.Director"}},relationPeople__Shows_Director:{init:!1,key:"relationPeople__Shows_Director",notion:"Shows.Director",type:"relation",relation:{database_id:"Shows",synced_property_name:"Director"}},relationShows__People_Director_Musical:{init:!0,key:"relationShows__People_Director_Musical",notion:"Director.Musical",type:"relation",relation:{database_id:"People",synced_property_name:"Shows.Director.Musical"}},relationPeople__Shows_Director_Musical:{init:!1,key:"relationPeople__Shows_Director_Musical",notion:"Shows.Director.Musical",type:"relation",relation:{database_id:"Shows",synced_property_name:"Director.Musical"}},relationShows__People_Director_Technical:{init:!0,key:"relationShows__People_Director_Technical",notion:"Director.Technical",type:"relation",relation:{database_id:"People",synced_property_name:"Shows.Director.Technical"}},relationPeople__Shows_Director_Technical:{init:!1,key:"relationPeople__Shows_Director_Technical",notion:"Shows.Director.Technical",type:"relation",relation:{database_id:"Shows",synced_property_name:"Director.Technical"}},relationEvents__People_Guest:{init:!0,key:"relationEvents__People_Guest",notion:"Guest",type:"relation",relation:{database_id:"People",synced_property_name:"Events.Guest"}},relationPeople__Events_Guest:{init:!1,key:"relationEvents__People_Guest",notion:"Events.Guest",type:"relation",relation:{database_id:"Events",synced_property_name:"Guest"}},relationPodcasts__People_Host:{init:!0,key:"relationPodcasts__People_Host",notion:"Host",type:"relation",relation:{database_id:"People",synced_property_name:"Podcasts.Host"}},relationPeople__Podcasts_Host:{init:!1,key:"relationPeople__Podcasts_Host",notion:"Podcasts.Host",type:"relation",relation:{database_id:"Podcasts",synced_property_name:"Host"}},relationEvents__People_Host:{init:!0,key:"relationEvents__People_Host",notion:"Host",type:"relation",relation:{database_id:"People",synced_property_name:"Events.Host"}},relationPeople__Events_Host:{init:!1,key:"relationPeople__Events_Host",notion:"Events.Host",type:"relation",relation:{database_id:"Events",synced_property_name:"Host"}},relationShows__People_Producer:{init:!0,key:"relationShows__People_Producer",notion:"Producer",type:"relation",relation:{database_id:"People",synced_property_name:"Shows.Producer"}},relationPeople__Shows_Producer:{init:!1,key:"relationPeople__Shows_Producer",notion:"Shows.Producer",type:"relation",relation:{database_id:"Shows",synced_property_name:"Producer"}},relationEvents__People_Guest_Music:{init:!0,key:"relationEvents__People_Guest_Music",notion:"Guest.Music",type:"relation",relation:{database_id:"People",synced_property_name:"Events.Guest.Music"}},relationPeople__Events_Guest_Music:{init:!1,key:"relationPeople__Events_Guest_Music",notion:"Events.Guest.Music",type:"relation",relation:{database_id:"Events",synced_property_name:"Guest.Music"}},relationPodcasts__People_Sound_Engineer:{init:!0,key:"relationPodcasts__People_Sound_Engineer",notion:"Sound.Engineer",type:"relation",relation:{database_id:"Podcasts",synced_property_name:"Podcasts.Sound.Engineer"}},relationPeople__Podcasts_Sound_Engineer:{init:!1,key:"relationPeople__Podcasts_Sound_Engineer",notion:"Podcasts.Sound.Engineer",type:"relation",relation:{database_id:"Podcasts",synced_property_name:"Sound.Engineer"}},relationShows__People_Thanks:{init:!0,key:"relationShows__People_Thanks",notion:"Thanks",type:"relation",relation:{database_id:"People",synced_property_name:"Shows.Thanks"}},relationPeople__Shows_Thanks:{init:!1,key:"relationPeople__Shows_Thanks",notion:"Shows.Thanks",type:"relation",relation:{database_id:"Shows",synced_property_name:"Thanks"}},relationShows__People_Writer:{init:!0,key:"relationShows__People_Writer",notion:"Writer",type:"relation",relation:{database_id:"People",synced_property_name:"Shows.Writer"}},relationPeople__Shows_Writer:{init:!1,key:"relationPeople__Shows_Writer",notion:"Shows.Writer",type:"relation",relation:{database_id:"Shows",synced_property_name:"Writer"}},relationShows__Tags:{init:!0,key:"relationShows__Tags",notion:"Tags",type:"relation",relation:{database_id:"Tags",synced_property_name:"Shows"}},relationTags__Shows:{init:!1,key:"relationTags__Shows",notion:"Shows",type:"relation",relation:{database_id:"Shows",synced_property_name:"Tags"}},rollupShows__Tags:{init:!1,key:"rollupShows__Tags",notion:"Tags.Rollup",type:"rollup",rollup:{relation_property_name:"Tags",rollup_property_id:"Title",function:"show_original"}},rollupShows__People_Cast:{init:!1,key:"rollupShows__People_Cast",notion:"Cast.Rollup",type:"rollup",rollup:{relation_property_name:"Cast",rollup_property_id:"Title",function:"show_original"}},rollupShows__People_Cast_Slug:{init:!1,key:"rollupShows__People_Cast_Slug",notion:"Cast.Rollup.Slug",type:"rollup",rollup:{relation_property_name:"Cast",rollup_property_name:"Slug",function:"show_original"}},rollupShows__People_Cast_Past:{init:!1,key:"rollupShows__People_Cast_Past",notion:"Cast.Past.Rollup",type:"rollup",rollup:{relation_property_name:"Cast.Past",rollup_property_id:"Title",function:"show_original"}},rollupShows__People_Crew:{init:!1,key:"rollupShows__People_Crew",notion:"Crew.Rollup",type:"rollup",rollup:{relation_property_name:"Crew",rollup_property_name:"Title",function:"show_original"}},rollupShows__People_Director:{init:!1,key:"rollupShows__People_Director",notion:"Director.Rollup",type:"rollup",rollup:{relation_property_name:"Director",rollup_property_name:"Title",function:"show_original"}},rollupShows__People_Director_Musical:{init:!1,key:"rollupShows__People_Director_Musical",notion:"Director.Musical.Rollup",type:"rollup",rollup:{relation_property_name:"Director.Musical",rollup_property_name:"Title",function:"show_original"}},rollupShows__People_Director_Technical:{init:!1,key:"rollupShows__People_Director_Technical",notion:"Director.Technical.Rollup",type:"rollup",rollup:{relation_property_name:"Director.Technical",rollup_property_name:"Title",function:"show_original"}},rollupShows__People_Music:{init:!1,key:"rollupShows__People_Music",notion:"Music.Rollup",type:"rollup",rollup:{relation_property_name:"Music",rollup_property_name:"Title",function:"show_original"}},rollupShows__People_Producer:{init:!1,key:"rollupShows__People_Producer",notion:"Producer.Rollup",type:"rollup",rollup:{relation_property_name:"Producer",rollup_property_name:"Title",function:"show_original"}},rollupShows__People_Thanks:{init:!1,key:"rollupShows__People_Thanks",notion:"Thanks.Rollup",type:"rollup",rollup:{relation_property_name:"Thanks",rollup_property_name:"Title",function:"show_original"}},rollupShows__People_Writer:{init:!1,key:"rollupShows__People_Writer",notion:"Writer.Rollup",type:"rollup",rollup:{relation_property_name:"Writer",rollup_property_name:"Title",function:"show_original"}},rollupEvents__People_Cast:{init:!1,key:"rollupEvents__People_Cast",notion:"Cast.Rollup",type:"rollup",rollup:{relation_property_name:"Shows",rollup_property_id:"Cast",function:"show_original"}},rollupEvents__People_Guest:{init:!1,key:"rollupEvents__People_Guest",notion:"Guest.Rollup",type:"rollup",rollup:{relation_property_name:"Guest",rollup_property_id:"Title",function:"show_original"}},rollupEvents__People_Guest_Music:{init:!1,key:"rollupEvents__People_Guest_Music",notion:"Guest.Music.Rollup",type:"rollup",rollup:{relation_property_name:"Guest.Music",rollup_property_id:"Title",function:"show_original"}},rollupEvents__People_Host:{init:!1,key:"rollupEvents__People_Host",notion:"Host.Rollup",type:"rollup",rollup:{relation_property_name:"Host",rollup_property_id:"Title",function:"show_original"}},rollupEvents__Shows:{init:!1,key:"rollupEvents__Shows",notion:"Shows.Rollup",type:"rollup",rollup:{relation_property_name:"Shows",rollup_property_id:"Title",function:"show_original"}},rollupEvents__Shows_Lineup:{init:!1,key:"rollupEvents__Shows_Lineup",notion:"Shows.Lineup.Rollup",type:"rollup",rollup:{relation_property_name:"Shows.Lineup",rollup_property_id:"Title",function:"show_original"}},rollupEvents__Venues:{init:!1,key:"rollupEvents__Venues",notion:"Venues.Rollup",type:"rollup",rollup:{relation_property_name:"Venues",rollup_property_id:"Title",function:"show_original"}},season:{init:!0,key:"season",notion:"Season",type:"number",format:"number"},seoDescription:{init:!0,key:"seoDescription",notion:"SEO.Description",type:"rich_text"},seoImage:{init:!0,key:"seoImage",notion:"SEO.Image",type:"files"},seoImageDescription:{init:!0,key:"seoImageDescription",notion:"SEO.Image.Description",type:"rich_text"},slug:{init:!0,key:"slug",notion:"Slug",type:"rich_text"},socialFacebook:{init:!0,key:"socialFacebook",notion:"Social.Facebook",type:"url"},socialInstagram:{init:!0,key:"socialInstagram",notion:"Social.Instagram",type:"url"},socialTwitter:{init:!0,key:"socialTwitter",notion:"Social.Twitter",type:"url"},socialWebsite:{init:!0,key:"socialWebsite",notion:"Social.Website",type:"url"},socialSpotify:{init:!0,key:"socialSpotify",notion:"Social.Spotify",type:"url"},socialApple:{init:!0,key:"socialApple",notion:"Social.Apple",type:"url"},subtitle:{init:!0,key:"subtitle",notion:"Subitle",type:"rich_text"},ticketUrl:{init:!0,key:"ticketUrl",notion:"TicketUrl",type:"url"},title:{init:!0,key:"title",notion:"Title",type:"title"},type:{init:!0,key:"type",notion:"Type",type:"select"}},L=[o.authors,o.datePublished,o.isIndexed,o.isPublished,o.slug,o.seoDescription,o.seoImage,o.seoImageDescription,o.title],Ae=[...L],Ue=[...L,o.dateRecorded,o.duration,o.episode,o.mp3,o.season,o.relationEpisodes__People_Guest,o.relationEpisodes__People_Sound_Engineer,o.relationEpisodes__People_Thanks,o.relationEpisodes__Podcast,o.relationEpisodes__Venues,o.socialApple,o.socialSpotify,o.type],Ve=[...L,o.dateEvent,o.relationEvents__People_Guest_Music,o.relationEvents__People_Guest,o.relationEvents__People_Host,o.relationEvents__Shows_Lineup,o.relationEvents__Shows,o.relationEvents__Venues,o.socialFacebook,o.socialWebsite,o.ticketUrl,o.rollupEvents__People_Cast,o.rollupEvents__People_Guest_Music,o.rollupEvents__People_Guest,o.rollupEvents__People_Host,o.rollupEvents__Shows_Lineup,o.rollupEvents__Shows,o.rollupEvents__Venues],Me=[...L],Re=[...L,o.email,o.nameFirst,o.nameLast,o.namePreferred,o.relationPeople__Episodes_Guest,o.relationPeople__Episodes_Sound_Engineer,o.relationPeople__Episodes_Thanks,o.relationPeople__Events_Guest,o.relationPeople__Events_Guest_Music,o.relationPeople__Events_Host,o.relationPeople__Podcasts_Host,o.relationPeople__Podcasts_Sound_Engineer,o.relationPeople__Shows_Cast,o.relationPeople__Shows_Cast_Past,o.relationPeople__Shows_Director,o.relationPeople__Shows_Director_Musical,o.relationPeople__Shows_Director_Technical,o.relationPeople__Shows_Producer,o.relationPeople__Shows_Thanks,o.relationPeople__Shows_Writer],He=[...L,o.categories,o.explicit,o.podcastAuthor,o.podcastAuthorEmail,o.relationPodcasts__People_Host,o.relationPodcasts__People_Sound_Engineer,o.socialApple,o.socialSpotify,o.type,o.relationPodcasts__Episodes],We=[...L],Fe=[...L,o.relationShows__People_Cast,o.relationShows__People_Cast_Past,o.relationShows__People_Director,o.relationShows__People_Director_Musical,o.relationShows__People_Director_Technical,o.relationShows__People_Producer,o.relationShows__People_Thanks,o.relationShows__People_Writer,o.relationShows__Tags,o.socialFacebook,o.socialInstagram,o.socialTwitter,o.socialWebsite,o.relationShows__Events,o.relationShows__Events_Lineup,o.rollupShows__People_Cast,o.rollupShows__People_Cast_Slug,o.rollupShows__People_Cast_Past,o.rollupShows__People_Crew,o.rollupShows__People_Director,o.rollupShows__People_Director_Musical,o.rollupShows__People_Director_Technical,o.rollupShows__People_Music,o.rollupShows__People_Producer,o.rollupShows__People_Thanks,o.rollupShows__People_Writer,o.rollupShows__Tags],Qe=[...L,o.addressCity,o.addressLatitude,o.addressLongitude,o.addressNeighborhood,o.addressState,o.addressStreet,o.addressZipCode,o.phoneNumber,o.socialFacebook,o.socialInstagram,o.socialTwitter,o.socialWebsite,o.relationVenues__Episodes,o.relationVenues__Events],Jt={BLOG:(0,O.default)(Ae,{init:!0}),EPISODES:(0,O.default)(Ue,{init:!0}),EVENTS:(0,O.default)(Ve,{init:!0}),PAGES:(0,O.default)(Me,{init:!0}),PEOPLE:(0,O.default)(Re,{init:!0}),PODCASTS:(0,O.default)(He,{init:!0}),SEO:(0,O.default)(We,{init:!0}),SHOWS:(0,O.default)(Fe,{init:!0}),VENUES:(0,O.default)(Qe,{init:!0})},ie={BLOG:Ae.map(e=>N(e)),EPISODES:Ue.map(e=>N(e)),EVENTS:Ve.map(e=>N(e)),PAGES:Me.map(e=>N(e)),PEOPLE:Re.map(e=>N(e)),PODCASTS:He.map(e=>N(e)),SEO:We.map(e=>N(e)),SHOWS:Fe.map(e=>N(e)),VENUES:Qe.map(e=>N(e))},se=(0,Be.default)(o,e=>N(e)),qe=new Date().toISOString(),B={dateBefore:{property:o.datePublished.notion,date:{before:qe}},dateOnOrAfter:{property:o.datePublished.notion,date:{on_or_after:qe}},published:{property:o.isPublished.notion,checkbox:{equals:!1}},slug:{property:o.slug.notion,text:{equals:""}}},Xt="LISTING",eo="LISTING_BY_DATE",to="SLUG",oo="SLUG_BY_ROUTE",ze=[Xt,eo,to,oo],A=Object.assign({},...ze.map(e=>({[e]:e})).flat(1));var ae=p(require("date-fns/esm/addDays"),1),$e=p(require("date-fns/esm/addMonths"),1),je=p(require("date-fns/esm/addYears"),1),ro=(e,t)=>{switch(t){case"year":return(0,je.default)(e,1).toISOString();case"month":return(0,$e.default)(e,1).toISOString();case"day":return(0,ae.default)(e,2).toISOString()}return(0,ae.default)(e,-1).toISOString()},C=ro;var no=250;async function io(){await so()}function so(e=no){return new Promise(t=>setTimeout(t,e))}var V=io;var Ye=p(require("lodash/map.js"),1);var ao=({config:e,data:t,pathVariables:n,pageId:l})=>{var m,c;let{NOTION:r}=e,i={};if(!(t==null?void 0:t.properties))return i;let{properties:a}=t,s;if(n){let{meta:h,routeType:f}=n;s=f===((m=r==null?void 0:r.PODCASTS)==null?void 0:m.routeType)&&h.length>1?(c=r==null?void 0:r.EPISODES)==null?void 0:c.routeType:f}let y=s?ie[s.toUpperCase()]:se;return(0,Ye.default)(y,h=>{let f,u=a[h.notion];i[h.key]=null,u&&(f=M[h.type](u,l),i[h.key]=f||null)}),i},I=ao;var Ze=p(require("lodash/map.js"),1),Ke=p(require("lodash/omit.js"),1);var lo=({config:e,results:t,routeType:n})=>{let l=[];return(0,Ze.default)(t,r=>{let i=(0,Ke.default)(r,"properties");i.properties=D(I({config:e,data:r,pathVariables:n,pageId:r==null?void 0:r.id})),l.push(i)}),l},Je=lo;var Xe=p(require("lodash/fromPairs.js"),1),et=p(require("lodash/sortBy.js"),1),tt=p(require("lodash/toPairs.js"),1),po=e=>(0,Xe.default)((0,et.default)((0,tt.default)(e))),D=po;var ot=p(require("lodash/filter.js"),1),Z=p(require("lodash/map.js"),1),_o=(e,t)=>{switch(t){case"info":let n=[];return(0,Z.default)(e.seoImage,r=>!!(r==null?void 0:r.url)&&(r==null?void 0:r.type)==="external"&&n.push(r==null?void 0:r.url)),n;case"content":return!!e&&(0,ot.default)(e,{object:"block",type:"image"});case"items":let l=[];return(0,Z.default)(e,r=>{var i;(0,Z.default)((i=r==null?void 0:r.properties)==null?void 0:i.seoImage,a=>!!(a==null?void 0:a.url)&&(a==null?void 0:a.type)==="external"&&l.push(a==null?void 0:a.url))}),l;default:return[]}},W=_o;var rt=p(require("github-slugger"),1),K=p(require("lodash/map.js"),1),J=p(require("plaiceholder"),1);var uo=async({data:e,pathVariables:t})=>{var c,h,f,u,T,E,g;let n=new rt.default,l={},r=((c=e.info)==null?void 0:c.object)==="page"?W((h=e.info)==null?void 0:h.properties,"info"):!!((f=e.info)==null?void 0:f.results)&&W((T=(u=e.info)==null?void 0:u.results[0])==null?void 0:T.properties,"info"),i=!!r&&r.map(async _=>{if(!_)return null;let w=!!_&&!!(_==null?void 0:_.url)?_==null?void 0:_.url:_;if(!w)return null;let{base64:S,img:P}=await(0,J.getPlaiceholder)(w),x=n.slug(w);return{base64:S,id:x,img:P,url:w}}),a=i?await Promise.all(i):[],s=!t.isIndex&&W(e==null?void 0:e.content,"content"),y=!!s&&s.map(async _=>{var U,H;if(!_)return null;let{type:w}=_,S=_[w],P=!!_&&!!((U=S==null?void 0:S.external)==null?void 0:U.url)?(H=S==null?void 0:S.external)==null?void 0:H.url:null;if(!P)return null;let{base64:x,img:F}=await(0,J.getPlaiceholder)(P),R=n.slug(P);return{base64:x,id:R,img:F,url:P}}),m=y?await Promise.all(y):[];if(e.items){let _=e.items.object==="page"?W((E=e.items)==null?void 0:E.data,"items"):W((g=e.items)==null?void 0:g.results,"items"),w=!!_&&_.map(async P=>{if(!P)return null;let x=!!P&&!!(P==null?void 0:P.url)?P==null?void 0:P.url:P;if(!x)return null;let{base64:F,img:R}=await(0,J.getPlaiceholder)(x),U=n.slug(x);return{base64:F,id:U,img:R,url:x}}),S=await Promise.all(w);!!S&&S[0]&&(0,K.default)(S,P=>l[P.id]=P)}return!!a&&a[0]&&(0,K.default)(a,_=>l[_.id]=_),!!m&&m[0]&&(0,K.default)(m,_=>l[_.id]=_),l},z=uo;var co=e=>(console.dir("@notion(_unsupported)"),console.dir(e),e),X=co;var yo=e=>e.checkbox||!1,nt=yo;var mo=e=>{let{type:t}=e;return e[t]},ee=mo;var ho=e=>e.email||null,it=ho;var at=p(require("github-slugger"),1),lt=p(require("lodash/size.js"),1);var So=e=>e.length!==32?e:e.substr(0,8)+"-"+e.substr(8,4)+"-"+e.substr(12,4)+"-"+e.substr(16,4)+"-"+e.substr(20),st=So;var Po="https://www.notion.so/image/{{FILENAME}}?table=block&id={{PAGE_ID}}&cache=v2&w1dth=600",fo=(e,t)=>Po.replace("{{FILENAME}}",encodeURIComponent(e)).replace("{{PAGE_ID}}",st(t)),Eo=(e,t)=>{let n=new at.default,l={};return(0,lt.default)(e.files)<=0||e.files.map(r=>{var i,a;if((r==null?void 0:r.type)==="file"){let s=(i=r==null?void 0:r.file)==null?void 0:i.url.split("?")[0],y=n.slug(s);l[y]={type:r==null?void 0:r.type,url:fo(s,t)}}if((r==null?void 0:r.type)==="external"){let s=(a=r==null?void 0:r.external)==null?void 0:a.url.split("?")[0],y=n.slug(s);l[y]={type:r==null?void 0:r.type,url:s}}}),l},le=Eo;var pt=p(require("github-slugger"),1),_t=p(require("lodash/map.js"),1),go=e=>{let t=new pt.default,n={};return(0,_t.default)(e.multi_select,l=>{let r=l;r.slug=t.slug(r.name),n[r.id]=r}),n},ut=go;var wo=e=>(e==null?void 0:e.number)||null,dt=wo;var ct=p(require("github-slugger"),1),bo=e=>{let t=new ct.default;return e.people.map(n=>{let{avatar_url:l,id:r,name:i,person:a}=n,{email:s}=a;return{[t.slug(i)]:{avatar_url:l,email:s,id:r,name:i}}})[0]},yt=bo;var To=e=>(e==null?void 0:e.phone_number)||null,mt=To;var pe=p(require("lodash/map.js"),1);var ko=e=>e.type==="rollup"?e.rollup.type==="array"&&(0,pe.default)(e.rollup.array,t=>M[t.type](t))[0]:(0,pe.default)(e.relation,t=>t.id),ht=ko;var Io=e=>{var t;return(e==null?void 0:e.rich_text)?(t=e==null?void 0:e.rich_text[0])==null?void 0:t.plain_text:null},St=Io;var Pt=p(require("lodash/map.js"),1),ft=p(require("lodash/sortBy.js"),1);var Do=e=>{var t;return(0,ft.default)((0,Pt.default)((t=e==null?void 0:e.rollup)==null?void 0:t.array,n=>M[n.type](n)))},Et=Do;var gt=p(require("github-slugger"),1),Co=e=>{let t=new gt.default,n=e.select;return n?(n.slug=t.slug(e.select.name),{[n.id]:n}):null},wt=Co;var vo=e=>{var t;return(e==null?void 0:e.title)?(t=e==null?void 0:e.title[0])==null?void 0:t.plain_text:null},bt=vo;var xo=e=>e.url||null,Tt=xo;var Oo={checkbox:nt,created_by:X,created_time:ee,date:ee,email:it,files:le,formula:X,image:le,last_edited_by:X,last_edited_time:ee,multi_select:ut,number:dt,people:yt,phone_number:mt,relation:ht,rich_text:St,rollup:Et,select:wt,title:bt,url:Tt},M=Oo;var No=e=>Object.entries(e).length===0&&e.constructor===Object,_e=No;var Lo=e=>e===void 0&&typeof e=="undefined",$=Lo;var Go=async(e,{block_id:t})=>$(t)?[]:(await V(),await e({block_id:t})),ue=Go;var kt={sorts:[{property:o.slug.notion,direction:"ascending"}]},Bo=async(e,{database_id:t,sorts:n=kt.sorts,filter:l=kt.filter})=>t?await e({database_id:t,sorts:n,filter:l}):[],de=Bo;var It=async(e,{blocks:t})=>{if(t==null)return t;let n=t.filter(r=>r.has_children).map(r=>({promise:e({block_id:r.id,page_size:100}),parent_block:r})),l=await Promise.all(n.map(r=>r.promise));for(let r=0;r<l.length;r++){let i=l[r].results;if(await It(e,{blocks:i}),n[r]){let a=n[r].parent_block;a[a.type].children=i}}return t},ce=It;var Ao=({config:e,item:t,routeType:n,meta:l})=>{var m,c,h,f,u;let{NOTION:r}=e,i="",a=(m=t.properties)==null?void 0:m.slug,s="",y="/[...catchAll]";switch(n){case r.BLOG.routeType:i=(h=(c=t.properties)==null?void 0:c.datePublished)==null?void 0:h.start.slice(0,10);let[T,E,g]=i==null?void 0:i.split("-");s=`/${n}/${T}/${E}/${g}/${a}`;break;case r.EVENTS.routeType:i=(u=(f=t.properties)==null?void 0:f.dateEvent)==null?void 0:u.start.slice(0,10);let[_,w,S]=i==null?void 0:i.split("-");s=`/${n}/${_}/${w}/${S}/${a}`;break;case r.PODCASTS.routeType:case r.EPISODES.routeType:s=`/${l==null?void 0:l.join("/")}/${a}`;break;case r.PEOPLE.routeType:case r.SHOWS.routeType:case r.VENUES.routeType:default:s=`/${n}/${a}`;break}return s=s.replace("//","/"),{as:s,date:i,href:y,slug:a}},ye=Ao;var Dt=p(require("lodash/map.js"),1),te=p(require("lodash/omit.js"),1);var Uo=async({config:e,getBlocksByIdChildren:t,getDatabasesByIdQuery:n,getPagesById:l,pathVariables:r,routeType:i})=>{let{NOTION:a}=e,s={},y={},m={},c=new Date().toISOString(),h=new Date("2020-01-01").toISOString(),f=a[i.toUpperCase()].page_id__seo,u=await l({page_id:f});if(!u)return{};(u==null?void 0:u.object)==="page"&&(y=(0,te.default)(u,"properties"),y.properties=D(I({config:e,data:u,pathVariables:r,pageId:y.id}))),s=await t({block_id:y.id});let T=await n({database_id:a[i.toUpperCase()].database_id,filter:{and:[{property:i===a.EVENTS.routeType?o.dateEvent.notion:o.datePublished.notion,date:{on_or_after:i===a.EVENTS.routeType?c:h}}]}}),E=[];(0,Dt.default)(T.results,S=>{let P=S;P=(0,te.default)(P,"properties"),P.properties=D(I({config:e,data:S,pathVariables:r,pageId:S.id})),E.push(P)});let g=(0,te.default)(T,"results");g.results=E,m=g;let _={info:y,content:s,items:m,images:{}},w=_?await z({data:_,pathVariables:r}):{};return _=k(b({},_),{images:w}),_},me=Uo;var Ct=p(require("lodash/map.js"),1),j=p(require("lodash/omit.js"),1),vt=p(require("lodash/size.js"),1);var Vo=async({config:e,getBlocksByIdChildren:t,getDatabasesByIdQuery:n,getPagesById:l,pathVariables:r,routeType:i,slug:a})=>{let{NOTION:s}=e,{meta:y}=r,m={},c={},h={},f=new Date().toISOString(),u=s[i.toUpperCase()].page_id__seo,T=await l({page_id:u});T.object==="page"&&(c=(0,j.default)(T,"properties"),c.properties=D(I({config:e,data:T,pathVariables:r,pageId:c.id}))),m=await t({block_id:c.id});let E=(0,vt.default)(y),[g,_,w]=y,S=new Date(`${g||f.slice(0,4)}-${_||"01"}-${w||"01"}`),P,x=[{property:o.datePublished.notion,direction:"descending"}];switch(E){case 1:P={and:[{property:i===s.EVENTS.routeType?o.dateEvent.notion:o.datePublished.notion,date:{on_or_after:C(S,"")}},{property:i===s.EVENTS.routeType?o.dateEvent.notion:o.datePublished.notion,date:{before:C(S,"year")}}]};break;case 2:P={and:[{property:i===s.EVENTS.routeType?o.dateEvent.notion:o.datePublished.notion,date:{on_or_after:C(S,"")}},{property:i===s.EVENTS.routeType?o.dateEvent.notion:o.datePublished.notion,date:{before:C(S,"month")}}]};break;case 3:P={and:[{property:i===s.EVENTS.routeType?o.dateEvent.notion:o.datePublished.notion,date:{on_or_after:C(S,"")}},{property:i===s.EVENTS.routeType?o.dateEvent.notion:o.datePublished.notion,date:{before:C(S,"day")}}]};break;default:P={and:[{property:i===s.EVENTS.routeType?o.dateEvent.notion:o.datePublished.notion,date:{on_or_after:C(S,"")}},{property:i===s.EVENTS.routeType?o.dateEvent.notion:o.datePublished.notion,date:{before:C(S,"day")}},k(b({},B.slug),{text:{equals:a}})]};break}let F=s[i.toUpperCase()].database_id,R=await n({database_id:F,filter:P,sorts:x}),U=[];(0,Ct.default)(R.results,ne=>{let Q=ne;Q=(0,j.default)(Q,"properties"),Q.properties=D(I({config:e,data:ne,pathVariables:r,pageId:ne.id})),!!Q&&U.push(Q)});let H=(0,j.default)(R,"results");H.results=U,h=H,h=(0,j.default)(H,"data");let re={info:c,content:m,items:h,images:{}},Ft={};return re=k(b({},re),{images:Ft}),re},he=Vo;var xt=p(require("lodash/filter.js"),1),Ot=p(require("lodash/omit.js"),1);var Mo=async({config:e,getBlocksByIdChildren:t,getDatabasesByIdQuery:n,getDeepFetchAllChildren:l,pathVariables:r,routeType:i,slug:a})=>{let{NOTION:s}=e,y={},m={},c={},h=i==null?void 0:i.toUpperCase();if(!Object.keys(s).includes(h))return{info:m,content:y,items:c,images:{}};let u=await n({database_id:s[h].database_id,filter:{and:[k(b({},B.slug),{text:{equals:a}})]}}),T=(u==null?void 0:u.object)==="list"&&u.results[0];if(!T)return{};m=(0,Ot.default)(T,"properties"),m.properties=D(I({config:e,data:T,pathVariables:r,pageId:m.id})),y=await t({block_id:m.id}),y=[...await l({blocks:y.results})],c&&(c.results=(0,xt.default)(c.results,{properties:{isPublished:!0}}));let g={info:m,content:y,items:c,images:{}},_=g?await z({data:g,pathVariables:r}):{};return g=k(b({},g),{images:_}),g},Se=Mo;var Pe=p(require("lodash/omit.js"),1),Nt=p(require("lodash/size.js"),1);var Ro=async({config:e,getBlocksByIdChildren:t,getDatabasesByIdQuery:n,getQuery:l,pathVariables:r,routeType:i,slug:a})=>{let{NOTION:s}=e,{meta:y}=r,m={},c={},h={},f=new Date().toISOString();if(i===s.PODCASTS.routeType){let[E,g]=y,_=(0,Nt.default)(y)===2,w=await n({database_id:s[_?s.EPISODES.routeType.toUpperCase():i.toUpperCase()].database_id,filter:{and:[k(b({},B.slug),{text:{equals:_?g:E}})]}}),S=(w==null?void 0:w.object)==="list"&&w.results[0];if(!S)return{};c=(0,Pe.default)(S,"properties"),c.properties=D(I({config:e,data:S,pathVariables:r,pageId:c.id})),m=await t({block_id:c.id}),_||i===s.PODCASTS.routeType&&(h=await l({config:e,reqQuery:{podcasts:c.id,databaseType:s.EPISODES.routeType.toUpperCase()}}))}if([s.BLOG.routeType,s.EVENTS.routeType].includes(i)){let[E,g,_]=y,w=new Date(`${E||f.slice(0,4)}-${g||"01"}-${_||"01"}`),S=await n({database_id:s[i.toUpperCase()].database_id,filter:{and:[{property:i===s.EVENTS.routeType?o.dateEvent.notion:o.datePublished.notion,date:{on_or_after:C(w,"")}},{property:i===s.EVENTS.routeType?o.dateEvent.notion:o.datePublished.notion,date:{before:C(w,"day")}},k(b({},B.slug),{text:{equals:a}})]}}),P=(S==null?void 0:S.object)==="list"&&S.results[0];P&&(c=(0,Pe.default)(P,"properties"),c.properties=D(I({config:e,data:P,pathVariables:r,pageId:c.id})),m=await t({block_id:c.id}))}let u={info:c,content:m,items:h,images:{}},T={};return u=k(b({},u),{images:T}),u},fe=Ro;var Ho=async(e,{page_id:t})=>$(t)?[]:(await V(),await e({page_id:t})),Ee=Ho;var ge=p(require("lodash/drop.js"),1),Lt=p(require("lodash/dropRight.js"),1),Gt=p(require("lodash/first.js"),1),we=p(require("lodash/includes.js"),1),Bt=p(require("lodash/isInteger.js"),1),At=p(require("lodash/join.js"),1),Ut=p(require("lodash/last.js"),1),be=p(require("lodash/size.js"),1);var Wo=({config:e,catchAll:t})=>{let{NOTION:n,PAGES__HOMEPAGE:l,ROUTE_TYPES:r}=e,i=(0,be.default)(t),a=(0,Gt.default)(t),s=(0,Ut.default)(t),y=i>1&&(0,we.default)([n.BLOG.routeType,n.EVENTS.routeType,n.PODCASTS.routeType],a)?(0,ge.default)(t):(0,ge.default)((0,Lt.default)(t)),m=a===s&&!(0,we.default)(r,a)?"pages":a,c=a!==s&&!(0,Bt.default)(parseInt(s))?s:a,h=m==="pages",f=c===a,u=!!y&&(0,be.default)(y)!==0,T=h&&a===l?"":(0,At.default)(t,"/"),E=A.SLUG;return h?E=A.SLUG:f&&!u?E=A.LISTING:f&&u?E=A.LISTING_BY_DATE:u?E=A.SLUG_BY_ROUTE:E=A.SLUG,{dataType:E,hasMeta:u,isPage:h,isIndex:f,meta:y,routeType:m,slug:c,url:T}},Te=Wo;var Vt=p(require("lodash/map.js"),1),Mt=p(require("lodash/omit.js"),1),Rt=p(require("lodash/size.js"),1);var Fo={ASCENDING:"ascending",DESCENDING:"descending"},Qo=[{property:o.slug.notion,direction:Fo.ASCENDING}],qo=async({config:e,reqQuery:t,notionDatabasesQuery:n})=>{let{NOTION:l}=e,{databaseType:r}=t,i=r,a=!1,s=r.toUpperCase(),y=l[s].database_id;if(!y)return[];let m={},c={},h,f;if(r==="EPISODES"){f=Qo;let{podcasts:u}=t,T=[],E=[];!!u&&E.push(...u==null?void 0:u.split(",")),(0,Rt.default)(E)>0&&(0,Vt.default)(E,g=>T.push({property:o.relationEpisodes__Podcast.notion,relation:{contains:g}})),h={or:[...T]}}else a=!0;if(!a&&(!m||_e(m))){await V();let u;h?((h==null?void 0:h.or.length)===0&&(h={and:[{property:o.slug.notion,rich_text:{equals:"@hack(notion)-do-not-return"}}]}),u=await n({database_id:y,filter:h,sorts:f}),m=u,c=Je({config:e,results:u.results,routeType:i}),m=(0,Mt.default)(m,"results"),m.results=c):a=!0}return m},ke=qo;var{DATA_TYPES:oe}=Y,v,Wt=class extends Ht.Client{constructor(t){super(t);Le(this,v,void 0);this.custom={getBlocksByIdChildren:async t=>await ue(this.blocks.children.list,b({},t)),getDatabasesByIdQuery:async t=>await de(this.databases.query,t),getDeepFetchAllChildren:async t=>await ce(this.blocks.children.list,b({},t)),getInfoType:t=>ye(k(b({},t),{config:G(this,v)})),getPagesById:async t=>await Ee(this.pages.retrieve,b({},t)),getPathVariables:t=>Te(k(b({},t),{config:G(this,v)})),getQuery:async t=>await ke(k(b({},t),{config:G(this,v),notionDatabasesQuery:this.databases.query}))};this.dataTypes={[oe.LISTING]:async t=>await me(k(b({},t),{config:G(this,v),getBlocksByIdChildren:this.custom.getBlocksByIdChildren,getDatabasesByIdQuery:this.custom.getDatabasesByIdQuery,getPagesById:this.custom.getPagesById})),[oe.LISTING_BY_DATE]:async t=>await he(k(b({},t),{config:G(this,v),getBlocksByIdChildren:this.custom.getBlocksByIdChildren,getDatabasesByIdQuery:this.custom.getDatabasesByIdQuery,getPagesById:this.custom.getPagesById})),[oe.SLUG]:async t=>await Se(k(b({},t),{config:G(this,v),getBlocksByIdChildren:this.custom.getBlocksByIdChildren,getDatabasesByIdQuery:this.custom.getDatabasesByIdQuery,getDeepFetchAllChildren:this.custom.getDeepFetchAllChildren})),[oe.SLUG_BY_ROUTE]:async t=>await fe(k(b({},t),{config:G(this,v),getBlocksByIdChildren:this.custom.getBlocksByIdChildren,getDatabasesByIdQuery:this.custom.getDatabasesByIdQuery,getQuery:this.custom.getQuery}))};Ge(this,v,t==null?void 0:t.config)}};v=new WeakMap;module.exports=Kt($o);0&&(module.exports={Client,constants});
1
+ var Rt=Object.create;var z=Object.defineProperty,Ht=Object.defineProperties,Wt=Object.getOwnPropertyDescriptor,Ft=Object.getOwnPropertyDescriptors,Qt=Object.getOwnPropertyNames,we=Object.getOwnPropertySymbols,zt=Object.getPrototypeOf,be=Object.prototype.hasOwnProperty,$t=Object.prototype.propertyIsEnumerable;var Te=(e,t,n)=>t in e?z(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,b=(e,t)=>{for(var n in t||(t={}))be.call(t,n)&&Te(e,n,t[n]);if(we)for(var n of we(t))$t.call(t,n)&&Te(e,n,t[n]);return e},k=(e,t)=>Ht(e,Ft(t)),ke=e=>z(e,"__esModule",{value:!0});var jt=(e,t)=>{for(var n in t)z(e,n,{get:t[n],enumerable:!0})},Ie=(e,t,n,l)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of Qt(t))!be.call(e,r)&&(n||r!=="default")&&z(e,r,{get:()=>t[r],enumerable:!(l=Wt(t,r))||l.enumerable});return e},p=(e,t)=>Ie(ke(z(e!=null?Rt(zt(e)):{},"default",!t&&e&&e.__esModule?{get:()=>e.default,enumerable:!0}:{value:e,enumerable:!0})),e),Yt=(e=>(t,n)=>e&&e.get(t)||(n=Ie(ke({}),t,1),e&&e.set(t,n),n))(typeof WeakMap!="undefined"?new WeakMap:0);var De=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)};var B=(e,t,n)=>(De(e,t,"read from private field"),n?n.call(e):t.get(e)),Ce=(e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)},ve=(e,t,n,l)=>(De(e,t,"write to private field"),l?l.call(e,n):t.set(e,n),n);var Fo={};jt(Fo,{Client:()=>Vt});var Ut=p(require("@notionhq/client"),1);var N=p(require("lodash/filter.js"),1),xe=p(require("lodash/map.js"),1),L=({key:e,notion:t,type:n})=>({key:e,notion:t,type:n}),o={addressCity:{init:!0,key:"addressCity",notion:"Address.City",type:"rich_text"},addressLatitude:{init:!0,key:"addressLatitude",notion:"Address.Latitude",type:"number",format:"number"},addressLongitude:{init:!0,key:"addressLongitude",notion:"Address.Longitude",type:"number",format:"number"},addressNeighborhood:{init:!0,key:"addressNeighborhood",notion:"Address.Neighborhood",type:"rich_text"},addressState:{init:!0,key:"addressState",notion:"Address.State",type:"select"},addressStreet:{init:!0,key:"addressStreet",notion:"Address.Street",type:"rich_text"},addressZipCode:{init:!0,key:"addressZipCode",notion:"Address.ZipCode",type:"number",format:"number"},authors:{init:!0,key:"authors",notion:"Authors",type:"people"},categories:{init:!0,key:"categories",notion:"Categories",type:"multi_select"},dateCreated:{init:!1,key:"dateCreated",notion:"Date.Created",type:"created_time"},dateEdited:{init:!1,key:"dateEdited",notion:"Date.Edited",type:"last_edited_time"},dateEvent:{init:!0,key:"dateEvent",notion:"Date.Event",type:"date"},datePublished:{init:!0,key:"datePublished",notion:"Date.Published",type:"date"},dateRecorded:{init:!0,key:"dateRecorded",notion:"Date.Recorded",type:"date"},duration:{init:!0,key:"duration",notion:"Duration",type:"rich_text"},email:{init:!0,key:"email",notion:"Email",type:"rich_text"},episode:{init:!0,key:"episode",notion:"Episode",type:"number",format:"number"},explicit:{init:!0,key:"explicit",notion:"Explicit",type:"checkbox"},festivals:{init:!0,key:"festivals",notion:"Festival",type:"multi_select"},food:{init:!0,key:"food",notion:"Food",type:"rich_text"},isIndexed:{init:!0,key:"isIndexed",notion:"Is.Indexed",type:"checkbox"},isPublished:{init:!0,key:"isPublished",notion:"Is.Published",type:"checkbox"},mp3:{init:!0,key:"mp3",notion:"MP3",type:"files"},name:{init:!0,key:"name",notion:"Name",type:"rich_text"},nameFirst:{init:!0,key:"nameFirst",notion:"Name.First",type:"rich_text"},nameLast:{init:!0,key:"nameLast",notion:"Name.Last",type:"rich_text"},namePreferred:{init:!0,key:"namePreferred",notion:"Name.Preferred",type:"rich_text"},phoneNumber:{init:!0,key:"phoneNumber",notion:"Phone",type:"rich_text"},podcastAuthor:{init:!0,key:"podcastAuthor",notion:"Author",type:"rich_text"},podcastAuthorEmail:{init:!0,key:"podcastAuthorEmail",notion:"Author.Email",type:"rich_text"},relationEpisodes__Podcast:{init:!0,key:"relationEpisodes__Podcast",notion:"Podcasts",type:"relation",relation:{database_id:"Podcasts",synced_property_name:"Episodes"}},relationPodcasts__Episodes:{init:!1,key:"relationPodcasts__Episodes",notion:"Episodes",type:"relation",relation:{database_id:"Episodes",synced_property_name:"Podcasts"}},relationEpisodes__People_Guest:{init:!0,key:"relationEpisodes__People_Guest",notion:"Guest",type:"relation",relation:{database_id:"People",synced_property_name:"Episodes.Guest"}},relationPeople__Episodes_Guest:{init:!1,key:"relationPeople__Episodes_Guest",notion:"Episodes.Guest",type:"relation",relation:{database_id:"Episodes",synced_property_name:"Guest"}},relationEpisodes__People_Sound_Engineer:{init:!0,key:"relationEpisodes__People_Sound_Engineer",notion:"Sound.Engineer",type:"relation",relation:{database_id:"People",synced_property_name:"Episodes.Sound.Engineer"}},relationPeople__Episodes_Sound_Engineer:{init:!1,key:"relationPeople__Episodes_Sound_Engineer",notion:"Episodes.Sound.Engineer",type:"relation",relation:{database_id:"Episodes",synced_property_name:"Sound.Engineer"}},relationEpisodes__People_Thanks:{init:!0,key:"relationEpisodes__People_Thanks",notion:"Thanks",type:"relation",relation:{database_id:"People",synced_property_name:"Episodes.Thanks"}},relationPeople__Episodes_Thanks:{init:!1,key:"relationPeople__Episodes_Thanks",notion:"Episodes.Thanks",type:"relation",relation:{database_id:"Episodes",synced_property_name:"Thanks"}},relationEpisodes__Venues:{init:!0,key:"relationEpisodes__Venues",notion:"Venues",type:"relation",relation:{database_id:"Venues",synced_property_name:"Episodes"}},relationVenues__Episodes:{init:!1,key:"relationVenues__Episodes",notion:"Episodes",type:"relation",relation:{database_id:"Episodes",synced_property_name:"Venues"}},relationEvents__Venues:{init:!0,key:"relationEvents__Venues",notion:"Venues",type:"relation",relation:{database_id:"Venues",synced_property_name:"Events"}},relationVenues__Events:{init:!1,key:"relationVenues__Events",notion:"Events",type:"relation",relation:{database_id:"Events",synced_property_name:"Venues"}},relationEvents__Shows:{init:!0,key:"relationEvents__Shows",notion:"Shows",type:"relation",relation:{database_id:"Shows",synced_property_name:"Events"}},relationShows__Events:{init:!1,key:"relationShows__Events",notion:"Events",type:"relation",relation:{database_id:"Events",synced_property_name:"Shows"}},relationEvents__Shows_Lineup:{init:!0,key:"relationEvents__Shows_Lineup",notion:"Shows.Lineup",type:"relation",relation:{database_id:"Shows",synced_property_name:"Events.Lineup"}},relationShows__Events_Lineup:{init:!1,key:"relationShows__Events_Lineup",notion:"Events.Lineup",type:"relation",relation:{database_id:"Events",synced_property_name:"Shows.Lineup"}},relationShows__People_Cast:{init:!0,key:"relationShows__People_Cast",notion:"Cast",type:"relation",relation:{database_id:"People",synced_property_name:"Shows.Cast"}},relationPeople__Shows_Cast:{init:!1,key:"relationPeople__Shows_Cast",notion:"Shows.Cast",type:"relation",relation:{database_id:"Shows",synced_property_name:"Cast"}},relationShows__People_Cast_Past:{init:!0,key:"relationShows__People_Cast_Past",notion:"Cast.Past",type:"relation",relation:{database_id:"People",synced_property_name:"Shows.Cast.Past"}},relationPeople__Shows_Cast_Past:{init:!1,key:"relationPeople__Shows_Cast_Past",notion:"Shows.Cast.Past",type:"relation",relation:{database_id:"Shows",synced_property_name:"Cast.Past"}},relationShows_People_Crew:{init:!0,key:"relationShows_People_Crew",notion:"Crew",type:"relation",relation:{database_id:"People",synced_property_name:"Shows.Crew"}},relationPeople__Shows_Crew:{init:!0,key:"relationPeople__Shows_Crew",notion:"Shows.Crew",type:"relation",relation:{database_id:"Shows",synced_property_name:"Crew"}},relationShows__People_Director:{init:!0,key:"relationShows__People_Director",notion:"Director",type:"relation",relation:{database_id:"People",synced_property_name:"Shows.Director"}},relationPeople__Shows_Director:{init:!1,key:"relationPeople__Shows_Director",notion:"Shows.Director",type:"relation",relation:{database_id:"Shows",synced_property_name:"Director"}},relationShows__People_Director_Musical:{init:!0,key:"relationShows__People_Director_Musical",notion:"Director.Musical",type:"relation",relation:{database_id:"People",synced_property_name:"Shows.Director.Musical"}},relationPeople__Shows_Director_Musical:{init:!1,key:"relationPeople__Shows_Director_Musical",notion:"Shows.Director.Musical",type:"relation",relation:{database_id:"Shows",synced_property_name:"Director.Musical"}},relationShows__People_Director_Technical:{init:!0,key:"relationShows__People_Director_Technical",notion:"Director.Technical",type:"relation",relation:{database_id:"People",synced_property_name:"Shows.Director.Technical"}},relationPeople__Shows_Director_Technical:{init:!1,key:"relationPeople__Shows_Director_Technical",notion:"Shows.Director.Technical",type:"relation",relation:{database_id:"Shows",synced_property_name:"Director.Technical"}},relationEvents__People_Guest:{init:!0,key:"relationEvents__People_Guest",notion:"Guest",type:"relation",relation:{database_id:"People",synced_property_name:"Events.Guest"}},relationPeople__Events_Guest:{init:!1,key:"relationEvents__People_Guest",notion:"Events.Guest",type:"relation",relation:{database_id:"Events",synced_property_name:"Guest"}},relationPodcasts__People_Host:{init:!0,key:"relationPodcasts__People_Host",notion:"Host",type:"relation",relation:{database_id:"People",synced_property_name:"Podcasts.Host"}},relationPeople__Podcasts_Host:{init:!1,key:"relationPeople__Podcasts_Host",notion:"Podcasts.Host",type:"relation",relation:{database_id:"Podcasts",synced_property_name:"Host"}},relationEvents__People_Host:{init:!0,key:"relationEvents__People_Host",notion:"Host",type:"relation",relation:{database_id:"People",synced_property_name:"Events.Host"}},relationPeople__Events_Host:{init:!1,key:"relationPeople__Events_Host",notion:"Events.Host",type:"relation",relation:{database_id:"Events",synced_property_name:"Host"}},relationShows__People_Producer:{init:!0,key:"relationShows__People_Producer",notion:"Producer",type:"relation",relation:{database_id:"People",synced_property_name:"Shows.Producer"}},relationPeople__Shows_Producer:{init:!1,key:"relationPeople__Shows_Producer",notion:"Shows.Producer",type:"relation",relation:{database_id:"Shows",synced_property_name:"Producer"}},relationEvents__People_Guest_Music:{init:!0,key:"relationEvents__People_Guest_Music",notion:"Guest.Music",type:"relation",relation:{database_id:"People",synced_property_name:"Events.Guest.Music"}},relationPeople__Events_Guest_Music:{init:!1,key:"relationPeople__Events_Guest_Music",notion:"Events.Guest.Music",type:"relation",relation:{database_id:"Events",synced_property_name:"Guest.Music"}},relationPodcasts__People_Sound_Engineer:{init:!0,key:"relationPodcasts__People_Sound_Engineer",notion:"Sound.Engineer",type:"relation",relation:{database_id:"Podcasts",synced_property_name:"Podcasts.Sound.Engineer"}},relationPeople__Podcasts_Sound_Engineer:{init:!1,key:"relationPeople__Podcasts_Sound_Engineer",notion:"Podcasts.Sound.Engineer",type:"relation",relation:{database_id:"Podcasts",synced_property_name:"Sound.Engineer"}},relationShows__People_Thanks:{init:!0,key:"relationShows__People_Thanks",notion:"Thanks",type:"relation",relation:{database_id:"People",synced_property_name:"Shows.Thanks"}},relationPeople__Shows_Thanks:{init:!1,key:"relationPeople__Shows_Thanks",notion:"Shows.Thanks",type:"relation",relation:{database_id:"Shows",synced_property_name:"Thanks"}},relationShows__People_Writer:{init:!0,key:"relationShows__People_Writer",notion:"Writer",type:"relation",relation:{database_id:"People",synced_property_name:"Shows.Writer"}},relationPeople__Shows_Writer:{init:!1,key:"relationPeople__Shows_Writer",notion:"Shows.Writer",type:"relation",relation:{database_id:"Shows",synced_property_name:"Writer"}},relationShows__Tags:{init:!0,key:"relationShows__Tags",notion:"Tags",type:"relation",relation:{database_id:"Tags",synced_property_name:"Shows"}},relationTags__Shows:{init:!1,key:"relationTags__Shows",notion:"Shows",type:"relation",relation:{database_id:"Shows",synced_property_name:"Tags"}},rollupShows__Tags:{init:!1,key:"rollupShows__Tags",notion:"Tags.Rollup",type:"rollup",rollup:{relation_property_name:"Tags",rollup_property_id:"Title",function:"show_original"}},rollupShows__People_Cast:{init:!1,key:"rollupShows__People_Cast",notion:"Cast.Rollup",type:"rollup",rollup:{relation_property_name:"Cast",rollup_property_id:"Title",function:"show_original"}},rollupShows__People_Cast_Slug:{init:!1,key:"rollupShows__People_Cast_Slug",notion:"Cast.Rollup.Slug",type:"rollup",rollup:{relation_property_name:"Cast",rollup_property_name:"Slug",function:"show_original"}},rollupShows__People_Cast_Past:{init:!1,key:"rollupShows__People_Cast_Past",notion:"Cast.Past.Rollup",type:"rollup",rollup:{relation_property_name:"Cast.Past",rollup_property_id:"Title",function:"show_original"}},rollupShows__People_Crew:{init:!1,key:"rollupShows__People_Crew",notion:"Crew.Rollup",type:"rollup",rollup:{relation_property_name:"Crew",rollup_property_name:"Title",function:"show_original"}},rollupShows__People_Director:{init:!1,key:"rollupShows__People_Director",notion:"Director.Rollup",type:"rollup",rollup:{relation_property_name:"Director",rollup_property_name:"Title",function:"show_original"}},rollupShows__People_Director_Musical:{init:!1,key:"rollupShows__People_Director_Musical",notion:"Director.Musical.Rollup",type:"rollup",rollup:{relation_property_name:"Director.Musical",rollup_property_name:"Title",function:"show_original"}},rollupShows__People_Director_Technical:{init:!1,key:"rollupShows__People_Director_Technical",notion:"Director.Technical.Rollup",type:"rollup",rollup:{relation_property_name:"Director.Technical",rollup_property_name:"Title",function:"show_original"}},rollupShows__People_Music:{init:!1,key:"rollupShows__People_Music",notion:"Music.Rollup",type:"rollup",rollup:{relation_property_name:"Music",rollup_property_name:"Title",function:"show_original"}},rollupShows__People_Producer:{init:!1,key:"rollupShows__People_Producer",notion:"Producer.Rollup",type:"rollup",rollup:{relation_property_name:"Producer",rollup_property_name:"Title",function:"show_original"}},rollupShows__People_Thanks:{init:!1,key:"rollupShows__People_Thanks",notion:"Thanks.Rollup",type:"rollup",rollup:{relation_property_name:"Thanks",rollup_property_name:"Title",function:"show_original"}},rollupShows__People_Writer:{init:!1,key:"rollupShows__People_Writer",notion:"Writer.Rollup",type:"rollup",rollup:{relation_property_name:"Writer",rollup_property_name:"Title",function:"show_original"}},rollupEvents__People_Cast:{init:!1,key:"rollupEvents__People_Cast",notion:"Cast.Rollup",type:"rollup",rollup:{relation_property_name:"Shows",rollup_property_id:"Cast",function:"show_original"}},rollupEvents__People_Guest:{init:!1,key:"rollupEvents__People_Guest",notion:"Guest.Rollup",type:"rollup",rollup:{relation_property_name:"Guest",rollup_property_id:"Title",function:"show_original"}},rollupEvents__People_Guest_Music:{init:!1,key:"rollupEvents__People_Guest_Music",notion:"Guest.Music.Rollup",type:"rollup",rollup:{relation_property_name:"Guest.Music",rollup_property_id:"Title",function:"show_original"}},rollupEvents__People_Host:{init:!1,key:"rollupEvents__People_Host",notion:"Host.Rollup",type:"rollup",rollup:{relation_property_name:"Host",rollup_property_id:"Title",function:"show_original"}},rollupEvents__Shows:{init:!1,key:"rollupEvents__Shows",notion:"Shows.Rollup",type:"rollup",rollup:{relation_property_name:"Shows",rollup_property_id:"Title",function:"show_original"}},rollupEvents__Shows_Lineup:{init:!1,key:"rollupEvents__Shows_Lineup",notion:"Shows.Lineup.Rollup",type:"rollup",rollup:{relation_property_name:"Shows.Lineup",rollup_property_id:"Title",function:"show_original"}},rollupEvents__Venues:{init:!1,key:"rollupEvents__Venues",notion:"Venues.Rollup",type:"rollup",rollup:{relation_property_name:"Venues",rollup_property_id:"Title",function:"show_original"}},season:{init:!0,key:"season",notion:"Season",type:"number",format:"number"},seoDescription:{init:!0,key:"seoDescription",notion:"SEO.Description",type:"rich_text"},seoImage:{init:!0,key:"seoImage",notion:"SEO.Image",type:"files"},seoImageDescription:{init:!0,key:"seoImageDescription",notion:"SEO.Image.Description",type:"rich_text"},slug:{init:!0,key:"slug",notion:"Slug",type:"rich_text"},socialFacebook:{init:!0,key:"socialFacebook",notion:"Social.Facebook",type:"url"},socialInstagram:{init:!0,key:"socialInstagram",notion:"Social.Instagram",type:"url"},socialTwitter:{init:!0,key:"socialTwitter",notion:"Social.Twitter",type:"url"},socialWebsite:{init:!0,key:"socialWebsite",notion:"Social.Website",type:"url"},socialSpotify:{init:!0,key:"socialSpotify",notion:"Social.Spotify",type:"url"},socialApple:{init:!0,key:"socialApple",notion:"Social.Apple",type:"url"},subtitle:{init:!0,key:"subtitle",notion:"Subitle",type:"rich_text"},ticketUrl:{init:!0,key:"ticketUrl",notion:"TicketUrl",type:"url"},title:{init:!0,key:"title",notion:"Title",type:"title"},type:{init:!0,key:"type",notion:"Type",type:"select"}},G=[o.authors,o.datePublished,o.isIndexed,o.isPublished,o.slug,o.seoDescription,o.seoImage,o.seoImageDescription,o.title],Oe=[...G],Ne=[...G,o.dateRecorded,o.duration,o.episode,o.mp3,o.season,o.relationEpisodes__People_Guest,o.relationEpisodes__People_Sound_Engineer,o.relationEpisodes__People_Thanks,o.relationEpisodes__Podcast,o.relationEpisodes__Venues,o.socialApple,o.socialSpotify,o.type],Le=[...G,o.dateEvent,o.relationEvents__People_Guest_Music,o.relationEvents__People_Guest,o.relationEvents__People_Host,o.relationEvents__Shows_Lineup,o.relationEvents__Shows,o.relationEvents__Venues,o.socialFacebook,o.socialWebsite,o.ticketUrl,o.rollupEvents__People_Cast,o.rollupEvents__People_Guest_Music,o.rollupEvents__People_Guest,o.rollupEvents__People_Host,o.rollupEvents__Shows_Lineup,o.rollupEvents__Shows,o.rollupEvents__Venues],Ge=[...G],Be=[...G,o.email,o.nameFirst,o.nameLast,o.namePreferred,o.relationPeople__Episodes_Guest,o.relationPeople__Episodes_Sound_Engineer,o.relationPeople__Episodes_Thanks,o.relationPeople__Events_Guest,o.relationPeople__Events_Guest_Music,o.relationPeople__Events_Host,o.relationPeople__Podcasts_Host,o.relationPeople__Podcasts_Sound_Engineer,o.relationPeople__Shows_Cast,o.relationPeople__Shows_Cast_Past,o.relationPeople__Shows_Director,o.relationPeople__Shows_Director_Musical,o.relationPeople__Shows_Director_Technical,o.relationPeople__Shows_Producer,o.relationPeople__Shows_Thanks,o.relationPeople__Shows_Writer],Ae=[...G,o.categories,o.explicit,o.podcastAuthor,o.podcastAuthorEmail,o.relationPodcasts__People_Host,o.relationPodcasts__People_Sound_Engineer,o.socialApple,o.socialSpotify,o.type,o.relationPodcasts__Episodes],Ue=[...G],Ve=[...G,o.relationShows__People_Cast,o.relationShows__People_Cast_Past,o.relationShows__People_Director,o.relationShows__People_Director_Musical,o.relationShows__People_Director_Technical,o.relationShows__People_Producer,o.relationShows__People_Thanks,o.relationShows__People_Writer,o.relationShows__Tags,o.socialFacebook,o.socialInstagram,o.socialTwitter,o.socialWebsite,o.relationShows__Events,o.relationShows__Events_Lineup,o.rollupShows__People_Cast,o.rollupShows__People_Cast_Slug,o.rollupShows__People_Cast_Past,o.rollupShows__People_Crew,o.rollupShows__People_Director,o.rollupShows__People_Director_Musical,o.rollupShows__People_Director_Technical,o.rollupShows__People_Music,o.rollupShows__People_Producer,o.rollupShows__People_Thanks,o.rollupShows__People_Writer,o.rollupShows__Tags],Me=[...G,o.addressCity,o.addressLatitude,o.addressLongitude,o.addressNeighborhood,o.addressState,o.addressStreet,o.addressZipCode,o.phoneNumber,o.socialFacebook,o.socialInstagram,o.socialTwitter,o.socialWebsite,o.relationVenues__Episodes,o.relationVenues__Events],zo={BLOG:(0,N.default)(Oe,{init:!0}),EPISODES:(0,N.default)(Ne,{init:!0}),EVENTS:(0,N.default)(Le,{init:!0}),PAGES:(0,N.default)(Ge,{init:!0}),PEOPLE:(0,N.default)(Be,{init:!0}),PODCASTS:(0,N.default)(Ae,{init:!0}),SEO:(0,N.default)(Ue,{init:!0}),SHOWS:(0,N.default)(Ve,{init:!0}),VENUES:(0,N.default)(Me,{init:!0})},Re={BLOG:Oe.map(e=>L(e)),EPISODES:Ne.map(e=>L(e)),EVENTS:Le.map(e=>L(e)),PAGES:Ge.map(e=>L(e)),PEOPLE:Be.map(e=>L(e)),PODCASTS:Ae.map(e=>L(e)),SEO:Ue.map(e=>L(e)),SHOWS:Ve.map(e=>L(e)),VENUES:Me.map(e=>L(e))},He=(0,xe.default)(o,e=>L(e)),We=new Date().toISOString(),U={dateBefore:{property:o.datePublished.notion,date:{before:We}},dateOnOrAfter:{property:o.datePublished.notion,date:{on_or_after:We}},published:{property:o.isPublished.notion,checkbox:{equals:!1}},slug:{property:o.slug.notion,text:{equals:""}}},qt="LISTING",Zt="LISTING_BY_DATE",Kt="SLUG",Jt="SLUG_BY_ROUTE",Xt=[qt,Zt,Kt,Jt],v=Object.assign({},...Xt.map(e=>({[e]:e})).flat(1));var re=p(require("date-fns/addDays/index.js"),1),Fe=p(require("date-fns/addMonths/index.js"),1),Qe=p(require("date-fns/addYears/index.js"),1),eo=(e,t)=>{switch(t){case"year":return(0,Qe.default)(e,1).toISOString();case"month":return(0,Fe.default)(e,1).toISOString();case"day":return(0,re.default)(e,2).toISOString()}return(0,re.default)(e,-1).toISOString()},C=eo;var to=250;async function oo(){await ro()}function ro(e=to){return new Promise(t=>setTimeout(t,e))}var V=oo;var ze=p(require("lodash/map.js"),1);var no=({config:e,data:t,pathVariables:n,pageId:l})=>{var m,c;let{NOTION:r}=e,i={};if(!(t==null?void 0:t.properties))return i;let{properties:a}=t,s;if(n){let{meta:h,routeType:f}=n;s=f===((m=r==null?void 0:r.PODCASTS)==null?void 0:m.routeType)&&h.length>1?(c=r==null?void 0:r.EPISODES)==null?void 0:c.routeType:f}let y=s?Re[s.toUpperCase()]:He;return(0,ze.default)(y,h=>{let f,u=a[h.notion];i[h.key]=null,u&&(f=M[h.type](u,l),i[h.key]=f||null)}),i},I=no;var $e=p(require("lodash/map.js"),1),je=p(require("lodash/omit.js"),1);var io=({config:e,results:t,routeType:n})=>{let l=[];return(0,$e.default)(t,r=>{let i=(0,je.default)(r,"properties");i.properties=D(I({config:e,data:r,pathVariables:n,pageId:r==null?void 0:r.id})),l.push(i)}),l},Ye=io;var qe=p(require("lodash/fromPairs.js"),1),Ze=p(require("lodash/sortBy.js"),1),Ke=p(require("lodash/toPairs.js"),1),so=e=>(0,qe.default)((0,Ze.default)((0,Ke.default)(e))),D=so;var Je=p(require("lodash/filter.js"),1),q=p(require("lodash/map.js"),1),ao=(e,t)=>{switch(t){case"info":let n=[];return(0,q.default)(e.seoImage,r=>!!(r==null?void 0:r.url)&&(r==null?void 0:r.type)==="external"&&n.push(r==null?void 0:r.url)),n;case"content":return!!e&&(0,Je.default)(e,{object:"block",type:"image"});case"items":let l=[];return(0,q.default)(e,r=>{var i;(0,q.default)((i=r==null?void 0:r.properties)==null?void 0:i.seoImage,a=>!!(a==null?void 0:a.url)&&(a==null?void 0:a.type)==="external"&&l.push(a==null?void 0:a.url))}),l;default:return[]}},W=ao;var Xe=p(require("github-slugger"),1),Z=p(require("lodash/map.js"),1),K=p(require("plaiceholder"),1);var lo=async({data:e,pathVariables:t})=>{var c,h,f,u,T,E,g;let n=new Xe.default,l={},r=((c=e.info)==null?void 0:c.object)==="page"?W((h=e.info)==null?void 0:h.properties,"info"):!!((f=e.info)==null?void 0:f.results)&&W((T=(u=e.info)==null?void 0:u.results[0])==null?void 0:T.properties,"info"),i=!!r&&r.map(async _=>{if(!_)return null;let w=!!_&&!!(_==null?void 0:_.url)?_==null?void 0:_.url:_;if(!w)return null;let{base64:S,img:P}=await(0,K.getPlaiceholder)(w),O=n.slug(w);return{base64:S,id:O,img:P,url:w}}),a=i?await Promise.all(i):[],s=!t.isIndex&&W(e==null?void 0:e.content,"content"),y=!!s&&s.map(async _=>{var A,H;if(!_)return null;let{type:w}=_,S=_[w],P=!!_&&!!((A=S==null?void 0:S.external)==null?void 0:A.url)?(H=S==null?void 0:S.external)==null?void 0:H.url:null;if(!P)return null;let{base64:O,img:F}=await(0,K.getPlaiceholder)(P),R=n.slug(P);return{base64:O,id:R,img:F,url:P}}),m=y?await Promise.all(y):[];if(e.items){let _=e.items.object==="page"?W((E=e.items)==null?void 0:E.data,"items"):W((g=e.items)==null?void 0:g.results,"items"),w=!!_&&_.map(async P=>{if(!P)return null;let O=!!P&&!!(P==null?void 0:P.url)?P==null?void 0:P.url:P;if(!O)return null;let{base64:F,img:R}=await(0,K.getPlaiceholder)(O),A=n.slug(O);return{base64:F,id:A,img:R,url:O}}),S=await Promise.all(w);!!S&&S[0]&&(0,Z.default)(S,P=>l[P.id]=P)}return!!a&&a[0]&&(0,Z.default)(a,_=>l[_.id]=_),!!m&&m[0]&&(0,Z.default)(m,_=>l[_.id]=_),l},$=lo;var po=e=>(console.dir("@notion(_unsupported)"),console.dir(e),e),J=po;var _o=e=>e.checkbox||!1,et=_o;var uo=e=>{let{type:t}=e;return e[t]},X=uo;var co=e=>e.email||null,tt=co;var rt=p(require("github-slugger"),1),nt=p(require("lodash/size.js"),1);var yo=e=>e.length!==32?e:e.substr(0,8)+"-"+e.substr(8,4)+"-"+e.substr(12,4)+"-"+e.substr(16,4)+"-"+e.substr(20),ot=yo;var mo="https://www.notion.so/image/{{FILENAME}}?table=block&id={{PAGE_ID}}&cache=v2&w1dth=600",ho=(e,t)=>mo.replace("{{FILENAME}}",encodeURIComponent(e)).replace("{{PAGE_ID}}",ot(t)),So=(e,t)=>{let n=new rt.default,l={};return(0,nt.default)(e.files)<=0||e.files.map(r=>{var i,a;if((r==null?void 0:r.type)==="file"){let s=(i=r==null?void 0:r.file)==null?void 0:i.url.split("?")[0],y=n.slug(s);l[y]={type:r==null?void 0:r.type,url:ho(s,t)}}if((r==null?void 0:r.type)==="external"){let s=(a=r==null?void 0:r.external)==null?void 0:a.url.split("?")[0],y=n.slug(s);l[y]={type:r==null?void 0:r.type,url:s}}}),l},ne=So;var it=p(require("github-slugger"),1),st=p(require("lodash/map.js"),1),Po=e=>{let t=new it.default,n={};return(0,st.default)(e.multi_select,l=>{let r=l;r.slug=t.slug(r.name),n[r.id]=r}),n},at=Po;var fo=e=>(e==null?void 0:e.number)||null,lt=fo;var pt=p(require("github-slugger"),1),Eo=e=>{let t=new pt.default;return e.people.map(n=>{let{avatar_url:l,id:r,name:i,person:a}=n,{email:s}=a;return{[t.slug(i)]:{avatar_url:l,email:s,id:r,name:i}}})[0]},_t=Eo;var go=e=>(e==null?void 0:e.phone_number)||null,ut=go;var ie=p(require("lodash/map.js"),1);var wo=e=>e.type==="rollup"?e.rollup.type==="array"&&(0,ie.default)(e.rollup.array,t=>M[t.type](t))[0]:(0,ie.default)(e.relation,t=>t.id),dt=wo;var bo=e=>{var t;return(e==null?void 0:e.rich_text)?(t=e==null?void 0:e.rich_text[0])==null?void 0:t.plain_text:null},ct=bo;var yt=p(require("lodash/map.js"),1),mt=p(require("lodash/sortBy.js"),1);var To=e=>{var t;return(0,mt.default)((0,yt.default)((t=e==null?void 0:e.rollup)==null?void 0:t.array,n=>M[n.type](n)))},ht=To;var St=p(require("github-slugger"),1),ko=e=>{let t=new St.default,n=e.select;return n?(n.slug=t.slug(e.select.name),{[n.id]:n}):null},Pt=ko;var Io=e=>{var t;return(e==null?void 0:e.title)?(t=e==null?void 0:e.title[0])==null?void 0:t.plain_text:null},ft=Io;var Do=e=>e.url||null,Et=Do;var Co={checkbox:et,created_by:J,created_time:X,date:X,email:tt,files:ne,formula:J,image:ne,last_edited_by:J,last_edited_time:X,multi_select:at,number:lt,people:_t,phone_number:ut,relation:dt,rich_text:ct,rollup:ht,select:Pt,title:ft,url:Et},M=Co;var vo=e=>Object.entries(e).length===0&&e.constructor===Object,se=vo;var xo=e=>e===void 0&&typeof e=="undefined",j=xo;var Oo=async(e,{block_id:t})=>j(t)?[]:(await V(),await e({block_id:t})),ae=Oo;var gt={sorts:[{property:o.slug.notion,direction:"ascending"}]},No=async(e,{database_id:t,sorts:n=gt.sorts,filter:l=gt.filter})=>t?await e({database_id:t,sorts:n,filter:l}):[],le=No;var wt=async(e,{blocks:t})=>{if(t==null)return t;let n=t.filter(r=>r.has_children).map(r=>({promise:e({block_id:r.id,page_size:100}),parent_block:r})),l=await Promise.all(n.map(r=>r.promise));for(let r=0;r<l.length;r++){let i=l[r].results;if(await wt(e,{blocks:i}),n[r]){let a=n[r].parent_block;a[a.type].children=i}}return t},pe=wt;var Lo=({config:e,item:t,routeType:n,meta:l})=>{var m,c,h,f,u;let{NOTION:r}=e,i="",a=(m=t.properties)==null?void 0:m.slug,s="",y="/[...catchAll]";switch(n){case r.BLOG.routeType:i=(h=(c=t.properties)==null?void 0:c.datePublished)==null?void 0:h.start.slice(0,10);let[T,E,g]=i==null?void 0:i.split("-");s=`/${n}/${T}/${E}/${g}/${a}`;break;case r.EVENTS.routeType:i=(u=(f=t.properties)==null?void 0:f.dateEvent)==null?void 0:u.start.slice(0,10);let[_,w,S]=i==null?void 0:i.split("-");s=`/${n}/${_}/${w}/${S}/${a}`;break;case r.PODCASTS.routeType:case r.EPISODES.routeType:s=`/${l==null?void 0:l.join("/")}/${a}`;break;case r.PEOPLE.routeType:case r.SHOWS.routeType:case r.VENUES.routeType:default:s=`/${n}/${a}`;break}return s=s.replace("//","/"),{as:s,date:i,href:y,slug:a}},_e=Lo;var bt=p(require("lodash/map.js"),1),ee=p(require("lodash/omit.js"),1);var Go=async({config:e,getBlocksByIdChildren:t,getDatabasesByIdQuery:n,getPagesById:l,pathVariables:r,routeType:i})=>{let{NOTION:a}=e,s={},y={},m={},c=new Date().toISOString(),h=new Date("2020-01-01").toISOString(),f=a[i.toUpperCase()].page_id__seo,u=await l({page_id:f});if(!u)return{};(u==null?void 0:u.object)==="page"&&(y=(0,ee.default)(u,"properties"),y.properties=D(I({config:e,data:u,pathVariables:r,pageId:y.id}))),s=await t({block_id:y.id});let T=await n({database_id:a[i.toUpperCase()].database_id,filter:{and:[{property:i===a.EVENTS.routeType?o.dateEvent.notion:o.datePublished.notion,date:{on_or_after:i===a.EVENTS.routeType?c:h}}]}}),E=[];(0,bt.default)(T.results,S=>{let P=S;P=(0,ee.default)(P,"properties"),P.properties=D(I({config:e,data:S,pathVariables:r,pageId:S.id})),E.push(P)});let g=(0,ee.default)(T,"results");g.results=E,m=g;let _={info:y,content:s,items:m,images:{}},w=_?await $({data:_,pathVariables:r}):{};return _=k(b({},_),{images:w}),_},ue=Go;var Tt=p(require("lodash/map.js"),1),Y=p(require("lodash/omit.js"),1),kt=p(require("lodash/size.js"),1);var Bo=async({config:e,getBlocksByIdChildren:t,getDatabasesByIdQuery:n,getPagesById:l,pathVariables:r,routeType:i,slug:a})=>{let{NOTION:s}=e,{meta:y}=r,m={},c={},h={},f=new Date().toISOString(),u=s[i.toUpperCase()].page_id__seo,T=await l({page_id:u});T.object==="page"&&(c=(0,Y.default)(T,"properties"),c.properties=D(I({config:e,data:T,pathVariables:r,pageId:c.id}))),m=await t({block_id:c.id});let E=(0,kt.default)(y),[g,_,w]=y,S=new Date(`${g||f.slice(0,4)}-${_||"01"}-${w||"01"}`),P,O=[{property:o.datePublished.notion,direction:"descending"}];switch(E){case 1:P={and:[{property:i===s.EVENTS.routeType?o.dateEvent.notion:o.datePublished.notion,date:{on_or_after:C(S,"")}},{property:i===s.EVENTS.routeType?o.dateEvent.notion:o.datePublished.notion,date:{before:C(S,"year")}}]};break;case 2:P={and:[{property:i===s.EVENTS.routeType?o.dateEvent.notion:o.datePublished.notion,date:{on_or_after:C(S,"")}},{property:i===s.EVENTS.routeType?o.dateEvent.notion:o.datePublished.notion,date:{before:C(S,"month")}}]};break;case 3:P={and:[{property:i===s.EVENTS.routeType?o.dateEvent.notion:o.datePublished.notion,date:{on_or_after:C(S,"")}},{property:i===s.EVENTS.routeType?o.dateEvent.notion:o.datePublished.notion,date:{before:C(S,"day")}}]};break;default:P={and:[{property:i===s.EVENTS.routeType?o.dateEvent.notion:o.datePublished.notion,date:{on_or_after:C(S,"")}},{property:i===s.EVENTS.routeType?o.dateEvent.notion:o.datePublished.notion,date:{before:C(S,"day")}},k(b({},U.slug),{text:{equals:a}})]};break}let F=s[i.toUpperCase()].database_id,R=await n({database_id:F,filter:P,sorts:O}),A=[];(0,Tt.default)(R.results,oe=>{let Q=oe;Q=(0,Y.default)(Q,"properties"),Q.properties=D(I({config:e,data:oe,pathVariables:r,pageId:oe.id})),!!Q&&A.push(Q)});let H=(0,Y.default)(R,"results");H.results=A,h=H,h=(0,Y.default)(H,"data");let te={info:c,content:m,items:h,images:{}},Mt={};return te=k(b({},te),{images:Mt}),te},de=Bo;var It=p(require("lodash/filter.js"),1),Dt=p(require("lodash/omit.js"),1);var Ao=async({config:e,getBlocksByIdChildren:t,getDatabasesByIdQuery:n,getDeepFetchAllChildren:l,pathVariables:r,routeType:i,slug:a})=>{let{NOTION:s}=e,y={},m={},c={},h=i==null?void 0:i.toUpperCase();if(!Object.keys(s).includes(h))return{info:m,content:y,items:c,images:{}};let u=await n({database_id:s[h].database_id,filter:{and:[k(b({},U.slug),{text:{equals:a}})]}}),T=(u==null?void 0:u.object)==="list"&&u.results[0];if(!T)return{};m=(0,Dt.default)(T,"properties"),m.properties=D(I({config:e,data:T,pathVariables:r,pageId:m.id})),y=await t({block_id:m.id}),y=[...await l({blocks:y.results})],c&&(c.results=(0,It.default)(c.results,{properties:{isPublished:!0}}));let g={info:m,content:y,items:c,images:{}},_=g?await $({data:g,pathVariables:r}):{};return g=k(b({},g),{images:_}),g},ce=Ao;var ye=p(require("lodash/omit.js"),1),Ct=p(require("lodash/size.js"),1);var Uo=async({config:e,getBlocksByIdChildren:t,getDatabasesByIdQuery:n,getQuery:l,pathVariables:r,routeType:i,slug:a})=>{let{NOTION:s}=e,{meta:y}=r,m={},c={},h={},f=new Date().toISOString();if(i===s.PODCASTS.routeType){let[E,g]=y,_=(0,Ct.default)(y)===2,w=await n({database_id:s[_?s.EPISODES.routeType.toUpperCase():i.toUpperCase()].database_id,filter:{and:[k(b({},U.slug),{text:{equals:_?g:E}})]}}),S=(w==null?void 0:w.object)==="list"&&w.results[0];if(!S)return{};c=(0,ye.default)(S,"properties"),c.properties=D(I({config:e,data:S,pathVariables:r,pageId:c.id})),m=await t({block_id:c.id}),_||i===s.PODCASTS.routeType&&(h=await l({config:e,reqQuery:{podcasts:c.id,databaseType:s.EPISODES.routeType.toUpperCase()}}))}if([s.BLOG.routeType,s.EVENTS.routeType].includes(i)){let[E,g,_]=y,w=new Date(`${E||f.slice(0,4)}-${g||"01"}-${_||"01"}`),S=await n({database_id:s[i.toUpperCase()].database_id,filter:{and:[{property:i===s.EVENTS.routeType?o.dateEvent.notion:o.datePublished.notion,date:{on_or_after:C(w,"")}},{property:i===s.EVENTS.routeType?o.dateEvent.notion:o.datePublished.notion,date:{before:C(w,"day")}},k(b({},U.slug),{text:{equals:a}})]}}),P=(S==null?void 0:S.object)==="list"&&S.results[0];P&&(c=(0,ye.default)(P,"properties"),c.properties=D(I({config:e,data:P,pathVariables:r,pageId:c.id})),m=await t({block_id:c.id}))}let u={info:c,content:m,items:h,images:{}},T={};return u=k(b({},u),{images:T}),u},me=Uo;var Vo=async(e,{page_id:t})=>j(t)?[]:(await V(),await e({page_id:t})),he=Vo;var Se=p(require("lodash/drop.js"),1),vt=p(require("lodash/dropRight.js"),1),xt=p(require("lodash/first.js"),1),Pe=p(require("lodash/includes.js"),1),Ot=p(require("lodash/isInteger.js"),1),Nt=p(require("lodash/join.js"),1),Lt=p(require("lodash/last.js"),1),fe=p(require("lodash/size.js"),1);var Mo=({config:e,catchAll:t})=>{let{NOTION:n,PAGES__HOMEPAGE:l,ROUTE_TYPES:r}=e,i=(0,fe.default)(t),a=(0,xt.default)(t),s=(0,Lt.default)(t),y=i>1&&(0,Pe.default)([n.BLOG.routeType,n.EVENTS.routeType,n.PODCASTS.routeType],a)?(0,Se.default)(t):(0,Se.default)((0,vt.default)(t)),m=a===s&&!(0,Pe.default)(r,a)?"pages":a,c=a!==s&&!(0,Ot.default)(parseInt(s))?s:a,h=m==="pages",f=c===a,u=!!y&&(0,fe.default)(y)!==0,T=h&&a===l?"":(0,Nt.default)(t,"/"),E=v.SLUG;return h?E=v.SLUG:f&&!u?E=v.LISTING:f&&u?E=v.LISTING_BY_DATE:u?E=v.SLUG_BY_ROUTE:E=v.SLUG,{dataType:E,hasMeta:u,isPage:h,isIndex:f,meta:y,routeType:m,slug:c,url:T}},Ee=Mo;var Gt=p(require("lodash/map.js"),1),Bt=p(require("lodash/omit.js"),1),At=p(require("lodash/size.js"),1);var Ro={ASCENDING:"ascending",DESCENDING:"descending"},Ho=[{property:o.slug.notion,direction:Ro.ASCENDING}],Wo=async({config:e,reqQuery:t,notionDatabasesQuery:n})=>{let{NOTION:l}=e,{databaseType:r}=t,i=r,a=!1,s=r.toUpperCase(),y=l[s].database_id;if(!y)return[];let m={},c={},h,f;if(r==="EPISODES"){f=Ho;let{podcasts:u}=t,T=[],E=[];!!u&&E.push(...u==null?void 0:u.split(",")),(0,At.default)(E)>0&&(0,Gt.default)(E,g=>T.push({property:o.relationEpisodes__Podcast.notion,relation:{contains:g}})),h={or:[...T]}}else a=!0;if(!a&&(!m||se(m))){await V();let u;h?((h==null?void 0:h.or.length)===0&&(h={and:[{property:o.slug.notion,rich_text:{equals:"@hack(notion)-do-not-return"}}]}),u=await n({database_id:y,filter:h,sorts:f}),m=u,c=Ye({config:e,results:u.results,routeType:i}),m=(0,Bt.default)(m,"results"),m.results=c):a=!0}return m},ge=Wo;var x,Vt=class extends Ut.Client{constructor(t){super(t);Ce(this,x,void 0);this.custom={getBlocksByIdChildren:async t=>await ae(this.blocks.children.list,b({},t)),getDatabasesByIdQuery:async t=>await le(this.databases.query,t),getDeepFetchAllChildren:async t=>await pe(this.blocks.children.list,b({},t)),getInfoType:t=>_e(k(b({},t),{config:B(this,x)})),getPagesById:async t=>await he(this.pages.retrieve,b({},t)),getPathVariables:t=>Ee(k(b({},t),{config:B(this,x)})),getQuery:async t=>await ge(k(b({},t),{config:B(this,x),notionDatabasesQuery:this.databases.query}))};this.dataTypes={[v.LISTING]:async t=>await ue(k(b({},t),{config:B(this,x),getBlocksByIdChildren:this.custom.getBlocksByIdChildren,getDatabasesByIdQuery:this.custom.getDatabasesByIdQuery,getPagesById:this.custom.getPagesById})),[v.LISTING_BY_DATE]:async t=>await de(k(b({},t),{config:B(this,x),getBlocksByIdChildren:this.custom.getBlocksByIdChildren,getDatabasesByIdQuery:this.custom.getDatabasesByIdQuery,getPagesById:this.custom.getPagesById})),[v.SLUG]:async t=>await ce(k(b({},t),{config:B(this,x),getBlocksByIdChildren:this.custom.getBlocksByIdChildren,getDatabasesByIdQuery:this.custom.getDatabasesByIdQuery,getDeepFetchAllChildren:this.custom.getDeepFetchAllChildren})),[v.SLUG_BY_ROUTE]:async t=>await me(k(b({},t),{config:B(this,x),getBlocksByIdChildren:this.custom.getBlocksByIdChildren,getDatabasesByIdQuery:this.custom.getDatabasesByIdQuery,getQuery:this.custom.getQuery}))};ve(this,x,t==null?void 0:t.config)}};x=new WeakMap;module.exports=Yt(Fo);0&&(module.exports={Client});
package/index.d.ts CHANGED
@@ -1,7 +1,5 @@
1
+ import { DataTypes } from './schema/index';
1
2
  import { Client as Client$1 } from '@notionhq/client';
2
- export { i as constants } from './index-d92e2850';
3
- import { D as DataTypes } from './index-78aac290';
4
- export { i as TYPES } from './index-78aac290';
5
3
 
6
4
  declare class Client extends Client$1 {
7
5
  #private;