@lorenzopant/tmdb 1.22.2 → 1.24.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/dist/index.d.mts CHANGED
@@ -29,7 +29,8 @@ type ChangeItem = {
29
29
  */
30
30
  type ChangeResultItem = {
31
31
  /** Id of the movie, tv show or person */id: number; /** Whether the movie, tv show or person is marked as adult content */
32
- adult: boolean;
32
+ adult: boolean; /** Whether the movie or tv show is flagged as softcore content */
33
+ softcore: boolean;
33
34
  };
34
35
  //#endregion
35
36
  //#region src/types/config/languages.d.ts
@@ -150,7 +151,7 @@ type Credit = {
150
151
  * Represents a cast member in a movie or TV show.
151
152
  */
152
153
  type Cast = Credit & {
153
- cast_id: number;
154
+ cast_id?: number;
154
155
  character: string;
155
156
  order: number;
156
157
  };
@@ -198,7 +199,7 @@ type AlternativeTitle = {
198
199
  type: string;
199
200
  };
200
201
  type VideoResults = {
201
- /** Media identifier */id: number | string; /** Array of video items */
202
+ /** Media identifier. Absent when this resource is fetched via `append_to_response` rather than standalone. */id?: number | string; /** Array of video items */
202
203
  results: VideoItem[];
203
204
  };
204
205
  /**
@@ -231,7 +232,8 @@ type BaseKnownForItem = {
231
232
  overview: string;
232
233
  poster_path?: string;
233
234
  genre_ids: number[];
234
- popularity: number;
235
+ popularity: number; /** Whether the item is flagged as softcore content */
236
+ softcore: boolean;
235
237
  vote_average: number;
236
238
  vote_count: number;
237
239
  };
@@ -292,7 +294,7 @@ type ReviewAuthorDetails = {
292
294
  };
293
295
  /** Collection of translations for a media item (object with `id` and `translations`). */
294
296
  type TranslationResults<T> = {
295
- id: number | string;
297
+ /** Absent when this resource is fetched via `append_to_response` rather than standalone. */id?: number | string;
296
298
  translations: Translation<T>[];
297
299
  };
298
300
  /**
@@ -309,15 +311,17 @@ type Translation<T = unknown> = {
309
311
  * Watch provider availability by country
310
312
  */
311
313
  type MediaWatchProviders = {
312
- /** Movie/TV show identifier */id: number; /** Watch providers grouped by country code */
314
+ /** Movie/TV show identifier. Absent when fetched via `append_to_response` rather than standalone. */id?: number; /** Watch providers grouped by country code */
313
315
  results: Record<CountryISO3166_1, WatchProvider>;
314
316
  };
315
317
  /**
316
318
  * Watch provider options for a specific country
317
319
  */
318
320
  type WatchProvider = {
319
- /** URL to watch/purchase the movie */link: string; /** Streaming providers (subscription required) */
320
- flatrate?: WatchProviderItem[]; /** Rental providers */
321
+ /** URL to watch/purchase the movie */link: string; /** Ad-supported (free with ads) providers */
322
+ ads?: WatchProviderItem[]; /** Streaming providers (subscription required) */
323
+ flatrate?: WatchProviderItem[]; /** Free (no ads, no subscription) providers */
324
+ free?: WatchProviderItem[]; /** Rental providers */
321
325
  rent?: WatchProviderItem[]; /** Purchase providers */
322
326
  buy?: WatchProviderItem[];
323
327
  };
@@ -339,6 +343,8 @@ type WatchProviderItem = {
339
343
  type Prettify<T> = T extends object ? (T extends infer O ? { [K in keyof O]: Prettify<O[K]> } : never) : T;
340
344
  /** Keep literal suggestions but allow any string */
341
345
  type LiteralUnion<T extends string> = T | (string & {});
346
+ /** Keep literal suggestions but allow any number */
347
+ type LiteralUnionNumber<T extends number> = T | (number & {});
342
348
  /**
343
349
  * Type guard checks for KnowForItems (tv or movie)
344
350
  * @returns
@@ -357,7 +363,8 @@ type ImageCollectionKey = "backdrops" | "logos" | "posters" | "profiles" | "stil
357
363
  type ImageItem = {
358
364
  /** Aspect ratio of the image (width/height) */aspect_ratio: number; /** Image height in pixels */
359
365
  height: number; /** ISO 639-1 language code if image contains text, null otherwise */
360
- iso_639_1?: string; /** Relative path to the image file (append to base URL) */
366
+ iso_639_1?: string; /** ISO 3166-1 country code the image is tagged for, if any */
367
+ iso_3166_1?: string; /** Relative path to the image file (append to base URL) */
361
368
  file_path: string; /** Average user rating for this image */
362
369
  vote_average: number; /** Total number of votes for this image */
363
370
  vote_count: number; /** Image width in pixels */
@@ -396,7 +403,7 @@ type OrganizationImage = Omit<ImageItem, "iso_639_1"> & {
396
403
  * type PersonImagesResult = ImagesResult<"profiles">;
397
404
  */
398
405
  type ImagesResult<T, K extends ImageCollectionKey> = {
399
- /** The unique TMDB identifier of the entity. */id: number;
406
+ /** The unique TMDB identifier of the entity. Absent when fetched via `append_to_response` rather than standalone. */id?: number;
400
407
  } & { [P in K]: T[] };
401
408
  /** Available file type on svg (for images) */
402
409
  type FileType = LiteralUnion<".png" | ".svg">;
@@ -667,7 +674,7 @@ declare class TMDBLogger {
667
674
  constructor(logger?: TMDBLoggerFn);
668
675
  static from(logger?: boolean | TMDBLoggerFn): TMDBLogger | undefined;
669
676
  log(entry: TMDBLoggerEntry): void;
670
- private static defaultLogger;
677
+ private static readonly defaultLogger;
671
678
  }
672
679
  //#endregion
673
680
  //#region src/utils/rate-limiter.d.ts
@@ -1551,7 +1558,7 @@ type RequestInterceptor = (context: RequestInterceptorContext) => RequestInterce
1551
1558
  * });
1552
1559
  * ```
1553
1560
  */
1554
- type ResponseSuccessInterceptor = (data: unknown) => unknown | void | Promise<unknown | void>;
1561
+ type ResponseSuccessInterceptor = (data: unknown) => unknown | Promise<unknown>;
1555
1562
  /**
1556
1563
  * Called after a TMDB API error has been normalised into a {@link TMDBError}.
1557
1564
  *
@@ -1833,8 +1840,8 @@ type PersonResultItem = {
1833
1840
  name: string; /** Original name, typically in the person's native language */
1834
1841
  original_name: string; /** TMDB popularity score based on views, votes, and activity */
1835
1842
  popularity: number; /** Path to person's profile image */
1836
- profile_path?: string; /** List of notable movies or TV shows the person is known for */
1837
- known_for: KnownForItem[];
1843
+ profile_path?: string; /** List of notable movies or TV shows the person is known for. Not returned by every endpoint (e.g. trending) */
1844
+ known_for?: KnownForItem[];
1838
1845
  };
1839
1846
  /**
1840
1847
  * A single TV series result as returned by TMDB APIs.
@@ -1844,7 +1851,8 @@ type PersonResultItem = {
1844
1851
  * It is a partial representation of the TVDetails type.
1845
1852
  */
1846
1853
  type TVSeriesResultItem = {
1847
- /** Relative path to the backdrop image for the series (nullable on some responses). */backdrop_path?: string; /** First air date of the series (YYYY-MM-DD). */
1854
+ /** Whether the series is marked as adult content. */adult: boolean; /** Relative path to the backdrop image for the series (nullable on some responses). */
1855
+ backdrop_path?: string; /** First air date of the series (YYYY-MM-DD). */
1848
1856
  first_air_date: string; /** Array of genre ids associated with the series. */
1849
1857
  genre_ids: number[]; /** Unique TMDB id for the series. */
1850
1858
  id: number; /** Series name (localized). */
@@ -1853,7 +1861,8 @@ type TVSeriesResultItem = {
1853
1861
  original_language: string; /** Brief synopsis/overview of the series. */
1854
1862
  overview: string; /** Popularity score as returned by TMDB. */
1855
1863
  popularity: number; /** Relative path to the poster image for the series (nullable on some responses). */
1856
- poster_path?: string; /** Average vote score for the series. */
1864
+ poster_path?: string; /** Whether the series is flagged as softcore content. */
1865
+ softcore: boolean; /** Average vote score for the series. */
1857
1866
  vote_average: number; /** Total number of votes the series has received. */
1858
1867
  vote_count: number; /** Original (non-localized) title of the series. */
1859
1868
  original_name: string;
@@ -1871,7 +1880,8 @@ type MovieResultItem = {
1871
1880
  adult: boolean; /** Original language of the movie (ISO 639-1 code) */
1872
1881
  original_language: string; /** Array of genre IDs (use /genre/movie/list to map to names) */
1873
1882
  genre_ids: number[]; /** Popularity score calculated by TMDB */
1874
- popularity: number; /** Release date in ISO 8601 format (YYYY-MM-DD) */
1883
+ popularity: number; /** Whether the movie is flagged as softcore content */
1884
+ softcore: boolean; /** Release date in ISO 8601 format (YYYY-MM-DD) */
1875
1885
  release_date: string; /** Whether a video is available on TMDB */
1876
1886
  video: boolean; /** Average user rating (0-10 scale) */
1877
1887
  vote_average: number; /** Total number of votes received */
@@ -2119,6 +2129,7 @@ type DiscoverTVSortBy = "first_air_date.asc" | "first_air_date.desc" | "name.asc
2119
2129
  * A TV result item as returned by discover endpoints.
2120
2130
  */
2121
2131
  type DiscoverTVResultItem = {
2132
+ adult: boolean;
2122
2133
  backdrop_path?: string;
2123
2134
  first_air_date: string;
2124
2135
  genre_ids: number[];
@@ -2130,6 +2141,7 @@ type DiscoverTVResultItem = {
2130
2141
  overview: string;
2131
2142
  popularity: number;
2132
2143
  poster_path?: string;
2144
+ softcore: boolean;
2133
2145
  vote_average: number;
2134
2146
  vote_count: number;
2135
2147
  };
@@ -2139,7 +2151,7 @@ type DiscoverTVResultItem = {
2139
2151
  *
2140
2152
  * The API expects these values serialized as query strings, not arrays.
2141
2153
  */
2142
- type DiscoverFilterExpression<T extends string | number = string | number> = T | `${T}` | string;
2154
+ type DiscoverFilterExpression<T extends string | number = string | number> = T | string;
2143
2155
  type DiscoverBaseParams = {
2144
2156
  include_adult?: boolean;
2145
2157
  language?: Language;
@@ -2262,7 +2274,8 @@ type TrendingAllResult = TrendingMovieResult | TrendingTVResult | TrendingPerson
2262
2274
  * Complete movie details with metadata, production info, and statistics
2263
2275
  */
2264
2276
  type MovieDetails = {
2265
- /** Whether the movie is marked as adult content */adult: boolean; /** Path to backdrop image, null if not available */
2277
+ /** Whether the movie is marked as adult content */adult: boolean; /** Whether the movie is flagged as softcore content */
2278
+ softcore: boolean; /** Path to backdrop image, null if not available */
2266
2279
  backdrop_path?: string; /** Collection the movie belongs to (e.g., "The Lord of the Rings Collection"), null if standalone */
2267
2280
  belongs_to_collection?: MovieCollection; /** Production budget in US dollars */
2268
2281
  budget: number; /** Array of genres associated with the movie */
@@ -2327,7 +2340,7 @@ type MovieDetailsWithAppends<T extends readonly MovieAppendToResponseNamespace[]
2327
2340
  * Alternative titles for a movie in different countries/languages
2328
2341
  */
2329
2342
  type MovieAlternativeTitles = {
2330
- /** Movie identifier */id: number; /** Array of alternative titles */
2343
+ /** Movie identifier. Absent when fetched via `append_to_response` rather than standalone. */id?: number; /** Array of alternative titles */
2331
2344
  titles: AlternativeTitle[];
2332
2345
  };
2333
2346
  type MovieChanges = Changes;
@@ -2335,7 +2348,7 @@ type MovieChanges = Changes;
2335
2348
  * Cast and crew credits for a movie
2336
2349
  */
2337
2350
  type MovieCredits = {
2338
- /** Movie identifier */id: number; /** Array of cast members (actors) */
2351
+ /** Movie identifier. Absent when fetched via `append_to_response` rather than standalone. */id?: number; /** Array of cast members (actors) */
2339
2352
  cast: Cast[]; /** Array of crew members (directors, writers, etc.) */
2340
2353
  crew: Crew[];
2341
2354
  };
@@ -2343,7 +2356,7 @@ type MovieCredits = {
2343
2356
  * External platform identifiers for a movie
2344
2357
  */
2345
2358
  type MovieExternalIDs = {
2346
- /** Movie identifier in TMDB */id: number; /** IMDb identifier (e.g., "tt0133093"), null if not available */
2359
+ /** Movie identifier in TMDB. Absent when fetched via `append_to_response` rather than standalone. */id?: number; /** IMDb identifier (e.g., "tt0133093"), null if not available */
2347
2360
  imdb_id?: string; /** Wikidata identifier (e.g., "Q190050"), null if not available */
2348
2361
  wikidata_id?: string; /** Facebook page identifier, null if not available */
2349
2362
  facebook_id?: string; /** Twitter/X handle, null if not available */
@@ -2358,18 +2371,20 @@ type MovieImages = ImagesResult<ImageItem, "backdrops" | "logos" | "posters">;
2358
2371
  * Keywords/tags associated with a movie
2359
2372
  */
2360
2373
  type MovieKeywords = {
2361
- /** Movie identifier */id: number; /** Array of keyword objects */
2374
+ /** Movie identifier. Absent when fetched via `append_to_response` rather than standalone. */id?: number; /** Array of keyword objects */
2362
2375
  keywords: Keyword[];
2363
2376
  };
2364
2377
  /**
2365
2378
  * Paginated list of recommended movies based on this movie
2366
2379
  */
2367
- type MovieRecommendations = PaginatedResponse<MovieResultItem>;
2380
+ type MovieRecommendations = PaginatedResponse<MovieResultItem & {
2381
+ media_type?: "movie";
2382
+ }>;
2368
2383
  /**
2369
2384
  * Release dates and certifications across different countries
2370
2385
  */
2371
2386
  type MovieReleaseDates = {
2372
- /** Movie identifier */id: number; /** Array of release date results grouped by country */
2387
+ /** Movie identifier. Absent when fetched via `append_to_response` rather than standalone. */id?: number; /** Array of release date results grouped by country */
2373
2388
  results: MovieReleaseDateResult[];
2374
2389
  };
2375
2390
  /**
@@ -2386,14 +2401,16 @@ type MovieReleaseDate = {
2386
2401
  /** Age certification/rating (e.g., "PG-13", "R", "12A") */certification: string; /** ISO 639-1 language code */
2387
2402
  iso_639_1: string; /** Release date and time in ISO 8601 format */
2388
2403
  release_date: string; /** Type of release (1=Premiere, 2=Theatrical (limited), 3=Theatrical, 4=Digital, 5=Physical, 6=TV) */
2389
- type: MovieReleaseType | number; /** Additional notes about this release */
2404
+ type: LiteralUnionNumber<MovieReleaseType>; /** Additional notes about this release */
2390
2405
  note: string; /** Content descriptors (currently unused by TMDB) */
2391
2406
  descriptors: unknown[];
2392
2407
  };
2393
2408
  /**
2394
2409
  * Paginated list of user reviews for a movie
2395
2410
  */
2396
- type MovieReviews = PaginatedResponse<Review>;
2411
+ type MovieReviews = PaginatedResponse<Review> & {
2412
+ /** Movie identifier. Absent when fetched via `append_to_response` rather than standalone. */id?: number;
2413
+ };
2397
2414
  /**
2398
2415
  * Paginated list of movies similar to this movie
2399
2416
  */
@@ -2426,6 +2443,16 @@ type MovieWatchProviders = {
2426
2443
  * Parameters for movie list endpoints (popular, top rated, now playing, upcoming).
2427
2444
  */
2428
2445
  type MovieListParams = TMDBQueryParams;
2446
+ /**
2447
+ * Paginated movie list response for endpoints that also report the queried release-date window
2448
+ * (`now_playing` and `upcoming`).
2449
+ */
2450
+ type MovieDateRangeList = PaginatedResponse<MovieResultItem> & {
2451
+ /** The release-date window this list was queried over */dates: {
2452
+ /** Latest release date included in this list */maximum: string; /** Earliest release date included in this list */
2453
+ minimum: string;
2454
+ };
2455
+ };
2429
2456
  /**
2430
2457
  * Almost every query within the Movie domain
2431
2458
  * will take this required param to identify the movie.
@@ -2551,8 +2578,9 @@ type NetworkBaseParams = {
2551
2578
  * Represent the detailed information about a TV show.
2552
2579
  */
2553
2580
  type TVSeriesDetails = {
2554
- /** The path to the backdrop image, or null if not available */backdrop_path?: string; /** Array of creators who developed the TV show */
2555
- created_by: Pick<Credit, "id" | "credit_id" | "gender" | "name" | "profile_path">[]; /** Array of typical episode runtimes in minutes */
2581
+ /** Whether the TV show is marked as adult content */adult: boolean; /** The path to the backdrop image, or null if not available */
2582
+ backdrop_path?: string; /** Array of creators who developed the TV show */
2583
+ created_by: Pick<Credit, "id" | "credit_id" | "gender" | "name" | "original_name" | "profile_path">[]; /** Array of typical episode runtimes in minutes */
2556
2584
  episode_run_time: number[]; /** The date the first episode aired */
2557
2585
  first_air_date: string; /** Array of genres associated with the TV show */
2558
2586
  genres: Genre[]; /** The official homepage URL for the TV show, or null if not available */
@@ -2575,9 +2603,11 @@ type TVSeriesDetails = {
2575
2603
  poster_path?: string; /** Array of companies that produced the TV show */
2576
2604
  production_companies?: ProductionCompany[]; /** Array of countries where the TV show was produced */
2577
2605
  production_countries?: ProductionCountry[]; /** Array of all seasons in the TV show */
2578
- seasons?: TVSeasonItem[]; /** Array of languages spoken in the TV show with full names */
2606
+ seasons?: TVSeasonItem[]; /** Whether the TV show is flagged as softcore content */
2607
+ softcore: boolean; /** Array of languages spoken in the TV show with full names */
2579
2608
  spoken_languages?: SpokenLanguage[]; /** The current status of the TV show (e.g., "Returning Series", "Ended") */
2580
- status?: string; /** The type of TV show (e.g., "Scripted", "Documentary", "Reality") */
2609
+ status?: string; /** TV show tagline/slogan, null if not available */
2610
+ tagline?: string; /** The type of TV show (e.g., "Scripted", "Documentary", "Reality") */
2581
2611
  type?: string; /** The average rating score for the TV show (0-10 scale) */
2582
2612
  vote_average: number; /** The total number of votes received for the TV show */
2583
2613
  vote_count: number;
@@ -2589,7 +2619,8 @@ type TVEpisodeItem = {
2589
2619
  vote_average: number; /** The total number of votes received for the episode */
2590
2620
  vote_count: number; /** The date the episode first aired */
2591
2621
  air_date?: string; /** The episode number within its season */
2592
- episode_number: number; /** The production code used internally during filming */
2622
+ episode_number: number; /** Episode type reported by TMDB (e.g., "standard", "finale") */
2623
+ episode_type?: LiteralUnion<"standard" | "finale">; /** The production code used internally during filming */
2593
2624
  production_code?: string; /** The runtime of the episode in minutes */
2594
2625
  runtime?: number; /** The season number this episode belongs to */
2595
2626
  season_number: number; /** The unique identifier of the TV show this episode belongs to */
@@ -2642,7 +2673,7 @@ type TVDetailsWithAppends<T extends readonly TVAppendToResponseNamespace[]> = TV
2642
2673
  * Aggregate credits for a TV show, including cast and crew across all seasons and episodes.
2643
2674
  */
2644
2675
  type TVAggregateCredits = {
2645
- /** TMDB unique identifier for the TV show. */id: number; /** List of all the known cast for the TV show. */
2676
+ /** TMDB unique identifier for the TV show. Absent when fetched via `append_to_response` rather than standalone. */id?: number; /** List of all the known cast for the TV show. */
2646
2677
  cast: TVAggregateCreditsCastItem[]; /** List of all the known crew members for the TV show. */
2647
2678
  crew: TVAggregateCreditsCrewItem[];
2648
2679
  };
@@ -2682,11 +2713,12 @@ type TVCreditJob = {
2682
2713
  * Alternative titles for a tv show in different countries/languages
2683
2714
  */
2684
2715
  type TVAlternativeTitles = {
2685
- /** Movie identifier */id: number; /** Array of alternative titles */
2716
+ /** TV show identifier. Absent when fetched via `append_to_response` rather than standalone. */id?: number; /** Array of alternative titles */
2686
2717
  results: AlternativeTitle[];
2687
2718
  };
2688
2719
  type TVSeriesChanges = Changes;
2689
2720
  type TVContentRatings = {
2721
+ /** TMDB unique identifier for the TV show. Absent when fetched via `append_to_response` rather than standalone. */id?: number;
2690
2722
  results: ContentRating[];
2691
2723
  };
2692
2724
  /**
@@ -2695,7 +2727,7 @@ type TVContentRatings = {
2695
2727
  * you should use the aggregate_credits method.
2696
2728
  */
2697
2729
  type TVCredits = {
2698
- /** TMDB unique identifier for the TV show. */id: number; /** List of all the known cast for the TV show. */
2730
+ /** TMDB unique identifier for the TV show. Absent when fetched via `append_to_response` rather than standalone. */id?: number; /** List of all the known cast for the TV show. */
2699
2731
  cast: Cast[]; /** List of all the known crew members for the TV show. */
2700
2732
  crew: Crew[];
2701
2733
  };
@@ -2703,7 +2735,7 @@ type TVCredits = {
2703
2735
  * Collection of episode groups for a TV series
2704
2736
  */
2705
2737
  type TVEpisodeGroups = {
2706
- /** TV series identifier */id: number; /** Array of episode group items */
2738
+ /** TV series identifier. Absent when fetched via `append_to_response` rather than standalone. */id?: number; /** Array of episode group items */
2707
2739
  results: TVEpisodeGroupItem[];
2708
2740
  };
2709
2741
  /**
@@ -2714,15 +2746,15 @@ type TVEpisodeGroupItem = {
2714
2746
  episode_count: number; /** Number of sub-groups within this episode group */
2715
2747
  group_count: number; /** Unique episode group identifier */
2716
2748
  id: string; /** Name of the episode group */
2717
- name: string; /** Network that created or distributed this episode grouping */
2718
- network: NetworkItem; /** Type of grouping (1=Original air date, 2=Absolute, 3=DVD, 4=Digital, 5=Story arc, 6=Production, 7=TV) */
2749
+ name: string; /** Network that created or distributed this episode grouping, if any */
2750
+ network: NetworkItem | null; /** Type of grouping (1=Original air date, 2=Absolute, 3=DVD, 4=Digital, 5=Story arc, 6=Production, 7=TV) */
2719
2751
  type: number;
2720
2752
  };
2721
2753
  /**
2722
2754
  * External platform identifiers for a TV series
2723
2755
  */
2724
2756
  type TVExternalIDs = {
2725
- /** TV series identifier in TMDB */id: number; /** IMDb identifier (e.g., "tt0944947"), null if not available */
2757
+ /** TV series identifier in TMDB. Absent when fetched via `append_to_response` rather than standalone. */id?: number; /** IMDb identifier (e.g., "tt0944947"), null if not available */
2726
2758
  imdb_id?: string; /** Freebase MID identifier (deprecated), null if not available */
2727
2759
  freebase_mid?: string; /** Freebase ID (deprecated), null if not available */
2728
2760
  freebase_id?: string; /** TheTVDB identifier, null if not available */
@@ -2737,20 +2769,12 @@ type TVExternalIDs = {
2737
2769
  * Images related to a TV show.
2738
2770
  * Contains backdrops, logos, posters and stills.
2739
2771
  */
2740
- type TVImages = ImagesResult<TVImageItem, "backdrops" | "logos" | "posters">;
2741
- /**
2742
- * Image items for TVShows have an undocumented "iso_3166_1" property
2743
- * I decided to put it anyway as an optional property,
2744
- * but only for tv shows images.
2745
- */
2746
- type TVImageItem = ImageItem & {
2747
- iso_3166_1?: string;
2748
- };
2772
+ type TVImages = ImagesResult<ImageItem, "backdrops" | "logos" | "posters">;
2749
2773
  /**
2750
2774
  * List of keywords related to the TV show.
2751
2775
  */
2752
2776
  type TVKeywords = {
2753
- /** TMDB unique identifier for the TV show. */id: number; /** List of keywords related to the TV show. */
2777
+ /** TMDB unique identifier for the TV show. Absent when fetched via `append_to_response` rather than standalone. */id?: number; /** List of keywords related to the TV show. */
2754
2778
  results: Keyword[];
2755
2779
  };
2756
2780
  /**
@@ -2759,7 +2783,7 @@ type TVKeywords = {
2759
2783
  * that uniquely identifies the tv show.
2760
2784
  */
2761
2785
  type TVSeriesLists = PaginatedResponse<TVSeriesListItem> & {
2762
- id: number;
2786
+ /** Absent when fetched via `append_to_response` rather than standalone. */id?: number;
2763
2787
  };
2764
2788
  /**
2765
2789
  * Represents a single TV series list entry as returned by the TMDB API.
@@ -2769,22 +2793,26 @@ type TVSeriesListItem = {
2769
2793
  favorite_count: number; /** The unique identifier for this list on TMDB. */
2770
2794
  id: number; /** The total number of items (TV series) currently in this list. */
2771
2795
  item_count: number; /** The primary language of the list content as an ISO 639-1 code (e.g. `"en"`). */
2772
- iso_639_1: string | LanguageISO6391; /** The country associated with the list as an ISO 3166-1 alpha-2 code (e.g. `"US"`). */
2773
- iso_3166_1: string | CountryISO3166_1; /** The display name of the list. */
2796
+ iso_639_1: LiteralUnion<LanguageISO6391>; /** The country associated with the list as an ISO 3166-1 alpha-2 code (e.g. `"US"`). */
2797
+ iso_3166_1: LiteralUnion<CountryISO3166_1>; /** The display name of the list. */
2774
2798
  name: string; /** Path to the list's poster image on the TMDB CDN. Combine with a base URL to get the full image path. */
2775
2799
  poster_path?: string;
2776
2800
  };
2777
2801
  /** List of TV shows that are recommended for a TV show. */
2778
- type TVRecommendations = PaginatedResponse<TVSeriesResultItem>;
2802
+ type TVRecommendations = PaginatedResponse<TVSeriesResultItem & {
2803
+ media_type?: "tv";
2804
+ }>;
2779
2805
  /**
2780
2806
  * Paginated list of user reviews for a tv show
2781
2807
  */
2782
- type TVReviews = PaginatedResponse<Review>;
2808
+ type TVReviews = PaginatedResponse<Review> & {
2809
+ /** TV show identifier. Absent when fetched via `append_to_response` rather than standalone. */id?: number;
2810
+ };
2783
2811
  /**
2784
2812
  * Represents the response for TV episodes that have been screened theatrically.
2785
2813
  */
2786
2814
  type TVScreenedTheatrically = {
2787
- /** The unique identifier of the TV series. */id: number; /** The list of episodes that received a theatrical screening. */
2815
+ /** The unique identifier of the TV series. Absent when fetched via `append_to_response` rather than standalone. */id?: number; /** The list of episodes that received a theatrical screening. */
2788
2816
  results: TVScreeningItem[];
2789
2817
  };
2790
2818
  /**
@@ -2813,7 +2841,7 @@ type TVTranslationData = {
2813
2841
  };
2814
2842
  /** List of videos related to a TV show. */
2815
2843
  type TVVideos = {
2816
- /** TMDB unique identifier for the TV show. */id: number; /** List of video results. */
2844
+ /** TMDB unique identifier for the TV show. Absent when fetched via `append_to_response` rather than standalone. */id?: number; /** List of video results. */
2817
2845
  results: VideoItem[];
2818
2846
  };
2819
2847
  /**
@@ -2914,7 +2942,8 @@ type TVSeasonEpisode = TVEpisodeItem & {
2914
2942
  * Detailed information about a TV season returned by the TMDB API.
2915
2943
  */
2916
2944
  type TVSeason = {
2917
- /** ISO 8601 date when the season first aired */air_date?: string; /** Array of episodes in this season */
2945
+ /** ISO 8601 date when the season first aired */air_date?: string; /** Legacy MongoDB identifier for the season */
2946
+ _id?: string; /** Array of episodes in this season */
2918
2947
  episodes: TVSeasonEpisode[]; /** Unique TMDB identifier for the season */
2919
2948
  id: number; /** Season name */
2920
2949
  name: string; /** Networks that broadcast this season */
@@ -2928,7 +2957,7 @@ type TVSeason = {
2928
2957
  * Available append-to-response options for TV season details.
2929
2958
  * These allow fetching additional related data in a single API request.
2930
2959
  */
2931
- type TVSeasonAppendToResponseNamespace = "aggregate_credits" | "credits" | "external_ids" | "images" | "translations" | "videos" | "watch_providers";
2960
+ type TVSeasonAppendToResponseNamespace = "aggregate_credits" | "credits" | "external_ids" | "images" | "translations" | "videos" | "watch/providers";
2932
2961
  /**
2933
2962
  * Maps append-to-response keys to their corresponding response types.
2934
2963
  */
@@ -2939,7 +2968,7 @@ type TVSeasonAppendableMap = {
2939
2968
  images: TVSeasonImages;
2940
2969
  translations: TVSeasonTranslations;
2941
2970
  videos: TVSeasonVideos;
2942
- watch_providers: MediaWatchProviders;
2971
+ "watch/providers": MediaWatchProviders;
2943
2972
  };
2944
2973
  /**
2945
2974
  * TV season details with additional appended data based on the requested namespaces.
@@ -2952,7 +2981,7 @@ type TVSeasonAggregateCredits = TVAggregateCredits;
2952
2981
  type TVSeasonChanges = Changes;
2953
2982
  /** Credits (cast & crew) for a TV season, mirroring the series-level credits shape. */
2954
2983
  type TVSeasonCredits = {
2955
- /** TMDB unique identifier */id: number; /** Cast members */
2984
+ /** TMDB unique identifier. Absent when fetched via `append_to_response` rather than standalone. */id?: number; /** Cast members */
2956
2985
  cast: Cast[]; /** Crew members */
2957
2986
  crew: Crew[];
2958
2987
  };
@@ -3001,7 +3030,8 @@ type TVSeasonChangesParams = TVSeasonId & Prettify<WithParams<"page"> & DateRang
3001
3030
  type TVEpisode = {
3002
3031
  /** ISO 8601 formatted date when the episode first aired (e.g. `"2023-05-15"`) */air_date: string; /** Array of crew members who worked on this specific episode */
3003
3032
  crew: Crew[]; /** Sequential number of this episode within its season (1-based) */
3004
- episode_number: number; /** Array of guest stars appearing in this episode (subset of cast without `cast_id`) */
3033
+ episode_number: number; /** Episode type reported by TMDB (e.g., "standard", "finale") */
3034
+ episode_type?: LiteralUnion<"standard" | "finale">; /** Array of guest stars appearing in this episode (subset of cast without `cast_id`) */
3005
3035
  guest_stars: Omit<Cast, "cast_id">[]; /** Episode title or name */
3006
3036
  name: string; /** Episode synopsis or description */
3007
3037
  overview: string; /** Unique TMDB identifier for this episode */
@@ -3034,7 +3064,7 @@ type TVEpisodeAppendableMap = {
3034
3064
  */
3035
3065
  type TVEpisodeDetailsWithAppends<T extends readonly TVEpisodeAppendToResponseNamespace[]> = TVEpisode & { [K in T[number]]: TVEpisodeAppendableMap[K] };
3036
3066
  type TVEpisodeCredits = {
3037
- id: number | string;
3067
+ /** Absent when fetched via `append_to_response` rather than standalone. */id?: number | string;
3038
3068
  cast: Omit<Cast, "cast_id">[];
3039
3069
  crew: Crew[];
3040
3070
  guest_stars: Omit<Cast, "cast_id">[];
@@ -3059,6 +3089,8 @@ type TVEpisodeBaseParams = TVSeasonBaseParams & {
3059
3089
  type TVEpisodeId = {
3060
3090
  episode_id: string | number;
3061
3091
  };
3092
+ /** Parameters for the episode changes endpoint. */
3093
+ type TVEpisodeChangesParams = TVEpisodeId & Prettify<WithParams<"page"> & DateRange>;
3062
3094
  /**
3063
3095
  * Parameters for fetching TV episode details with optional additional data appended.
3064
3096
  */
@@ -3190,10 +3222,12 @@ type TVEpisodeGroupDetailsItem = {
3190
3222
  };
3191
3223
  /**
3192
3224
  * A simplified TV episode item returned in episode group details.
3225
+ * Unlike a standalone episode, grouped episodes have no `crew`, but do carry
3226
+ * their `order` within the group and the parent show's `show_id`.
3193
3227
  */
3194
- type TVEpisodeGroupEpisode = Omit<TVEpisode, "guest_stars" | "runtime"> & {
3195
- /** Production code for the episode, if available */production_code?: string; /** Path to the episode still image, if available */
3196
- still_path?: string;
3228
+ type TVEpisodeGroupEpisode = Omit<TVEpisode, "guest_stars" | "crew"> & {
3229
+ /** Display order of the episode within the group */order: number; /** Unique identifier of the parent TV show */
3230
+ show_id: number;
3197
3231
  };
3198
3232
  type TVEpisodeGroupParams = {
3199
3233
  /** Episode group identifier */episode_group_id: string;
@@ -3217,11 +3251,13 @@ type FindByIDParams = {
3217
3251
  type FindMediaResultBase = {
3218
3252
  adult: boolean;
3219
3253
  backdrop_path?: string;
3254
+ genre_ids: number[];
3220
3255
  id: number;
3221
3256
  original_language: string;
3222
3257
  overview: string;
3223
3258
  poster_path?: string;
3224
3259
  popularity: number;
3260
+ softcore: boolean;
3225
3261
  vote_average: number;
3226
3262
  vote_count: number;
3227
3263
  };
@@ -3362,7 +3398,9 @@ type CreditDetailsParams = CreditBaseParam & WithLanguage;
3362
3398
  /**
3363
3399
  * Person data attached to a credit details response.
3364
3400
  */
3365
- type CreditDetailsPerson = Omit<Credit, "credit_id">;
3401
+ type CreditDetailsPerson = Omit<Credit, "credit_id"> & {
3402
+ /** Media type discriminator. */media_type: "person";
3403
+ };
3366
3404
  type CreditDetailsMediaBase = {
3367
3405
  /** Indicates whether the title is marked for adult content. */adult: boolean; /** Relative path to the backdrop image, if available. */
3368
3406
  backdrop_path?: string; /** Character name when the credit belongs to cast. */
@@ -3372,7 +3410,8 @@ type CreditDetailsMediaBase = {
3372
3410
  original_language: string; /** Plot summary. */
3373
3411
  overview: string; /** Relative path to the poster image, if available. */
3374
3412
  poster_path?: string; /** Popularity score. */
3375
- popularity: number; /** Average vote score. */
3413
+ popularity: number; /** Whether the media is flagged as softcore content. */
3414
+ softcore: boolean; /** Average vote score. */
3376
3415
  vote_average: number; /** Total vote count. */
3377
3416
  vote_count: number;
3378
3417
  };
@@ -3506,7 +3545,7 @@ type PersonChanges = Changes;
3506
3545
  * External identifiers linked to a person.
3507
3546
  */
3508
3547
  type PersonExternalIDs = {
3509
- id: number;
3548
+ /** Absent when fetched via `append_to_response` rather than standalone. */id?: number;
3510
3549
  freebase_mid?: string;
3511
3550
  freebase_id?: string;
3512
3551
  imdb_id?: string;
@@ -3542,7 +3581,7 @@ type PersonMovieCrewCredit = MovieResultItem & {
3542
3581
  * Movie credits for a person.
3543
3582
  */
3544
3583
  type PersonMovieCredits = {
3545
- id: number;
3584
+ /** Absent when fetched via `append_to_response` rather than standalone. */id?: number;
3546
3585
  cast: PersonMovieCastCredit[];
3547
3586
  crew: PersonMovieCrewCredit[];
3548
3587
  };
@@ -3552,7 +3591,8 @@ type PersonMovieCredits = {
3552
3591
  type PersonTVCastCredit = TVSeriesResultItem & {
3553
3592
  character: string;
3554
3593
  credit_id: string;
3555
- episode_count: number;
3594
+ episode_count: number; /** Air date of this person's first credited episode for the show */
3595
+ first_credit_air_date?: string;
3556
3596
  };
3557
3597
  /**
3558
3598
  * Crew credit for a TV show on a person profile.
@@ -3560,14 +3600,15 @@ type PersonTVCastCredit = TVSeriesResultItem & {
3560
3600
  type PersonTVCrewCredit = TVSeriesResultItem & {
3561
3601
  credit_id: string;
3562
3602
  department: string;
3563
- episode_count: number;
3603
+ episode_count: number; /** Air date of this person's first credited episode for the show */
3604
+ first_credit_air_date?: string;
3564
3605
  job: string;
3565
3606
  };
3566
3607
  /**
3567
3608
  * TV credits for a person.
3568
3609
  */
3569
3610
  type PersonTVCredits = {
3570
- id: number;
3611
+ /** Absent when fetched via `append_to_response` rather than standalone. */id?: number;
3571
3612
  cast: PersonTVCastCredit[];
3572
3613
  crew: PersonTVCrewCredit[];
3573
3614
  };
@@ -3591,7 +3632,7 @@ type PersonCombinedCrewCredit = (PersonMovieCrewCredit & {
3591
3632
  * Combined credits for a person.
3592
3633
  */
3593
3634
  type PersonCombinedCredits = {
3594
- id: number;
3635
+ /** Absent when fetched via `append_to_response` rather than standalone. */id?: number;
3595
3636
  cast: PersonCombinedCastCredit[];
3596
3637
  crew: PersonCombinedCrewCredit[];
3597
3638
  };
@@ -3616,14 +3657,15 @@ type PersonTaggedImage = ImageItem & {
3616
3657
  * Paginated tagged images for a person.
3617
3658
  */
3618
3659
  type PersonTaggedImages = PaginatedResponse<PersonTaggedImage> & {
3619
- id: number;
3660
+ /** Absent when fetched via `append_to_response` rather than standalone. */id?: number;
3620
3661
  };
3621
3662
  /**
3622
3663
  * Translation payload for person records.
3623
3664
  */
3624
3665
  type PersonTranslationData = {
3625
3666
  biography?: string;
3626
- name?: string;
3667
+ name?: string; /** Whether this is the primary translation for the language */
3668
+ primary?: boolean;
3627
3669
  };
3628
3670
  /**
3629
3671
  * Available translations for a person.
@@ -4000,7 +4042,7 @@ declare class ApiClient {
4000
4042
  * call triggers a fresh fetch. Deduplication can be disabled globally via
4001
4043
  * `TMDBOptions.deduplication = false`.
4002
4044
  */
4003
- request<T>(endpoint: string, params?: Record<string, unknown | undefined>): Promise<T>;
4045
+ request<T>(endpoint: string, params?: Record<string, unknown>): Promise<T>;
4004
4046
  /**
4005
4047
  * Removes a single entry from the response cache.
4006
4048
  *
@@ -4041,7 +4083,7 @@ declare class ApiClient {
4041
4083
  * @param body - JSON body to send (omit for DELETE/GET requests without a body)
4042
4084
  * @param params - Optional query string parameters (e.g. session_id)
4043
4085
  */
4044
- mutate<T>(method: "GET" | "POST" | "PUT" | "DELETE", endpoint: string, body?: Record<string, unknown>, params?: Record<string, unknown | undefined>): Promise<T>;
4086
+ mutate<T>(method: "GET" | "POST" | "PUT" | "DELETE", endpoint: string, body?: Record<string, unknown>, params?: Record<string, unknown>): Promise<T>;
4045
4087
  /**
4046
4088
  * Shared fetch + response-parsing pipeline used by both `request` and `mutate`.
4047
4089
  * Handles URL construction, auth, logging, error mapping, and null sanitisation.
@@ -4409,7 +4451,9 @@ declare class KeywordsAPI extends TMDBAPIBase {
4409
4451
  * @param include_adult Include adult titles in results
4410
4452
  * @reference https://developer.themoviedb.org/reference/keyword-movies
4411
4453
  */
4412
- movies(params: KeywordMoviesParams): Promise<PaginatedResponse<MovieResultItem>>;
4454
+ movies(params: KeywordMoviesParams): Promise<PaginatedResponse<MovieResultItem> & {
4455
+ id: number;
4456
+ }>;
4413
4457
  }
4414
4458
  //#endregion
4415
4459
  //#region src/endpoints/movie_lists.d.ts
@@ -4431,7 +4475,7 @@ declare class MovieListsAPI extends TMDBAPIBase {
4431
4475
  * @param page Page (Defaults to 1)
4432
4476
  * @param region ISO-3166-1 code
4433
4477
  */
4434
- now_playing(params?: MovieListParams): Promise<PaginatedResponse<MovieResultItem>>;
4478
+ now_playing(params?: MovieListParams): Promise<MovieDateRangeList>;
4435
4479
  /**
4436
4480
  * Popular
4437
4481
  * GET - https://api.themoviedb.org/3/movie/popular
@@ -4461,7 +4505,7 @@ declare class MovieListsAPI extends TMDBAPIBase {
4461
4505
  * @param page Page (Defaults to 1)
4462
4506
  * @param region ISO-3166-1 code
4463
4507
  */
4464
- upcoming(params?: MovieListParams): Promise<PaginatedResponse<MovieResultItem>>;
4508
+ upcoming(params?: MovieListParams): Promise<MovieDateRangeList>;
4465
4509
  }
4466
4510
  //#endregion
4467
4511
  //#region src/endpoints/movies.d.ts
@@ -5193,9 +5237,7 @@ declare class TVEpisodesAPI extends TMDBAPIBase {
5193
5237
  * GET - https://api.themoviedb.org/3/tv/episode/{episode_id}/changes
5194
5238
  *
5195
5239
  * Get the changes for a TV episode. By default only the last 24 hours are returned.
5196
- * ACCORDING TO TMDB DOCS:
5197
5240
  * You can query up to 14 days in a single query by using the start_date and end_date query parameters.
5198
- * BUT NO start_date or end_date query params are specified in the documentation
5199
5241
  *
5200
5242
  * NOTE: TV show changes are a little different than movie changes in that there are some edits
5201
5243
  * on seasons and episodes that will create a top level change entry at the show level.
@@ -5204,10 +5246,13 @@ declare class TVEpisodesAPI extends TMDBAPIBase {
5204
5246
  * You can use the season changes and episode changes methods to look these up individually.
5205
5247
  *
5206
5248
  * @param episode_id The ID of the TV episode.
5249
+ * @param start_date Filter changes by start date (ISO 8601 format, e.g. "2024-01-01").
5250
+ * @param end_date Filter changes by end date (ISO 8601 format, e.g. "2024-01-14").
5251
+ * @param page The page of results to return.
5207
5252
  * @returns A promise that resolves to the TV episode changes history.
5208
5253
  * @reference https://developer.themoviedb.org/reference/tv-episode-changes-by-id
5209
5254
  */
5210
- changes(params: TVEpisodeId): Promise<Changes>;
5255
+ changes(params: TVEpisodeChangesParams): Promise<Changes>;
5211
5256
  /**
5212
5257
  * Credits
5213
5258
  * GET - https://api.themoviedb.org/3/tv/{series_id}/season/{season_number}/episode/{episode_number}/credits
@@ -6240,4 +6285,4 @@ type PageInfo = {
6240
6285
  */
6241
6286
  declare function getPageInfo(response: PaginatedResponse<unknown>): PageInfo;
6242
6287
  //#endregion
6243
- export { AccountAPI, AccountAddFavoriteBody, AccountAddToWatchlistBody, AccountAvatar, AccountDetails, AccountDetailsParams, AccountListItem, AccountListsParams, AccountListsResponse, AccountMediaListParams, AccountMovieItem, AccountMovieListResponse, AccountMutationParams, AccountMutationResponse, AccountRatedEpisodeItem, AccountRatedEpisodesResponse, AccountRatedMovieItem, AccountRatedMoviesResponse, AccountRatedTVItem, AccountRatedTVResponse, AccountSortBy, AccountTVItem, AccountTVListResponse, AlternativeName, AlternativeNamesResult, AlternativeTitle, AuthCreateSessionBody, AuthCreateSessionResponse, AuthCreateSessionWithLoginBody, AuthDeleteSessionBody, AuthDeleteSessionResponse, AuthGuestSessionResponse, AuthRequestTokenResponse, AuthValidateKeyResponse, AuthenticationAPI, BACKDROP_SIZES, BackdropSize, Cast, CertificationItem, Certifications, CertificationsAPI, Change, ChangeItem, ChangeResultItem, Changes, ChangesAPI, Collection, CollectionBaseParam, CollectionDetailsParams, CollectionImages, CollectionImagesParams, CollectionItem, CollectionResultItem, CollectionTranslationData, CollectionTranslations, CollectionsAPI, CompaniesAPI, Company, CompanyAlternativeName, CompanyAlternativeNames, CompanyAlternativeNamesParams, CompanyBaseParam, CompanyDetailsParams, CompanyImages, CompanyImagesParams, CompanyResultItem, CompanySummary, ConfigurationAPI, ConfigurationCountriesParams, ConfigurationCountry, ConfigurationJob, ConfigurationLanguage, ConfigurationResponse, ConfigurationTimezone, ContentRating, CountryISO3166_1, Credit, CreditBaseParam, CreditDetails, CreditDetailsMedia, CreditDetailsMovieMedia, CreditDetailsParams, CreditDetailsPerson, CreditDetailsTVEpisode, CreditDetailsTVMedia, CreditDetailsTVSeason, CreditsAPI, Crew, DateRange, DefaultImageSizesConfig, DiscoverAPI, DiscoverFilterExpression, DiscoverMovieParams, DiscoverMovieSortBy, DiscoverTVParams, DiscoverTVResultItem, DiscoverTVSortBy, DiscoverTVStatus, DiscoverTVStatusLabel, DiscoverTVType, DiscoverTVTypeLabel, FallbackUrlConfig, FetchAllPagesOptions, FileType, FindAPI, FindByIDParams, FindExternalSource, FindMovieResultItem, FindPersonResultItem, FindResults, FindTVEpisodeResultItem, FindTVResultItem, FindTVSeasonResultItem, Genre, GenresAPI, GenresResponse, GuestSessionRatedEpisodesResponse, GuestSessionRatedMoviesResponse, GuestSessionRatedParams, GuestSessionRatedTVResponse, GuestSessionsAPI, IMAGE_BASE_URL, IMAGE_SECURE_BASE_URL, ImageCollectionKey, ImageConfiguration, ImageItem, ImageLanguagePriorityConfig, ImageSize, ImageSizeTypes, ImagesConfig, ImagesResult, Keyword, KeywordBaseParam, KeywordDetailsParams, KeywordMoviesParams, KeywordResultItem, KeywordsAPI, KnownForItem, KnownForMovie, KnownForTV, LOGO_SIZES, Language, LanguageISO6391, ListClearParams, ListCreateBody, ListCreateParams, ListCreateResponse, ListDetails, ListDetailsParams, ListItem, ListItemStatusParams, ListItemStatusResponse, ListMovieBody, ListMutationParams, ListMutationResponse, ListsAPI, LiteralUnion, LogoSize, MediaType, MediaWatchProviders, MovieAlternativeTitles, MovieAlternativeTitlesParams, MovieAppendToResponseNamespace, MovieAppendableMap, MovieChanges, MovieChangesParams, MovieCollection, MovieCredits, MovieCreditsParams, MovieDetails, MovieDetailsParams, MovieDetailsWithAppends, MovieExternalIDs, MovieExternalIDsParams, MovieImages, MovieImagesParams, MovieKeywords, MovieKeywordsParams, MovieListParams, MovieListsAPI, MovieRecommendations, MovieRecommendationsParams, MovieReleaseDate, MovieReleaseDateResult, MovieReleaseDates, MovieReleaseDatesParams, MovieReleaseType, MovieReleaseTypeLabel, MovieResultItem, MovieReviews, MovieReviewsParams, MovieSimilar, MovieSimilarParams, MovieTranslationData, MovieTranslations, MovieTranslationsParams, MovieVideos, MovieVideosParams, MovieWatchProviders, MovieWatchProvidersParams, MoviesAPI, MultiSearchResultItem, Network, NetworkBaseParams, NetworkImages, NetworkItem, NetworksAPI, OrganizationImage, POSTER_SIZES, PROFILE_SIZES, PageInfo, PaginatedResponse, PeopleAPI, PeopleListParams, PeopleListsAPI, PersonAppendToResponseNamespace, PersonAppendableMap, PersonBaseParam, PersonChanges, PersonChangesParams, PersonCombinedCastCredit, PersonCombinedCredits, PersonCombinedCrewCredit, PersonCreditsParams, PersonDetails, PersonDetailsParams, PersonDetailsWithAppends, PersonExternalIDs, PersonExternalIDsParams, PersonImages, PersonImagesParams, PersonMovieCastCredit, PersonMovieCredits, PersonMovieCrewCredit, PersonResultItem, PersonTVCastCredit, PersonTVCredits, PersonTVCrewCredit, PersonTaggedImage, PersonTaggedImageMedia, PersonTaggedImages, PersonTaggedImagesParams, PersonTranslationData, PersonTranslations, PersonTranslationsParams, PosterSize, Prettify, PrimaryTranslations, ProductionCompany, ProductionCountry, ProfileSize, RequestInterceptor, RequestInterceptorContext, ResponseErrorInterceptor, ResponseSuccessInterceptor, RetryOptions, Review, ReviewAuthorDetails, ReviewDetails, ReviewDetailsParams, ReviewsAPI, STILL_SIZES, SearchAPI, SearchCollectionsParams, SearchCompanyParams, SearchKeywordsParams, SearchMoviesParams, SearchMultiParams, SearchPersonParams, SearchTVSeriesParams, SpokenLanguage, StillSize, TMDB, TMDBCountries, TMDBError, TMDBLogger, TMDBLoggerEntry, TMDBLoggerFn, TMDBOptions, TMDBQueryParams, TMDBv4, TVAggregateCredits, TVAggregateCreditsCastItem, TVAggregateCreditsCrewItem, TVAggregateCreditsParams, TVAlternativeTitles, TVAppendToResponseNamespace, TVAppendableMap, TVBaseParam, TVChangeParams, TVContentRatings, TVCreditJob, TVCreditRole, TVCredits, TVCreditsParams, TVDetailsParams, TVDetailsWithAppends, TVEpisode, TVEpisodeAppendToResponseNamespace, TVEpisodeAppendableMap, TVEpisodeBaseParams, TVEpisodeCredits, TVEpisodeCreditsParams, TVEpisodeDetailsParams, TVEpisodeDetailsWithAppends, TVEpisodeExternalIDs, TVEpisodeGroupDetails, TVEpisodeGroupDetailsItem, TVEpisodeGroupEpisode, TVEpisodeGroupItem, TVEpisodeGroupParams, TVEpisodeGroupType, TVEpisodeGroupTypeLabel, TVEpisodeGroups, TVEpisodeGroupsAPI, TVEpisodeId, TVEpisodeImages, TVEpisodeImagesParams, TVEpisodeItem, TVEpisodeTranslationData, TVEpisodeTranslations, TVEpisodeVideos, TVEpisodesAPI, TVExternalIDs, TVImageItem, TVImages, TVImagesParams, TVKeywords, TVRecommendations, TVRecommendationsParams, TVReviews, TVReviewsParams, TVScreenedTheatrically, TVScreeningItem, TVSeason, TVSeasonAggregateCredits, TVSeasonAggregateCreditsParams, TVSeasonAppendToResponseNamespace, TVSeasonAppendableMap, TVSeasonBaseParams, TVSeasonChanges, TVSeasonChangesParams, TVSeasonCredits, TVSeasonCreditsParams, TVSeasonDetailsParams, TVSeasonDetailsWithAppends, TVSeasonEpisode, TVSeasonExternalIDs, TVSeasonId, TVSeasonImages, TVSeasonImagesParams, TVSeasonItem, TVSeasonTranslationData, TVSeasonTranslations, TVSeasonVideos, TVSeasonVideosParams, TVSeasonWatchProvidersParams, TVSeasonsAPI, TVSeriesAPI, TVSeriesChanges, TVSeriesDetails, TVSeriesListItem, TVSeriesListParams, TVSeriesLists, TVSeriesListsAPI, TVSeriesListsParams, TVSeriesResultItem, TVSimilar, TVSimilarParams, TVTranslationData, TVTranslations, TVVideos, Timezone, Translation, TranslationResults, TrendingAPI, TrendingAllResult, TrendingMovieResult, TrendingParams, TrendingPersonResult, TrendingTVResult, TrendingTimeWindow, V4AccountAPI, V4AddListItemsBody, V4AddListItemsResponse, V4AuthAPI, V4AuthAccessTokenResponse, V4AuthCreateAccessTokenBody, V4AuthCreateRequestTokenBody, V4AuthDeleteAccessTokenBody, V4AuthDeleteAccessTokenResponse, V4AuthRequestTokenResponse, V4CreateListBody, V4CreateListResponse, V4DeleteListParams, V4ListDetails, V4ListDetailsParams, V4ListItemInput, V4ListItemResult, V4ListItemStatusParams, V4ListItemStatusResponse, V4ListMediaType, V4ListResult, V4ListStatusResponse, V4ListsAPI, V4RemoveListItemsBody, V4UpdateListBody, V4UpdateListItemsBody, V4UpdateListItemsResponse, VideoItem, VideoResults, WatchMonetizationType, WatchProvider, WatchProviderDisplayPriorities, WatchProviderItem, WatchProviderListItem, WatchProviderListParams, WatchProviderListResponse, WatchProviderRegionsParams, WatchProviderRegionsResponse, WatchProvidersAPI, WithLanguage, WithLanguagePage, WithPage, WithPageAndDateRange, WithParams, WithRegion, fetchAllPages, getPageInfo, hasBackdropPath, hasLogoPath, hasNextPage, hasPosterPath, hasPreviousPage, hasProfilePath, hasStillPath, isJwt, isKnownForMovie, isKnownForTV, isPlainObject, isRecord, paginate };
6288
+ export { AccountAPI, AccountAddFavoriteBody, AccountAddToWatchlistBody, AccountAvatar, AccountDetails, AccountDetailsParams, AccountListItem, AccountListsParams, AccountListsResponse, AccountMediaListParams, AccountMovieItem, AccountMovieListResponse, AccountMutationParams, AccountMutationResponse, AccountRatedEpisodeItem, AccountRatedEpisodesResponse, AccountRatedMovieItem, AccountRatedMoviesResponse, AccountRatedTVItem, AccountRatedTVResponse, AccountSortBy, AccountTVItem, AccountTVListResponse, AlternativeName, AlternativeNamesResult, AlternativeTitle, AuthCreateSessionBody, AuthCreateSessionResponse, AuthCreateSessionWithLoginBody, AuthDeleteSessionBody, AuthDeleteSessionResponse, AuthGuestSessionResponse, AuthRequestTokenResponse, AuthValidateKeyResponse, AuthenticationAPI, BACKDROP_SIZES, BackdropSize, Cast, CertificationItem, Certifications, CertificationsAPI, Change, ChangeItem, ChangeResultItem, Changes, ChangesAPI, Collection, CollectionBaseParam, CollectionDetailsParams, CollectionImages, CollectionImagesParams, CollectionItem, CollectionResultItem, CollectionTranslationData, CollectionTranslations, CollectionsAPI, CompaniesAPI, Company, CompanyAlternativeName, CompanyAlternativeNames, CompanyAlternativeNamesParams, CompanyBaseParam, CompanyDetailsParams, CompanyImages, CompanyImagesParams, CompanyResultItem, CompanySummary, ConfigurationAPI, ConfigurationCountriesParams, ConfigurationCountry, ConfigurationJob, ConfigurationLanguage, ConfigurationResponse, ConfigurationTimezone, ContentRating, CountryISO3166_1, Credit, CreditBaseParam, CreditDetails, CreditDetailsMedia, CreditDetailsMovieMedia, CreditDetailsParams, CreditDetailsPerson, CreditDetailsTVEpisode, CreditDetailsTVMedia, CreditDetailsTVSeason, CreditsAPI, Crew, DateRange, DefaultImageSizesConfig, DiscoverAPI, DiscoverFilterExpression, DiscoverMovieParams, DiscoverMovieSortBy, DiscoverTVParams, DiscoverTVResultItem, DiscoverTVSortBy, DiscoverTVStatus, DiscoverTVStatusLabel, DiscoverTVType, DiscoverTVTypeLabel, FallbackUrlConfig, FetchAllPagesOptions, FileType, FindAPI, FindByIDParams, FindExternalSource, FindMovieResultItem, FindPersonResultItem, FindResults, FindTVEpisodeResultItem, FindTVResultItem, FindTVSeasonResultItem, Genre, GenresAPI, GenresResponse, GuestSessionRatedEpisodesResponse, GuestSessionRatedMoviesResponse, GuestSessionRatedParams, GuestSessionRatedTVResponse, GuestSessionsAPI, IMAGE_BASE_URL, IMAGE_SECURE_BASE_URL, ImageAPI, ImageCollectionKey, ImageConfiguration, ImageItem, ImageLanguagePriorityConfig, ImageSize, ImageSizeTypes, ImagesConfig, ImagesResult, Keyword, KeywordBaseParam, KeywordDetailsParams, KeywordMoviesParams, KeywordResultItem, KeywordsAPI, KnownForItem, KnownForMovie, KnownForTV, LOGO_SIZES, Language, LanguageISO6391, ListClearParams, ListCreateBody, ListCreateParams, ListCreateResponse, ListDetails, ListDetailsParams, ListItem, ListItemStatusParams, ListItemStatusResponse, ListMovieBody, ListMutationParams, ListMutationResponse, ListsAPI, LiteralUnion, LiteralUnionNumber, LogoSize, MediaType, MediaWatchProviders, MovieAlternativeTitles, MovieAlternativeTitlesParams, MovieAppendToResponseNamespace, MovieAppendableMap, MovieChanges, MovieChangesParams, MovieCollection, MovieCredits, MovieCreditsParams, MovieDateRangeList, MovieDetails, MovieDetailsParams, MovieDetailsWithAppends, MovieExternalIDs, MovieExternalIDsParams, MovieImages, MovieImagesParams, MovieKeywords, MovieKeywordsParams, MovieListParams, MovieListsAPI, MovieRecommendations, MovieRecommendationsParams, MovieReleaseDate, MovieReleaseDateResult, MovieReleaseDates, MovieReleaseDatesParams, MovieReleaseType, MovieReleaseTypeLabel, MovieResultItem, MovieReviews, MovieReviewsParams, MovieSimilar, MovieSimilarParams, MovieTranslationData, MovieTranslations, MovieTranslationsParams, MovieVideos, MovieVideosParams, MovieWatchProviders, MovieWatchProvidersParams, MoviesAPI, MultiSearchResultItem, Network, NetworkBaseParams, NetworkImages, NetworkItem, NetworksAPI, OrganizationImage, POSTER_SIZES, PROFILE_SIZES, PageInfo, PaginatedResponse, PeopleAPI, PeopleListParams, PeopleListsAPI, PersonAppendToResponseNamespace, PersonAppendableMap, PersonBaseParam, PersonChanges, PersonChangesParams, PersonCombinedCastCredit, PersonCombinedCredits, PersonCombinedCrewCredit, PersonCreditsParams, PersonDetails, PersonDetailsParams, PersonDetailsWithAppends, PersonExternalIDs, PersonExternalIDsParams, PersonImages, PersonImagesParams, PersonMovieCastCredit, PersonMovieCredits, PersonMovieCrewCredit, PersonResultItem, PersonTVCastCredit, PersonTVCredits, PersonTVCrewCredit, PersonTaggedImage, PersonTaggedImageMedia, PersonTaggedImages, PersonTaggedImagesParams, PersonTranslationData, PersonTranslations, PersonTranslationsParams, PosterSize, Prettify, PrimaryTranslations, ProductionCompany, ProductionCountry, ProfileSize, RequestInterceptor, RequestInterceptorContext, ResponseErrorInterceptor, ResponseSuccessInterceptor, RetryOptions, Review, ReviewAuthorDetails, ReviewDetails, ReviewDetailsParams, ReviewsAPI, STILL_SIZES, SearchAPI, SearchCollectionsParams, SearchCompanyParams, SearchKeywordsParams, SearchMoviesParams, SearchMultiParams, SearchPersonParams, SearchTVSeriesParams, SpokenLanguage, StillSize, TMDB, TMDBCountries, TMDBError, TMDBLogger, TMDBLoggerEntry, TMDBLoggerFn, TMDBOptions, TMDBQueryParams, TMDBv4, TVAggregateCredits, TVAggregateCreditsCastItem, TVAggregateCreditsCrewItem, TVAggregateCreditsParams, TVAlternativeTitles, TVAppendToResponseNamespace, TVAppendableMap, TVBaseParam, TVChangeParams, TVContentRatings, TVCreditJob, TVCreditRole, TVCredits, TVCreditsParams, TVDetailsParams, TVDetailsWithAppends, TVEpisode, TVEpisodeAppendToResponseNamespace, TVEpisodeAppendableMap, TVEpisodeBaseParams, TVEpisodeChangesParams, TVEpisodeCredits, TVEpisodeCreditsParams, TVEpisodeDetailsParams, TVEpisodeDetailsWithAppends, TVEpisodeExternalIDs, TVEpisodeGroupDetails, TVEpisodeGroupDetailsItem, TVEpisodeGroupEpisode, TVEpisodeGroupItem, TVEpisodeGroupParams, TVEpisodeGroupType, TVEpisodeGroupTypeLabel, TVEpisodeGroups, TVEpisodeGroupsAPI, TVEpisodeId, TVEpisodeImages, TVEpisodeImagesParams, TVEpisodeItem, TVEpisodeTranslationData, TVEpisodeTranslations, TVEpisodeVideos, TVEpisodesAPI, TVExternalIDs, TVImages, TVImagesParams, TVKeywords, TVRecommendations, TVRecommendationsParams, TVReviews, TVReviewsParams, TVScreenedTheatrically, TVScreeningItem, TVSeason, TVSeasonAggregateCredits, TVSeasonAggregateCreditsParams, TVSeasonAppendToResponseNamespace, TVSeasonAppendableMap, TVSeasonBaseParams, TVSeasonChanges, TVSeasonChangesParams, TVSeasonCredits, TVSeasonCreditsParams, TVSeasonDetailsParams, TVSeasonDetailsWithAppends, TVSeasonEpisode, TVSeasonExternalIDs, TVSeasonId, TVSeasonImages, TVSeasonImagesParams, TVSeasonItem, TVSeasonTranslationData, TVSeasonTranslations, TVSeasonVideos, TVSeasonVideosParams, TVSeasonWatchProvidersParams, TVSeasonsAPI, TVSeriesAPI, TVSeriesChanges, TVSeriesDetails, TVSeriesListItem, TVSeriesListParams, TVSeriesLists, TVSeriesListsAPI, TVSeriesListsParams, TVSeriesResultItem, TVSimilar, TVSimilarParams, TVTranslationData, TVTranslations, TVVideos, Timezone, Translation, TranslationResults, TrendingAPI, TrendingAllResult, TrendingMovieResult, TrendingParams, TrendingPersonResult, TrendingTVResult, TrendingTimeWindow, V4AccountAPI, V4AddListItemsBody, V4AddListItemsResponse, V4AuthAPI, V4AuthAccessTokenResponse, V4AuthCreateAccessTokenBody, V4AuthCreateRequestTokenBody, V4AuthDeleteAccessTokenBody, V4AuthDeleteAccessTokenResponse, V4AuthRequestTokenResponse, V4CreateListBody, V4CreateListResponse, V4DeleteListParams, V4ListDetails, V4ListDetailsParams, V4ListItemInput, V4ListItemResult, V4ListItemStatusParams, V4ListItemStatusResponse, V4ListMediaType, V4ListResult, V4ListStatusResponse, V4ListsAPI, V4RemoveListItemsBody, V4UpdateListBody, V4UpdateListItemsBody, V4UpdateListItemsResponse, VideoItem, VideoResults, WatchMonetizationType, WatchProvider, WatchProviderDisplayPriorities, WatchProviderItem, WatchProviderListItem, WatchProviderListParams, WatchProviderListResponse, WatchProviderRegionsParams, WatchProviderRegionsResponse, WatchProvidersAPI, WithLanguage, WithLanguagePage, WithPage, WithPageAndDateRange, WithParams, WithRegion, fetchAllPages, getPageInfo, hasBackdropPath, hasLogoPath, hasNextPage, hasPosterPath, hasPreviousPage, hasProfilePath, hasStillPath, isJwt, isKnownForMovie, isKnownForTV, isPlainObject, isRecord, paginate };
package/dist/index.mjs CHANGED
@@ -1 +1 @@
1
- var e=class extends Error{tmdb_status_code;message;http_status_code;constructor(e,t,n){super(e),this.name=`TMDBError`,this.tmdb_status_code=n||-1,this.message=e,this.http_status_code=t}};const t=`http://image.tmdb.org/t/p/`,n=`https://image.tmdb.org/t/p/`,r=[`w300`,`w780`,`w1280`,`original`],i=[`w45`,`w92`,`w154`,`w185`,`w300`,`w500`,`original`],a=[`w92`,`w154`,`w185`,`w342`,`w500`,`w780`,`original`],o=[`w45`,`w185`,`h632`,`original`],s=[`w92`,`w185`,`w300`,`original`];var c=class e{logger;constructor(e){this.logger=e}static from(t){if(t)return t===!0?new e(e.defaultLogger):new e(t)}log(e){if(this.logger)try{this.logger(e)}catch(e){console.warn(`TMDB logger error: ${e}`)}}static defaultLogger(e){let t=`🎬 [tmdb]`,n=new Date().toISOString();if(e.type===`request`){console.log(`${t} ${n} 🛰️ REQUEST ${e.method} ${e.endpoint} \n`);return}if(e.type===`response`){console.log(`${t} ${n} ✅ RESPONSE ${e.method} ${e.status} ${e.statusText} ${e.endpoint} (${e.durationMs}ms)\n`);return}let r=e.status==null?`NETWORK ERROR`:`${e.status} ${e.statusText}`,i=e.tmdbStatusCode==null?``:` (tmdb: ${e.tmdbStatusCode})`;console.log(`${t} ${n} ❌ ${e.method} ${r} ${e.endpoint} - ${e.errorMessage}${i}\n`)}};function l(e){return/^[A-Za-z0-9\-_]+$/.test(e)}function u(e){try{let t=e.replace(/-/g,`+`).replace(/_/g,`/`),n=t.padEnd(t.length+(4-t.length%4)%4,`=`);return atob(n)}catch{return null}}function d(e){return typeof e==`object`&&!!e}function f(e){return d(e)?typeof e.alg==`string`:!1}function p(e){return!(!d(e)||`exp`in e&&typeof e.exp!=`number`||`nbf`in e&&typeof e.nbf!=`number`||`iat`in e&&typeof e.iat!=`number`)}function m(e){if(typeof e!=`string`)return!1;let t=e.split(`.`);if(t.length!==3)return!1;let[n,r,i]=t;if(!l(n)||!l(r)||!l(i))return!1;let a=u(n),o=u(r);if(!a||!o)return!1;let s,c;try{s=JSON.parse(a),c=JSON.parse(o)}catch{return!1}return!(!f(s)||!p(c))}function h(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function g(e){if(!h(e))return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function _(e){return typeof e==`object`&&!!e&&`poster_path`in e&&typeof e.poster_path==`string`}function ee(e){return typeof e==`object`&&!!e&&`backdrop_path`in e&&typeof e.backdrop_path==`string`}function te(e){return typeof e==`object`&&!!e&&`profile_path`in e&&typeof e.profile_path==`string`}function ne(e){return typeof e==`object`&&!!e&&`still_path`in e&&typeof e.still_path==`string`}function re(e){return typeof e==`object`&&!!e&&`logo_path`in e&&typeof e.logo_path==`string`}const v={NO_ACCESS_TOKEN:`TMDB requires a valid access token, please provide one.`,INVALID_CLIENT:`TMDB received an invalid ApiClient instance. Pass a valid ApiClient or an access token string.`,V4_REQUIRES_JWT:`TMDB v4 requires a Bearer (JWT) access token. API key strings are not supported for v4 endpoints.`,INVALID_START_PAGE:`Invalid page: Pages start at 1 and max at 500. They are expected to be an integer.`};async function*ie(e,t=1){if(!Number.isInteger(t)||t<1||t>500)throw RangeError(v.INVALID_START_PAGE);let n=t;for(;;){let t=await e(n);if(yield t,t.page>=t.total_pages)break;n++}}async function ae(e,t={}){let{maxPages:n=500,deduplicateBy:r}=t,i=[],a=1;for(;;){let t=await e(a);if(i.push(...t.results),t.page>=t.total_pages||a>=n)break;a++}if(r){let e=new Map;for(let t of i){let n=r(t);e.has(n)&&e.delete(n),e.set(n,t)}return[...e.values()]}return i}function oe(e){return e.page<e.total_pages}function se(e){return e.page>1}function ce(e){return{current:e.page,total:e.total_pages,totalResults:e.total_results,isFirst:e.page===1,isLast:e.page>=e.total_pages}}const y={backdrop_path:`backdrop`,logo_path:`logo`,poster_path:`poster`,profile_path:`profile`,still_path:`still`},le={backdrop_path:`backdrops`,logo_path:`logos`,poster_path:`posters`,profile_path:`profiles`,still_path:`stills`},b={backdrops:`backdrop_path`,logos:`logo_path`,posters:`poster_path`,profiles:`profile_path`,stills:`still_path`};var x=class{options;constructor(e={}){this.options={secure_images_url:!0,...e}}buildUrl(e,r){return`${this.options.secure_images_url?n:t}${r}${e}`}backdrop(e,t=this.options.default_image_sizes?.backdrops||`w780`){return this.buildUrl(e,t)}logo(e,t=this.options.default_image_sizes?.logos||`w185`){return this.buildUrl(e,t)}poster(e,t=this.options.default_image_sizes?.posters||`w500`){return this.buildUrl(e,t)}profile(e,t=this.options.default_image_sizes?.profiles||`w185`){return this.buildUrl(e,t)}still(e,t=this.options.default_image_sizes?.still||`w300`){return this.buildUrl(e,t)}autocompleteImagePaths(e,t){return this.traverse(e,t,!0)}applyFallbacksOnly(e){return this.traverse(e,void 0,!1)}traverse(e,t,n){if(Array.isArray(e)){let r=n&&t&&this.options.image_language_priority?.[t];return(r?this.sortByLanguagePriority(e,r):e).map(e=>this.traverse(e,t,n))}if(!g(e))return e;let r=Object.create(null);for(let[i,a]of Object.entries(e)){if(i===`__proto__`||i===`constructor`||i===`prototype`){r[i]=a;continue}if(a==null){if(Object.hasOwn(y,i)){let e=le[i];r[i]=this.getFallbackForCollection(e)??a;continue}if(i===`file_path`&&t){r[i]=this.getFallbackForCollection(t)??a;continue}r[i]=a;continue}if(typeof a==`string`){r[i]=n?this.transformPathValue(i,a,t):a;continue}let e=this.isImageCollectionKey(i)?i:t;r[i]=this.traverse(a,e,n)}return r}sortByLanguagePriority(e,t){let n=[],r=[...e];for(let e of t){if(e===`*`){n.push(...r.splice(0,r.length));break}let t=[];for(let i of r){let r=i?.iso_639_1;(e===`null`?r==null:r===e)?n.push(i):t.push(i)}r.length=0,r.push(...t)}return n.push(...r),n}isImageCollectionKey(e){return Object.hasOwn(b,e)}getFallbackForCollection(e){let t=this.options.fallback_url;if(t!=null)return typeof t==`string`?t:t[e]}isFullUrl(e){return/^https?:\/\//.test(e)}buildImageUrl(e,t){let n=y[e];return Object.hasOwn(this,n)||this[n],this[n](t)}transformPathValue(e,t,n){return!t.startsWith(`/`)||this.isFullUrl(t)?t:Object.hasOwn(y,e)?this.buildImageUrl(e,t):e===`file_path`&&n?this.buildImageUrl(b[n],t):t}},ue=class{ttl;maxSize;excludedEndpoints;store=new Map;constructor(e={}){let t=e.ttl??3e5;if(!Number.isFinite(t)||!Number.isInteger(t)||t<1)throw RangeError(`cache.ttl must be a finite integer >= 1 (got ${t})`);if(e.max_size!==void 0&&(!Number.isFinite(e.max_size)||!Number.isInteger(e.max_size)||e.max_size<1))throw RangeError(`cache.max_size must be a finite integer >= 1 (got ${e.max_size})`);this.ttl=t,this.maxSize=e.max_size,this.excludedEndpoints=(e.excluded_endpoints??[]).map(e=>typeof e!=`string`&&/[gy]/.test(e.flags)?new RegExp(e.source,e.flags.replace(/[gy]/g,``)):e)}shouldCache(e){return!this.excludedEndpoints.some(t=>typeof t==`string`?e.startsWith(t):t.test(e))}get(e){let t=this.store.get(e);if(t){if(Date.now()>t.expiresAt){this.store.delete(e);return}return t.value}}has(e){let t=this.store.get(e);return t?Date.now()>t.expiresAt?(this.store.delete(e),!1):!0:!1}set(e,t){this.maxSize!==void 0&&!this.store.has(e)&&this.store.size>=this.maxSize&&this.store.delete(this.store.keys().next().value),this.store.set(e,{value:t,expiresAt:Date.now()+this.ttl})}delete(e){return this.store.delete(e)}clear(){this.store.clear()}get size(){return this.store.size}},de=class{maxRequests;windowMs;timestamps=[];queue=[];processing=!1;constructor(e={}){let t=e.max_requests??40,n=e.per_ms??1e3;if(!Number.isFinite(t)||!Number.isInteger(t)||t<1)throw RangeError(`rate_limit.max_requests must be a finite integer >= 1 (got ${t})`);if(!Number.isFinite(n)||!Number.isInteger(n)||n<1)throw RangeError(`rate_limit.per_ms must be a finite integer >= 1 (got ${n})`);this.maxRequests=t,this.windowMs=n}acquire(){return new Promise(e=>{this.queue.push(e),this.processing||this.process()})}async process(){for(this.processing=!0;this.queue.length>0;){let e=Date.now();if(this.timestamps=this.timestamps.filter(t=>e-t<this.windowMs),this.timestamps.length<this.maxRequests)this.timestamps.push(Date.now()),this.queue.shift()();else{let e=this.timestamps[0],t=this.windowMs-(Date.now()-e)+1;await new Promise(e=>setTimeout(e,t))}}this.processing=!1}};function fe(t){if(t instanceof e)return t.http_status_code>=500;if(t instanceof Error)switch(t.name){case`FetchError`:case`AbortError`:return!0;case`SyntaxError`:return!1;case`TypeError`:return!0;default:return!1}return!0}var pe=class{maxRetries;baseDelayMs;maxDelayMs;shouldRetry;constructor(e={}){let t=e.max_retries??3,n=e.base_delay_ms??500,r=e.max_delay_ms??3e4;if(!Number.isFinite(t)||!Number.isInteger(t)||t<0)throw RangeError(`retry.max_retries must be a finite integer >= 0 (got ${t})`);if(!Number.isFinite(n)||!Number.isInteger(n)||n<1)throw RangeError(`retry.base_delay_ms must be a finite integer >= 1 (got ${n})`);if(!Number.isFinite(r)||!Number.isInteger(r)||r<1)throw RangeError(`retry.max_delay_ms must be a finite integer >= 1 (got ${r})`);this.maxRetries=t,this.baseDelayMs=n,this.maxDelayMs=r,this.shouldRetry=e.shouldRetry??fe}delayFor(e){let t=Math.min(this.baseDelayMs*2**(e-1),this.maxDelayMs);return Math.floor(Math.random()*t)}async execute(e,t=me){let n;for(let r=0;r<=this.maxRetries;r++)try{return await e()}catch(e){if(n=e,r>=this.maxRetries||!await this.shouldRetry(e,r+1))break;let i=this.delayFor(r+1);i>0&&await t(i)}throw n}};function me(e){return new Promise(t=>setTimeout(t,e))}var S=class{accessToken;baseUrl;logger;inflightRequests=new Map;deduplication;rateLimiter;retryManager;requestInterceptors;onSuccessInterceptor;onErrorInterceptor;imageApi;imageOptions;responseCache;constructor(e,t={}){this.accessToken=e,this.baseUrl=`https://api.themoviedb.org/${t.version??3}`,this.logger=c.from(t.logger),this.deduplication=t.deduplication!==!1,t.rate_limit&&(this.rateLimiter=new de(t.rate_limit===!0?{}:t.rate_limit)),t.retry&&(this.retryManager=new pe(t.retry===!0?{}:t.retry)),t.cache&&(this.responseCache=new ue(t.cache===!0?{}:t.cache));let n=t.interceptors?.request;this.requestInterceptors=n==null?[]:Array.isArray(n)?n:[n],this.onSuccessInterceptor=t.interceptors?.response?.onSuccess,this.onErrorInterceptor=t.interceptors?.response?.onError,this.imageApi=t.images?.autocomplete_paths||t.images?.fallback_url!=null?new x(t.images):void 0,this.imageOptions=t.images}buildRequestKey(e,t){let n=this.serializeParams(t).sort(([e],[t])=>e.localeCompare(t)).map(([e,t])=>`${e}=${t}`);return n.length>0?`${e}?${n.join(`&`)}`:e}serializeParams(e){return Object.entries(e).flatMap(([e,t])=>t===void 0?[]:[[e,String(t)]])}async request(e,t={}){let n=await this.runRequestInterceptors({endpoint:e,params:t,method:`GET`}),r=n.endpoint,i=n.params,a=this.buildRequestKey(r,i),o=!!this.responseCache?.shouldCache(a);if(o&&this.responseCache.has(a))return this.responseCache.get(a);if(!this.deduplication){let e=await this.execute(`GET`,r,i,void 0,!0);return o&&this.responseCache.set(a,e),e}let s=this.inflightRequests.get(a);if(s)return s;let c=o?this.responseCache:void 0,l=this.execute(`GET`,r,i,void 0,!0).then(e=>(c?.set(a,e),e)).finally(()=>{this.inflightRequests.delete(a)});return this.inflightRequests.set(a,l),l}invalidateCache(e,t={}){return this.responseCache?this.responseCache.delete(this.buildRequestKey(e,t)):!1}clearCache(){this.responseCache?.clear()}get cacheSize(){return this.responseCache?.size??0}async runRequestInterceptors(e){let t=e;for(let e of this.requestInterceptors){let n=await e(t);n!=null&&(t=n)}return t}sanitizeNulls(e){if(e===null)return;if(typeof e!=`object`)return e;if(Array.isArray(e))return e.map(e=>this.sanitizeNulls(e));let t={};for(let[n,r]of Object.entries(e))t[n]=this.sanitizeNulls(r);return t}async normalizeError(t,n,r){let i=t.statusText,a=-1;try{let e=await t.json();if(e&&typeof e==`object`){let t=e;i=t.status_message||i,a=t.status_code||-1}}catch(e){console.error(`Unknown error: ${e}`)}return this.logger?.log({type:`error`,method:r,endpoint:n,status:t.status,statusText:t.statusText,tmdbStatusCode:a,errorMessage:i}),new e(i,t.status,a)}async notifyErrorInterceptor(e){this.onErrorInterceptor&&await this.onErrorInterceptor(e)}async mutate(e,t,n,r={}){return this.execute(e,t,r,n)}async execute(t,n,r,i,a=!1){let o=i===void 0?void 0:JSON.stringify(i),s,c;if(a)s=n,c=r;else{let e=await this.runRequestInterceptors({endpoint:n,params:r,method:t});s=e.endpoint,c=e.params}let l=new URL(`${this.baseUrl}${s}`),u=m(this.accessToken);for(let[e,t]of this.serializeParams(c))l.searchParams.append(e,t);u||l.searchParams.append(`api_key`,this.accessToken);let d=Date.now();this.logger?.log({type:`request`,method:t,endpoint:s});let f=async()=>{this.rateLimiter&&await this.rateLimiter.acquire();let e;try{e=await fetch(l.toString(),{method:t,headers:u?{Authorization:`Bearer ${this.accessToken}`,"Content-Type":`application/json;charset=utf-8`}:{"Content-Type":`application/json;charset=utf-8`},...o===void 0?{}:{body:o}})}catch(e){throw this.logger?.log({type:`error`,method:t,endpoint:s,errorMessage:e instanceof Error?e.message:String(e),durationMs:Date.now()-d}),e}if(!e.ok)throw await this.normalizeError(e,s,t);return e},p;try{p=this.retryManager?await this.retryManager.execute(f):await f()}catch(t){throw t instanceof e&&await this.notifyErrorInterceptor(t),t}this.logger?.log({type:`response`,method:t,endpoint:s,status:p.status,statusText:p.statusText,durationMs:Date.now()-d});let h=await p.json(),g=this.sanitizeNulls(h),_=this.imageApi?this.imageOptions?.autocomplete_paths?this.imageApi.autocompleteImagePaths(g):this.imageApi.applyFallbacksOnly(g):g;if(this.onSuccessInterceptor){let e=await this.onSuccessInterceptor(_);return e===void 0?_:e}return _}};const C={AUTHENTICATION:{VALIDATE:`/authentication`,GUEST_SESSION:`/authentication/guest_session/new`,REQUEST_TOKEN:`/authentication/token/new`,CREATE_SESSION:`/authentication/session/new`,CREATE_SESSION_WITH_LOGIN:`/authentication/token/validate_with_login`,DELETE_SESSION:`/authentication/session`},ACCOUNT:{DETAILS:`/account`,ADD_FAVORITE:`/favorite`,ADD_TO_WATCHLIST:`/watchlist`,FAVORITE_MOVIES:`/favorite/movies`,FAVORITE_TV:`/favorite/tv`,WATCHLIST_MOVIES:`/watchlist/movies`,WATCHLIST_TV:`/watchlist/tv`,RATED_MOVIES:`/rated/movies`,RATED_TV:`/rated/tv`,RATED_TV_EPISODES:`/rated/tv/episodes`,LISTS:`/lists`},CONFIGURATION:{DETAILS:`/configuration`,COUNTRIES:`/configuration/countries`,JOBS:`/configuration/jobs`,LANGUAGES:`/configuration/languages`,TIMEZONES:`/configuration/timezones`,PRIMARY_TRANSLATIONS:`/configuration/primary_translations`},CERTIFICATIONS:{MOVIE_CERTIFICATIONS:`/certification/movie/list`,TV_CERTIFICATIONS:`/certification/tv/list`},CHANGES:{MOVIE_LIST:`/movie/changes`,PEOPLE_LIST:`/person/changes`,TV_LIST:`/tv/changes`},DISCOVER:{MOVIE:`/discover/movie`,TV:`/discover/tv`},FIND:`/find`,CREDITS:{DETAILS:`/credit`},COMPANIES:{DETAILS:`/company`,ALTERNATIVE_NAMES:`/alternative_names`,IMAGES:`/images`},COLLECTIONS:{DETAILS:`/collection`,IMAGES:`/images`,TRANSLATIONS:`/translations`},GENRES:{MOVIE_LIST:`/genre/movie/list`,TV_LIST:`/genre/tv/list`},KEYWORDS:{DETAILS:`/keyword`,MOVIES:`/movies`},MOVIES:{DETAILS:`/movie`,ALTERNATIVE_TITLES:`/alternative_titles`,CREDITS:`/credits`,EXTERNAL_IDS:`/external_ids`,KEYWORDS:`/keywords`,CHANGES:`/changes`,IMAGES:`/images`,LATEST:`/latest`,NOW_PLAYING:`/now_playing`,POPULAR:`/popular`,RECOMMENDATIONS:`/recommendations`,RELEASE_DATES:`/release_dates`,REVIEWS:`/reviews`,SIMILAR:`/similar`,TOP_RATED:`/top_rated`,TRANSLATIONS:`/translations`,UPCOMING:`/upcoming`,VIDEOS:`/videos`,WATCH_PROVIDERS:`/watch/providers`},NETWORKS:{DETAILS:`/network`,ALTERNATIVE_NAMES:`/alternative_names`,IMAGES:`/images`},PEOPLE:{DETAILS:`/person`,CHANGES:`/changes`,COMBINED_CREDITS:`/combined_credits`,EXTERNAL_IDS:`/external_ids`,IMAGES:`/images`,LATEST:`/latest`,MOVIE_CREDITS:`/movie_credits`,TAGGED_IMAGES:`/tagged_images`,TRANSLATIONS:`/translations`,TV_CREDITS:`/tv_credits`},SEARCH:{MOVIE:`/search/movie`,COLLECTION:`/search/collection`,COMPANY:`/search/company`,KEYWORD:`/search/keyword`,MULTI:`/search/multi`,PERSON:`/search/person`,TV:`/search/tv`},TV_SERIES:{DETAILS:`/tv`,AGGREGATE_CREDITS:`/aggregate_credits`,AIRING_TODAY:`/airing_today`,ALTERNATIVE_TITLES:`/alternative_titles`,CHANGES:`/changes`,CONTENT_RATINGS:`/content_ratings`,CREDITS:`/credits`,EPISODE_GROUPS:`/episode_groups`,EXTERNAL_IDS:`/external_ids`,IMAGES:`/images`,KEYWORDS:`/keywords`,LATEST:`/latest`,LISTS:`/lists`,ON_THE_AIR:`/on_the_air`,POPULAR:`/popular`,RECOMMENDATIONS:`/recommendations`,REVIEWS:`/reviews`,SCREENED_THEATRICALLY:`/screened_theatrically`,SIMILAR:`/similar`,TOP_RATED:`/top_rated`,TRANSLATIONS:`/translations`,VIDEOS:`/videos`,WATCH_PROVIDERS:`/watch/providers`},TV_SEASONS:{DETAILS:`/season`,AGGREGATE_CREDITS:`/aggregate_credits`,CHANGES:`/changes`,CREDITS:`/credits`,EXTERNAL_IDS:`/external_ids`,IMAGES:`/images`,TRANSLATIONS:`/translations`,VIDEOS:`/videos`,WATCH_PROVIDERS:`/watch/providers`},TV_EPISODES:{DETAILS:`/episode`,CHANGES:`/changes`,CREDITS:`/credits`,EXTERNAL_IDS:`/external_ids`,IMAGES:`/images`,TRANSLATIONS:`/translations`,VIDEOS:`/videos`},TV_EPISODE_GROUPS:{DETAILS:`/tv/episode_group`},WATCH_PROVIDERS:{MOVIE:`/watch/providers/movie`,TV:`/watch/providers/tv`,REGIONS:`/watch/providers/regions`},TRENDING:{ALL:`/trending/all`,MOVIE:`/trending/movie`,TV:`/trending/tv`,PERSON:`/trending/person`},REVIEWS:{DETAILS:`/review`},PEOPLE_LISTS:{POPULAR:`/person/popular`},LISTS:{DETAILS:`/list`,ADD_ITEM:`/add_item`,ITEM_STATUS:`/item_status`,CLEAR:`/clear`,REMOVE_ITEM:`/remove_item`},GUEST_SESSIONS:{DETAILS:`/guest_session`,RATED_MOVIES:`/rated/movies`,RATED_TV:`/rated/tv`,RATED_TV_EPISODES:`/rated/tv/episodes`}},w={AUTH:{REQUEST_TOKEN:`/auth/request_token`,ACCESS_TOKEN:`/auth/access_token`},ACCOUNT:{DETAILS:`/account`,LISTS:`/lists`,FAVORITE_MOVIES:`/favorite/movies`,FAVORITE_TV:`/favorite/tv`,WATCHLIST_MOVIES:`/watchlist/movies`,WATCHLIST_TV:`/watchlist/tv`,RATED_MOVIES:`/rated/movies`,RATED_TV:`/rated/tv`},LISTS:{DETAILS:`/list`,ITEMS:`/items`,ITEM_STATUS:`/item_status`,CLEAR:`/clear`}};var T=class{client;defaultOptions;constructor(e,t={}){if(typeof e==`string`){if(!e)throw Error(v.NO_ACCESS_TOKEN);this.client=new S(e,{logger:t.logger,deduplication:t.deduplication,rate_limit:t.rate_limit,interceptors:t.interceptors})}else if(e instanceof S)this.client=e;else throw Error(e==null?v.NO_ACCESS_TOKEN:v.INVALID_CLIENT);this.defaultOptions=t}applyDefaults(e){let{language:t,region:n}=this.defaultOptions;return{...t!==void 0&&{language:t},...n!==void 0&&{region:n},...e}}withLanguage(e){let t=this.defaultOptions?.language;return e?e.language!==void 0||t===void 0?e:{...e,language:t}:t===void 0?void 0:{language:t}}injectImageLanguage(e){if(!this.defaultOptions.images?.auto_include_image_language||e.include_image_language!==void 0)return e;let t=this.defaultOptions.images?.image_language_priority;if(!t)return e;let n=[...new Set(Object.values(t).flat().filter(e=>e!==`*`))];return n.length?{...e,include_image_language:n}:e}},E=class extends T{async movie_certifications(){return this.client.request(C.CERTIFICATIONS.MOVIE_CERTIFICATIONS)}async tv_certifications(){return this.client.request(C.CERTIFICATIONS.TV_CERTIFICATIONS)}},D=class extends T{async movie_list(e){return this.client.request(C.CHANGES.MOVIE_LIST,e)}async people_list(e){return this.client.request(C.CHANGES.PEOPLE_LIST,e)}async tv_list(e){return this.client.request(C.CHANGES.TV_LIST,e)}},O=class extends T{companyPath(e){return`${C.COMPANIES.DETAILS}/${e}`}async details(e){let t=this.companyPath(e.company_id);return this.client.request(t)}async alternative_names(e){let t=`${this.companyPath(e.company_id)}${C.COMPANIES.ALTERNATIVE_NAMES}`;return this.client.request(t)}async images(e){let{company_id:t,...n}=e,r=`${this.companyPath(t)}${C.COMPANIES.IMAGES}`;return this.client.request(r,this.injectImageLanguage(this.withLanguage(n)??n))}},k=class extends T{creditPath(e){return`${C.CREDITS.DETAILS}/${e}`}async details(e){let{credit_id:t,...n}=e,r=this.creditPath(t);return this.client.request(r,this.withLanguage(n))}},A=class extends T{collectionPath(e){return`${C.COLLECTIONS.DETAILS}/${e}`}async details(e){let{language:t=this.defaultOptions.language,collection_id:n}=e,r=this.collectionPath(n);return this.client.request(r,{language:t})}async images(e){let{collection_id:t,...n}=e,r=`${this.collectionPath(t)}${C.COLLECTIONS.IMAGES}`;return this.client.request(r,this.injectImageLanguage(this.withLanguage(n)??n))}async translations(e){let t=`${this.collectionPath(e.collection_id)}${C.COLLECTIONS.TRANSLATIONS}`;return this.client.request(t)}},j=class extends T{async details(){return this.client.request(C.CONFIGURATION.DETAILS)}async countries(e){return this.client.request(C.CONFIGURATION.COUNTRIES,this.withLanguage(e))}async jobs(){return this.client.request(C.CONFIGURATION.JOBS)}async languages(){return this.client.request(C.CONFIGURATION.LANGUAGES)}async primary_translations(){return this.client.request(C.CONFIGURATION.PRIMARY_TRANSLATIONS)}async timezones(){return this.client.request(C.CONFIGURATION.TIMEZONES)}},M=class extends T{withMovieDefaults(e){if(!e&&!this.defaultOptions.language&&!this.defaultOptions.region)return;let t=e?.language??this.defaultOptions.language,n=e?.region??this.defaultOptions.region;return{...e,language:t,region:n}}withTVDefaults(e){if(!e&&!this.defaultOptions.language&&!this.defaultOptions.timezone)return;let t=e?.language??this.defaultOptions.language,n=e?.timezone??this.defaultOptions.timezone;return{...e,language:t,timezone:n}}async movie(e={}){return this.client.request(C.DISCOVER.MOVIE,this.withMovieDefaults(e))}async tv(e={}){return this.client.request(C.DISCOVER.TV,this.withTVDefaults(e))}},N=class extends T{async by_id(e){let{external_id:t,...n}=e,r=`${C.FIND}/${encodeURIComponent(t)}`,i=this.withLanguage(n);return this.client.request(r,i)}},P=class extends T{async movie_list(e){return this.client.request(C.GENRES.MOVIE_LIST,this.withLanguage(e))}async tv_list(e){return this.client.request(C.GENRES.TV_LIST,this.withLanguage(e))}},F=class extends T{keywordPath(e){return`${C.KEYWORDS.DETAILS}/${e}`}async details(e){let t=this.keywordPath(e.keyword_id);return this.client.request(t)}async movies(e){let{keyword_id:t,...n}=e,r=`${this.keywordPath(t)}${C.KEYWORDS.MOVIES}`,i=this.withLanguage(n);return this.client.request(r,i)}},I=class extends T{withDefaults(e){let{language:t=this.defaultOptions.language,region:n=this.defaultOptions.region,...r}=e;return{language:t,region:n,...r}}fetch_movie_list(e,t={}){return this.client.request(C.MOVIES.DETAILS+e,this.withDefaults(t))}async now_playing(e={}){return this.fetch_movie_list(C.MOVIES.NOW_PLAYING,e)}async popular(e={}){return this.fetch_movie_list(C.MOVIES.POPULAR,e)}async top_rated(e={}){return this.fetch_movie_list(C.MOVIES.TOP_RATED,e)}async upcoming(e={}){return this.fetch_movie_list(C.MOVIES.UPCOMING,e)}},L=class extends T{moviePath(e){return`${C.MOVIES.DETAILS}/${e}`}movieSubPath(e,t){return`${this.moviePath(e)}${t}`}async details(e){let{language:t=this.defaultOptions.language,movie_id:n,append_to_response:r}=e,i=this.moviePath(n);return this.client.request(i,{language:t,append_to_response:r})}async alternative_titles(e){let{movie_id:t,...n}=e,r=this.movieSubPath(t,C.MOVIES.ALTERNATIVE_TITLES);return this.client.request(r,n)}async credits(e){let{movie_id:t,language:n=this.defaultOptions.language,...r}=e,i=this.movieSubPath(t,C.MOVIES.CREDITS);return this.client.request(i,{language:n,...r})}async external_ids(e){let t=this.movieSubPath(e.movie_id,C.MOVIES.EXTERNAL_IDS);return this.client.request(t)}async keywords(e){let t=this.movieSubPath(e.movie_id,C.MOVIES.KEYWORDS);return this.client.request(t)}async changes(e){let{movie_id:t,...n}=e,r=this.movieSubPath(t,C.MOVIES.CHANGES);return this.client.request(r,n)}async images(e){let{movie_id:t,language:n=this.defaultOptions.language,...r}=e,i=this.movieSubPath(t,C.MOVIES.IMAGES);return this.client.request(i,this.injectImageLanguage({language:n,...r}))}async latest(){let e=`${C.MOVIES.DETAILS}${C.MOVIES.LATEST}`;return this.client.request(e)}async recommendations(e){let{movie_id:t,language:n=this.defaultOptions.language,...r}=e,i=this.movieSubPath(t,C.MOVIES.RECOMMENDATIONS);return this.client.request(i,{language:n,...r})}async release_dates(e){let t=this.movieSubPath(e.movie_id,C.MOVIES.RELEASE_DATES);return this.client.request(t)}async reviews(e){let{movie_id:t,language:n=this.defaultOptions.language,...r}=e,i=this.movieSubPath(t,C.MOVIES.REVIEWS);return this.client.request(i,{language:n,...r})}async similar(e){let{movie_id:t,language:n=this.defaultOptions.language,...r}=e,i=this.movieSubPath(t,C.MOVIES.SIMILAR);return this.client.request(i,{language:n,...r})}async translations(e){let t=this.movieSubPath(e.movie_id,C.MOVIES.TRANSLATIONS);return this.client.request(t)}async videos(e){let{movie_id:t,language:n=this.defaultOptions.language,...r}=e,i=this.movieSubPath(t,C.MOVIES.VIDEOS);return this.client.request(i,{language:n,...r})}async watch_providers(e){let t=this.movieSubPath(e.movie_id,C.MOVIES.WATCH_PROVIDERS);return this.client.request(t)}},R=class extends T{async collections(e){return this.client.request(C.SEARCH.COLLECTION,this.applyDefaults(e))}async movies(e){return this.client.request(C.SEARCH.MOVIE,this.applyDefaults(e))}async company(e){return this.client.request(C.SEARCH.COMPANY,this.applyDefaults(e))}async keyword(e){return this.client.request(C.SEARCH.KEYWORD,this.applyDefaults(e))}async person(e){return this.client.request(C.SEARCH.PERSON,this.applyDefaults(e))}async tv_series(e){return this.client.request(C.SEARCH.TV,this.applyDefaults(e))}async multi(e){return this.client.request(C.SEARCH.MULTI,this.applyDefaults(e))}},z=class extends T{seriesPath(e){return`${C.TV_SERIES.DETAILS}/${e}`}seriesSubPath(e,t){return`${this.seriesPath(e)}${t}`}async details(e){let{language:t=this.defaultOptions.language,series_id:n,...r}=e,i=this.seriesPath(n);return this.client.request(i,{language:t,...r})}async aggregate_credits(e){let{language:t=this.defaultOptions.language,series_id:n,...r}=e,i=this.seriesSubPath(n,C.TV_SERIES.AGGREGATE_CREDITS);return this.client.request(i,{language:t,...r})}async alternative_titles(e){let t=this.seriesSubPath(e.series_id,C.TV_SERIES.ALTERNATIVE_TITLES);return this.client.request(t)}async changes(e){let{series_id:t,...n}=e,r=this.seriesSubPath(t,C.TV_SERIES.CHANGES);return this.client.request(r,{...n})}async content_ratings(e){let t=this.seriesSubPath(e.series_id,C.TV_SERIES.CONTENT_RATINGS);return this.client.request(t)}async credits(e){let{language:t=this.defaultOptions.language,series_id:n,...r}=e,i=this.seriesSubPath(n,C.TV_SERIES.CREDITS);return this.client.request(i,{language:t,...r})}async episode_groups(e){let t=this.seriesSubPath(e.series_id,C.TV_SERIES.EPISODE_GROUPS);return this.client.request(t)}async external_ids(e){let t=this.seriesSubPath(e.series_id,C.TV_SERIES.EXTERNAL_IDS);return this.client.request(t)}async images(e){let{language:t=this.defaultOptions.language,series_id:n,...r}=e,i=this.seriesSubPath(n,C.TV_SERIES.IMAGES);return this.client.request(i,this.injectImageLanguage({language:t,...r}))}async keywords(e){let t=this.seriesSubPath(e.series_id,C.TV_SERIES.KEYWORDS);return this.client.request(t)}async latest(){let e=`${C.TV_SERIES.DETAILS}${C.TV_SERIES.LATEST}`;return this.client.request(e)}async lists(e){let{language:t=this.defaultOptions.language,series_id:n,...r}=e,i=this.seriesSubPath(n,C.TV_SERIES.LISTS);return this.client.request(i,{language:t,...r})}async recommendations(e){let{language:t=this.defaultOptions.language,series_id:n,...r}=e,i=this.seriesSubPath(n,C.TV_SERIES.RECOMMENDATIONS);return this.client.request(i,{language:t,...r})}async reviews(e){let{language:t=this.defaultOptions.language,series_id:n,...r}=e,i=this.seriesSubPath(n,C.TV_SERIES.REVIEWS);return this.client.request(i,{language:t,...r})}async screened_theatrically(e){let t=this.seriesSubPath(e.series_id,C.TV_SERIES.SCREENED_THEATRICALLY);return this.client.request(t)}async similar(e){let{language:t=this.defaultOptions.language,series_id:n,...r}=e,i=this.seriesSubPath(n,C.TV_SERIES.SIMILAR);return this.client.request(i,{language:t,...r})}async translations(e){let t=this.seriesSubPath(e.series_id,C.TV_SERIES.TRANSLATIONS);return this.client.request(t)}async videos(e){let t=this.seriesSubPath(e.series_id,C.TV_SERIES.VIDEOS);return this.client.request(t)}async watch_providers(e){let t=this.seriesSubPath(e.series_id,C.TV_SERIES.WATCH_PROVIDERS);return this.client.request(t)}},he=class extends T{withDefaults(e){let{language:t=this.defaultOptions.language,timezone:n=this.defaultOptions.timezone,...r}=e;return{language:t,timezone:n,...r}}fetch_tv_series_list(e,t={}){return this.client.request(C.TV_SERIES.DETAILS+e,this.withDefaults(t))}async airing_today(e={}){return this.fetch_tv_series_list(C.TV_SERIES.AIRING_TODAY,e)}async on_the_air(e={}){return this.fetch_tv_series_list(C.TV_SERIES.ON_THE_AIR,e)}async popular(e={}){return this.fetch_tv_series_list(C.TV_SERIES.POPULAR,e)}async top_rated(e={}){return this.fetch_tv_series_list(C.TV_SERIES.TOP_RATED,e)}},B=class extends T{async movie_providers(e){let t=e?.language??this.defaultOptions.language,n=t===void 0?e:{...e,language:t};return this.client.request(C.WATCH_PROVIDERS.MOVIE,n)}async tv_providers(e){let t=e?.language??this.defaultOptions.language,n=t===void 0?e:{...e,language:t};return this.client.request(C.WATCH_PROVIDERS.TV,n)}async available_regions(e){let t=e?.language??this.defaultOptions.language,n=t===void 0?e:{...e,language:t};return this.client.request(C.WATCH_PROVIDERS.REGIONS,n)}},V=class extends T{networkPath(e){return`${C.NETWORKS.DETAILS}/${e}`}async details(e){let t=this.networkPath(e.network_id);return this.client.request(t)}async alternative_names(e){let t=`${this.networkPath(e.network_id)}${C.NETWORKS.ALTERNATIVE_NAMES}`;return this.client.request(t)}async images(e){let t=`${this.networkPath(e.network_id)}${C.NETWORKS.IMAGES}`;return this.client.request(t)}},H=class extends T{episodePath(e){return`${C.TV_SERIES.DETAILS}/${e.series_id}${C.TV_SEASONS.DETAILS}/${e.season_number}${C.TV_EPISODES.DETAILS}/${e.episode_number}`}episodeSubPath(e,t){return`${this.episodePath(e)}${t}`}async details(e){let{language:t=this.defaultOptions.language,append_to_response:n,...r}=e,i=this.episodePath(r);return this.client.request(i,{language:t,append_to_response:n})}async changes(e){let t=`${C.TV_SERIES.DETAILS}${C.TV_EPISODES.DETAILS}/${e.episode_id}${C.TV_EPISODES.CHANGES}`;return this.client.request(t)}async credits(e){let{language:t=this.defaultOptions.language,...n}=e,r=this.episodeSubPath(n,C.TV_EPISODES.CREDITS);return this.client.request(r,{language:t})}async external_ids(e){let t=this.episodeSubPath(e,C.TV_EPISODES.EXTERNAL_IDS);return this.client.request(t)}async images(e){let{language:t=this.defaultOptions.language,include_image_language:n,...r}=e,i=this.episodeSubPath(r,C.TV_EPISODES.IMAGES);return this.client.request(i,this.injectImageLanguage({language:t,include_image_language:n}))}async translations(e){let t=this.episodeSubPath(e,C.TV_EPISODES.TRANSLATIONS);return this.client.request(t)}async videos(e){let t=this.episodeSubPath(e,C.TV_EPISODES.VIDEOS);return this.client.request(t)}},U=class extends T{async details(e){let t=`${C.TV_EPISODE_GROUPS.DETAILS}/${e.episode_group_id}`;return this.client.request(t)}},W=class extends T{seasonPath(e){return`${C.TV_SERIES.DETAILS}/${e.series_id}${C.TV_SEASONS.DETAILS}/${e.season_number}`}seasonSubPath(e,t){return`${this.seasonPath(e)}${t}`}async details(e){let{language:t=this.defaultOptions.language,append_to_response:n,...r}=e,i=this.seasonPath(r);return this.client.request(i,{language:t,append_to_response:n})}async aggregate_credits(e){let{language:t=this.defaultOptions.language,...n}=e,r=this.seasonSubPath(n,C.TV_SEASONS.AGGREGATE_CREDITS);return this.client.request(r,{language:t})}async changes(e){let{season_id:t,...n}=e,r=`${C.TV_SERIES.DETAILS}${C.TV_SEASONS.DETAILS}/${t}${C.TV_SEASONS.CHANGES}`;return this.client.request(r,{...n})}async credits(e){let{language:t=this.defaultOptions.language,...n}=e,r=this.seasonSubPath(n,C.TV_SEASONS.CREDITS);return this.client.request(r,{language:t})}async external_ids(e){let t=this.seasonSubPath(e,C.TV_SEASONS.EXTERNAL_IDS);return this.client.request(t)}async images(e){let{language:t=this.defaultOptions.language,include_image_language:n,...r}=e,i=this.seasonSubPath(r,C.TV_SEASONS.IMAGES);return this.client.request(i,this.injectImageLanguage({language:t,include_image_language:n}))}async translations(e){let t=this.seasonSubPath(e,C.TV_SEASONS.TRANSLATIONS);return this.client.request(t)}async videos(e){let{language:t=this.defaultOptions.language,include_video_language:n,...r}=e,i=this.seasonSubPath(r,C.TV_SEASONS.VIDEOS);return this.client.request(i,{language:t,include_video_language:n})}async watch_providers(e){let{language:t=this.defaultOptions.language,...n}=e,r=this.seasonSubPath(n,C.TV_SEASONS.WATCH_PROVIDERS);return this.client.request(r,{language:t})}},G=class extends T{async all(e){let{time_window:t,language:n=this.defaultOptions.language,...r}=e;return this.client.request(`${C.TRENDING.ALL}/${t}`,{language:n,...r})}async movies(e){let{time_window:t,language:n=this.defaultOptions.language,...r}=e;return this.client.request(`${C.TRENDING.MOVIE}/${t}`,{language:n,...r})}async tv(e){let{time_window:t,language:n=this.defaultOptions.language,...r}=e;return this.client.request(`${C.TRENDING.TV}/${t}`,{language:n,...r})}async people(e){let{time_window:t,language:n=this.defaultOptions.language,...r}=e;return this.client.request(`${C.TRENDING.PERSON}/${t}`,{language:n,...r})}},K=class extends T{async details(e){return this.client.request(`${C.REVIEWS.DETAILS}/${e.review_id}`)}},q=class extends T{async popular(e={}){return this.client.request(C.PEOPLE_LISTS.POPULAR,this.withLanguage(e))}},J=class extends T{personPath(e){return`${C.PEOPLE.DETAILS}/${e}`}personSubPath(e,t){return`${this.personPath(e)}${t}`}async details(e){let{language:t=this.defaultOptions.language,person_id:n,...r}=e;return this.client.request(this.personPath(n),{language:t,...r})}async changes(e){let{person_id:t,...n}=e;return this.client.request(this.personSubPath(t,C.PEOPLE.CHANGES),n)}async combined_credits(e){let{language:t=this.defaultOptions.language,person_id:n,...r}=e;return this.client.request(this.personSubPath(n,C.PEOPLE.COMBINED_CREDITS),{language:t,...r})}async external_ids(e){return this.client.request(this.personSubPath(e.person_id,C.PEOPLE.EXTERNAL_IDS))}async images(e){return this.client.request(this.personSubPath(e.person_id,C.PEOPLE.IMAGES))}async latest(){return this.client.request(`${C.PEOPLE.DETAILS}${C.PEOPLE.LATEST}`)}async movie_credits(e){let{language:t=this.defaultOptions.language,person_id:n,...r}=e;return this.client.request(this.personSubPath(n,C.PEOPLE.MOVIE_CREDITS),{language:t,...r})}async tagged_images(e){let{person_id:t,...n}=e;return this.client.request(this.personSubPath(t,C.PEOPLE.TAGGED_IMAGES),n)}async translations(e){return this.client.request(this.personSubPath(e.person_id,C.PEOPLE.TRANSLATIONS))}async tv_credits(e){let{language:t=this.defaultOptions.language,person_id:n,...r}=e;return this.client.request(this.personSubPath(n,C.PEOPLE.TV_CREDITS),{language:t,...r})}},Y=class extends T{accountPath(e){return`${C.ACCOUNT.DETAILS}/${e}`}accountSubPath(e,t){return`${this.accountPath(e)}${t}`}async details(e){let{account_id:t,...n}=e;return this.client.request(this.accountPath(t),n)}async add_favorite(e,t){let{account_id:n,...r}=e;return this.client.mutate(`POST`,this.accountSubPath(n,C.ACCOUNT.ADD_FAVORITE),t,r)}async add_to_watchlist(e,t){let{account_id:n,...r}=e;return this.client.mutate(`POST`,this.accountSubPath(n,C.ACCOUNT.ADD_TO_WATCHLIST),t,r)}async favorite_movies(e){let{account_id:t,language:n=this.defaultOptions.language,...r}=e;return this.client.request(this.accountSubPath(t,C.ACCOUNT.FAVORITE_MOVIES),{language:n,...r})}async favorite_tv(e){let{account_id:t,language:n=this.defaultOptions.language,...r}=e;return this.client.request(this.accountSubPath(t,C.ACCOUNT.FAVORITE_TV),{language:n,...r})}async watchlist_movies(e){let{account_id:t,language:n=this.defaultOptions.language,...r}=e;return this.client.request(this.accountSubPath(t,C.ACCOUNT.WATCHLIST_MOVIES),{language:n,...r})}async watchlist_tv(e){let{account_id:t,language:n=this.defaultOptions.language,...r}=e;return this.client.request(this.accountSubPath(t,C.ACCOUNT.WATCHLIST_TV),{language:n,...r})}async rated_movies(e){let{account_id:t,language:n=this.defaultOptions.language,...r}=e;return this.client.request(this.accountSubPath(t,C.ACCOUNT.RATED_MOVIES),{language:n,...r})}async rated_tv(e){let{account_id:t,language:n=this.defaultOptions.language,...r}=e;return this.client.request(this.accountSubPath(t,C.ACCOUNT.RATED_TV),{language:n,...r})}async rated_tv_episodes(e){let{account_id:t,language:n=this.defaultOptions.language,...r}=e;return this.client.request(this.accountSubPath(t,C.ACCOUNT.RATED_TV_EPISODES),{language:n,...r})}async lists(e){let{account_id:t,...n}=e;return this.client.request(this.accountSubPath(t,C.ACCOUNT.LISTS),n)}},X=class extends T{async validate_key(){return this.client.request(C.AUTHENTICATION.VALIDATE)}async create_guest_session(){return this.client.request(C.AUTHENTICATION.GUEST_SESSION)}async create_request_token(){return this.client.request(C.AUTHENTICATION.REQUEST_TOKEN)}async create_session(e){return this.client.mutate(`POST`,C.AUTHENTICATION.CREATE_SESSION,e)}async create_session_with_login(e){return this.client.mutate(`POST`,C.AUTHENTICATION.CREATE_SESSION_WITH_LOGIN,e)}async delete_session(e){return this.client.mutate(`DELETE`,C.AUTHENTICATION.DELETE_SESSION,e)}},Z=class extends T{guestSessionPath(e){return`${C.GUEST_SESSIONS.DETAILS}/${e}`}guestSessionSubPath(e,t){return`${this.guestSessionPath(e)}${t}`}async rated_movies(e){let{guest_session_id:t,language:n=this.defaultOptions.language,...r}=e;return this.client.request(this.guestSessionSubPath(t,C.GUEST_SESSIONS.RATED_MOVIES),{language:n,...r})}async rated_tv(e){let{guest_session_id:t,language:n=this.defaultOptions.language,...r}=e;return this.client.request(this.guestSessionSubPath(t,C.GUEST_SESSIONS.RATED_TV),{language:n,...r})}async rated_tv_episodes(e){let{guest_session_id:t,language:n=this.defaultOptions.language,...r}=e;return this.client.request(this.guestSessionSubPath(t,C.GUEST_SESSIONS.RATED_TV_EPISODES),{language:n,...r})}},Q=class extends T{listPath(e){return`${C.LISTS.DETAILS}/${e}`}listSubPath(e,t){return`${this.listPath(e)}${t}`}async details(e){let{list_id:t,language:n=this.defaultOptions.language,...r}=e;return this.client.request(this.listPath(t),{language:n,...r})}async create(e,t){return this.client.mutate(`POST`,C.LISTS.DETAILS,t,e)}async delete(e){let{list_id:t,...n}=e;return this.client.mutate(`DELETE`,this.listPath(t),void 0,n)}async add_movie(e,t){let{list_id:n,...r}=e;return this.client.mutate(`POST`,this.listSubPath(n,C.LISTS.ADD_ITEM),t,r)}async remove_movie(e,t){let{list_id:n,...r}=e;return this.client.mutate(`POST`,this.listSubPath(n,C.LISTS.REMOVE_ITEM),t,r)}async check_item_status(e){let{list_id:t,language:n=this.defaultOptions.language,...r}=e;return this.client.request(this.listSubPath(t,C.LISTS.ITEM_STATUS),{language:n,...r})}async clear(e){let{list_id:t,...n}=e;return this.client.mutate(`POST`,this.listSubPath(t,C.LISTS.CLEAR),void 0,n)}},ge=class extends T{async create_request_token(e){return this.client.mutate(`POST`,w.AUTH.REQUEST_TOKEN,e??{})}async create_access_token(e){return this.client.mutate(`POST`,w.AUTH.ACCESS_TOKEN,e)}async delete_access_token(e){return this.client.mutate(`DELETE`,w.AUTH.ACCESS_TOKEN,e)}},_e=class extends T{},ve=class extends T{listPath(e){return`${w.LISTS.DETAILS}/${e}`}async create(e){return this.client.mutate(`POST`,w.LISTS.DETAILS,e)}async details({list_id:e,...t}){return this.client.request(this.listPath(e),this.withLanguage(t))}async update({list_id:e,...t}){return this.client.mutate(`PUT`,this.listPath(e),t)}async delete({list_id:e}){return this.client.mutate(`DELETE`,this.listPath(e),{})}async add_items(e,t){return this.client.mutate(`POST`,`${this.listPath(e)}${w.LISTS.ITEMS}`,t)}async update_items(e,t){return this.client.mutate(`PUT`,`${this.listPath(e)}${w.LISTS.ITEMS}`,t)}async remove_items(e,t){return this.client.mutate(`DELETE`,`${this.listPath(e)}${w.LISTS.ITEMS}`,t)}async item_status({list_id:e,...t}){return this.client.request(`${this.listPath(e)}${w.LISTS.ITEM_STATUS}`,t)}async clear(e){return this.client.mutate(`GET`,`${this.listPath(e)}${w.LISTS.CLEAR}`)}},$=class{client;auth;account;lists;constructor(e,t={}){if(!e)throw Error(v.NO_ACCESS_TOKEN);this.client=new S(e,{...t,version:4}),this.auth=new ge(this.client,t),this.account=new _e(this.client,t),this.lists=new ve(this.client,t)}},ye=class{client;accessToken;options;movies;movie_lists;search;images;configuration;genres;keywords;tv_lists;tv_series;watch_providers;certifications;changes;companies;credits;collections;discover;find;networks;tv_episodes;tv_episode_groups;tv_seasons;trending;reviews;people_lists;people;account;authentication;guest_sessions;lists;get v4(){if(!m(this.accessToken))throw Error(v.V4_REQUIRES_JWT);return this._v4||=new $(this.accessToken,this.options),this._v4}_v4;get cache(){if(!this.options.cache)return;let e=this.client;return{clear(){e.clearCache()},invalidate(t,n){return e.invalidateCache(t,n)},get size(){return e.cacheSize}}}constructor(e,t={}){if(!e)throw Error(v.NO_ACCESS_TOKEN);this.accessToken=e,this.options=t,this.client=new S(e,{logger:t.logger,deduplication:t.deduplication,images:t.images,rate_limit:t.rate_limit,cache:t.cache,interceptors:t.interceptors}),this.movies=new L(this.client,this.options),this.movie_lists=new I(this.client,this.options),this.search=new R(this.client,this.options),this.images=new x(this.options.images),this.configuration=new j(this.client,this.options),this.genres=new P(this.client,this.options),this.keywords=new F(this.client,this.options),this.tv_lists=new he(this.client,this.options),this.tv_series=new z(this.client,this.options),this.watch_providers=new B(this.client,this.options),this.certifications=new E(this.client,this.options),this.changes=new D(this.client,this.options),this.companies=new O(this.client,this.options),this.credits=new k(this.client,this.options),this.collections=new A(this.client,this.options),this.discover=new M(this.client,this.options),this.find=new N(this.client,this.options),this.networks=new V(this.client,this.options),this.tv_episodes=new H(this.client,this.options),this.tv_episode_groups=new U(this.client,this.options),this.tv_seasons=new W(this.client,this.options),this.trending=new G(this.client,this.options),this.reviews=new K(this.client,this.options),this.people_lists=new q(this.client,this.options),this.people=new J(this.client,this.options),this.account=new Y(this.client,this.options),this.authentication=new X(this.client,this.options),this.guest_sessions=new Z(this.client,this.options),this.lists=new Q(this.client,this.options)}};const be={Premiere:1,TheatricalLimited:2,Theatrical:3,Digital:4,Physical:5,TV:6},xe={1:`Premiere`,2:`Theatrical (Limited)`,3:`Theatrical`,4:`Digital`,5:`Physical`,6:`TV`},Se={ReturningSeries:0,Planned:1,InProduction:2,Ended:3,Canceled:4,Pilot:5},Ce={0:`Returning Series`,1:`Planned`,2:`In Production`,3:`Ended`,4:`Canceled`,5:`Pilot`},we={Documentary:0,News:1,Miniseries:2,Reality:3,Scripted:4,TalkShow:5,Video:6},Te={0:`Documentary`,1:`News`,2:`Miniseries`,3:`Reality`,4:`Scripted`,5:`Talk Show`,6:`Video`},Ee={OriginalAirDate:1,Absolute:2,Dvd:3,Digital:4,StoryArc:5,Production:6,TV:7},De={1:`Original Air Date`,2:`Absolute`,3:`DVD`,4:`Digital`,5:`Story Arc`,6:`Production`,7:`TV`},Oe=[{iso_3166_1:`AD`,english_name:`Andorra`,native_name:`Andorra`},{iso_3166_1:`AE`,english_name:`United Arab Emirates`,native_name:`United Arab Emirates`},{iso_3166_1:`AF`,english_name:`Afghanistan`,native_name:`Afghanistan`},{iso_3166_1:`AG`,english_name:`Antigua and Barbuda`,native_name:`Antigua & Barbuda`},{iso_3166_1:`AI`,english_name:`Anguilla`,native_name:`Anguilla`},{iso_3166_1:`AL`,english_name:`Albania`,native_name:`Albania`},{iso_3166_1:`AM`,english_name:`Armenia`,native_name:`Armenia`},{iso_3166_1:`AN`,english_name:`Netherlands Antilles`,native_name:`Netherlands Antilles`},{iso_3166_1:`AO`,english_name:`Angola`,native_name:`Angola`},{iso_3166_1:`AQ`,english_name:`Antarctica`,native_name:`Antarctica`},{iso_3166_1:`AR`,english_name:`Argentina`,native_name:`Argentina`},{iso_3166_1:`AS`,english_name:`American Samoa`,native_name:`American Samoa`},{iso_3166_1:`AT`,english_name:`Austria`,native_name:`Austria`},{iso_3166_1:`AU`,english_name:`Australia`,native_name:`Australia`},{iso_3166_1:`AW`,english_name:`Aruba`,native_name:`Aruba`},{iso_3166_1:`AZ`,english_name:`Azerbaijan`,native_name:`Azerbaijan`},{iso_3166_1:`BA`,english_name:`Bosnia and Herzegovina`,native_name:`Bosnia & Herzegovina`},{iso_3166_1:`BB`,english_name:`Barbados`,native_name:`Barbados`},{iso_3166_1:`BD`,english_name:`Bangladesh`,native_name:`Bangladesh`},{iso_3166_1:`BE`,english_name:`Belgium`,native_name:`Belgium`},{iso_3166_1:`BF`,english_name:`Burkina Faso`,native_name:`Burkina Faso`},{iso_3166_1:`BG`,english_name:`Bulgaria`,native_name:`Bulgaria`},{iso_3166_1:`BH`,english_name:`Bahrain`,native_name:`Bahrain`},{iso_3166_1:`BI`,english_name:`Burundi`,native_name:`Burundi`},{iso_3166_1:`BJ`,english_name:`Benin`,native_name:`Benin`},{iso_3166_1:`BM`,english_name:`Bermuda`,native_name:`Bermuda`},{iso_3166_1:`BN`,english_name:`Brunei Darussalam`,native_name:`Brunei`},{iso_3166_1:`BO`,english_name:`Bolivia`,native_name:`Bolivia`},{iso_3166_1:`BR`,english_name:`Brazil`,native_name:`Brazil`},{iso_3166_1:`BS`,english_name:`Bahamas`,native_name:`Bahamas`},{iso_3166_1:`BT`,english_name:`Bhutan`,native_name:`Bhutan`},{iso_3166_1:`BU`,english_name:`Burma`,native_name:`Burma`},{iso_3166_1:`BV`,english_name:`Bouvet Island`,native_name:`Bouvet Island`},{iso_3166_1:`BW`,english_name:`Botswana`,native_name:`Botswana`},{iso_3166_1:`BY`,english_name:`Belarus`,native_name:`Belarus`},{iso_3166_1:`BZ`,english_name:`Belize`,native_name:`Belize`},{iso_3166_1:`CA`,english_name:`Canada`,native_name:`Canada`},{iso_3166_1:`CC`,english_name:`Cocos Islands`,native_name:`Cocos (Keeling) Islands`},{iso_3166_1:`CD`,english_name:`Congo`,native_name:`Democratic Republic of the Congo (Kinshasa)`},{iso_3166_1:`CF`,english_name:`Central African Republic`,native_name:`Central African Republic`},{iso_3166_1:`CG`,english_name:`Congo`,native_name:`Republic of the Congo (Brazzaville)`},{iso_3166_1:`CH`,english_name:`Switzerland`,native_name:`Switzerland`},{iso_3166_1:`CI`,english_name:`Cote D'Ivoire`,native_name:`Côte d’Ivoire`},{iso_3166_1:`CK`,english_name:`Cook Islands`,native_name:`Cook Islands`},{iso_3166_1:`CL`,english_name:`Chile`,native_name:`Chile`},{iso_3166_1:`CM`,english_name:`Cameroon`,native_name:`Cameroon`},{iso_3166_1:`CN`,english_name:`China`,native_name:`China`},{iso_3166_1:`CO`,english_name:`Colombia`,native_name:`Colombia`},{iso_3166_1:`CR`,english_name:`Costa Rica`,native_name:`Costa Rica`},{iso_3166_1:`CS`,english_name:`Serbia and Montenegro`,native_name:`Serbia and Montenegro`},{iso_3166_1:`CU`,english_name:`Cuba`,native_name:`Cuba`},{iso_3166_1:`CV`,english_name:`Cape Verde`,native_name:`Cape Verde`},{iso_3166_1:`CX`,english_name:`Christmas Island`,native_name:`Christmas Island`},{iso_3166_1:`CY`,english_name:`Cyprus`,native_name:`Cyprus`},{iso_3166_1:`CZ`,english_name:`Czech Republic`,native_name:`Czech Republic`},{iso_3166_1:`DE`,english_name:`Germany`,native_name:`Germany`},{iso_3166_1:`DJ`,english_name:`Djibouti`,native_name:`Djibouti`},{iso_3166_1:`DK`,english_name:`Denmark`,native_name:`Denmark`},{iso_3166_1:`DM`,english_name:`Dominica`,native_name:`Dominica`},{iso_3166_1:`DO`,english_name:`Dominican Republic`,native_name:`Dominican Republic`},{iso_3166_1:`DZ`,english_name:`Algeria`,native_name:`Algeria`},{iso_3166_1:`EC`,english_name:`Ecuador`,native_name:`Ecuador`},{iso_3166_1:`EE`,english_name:`Estonia`,native_name:`Estonia`},{iso_3166_1:`EG`,english_name:`Egypt`,native_name:`Egypt`},{iso_3166_1:`EH`,english_name:`Western Sahara`,native_name:`Western Sahara`},{iso_3166_1:`ER`,english_name:`Eritrea`,native_name:`Eritrea`},{iso_3166_1:`ES`,english_name:`Spain`,native_name:`Spain`},{iso_3166_1:`ET`,english_name:`Ethiopia`,native_name:`Ethiopia`},{iso_3166_1:`FI`,english_name:`Finland`,native_name:`Finland`},{iso_3166_1:`FJ`,english_name:`Fiji`,native_name:`Fiji`},{iso_3166_1:`FK`,english_name:`Falkland Islands`,native_name:`Falkland Islands`},{iso_3166_1:`FM`,english_name:`Micronesia`,native_name:`Micronesia`},{iso_3166_1:`FO`,english_name:`Faeroe Islands`,native_name:`Faroe Islands`},{iso_3166_1:`FR`,english_name:`France`,native_name:`France`},{iso_3166_1:`GA`,english_name:`Gabon`,native_name:`Gabon`},{iso_3166_1:`GB`,english_name:`United Kingdom`,native_name:`United Kingdom`},{iso_3166_1:`GD`,english_name:`Grenada`,native_name:`Grenada`},{iso_3166_1:`GE`,english_name:`Georgia`,native_name:`Georgia`},{iso_3166_1:`GF`,english_name:`French Guiana`,native_name:`French Guiana`},{iso_3166_1:`GH`,english_name:`Ghana`,native_name:`Ghana`},{iso_3166_1:`GI`,english_name:`Gibraltar`,native_name:`Gibraltar`},{iso_3166_1:`GL`,english_name:`Greenland`,native_name:`Greenland`},{iso_3166_1:`GM`,english_name:`Gambia`,native_name:`Gambia`},{iso_3166_1:`GN`,english_name:`Guinea`,native_name:`Guinea`},{iso_3166_1:`GP`,english_name:`Guadaloupe`,native_name:`Guadeloupe`},{iso_3166_1:`GQ`,english_name:`Equatorial Guinea`,native_name:`Equatorial Guinea`},{iso_3166_1:`GR`,english_name:`Greece`,native_name:`Greece`},{iso_3166_1:`GS`,english_name:`South Georgia and the South Sandwich Islands`,native_name:`South Georgia & South Sandwich Islands`},{iso_3166_1:`GT`,english_name:`Guatemala`,native_name:`Guatemala`},{iso_3166_1:`GU`,english_name:`Guam`,native_name:`Guam`},{iso_3166_1:`GW`,english_name:`Guinea-Bissau`,native_name:`Guinea-Bissau`},{iso_3166_1:`GY`,english_name:`Guyana`,native_name:`Guyana`},{iso_3166_1:`HK`,english_name:`Hong Kong`,native_name:`Hong Kong SAR China`},{iso_3166_1:`HM`,english_name:`Heard and McDonald Islands`,native_name:`Heard & McDonald Islands`},{iso_3166_1:`HN`,english_name:`Honduras`,native_name:`Honduras`},{iso_3166_1:`HR`,english_name:`Croatia`,native_name:`Croatia`},{iso_3166_1:`HT`,english_name:`Haiti`,native_name:`Haiti`},{iso_3166_1:`HU`,english_name:`Hungary`,native_name:`Hungary`},{iso_3166_1:`ID`,english_name:`Indonesia`,native_name:`Indonesia`},{iso_3166_1:`IE`,english_name:`Ireland`,native_name:`Ireland`},{iso_3166_1:`IL`,english_name:`Israel`,native_name:`Israel`},{iso_3166_1:`IN`,english_name:`India`,native_name:`India`},{iso_3166_1:`IO`,english_name:`British Indian Ocean Territory`,native_name:`British Indian Ocean Territory`},{iso_3166_1:`IQ`,english_name:`Iraq`,native_name:`Iraq`},{iso_3166_1:`IR`,english_name:`Iran`,native_name:`Iran`},{iso_3166_1:`IS`,english_name:`Iceland`,native_name:`Iceland`},{iso_3166_1:`IT`,english_name:`Italy`,native_name:`Italy`},{iso_3166_1:`JM`,english_name:`Jamaica`,native_name:`Jamaica`},{iso_3166_1:`JO`,english_name:`Jordan`,native_name:`Jordan`},{iso_3166_1:`JP`,english_name:`Japan`,native_name:`Japan`},{iso_3166_1:`KE`,english_name:`Kenya`,native_name:`Kenya`},{iso_3166_1:`KG`,english_name:`Kyrgyz Republic`,native_name:`Kyrgyzstan`},{iso_3166_1:`KH`,english_name:`Cambodia`,native_name:`Cambodia`},{iso_3166_1:`KI`,english_name:`Kiribati`,native_name:`Kiribati`},{iso_3166_1:`KM`,english_name:`Comoros`,native_name:`Comoros`},{iso_3166_1:`KN`,english_name:`St. Kitts and Nevis`,native_name:`St. Kitts & Nevis`},{iso_3166_1:`KP`,english_name:`North Korea`,native_name:`North Korea`},{iso_3166_1:`KR`,english_name:`South Korea`,native_name:`South Korea`},{iso_3166_1:`KW`,english_name:`Kuwait`,native_name:`Kuwait`},{iso_3166_1:`KY`,english_name:`Cayman Islands`,native_name:`Cayman Islands`},{iso_3166_1:`KZ`,english_name:`Kazakhstan`,native_name:`Kazakhstan`},{iso_3166_1:`LA`,english_name:`Lao People's Democratic Republic`,native_name:`Laos`},{iso_3166_1:`LB`,english_name:`Lebanon`,native_name:`Lebanon`},{iso_3166_1:`LC`,english_name:`St. Lucia`,native_name:`St. Lucia`},{iso_3166_1:`LI`,english_name:`Liechtenstein`,native_name:`Liechtenstein`},{iso_3166_1:`LK`,english_name:`Sri Lanka`,native_name:`Sri Lanka`},{iso_3166_1:`LR`,english_name:`Liberia`,native_name:`Liberia`},{iso_3166_1:`LS`,english_name:`Lesotho`,native_name:`Lesotho`},{iso_3166_1:`LT`,english_name:`Lithuania`,native_name:`Lithuania`},{iso_3166_1:`LU`,english_name:`Luxembourg`,native_name:`Luxembourg`},{iso_3166_1:`LV`,english_name:`Latvia`,native_name:`Latvia`},{iso_3166_1:`LY`,english_name:`Libyan Arab Jamahiriya`,native_name:`Libya`},{iso_3166_1:`MA`,english_name:`Morocco`,native_name:`Morocco`},{iso_3166_1:`MC`,english_name:`Monaco`,native_name:`Monaco`},{iso_3166_1:`MD`,english_name:`Moldova`,native_name:`Moldova`},{iso_3166_1:`ME`,english_name:`Montenegro`,native_name:`Montenegro`},{iso_3166_1:`MG`,english_name:`Madagascar`,native_name:`Madagascar`},{iso_3166_1:`MH`,english_name:`Marshall Islands`,native_name:`Marshall Islands`},{iso_3166_1:`MK`,english_name:`Macedonia`,native_name:`Macedonia`},{iso_3166_1:`ML`,english_name:`Mali`,native_name:`Mali`},{iso_3166_1:`MM`,english_name:`Myanmar`,native_name:`Myanmar (Burma)`},{iso_3166_1:`MN`,english_name:`Mongolia`,native_name:`Mongolia`},{iso_3166_1:`MO`,english_name:`Macao`,native_name:`Macau SAR China`},{iso_3166_1:`MP`,english_name:`Northern Mariana Islands`,native_name:`Northern Mariana Islands`},{iso_3166_1:`MQ`,english_name:`Martinique`,native_name:`Martinique`},{iso_3166_1:`MR`,english_name:`Mauritania`,native_name:`Mauritania`},{iso_3166_1:`MS`,english_name:`Montserrat`,native_name:`Montserrat`},{iso_3166_1:`MT`,english_name:`Malta`,native_name:`Malta`},{iso_3166_1:`MU`,english_name:`Mauritius`,native_name:`Mauritius`},{iso_3166_1:`MV`,english_name:`Maldives`,native_name:`Maldives`},{iso_3166_1:`MW`,english_name:`Malawi`,native_name:`Malawi`},{iso_3166_1:`MX`,english_name:`Mexico`,native_name:`Mexico`},{iso_3166_1:`MY`,english_name:`Malaysia`,native_name:`Malaysia`},{iso_3166_1:`MZ`,english_name:`Mozambique`,native_name:`Mozambique`},{iso_3166_1:`NA`,english_name:`Namibia`,native_name:`Namibia`},{iso_3166_1:`NC`,english_name:`New Caledonia`,native_name:`New Caledonia`},{iso_3166_1:`NE`,english_name:`Niger`,native_name:`Niger`},{iso_3166_1:`NF`,english_name:`Norfolk Island`,native_name:`Norfolk Island`},{iso_3166_1:`NG`,english_name:`Nigeria`,native_name:`Nigeria`},{iso_3166_1:`NI`,english_name:`Nicaragua`,native_name:`Nicaragua`},{iso_3166_1:`NL`,english_name:`Netherlands`,native_name:`Netherlands`},{iso_3166_1:`NO`,english_name:`Norway`,native_name:`Norway`},{iso_3166_1:`NP`,english_name:`Nepal`,native_name:`Nepal`},{iso_3166_1:`NR`,english_name:`Nauru`,native_name:`Nauru`},{iso_3166_1:`NU`,english_name:`Niue`,native_name:`Niue`},{iso_3166_1:`NZ`,english_name:`New Zealand`,native_name:`New Zealand`},{iso_3166_1:`OM`,english_name:`Oman`,native_name:`Oman`},{iso_3166_1:`PA`,english_name:`Panama`,native_name:`Panama`},{iso_3166_1:`PE`,english_name:`Peru`,native_name:`Peru`},{iso_3166_1:`PF`,english_name:`French Polynesia`,native_name:`French Polynesia`},{iso_3166_1:`PG`,english_name:`Papua New Guinea`,native_name:`Papua New Guinea`},{iso_3166_1:`PH`,english_name:`Philippines`,native_name:`Philippines`},{iso_3166_1:`PK`,english_name:`Pakistan`,native_name:`Pakistan`},{iso_3166_1:`PL`,english_name:`Poland`,native_name:`Poland`},{iso_3166_1:`PM`,english_name:`St. Pierre and Miquelon`,native_name:`St. Pierre & Miquelon`},{iso_3166_1:`PN`,english_name:`Pitcairn Island`,native_name:`Pitcairn Islands`},{iso_3166_1:`PR`,english_name:`Puerto Rico`,native_name:`Puerto Rico`},{iso_3166_1:`PS`,english_name:`Palestinian Territory`,native_name:`Palestinian Territories`},{iso_3166_1:`PT`,english_name:`Portugal`,native_name:`Portugal`},{iso_3166_1:`PW`,english_name:`Palau`,native_name:`Palau`},{iso_3166_1:`PY`,english_name:`Paraguay`,native_name:`Paraguay`},{iso_3166_1:`QA`,english_name:`Qatar`,native_name:`Qatar`},{iso_3166_1:`RE`,english_name:`Reunion`,native_name:`Réunion`},{iso_3166_1:`RO`,english_name:`Romania`,native_name:`Romania`},{iso_3166_1:`RS`,english_name:`Serbia`,native_name:`Serbia`},{iso_3166_1:`RU`,english_name:`Russia`,native_name:`Russia`},{iso_3166_1:`RW`,english_name:`Rwanda`,native_name:`Rwanda`},{iso_3166_1:`SA`,english_name:`Saudi Arabia`,native_name:`Saudi Arabia`},{iso_3166_1:`SB`,english_name:`Solomon Islands`,native_name:`Solomon Islands`},{iso_3166_1:`SC`,english_name:`Seychelles`,native_name:`Seychelles`},{iso_3166_1:`SD`,english_name:`Sudan`,native_name:`Sudan`},{iso_3166_1:`SE`,english_name:`Sweden`,native_name:`Sweden`},{iso_3166_1:`SG`,english_name:`Singapore`,native_name:`Singapore`},{iso_3166_1:`SH`,english_name:`St. Helena`,native_name:`St. Helena`},{iso_3166_1:`SI`,english_name:`Slovenia`,native_name:`Slovenia`},{iso_3166_1:`SJ`,english_name:`Svalbard & Jan Mayen Islands`,native_name:`Svalbard & Jan Mayen`},{iso_3166_1:`SK`,english_name:`Slovakia`,native_name:`Slovakia`},{iso_3166_1:`SL`,english_name:`Sierra Leone`,native_name:`Sierra Leone`},{iso_3166_1:`SM`,english_name:`San Marino`,native_name:`San Marino`},{iso_3166_1:`SN`,english_name:`Senegal`,native_name:`Senegal`},{iso_3166_1:`SO`,english_name:`Somalia`,native_name:`Somalia`},{iso_3166_1:`SR`,english_name:`Suriname`,native_name:`Suriname`},{iso_3166_1:`SS`,english_name:`South Sudan`,native_name:`South Sudan`},{iso_3166_1:`ST`,english_name:`Sao Tome and Principe`,native_name:`São Tomé & Príncipe`},{iso_3166_1:`SU`,english_name:`Soviet Union`,native_name:`Soviet Union`},{iso_3166_1:`SV`,english_name:`El Salvador`,native_name:`El Salvador`},{iso_3166_1:`SY`,english_name:`Syrian Arab Republic`,native_name:`Syria`},{iso_3166_1:`SZ`,english_name:`Swaziland`,native_name:`Eswatini (Swaziland)`},{iso_3166_1:`TC`,english_name:`Turks and Caicos Islands`,native_name:`Turks & Caicos Islands`},{iso_3166_1:`TD`,english_name:`Chad`,native_name:`Chad`},{iso_3166_1:`TF`,english_name:`French Southern Territories`,native_name:`French Southern Territories`},{iso_3166_1:`TG`,english_name:`Togo`,native_name:`Togo`},{iso_3166_1:`TH`,english_name:`Thailand`,native_name:`Thailand`},{iso_3166_1:`TJ`,english_name:`Tajikistan`,native_name:`Tajikistan`},{iso_3166_1:`TK`,english_name:`Tokelau`,native_name:`Tokelau`},{iso_3166_1:`TL`,english_name:`Timor-Leste`,native_name:`Timor-Leste`},{iso_3166_1:`TM`,english_name:`Turkmenistan`,native_name:`Turkmenistan`},{iso_3166_1:`TN`,english_name:`Tunisia`,native_name:`Tunisia`},{iso_3166_1:`TO`,english_name:`Tonga`,native_name:`Tonga`},{iso_3166_1:`TP`,english_name:`East Timor`,native_name:`East Timor`},{iso_3166_1:`TR`,english_name:`Turkey`,native_name:`Turkey`},{iso_3166_1:`TT`,english_name:`Trinidad and Tobago`,native_name:`Trinidad & Tobago`},{iso_3166_1:`TV`,english_name:`Tuvalu`,native_name:`Tuvalu`},{iso_3166_1:`TW`,english_name:`Taiwan`,native_name:`Taiwan`},{iso_3166_1:`TZ`,english_name:`Tanzania`,native_name:`Tanzania`},{iso_3166_1:`UA`,english_name:`Ukraine`,native_name:`Ukraine`},{iso_3166_1:`UG`,english_name:`Uganda`,native_name:`Uganda`},{iso_3166_1:`UM`,english_name:`United States Minor Outlying Islands`,native_name:`U.S. Outlying Islands`},{iso_3166_1:`US`,english_name:`United States of America`,native_name:`United States`},{iso_3166_1:`UY`,english_name:`Uruguay`,native_name:`Uruguay`},{iso_3166_1:`UZ`,english_name:`Uzbekistan`,native_name:`Uzbekistan`},{iso_3166_1:`VA`,english_name:`Holy See`,native_name:`Vatican City`},{iso_3166_1:`VC`,english_name:`St. Vincent and the Grenadines`,native_name:`St. Vincent & Grenadines`},{iso_3166_1:`VE`,english_name:`Venezuela`,native_name:`Venezuela`},{iso_3166_1:`VG`,english_name:`British Virgin Islands`,native_name:`British Virgin Islands`},{iso_3166_1:`VI`,english_name:`US Virgin Islands`,native_name:`U.S. Virgin Islands`},{iso_3166_1:`VN`,english_name:`Vietnam`,native_name:`Vietnam`},{iso_3166_1:`VU`,english_name:`Vanuatu`,native_name:`Vanuatu`},{iso_3166_1:`WF`,english_name:`Wallis and Futuna Islands`,native_name:`Wallis & Futuna`},{iso_3166_1:`WS`,english_name:`Samoa`,native_name:`Samoa`},{iso_3166_1:`XC`,english_name:`Czechoslovakia`,native_name:`Czechoslovakia`},{iso_3166_1:`XG`,english_name:`East Germany`,native_name:`East Germany`},{iso_3166_1:`XI`,english_name:`Northern Ireland`,native_name:`Northern Ireland`},{iso_3166_1:`XK`,english_name:`Kosovo`,native_name:`Kosovo`},{iso_3166_1:`YE`,english_name:`Yemen`,native_name:`Yemen`},{iso_3166_1:`YT`,english_name:`Mayotte`,native_name:`Mayotte`},{iso_3166_1:`YU`,english_name:`Yugoslavia`,native_name:`Yugoslavia`},{iso_3166_1:`ZA`,english_name:`South Africa`,native_name:`South Africa`},{iso_3166_1:`ZM`,english_name:`Zambia`,native_name:`Zambia`},{iso_3166_1:`ZR`,english_name:`Zaire`,native_name:`Zaire`},{iso_3166_1:`ZW`,english_name:`Zimbabwe`,native_name:`Zimbabwe`}];function ke(e){return e.media_type===`movie`}function Ae(e){return e.media_type===`tv`}export{Y as AccountAPI,X as AuthenticationAPI,r as BACKDROP_SIZES,E as CertificationsAPI,D as ChangesAPI,A as CollectionsAPI,O as CompaniesAPI,j as ConfigurationAPI,k as CreditsAPI,M as DiscoverAPI,Se as DiscoverTVStatus,Ce as DiscoverTVStatusLabel,we as DiscoverTVType,Te as DiscoverTVTypeLabel,N as FindAPI,P as GenresAPI,Z as GuestSessionsAPI,t as IMAGE_BASE_URL,n as IMAGE_SECURE_BASE_URL,F as KeywordsAPI,i as LOGO_SIZES,Q as ListsAPI,I as MovieListsAPI,be as MovieReleaseType,xe as MovieReleaseTypeLabel,L as MoviesAPI,V as NetworksAPI,a as POSTER_SIZES,o as PROFILE_SIZES,J as PeopleAPI,q as PeopleListsAPI,K as ReviewsAPI,s as STILL_SIZES,R as SearchAPI,ye as TMDB,Oe as TMDBCountries,e as TMDBError,c as TMDBLogger,$ as TMDBv4,Ee as TVEpisodeGroupType,De as TVEpisodeGroupTypeLabel,U as TVEpisodeGroupsAPI,H as TVEpisodesAPI,W as TVSeasonsAPI,z as TVSeriesAPI,he as TVSeriesListsAPI,G as TrendingAPI,_e as V4AccountAPI,ge as V4AuthAPI,ve as V4ListsAPI,B as WatchProvidersAPI,ae as fetchAllPages,ce as getPageInfo,ee as hasBackdropPath,re as hasLogoPath,oe as hasNextPage,_ as hasPosterPath,se as hasPreviousPage,te as hasProfilePath,ne as hasStillPath,m as isJwt,ke as isKnownForMovie,Ae as isKnownForTV,g as isPlainObject,h as isRecord,ie as paginate};
1
+ var e=class extends Error{tmdb_status_code;message;http_status_code;constructor(e,t,n){super(e),this.name=`TMDBError`,this.tmdb_status_code=n||-1,this.message=e,this.http_status_code=t}};const t=`http://image.tmdb.org/t/p/`,n=`https://image.tmdb.org/t/p/`,r=[`w300`,`w780`,`w1280`,`original`],i=[`w45`,`w92`,`w154`,`w185`,`w300`,`w500`,`original`],a=[`w92`,`w154`,`w185`,`w342`,`w500`,`w780`,`original`],o=[`w45`,`w185`,`h632`,`original`],s=[`w92`,`w185`,`w300`,`original`];var c=class e{logger;constructor(e){this.logger=e}static from(t){if(t)return t===!0?new e(e.defaultLogger):new e(t)}log(e){if(this.logger)try{this.logger(e)}catch(e){console.warn(`TMDB logger error: ${String(e)}`)}}static defaultLogger=e=>{let t=`🎬 [tmdb]`,n=new Date().toISOString();if(e.type===`request`){console.log(`${t} ${n} 🛰️ REQUEST ${e.method} ${e.endpoint} \n`);return}if(e.type===`response`){console.log(`${t} ${n} ✅ RESPONSE ${e.method} ${e.status} ${e.statusText} ${e.endpoint} (${e.durationMs}ms)\n`);return}let r=e.status==null?`NETWORK ERROR`:`${e.status} ${e.statusText}`,i=e.tmdbStatusCode==null?``:` (tmdb: ${e.tmdbStatusCode})`;console.log(`${t} ${n} ❌ ${e.method} ${r} ${e.endpoint} - ${e.errorMessage}${i}\n`)}};function l(e){return/^[A-Za-z0-9\-_]+$/.test(e)}function u(e){try{let t=e.replace(/-/g,`+`).replace(/_/g,`/`),n=t.padEnd(t.length+(4-t.length%4)%4,`=`);return atob(n)}catch{return null}}function d(e){return typeof e==`object`&&!!e}function f(e){return d(e)?typeof e.alg==`string`:!1}function p(e){return!(!d(e)||`exp`in e&&typeof e.exp!=`number`||`nbf`in e&&typeof e.nbf!=`number`||`iat`in e&&typeof e.iat!=`number`)}function m(e){if(typeof e!=`string`)return!1;let t=e.split(`.`);if(t.length!==3)return!1;let[n,r,i]=t;if(!l(n)||!l(r)||!l(i))return!1;let a=u(n),o=u(r);if(!a||!o)return!1;let s,c;try{s=JSON.parse(a),c=JSON.parse(o)}catch{return!1}return!(!f(s)||!p(c))}function h(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function g(e){if(!h(e))return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function _(e){return typeof e==`object`&&!!e&&`poster_path`in e&&typeof e.poster_path==`string`}function ee(e){return typeof e==`object`&&!!e&&`backdrop_path`in e&&typeof e.backdrop_path==`string`}function te(e){return typeof e==`object`&&!!e&&`profile_path`in e&&typeof e.profile_path==`string`}function ne(e){return typeof e==`object`&&!!e&&`still_path`in e&&typeof e.still_path==`string`}function re(e){return typeof e==`object`&&!!e&&`logo_path`in e&&typeof e.logo_path==`string`}const v={NO_ACCESS_TOKEN:`TMDB requires a valid access token, please provide one.`,INVALID_CLIENT:`TMDB received an invalid ApiClient instance. Pass a valid ApiClient or an access token string.`,V4_REQUIRES_JWT:`TMDB v4 requires a Bearer (JWT) access token. API key strings are not supported for v4 endpoints.`,INVALID_START_PAGE:`Invalid page: Pages start at 1 and max at 500. They are expected to be an integer.`};async function*ie(e,t=1){if(!Number.isInteger(t)||t<1||t>500)throw RangeError(v.INVALID_START_PAGE);let n=t;for(;;){let t=await e(n);if(yield t,t.page>=t.total_pages)break;n++}}async function ae(e,t={}){let{maxPages:n=500,deduplicateBy:r}=t,i=[],a=1;for(;;){let t=await e(a);if(i.push(...t.results),t.page>=t.total_pages||a>=n)break;a++}if(r){let e=new Map;for(let t of i){let n=r(t);e.has(n)&&e.delete(n),e.set(n,t)}return[...e.values()]}return i}function oe(e){return e.page<e.total_pages}function se(e){return e.page>1}function ce(e){return{current:e.page,total:e.total_pages,totalResults:e.total_results,isFirst:e.page===1,isLast:e.page>=e.total_pages}}const y={backdrop_path:`backdrop`,logo_path:`logo`,poster_path:`poster`,profile_path:`profile`,still_path:`still`},le={backdrop_path:`backdrops`,logo_path:`logos`,poster_path:`posters`,profile_path:`profiles`,still_path:`stills`},b={backdrops:`backdrop_path`,logos:`logo_path`,posters:`poster_path`,profiles:`profile_path`,stills:`still_path`};var x=class{options;constructor(e={}){this.options={secure_images_url:!0,...e}}buildUrl(e,r){return`${this.options.secure_images_url?n:t}${r}${e}`}backdrop(e,t=this.options.default_image_sizes?.backdrops||`w780`){return this.buildUrl(e,t)}logo(e,t=this.options.default_image_sizes?.logos||`w185`){return this.buildUrl(e,t)}poster(e,t=this.options.default_image_sizes?.posters||`w500`){return this.buildUrl(e,t)}profile(e,t=this.options.default_image_sizes?.profiles||`w185`){return this.buildUrl(e,t)}still(e,t=this.options.default_image_sizes?.still||`w300`){return this.buildUrl(e,t)}autocompleteImagePaths(e,t){return this.traverse(e,t,!0)}applyFallbacksOnly(e){return this.traverse(e,void 0,!1)}traverse(e,t,n){if(Array.isArray(e)){let r=n&&t&&this.options.image_language_priority?.[t];return(r?this.sortByLanguagePriority(e,r):e).map(e=>this.traverse(e,t,n))}if(!g(e))return e;let r=Object.create(null);for(let[i,a]of Object.entries(e)){if(i===`__proto__`||i===`constructor`||i===`prototype`){r[i]=a;continue}if(a==null){if(Object.hasOwn(y,i)){let e=le[i];r[i]=this.getFallbackForCollection(e)??a;continue}if(i===`file_path`&&t){r[i]=this.getFallbackForCollection(t)??a;continue}r[i]=a;continue}if(typeof a==`string`){r[i]=n?this.transformPathValue(i,a,t):a;continue}let e=this.isImageCollectionKey(i)?i:t;r[i]=this.traverse(a,e,n)}return r}sortByLanguagePriority(e,t){let n=[],r=[...e];for(let e of t){if(e===`*`){n.push(...r.splice(0,r.length));break}let t=[];for(let i of r){let r=i?.iso_639_1;(e===`null`?r==null:r===e)?n.push(i):t.push(i)}r.length=0,r.push(...t)}return n.push(...r),n}isImageCollectionKey(e){return Object.hasOwn(b,e)}getFallbackForCollection(e){let t=this.options.fallback_url;if(t!=null)return typeof t==`string`?t:t[e]}isFullUrl(e){return/^https?:\/\//.test(e)}buildImageUrl(e,t){let n=y[e];return Object.hasOwn(this,n)||this[n],this[n](t)}transformPathValue(e,t,n){return!t.startsWith(`/`)||this.isFullUrl(t)?t:Object.hasOwn(y,e)?this.buildImageUrl(e,t):e===`file_path`&&n?this.buildImageUrl(b[n],t):t}},ue=class{ttl;maxSize;excludedEndpoints;store=new Map;constructor(e={}){let t=e.ttl??3e5;if(!Number.isFinite(t)||!Number.isInteger(t)||t<1)throw RangeError(`cache.ttl must be a finite integer >= 1 (got ${t})`);if(e.max_size!==void 0&&(!Number.isFinite(e.max_size)||!Number.isInteger(e.max_size)||e.max_size<1))throw RangeError(`cache.max_size must be a finite integer >= 1 (got ${e.max_size})`);this.ttl=t,this.maxSize=e.max_size,this.excludedEndpoints=(e.excluded_endpoints??[]).map(e=>typeof e!=`string`&&/[gy]/.test(e.flags)?new RegExp(e.source,e.flags.replace(/[gy]/g,``)):e)}shouldCache(e){return!this.excludedEndpoints.some(t=>typeof t==`string`?e.startsWith(t):t.test(e))}get(e){let t=this.store.get(e);if(t){if(Date.now()>t.expiresAt){this.store.delete(e);return}return t.value}}has(e){let t=this.store.get(e);return t?Date.now()>t.expiresAt?(this.store.delete(e),!1):!0:!1}set(e,t){this.maxSize!==void 0&&!this.store.has(e)&&this.store.size>=this.maxSize&&this.store.delete(this.store.keys().next().value),this.store.set(e,{value:t,expiresAt:Date.now()+this.ttl})}delete(e){return this.store.delete(e)}clear(){this.store.clear()}get size(){return this.store.size}},de=class{maxRequests;windowMs;timestamps=[];queue=[];processing=!1;constructor(e={}){let t=e.max_requests??40,n=e.per_ms??1e3;if(!Number.isFinite(t)||!Number.isInteger(t)||t<1)throw RangeError(`rate_limit.max_requests must be a finite integer >= 1 (got ${t})`);if(!Number.isFinite(n)||!Number.isInteger(n)||n<1)throw RangeError(`rate_limit.per_ms must be a finite integer >= 1 (got ${n})`);this.maxRequests=t,this.windowMs=n}acquire(){return new Promise(e=>{this.queue.push(e),this.processing||this.process()})}async process(){for(this.processing=!0;this.queue.length>0;){let e=Date.now();if(this.timestamps=this.timestamps.filter(t=>e-t<this.windowMs),this.timestamps.length<this.maxRequests)this.timestamps.push(Date.now()),this.queue.shift()();else{let e=this.timestamps[0],t=this.windowMs-(Date.now()-e)+1;await new Promise(e=>setTimeout(e,t))}}this.processing=!1}};function fe(t){if(t instanceof e)return t.http_status_code>=500;if(t instanceof Error)switch(t.name){case`FetchError`:case`AbortError`:return!0;case`SyntaxError`:return!1;case`TypeError`:return!0;default:return!1}return!0}var pe=class{maxRetries;baseDelayMs;maxDelayMs;shouldRetry;constructor(e={}){let t=e.max_retries??3,n=e.base_delay_ms??500,r=e.max_delay_ms??3e4;if(!Number.isFinite(t)||!Number.isInteger(t)||t<0)throw RangeError(`retry.max_retries must be a finite integer >= 0 (got ${t})`);if(!Number.isFinite(n)||!Number.isInteger(n)||n<1)throw RangeError(`retry.base_delay_ms must be a finite integer >= 1 (got ${n})`);if(!Number.isFinite(r)||!Number.isInteger(r)||r<1)throw RangeError(`retry.max_delay_ms must be a finite integer >= 1 (got ${r})`);this.maxRetries=t,this.baseDelayMs=n,this.maxDelayMs=r,this.shouldRetry=e.shouldRetry??fe}delayFor(e){let t=Math.min(this.baseDelayMs*2**(e-1),this.maxDelayMs);return Math.floor(Math.random()*t)}async execute(e,t=me){let n;for(let r=0;r<=this.maxRetries;r++)try{return await e()}catch(e){if(n=e,r>=this.maxRetries||!await this.shouldRetry(e,r+1))break;let i=this.delayFor(r+1);i>0&&await t(i)}throw n}};function me(e){return new Promise(t=>setTimeout(t,e))}var S=class{accessToken;baseUrl;logger;inflightRequests=new Map;deduplication;rateLimiter;retryManager;requestInterceptors;onSuccessInterceptor;onErrorInterceptor;imageApi;imageOptions;responseCache;constructor(e,t={}){this.accessToken=e,this.baseUrl=`https://api.themoviedb.org/${t.version??3}`,this.logger=c.from(t.logger),this.deduplication=t.deduplication!==!1,t.rate_limit&&(this.rateLimiter=new de(t.rate_limit===!0?{}:t.rate_limit)),t.retry&&(this.retryManager=new pe(t.retry===!0?{}:t.retry)),t.cache&&(this.responseCache=new ue(t.cache===!0?{}:t.cache));let n=t.interceptors?.request;this.requestInterceptors=n==null?[]:Array.isArray(n)?n:[n],this.onSuccessInterceptor=t.interceptors?.response?.onSuccess,this.onErrorInterceptor=t.interceptors?.response?.onError,this.imageApi=t.images?.autocomplete_paths||t.images?.fallback_url!=null?new x(t.images):void 0,this.imageOptions=t.images}buildRequestKey(e,t){let n=this.serializeParams(t).sort(([e],[t])=>e.localeCompare(t)).map(([e,t])=>`${e}=${t}`);return n.length>0?`${e}?${n.join(`&`)}`:e}serializeParams(e){return Object.entries(e).flatMap(([e,t])=>t===void 0?[]:[[e,String(t)]])}async request(e,t={}){let n=await this.runRequestInterceptors({endpoint:e,params:t,method:`GET`}),r=n.endpoint,i=n.params,a=this.buildRequestKey(r,i),o=!!this.responseCache?.shouldCache(a);if(o&&this.responseCache.has(a))return this.responseCache.get(a);if(!this.deduplication){let e=await this.execute(`GET`,r,i,void 0,!0);return o&&this.responseCache.set(a,e),e}let s=this.inflightRequests.get(a);if(s)return s;let c=o?this.responseCache:void 0,l=this.execute(`GET`,r,i,void 0,!0).then(e=>(c?.set(a,e),e)).finally(()=>{this.inflightRequests.delete(a)});return this.inflightRequests.set(a,l),l}invalidateCache(e,t={}){return this.responseCache?this.responseCache.delete(this.buildRequestKey(e,t)):!1}clearCache(){this.responseCache?.clear()}get cacheSize(){return this.responseCache?.size??0}async runRequestInterceptors(e){let t=e;for(let e of this.requestInterceptors){let n=await e(t);n!=null&&(t=n)}return t}sanitizeNulls(e){if(e===null)return;if(typeof e!=`object`)return e;if(Array.isArray(e))return e.map(e=>this.sanitizeNulls(e));let t={};for(let[n,r]of Object.entries(e))t[n]=this.sanitizeNulls(r);return t}async normalizeError(t,n,r){let i=t.statusText,a=-1;try{let e=await t.json();if(e&&typeof e==`object`){let t=e;i=t.status_message||i,a=t.status_code||-1}}catch(e){console.error(`Unknown error: ${String(e)}`)}return this.logger?.log({type:`error`,method:r,endpoint:n,status:t.status,statusText:t.statusText,tmdbStatusCode:a,errorMessage:i}),new e(i,t.status,a)}async notifyErrorInterceptor(e){this.onErrorInterceptor&&await this.onErrorInterceptor(e)}async mutate(e,t,n,r={}){return this.execute(e,t,r,n)}async execute(t,n,r,i,a=!1){let o=i===void 0?void 0:JSON.stringify(i),s,c;if(a)s=n,c=r;else{let e=await this.runRequestInterceptors({endpoint:n,params:r,method:t});s=e.endpoint,c=e.params}let l=new URL(`${this.baseUrl}${s}`),u=m(this.accessToken);for(let[e,t]of this.serializeParams(c))l.searchParams.append(e,t);u||l.searchParams.append(`api_key`,this.accessToken);let d=Date.now();this.logger?.log({type:`request`,method:t,endpoint:s});let f=async()=>{this.rateLimiter&&await this.rateLimiter.acquire();let e;try{e=await fetch(l.toString(),{method:t,headers:u?{Authorization:`Bearer ${this.accessToken}`,"Content-Type":`application/json;charset=utf-8`}:{"Content-Type":`application/json;charset=utf-8`},...o===void 0?{}:{body:o}})}catch(e){throw this.logger?.log({type:`error`,method:t,endpoint:s,errorMessage:e instanceof Error?e.message:String(e),durationMs:Date.now()-d}),e}if(!e.ok)throw await this.normalizeError(e,s,t);return e},p;try{p=this.retryManager?await this.retryManager.execute(f):await f()}catch(t){throw t instanceof e&&await this.notifyErrorInterceptor(t),t}this.logger?.log({type:`response`,method:t,endpoint:s,status:p.status,statusText:p.statusText,durationMs:Date.now()-d});let h=await p.json(),g=this.sanitizeNulls(h),_=this.imageApi?this.imageOptions?.autocomplete_paths?this.imageApi.autocompleteImagePaths(g):this.imageApi.applyFallbacksOnly(g):g;if(this.onSuccessInterceptor){let e=await this.onSuccessInterceptor(_);return e===void 0?_:e}return _}};const C={AUTHENTICATION:{VALIDATE:`/authentication`,GUEST_SESSION:`/authentication/guest_session/new`,REQUEST_TOKEN:`/authentication/token/new`,CREATE_SESSION:`/authentication/session/new`,CREATE_SESSION_WITH_LOGIN:`/authentication/token/validate_with_login`,DELETE_SESSION:`/authentication/session`},ACCOUNT:{DETAILS:`/account`,ADD_FAVORITE:`/favorite`,ADD_TO_WATCHLIST:`/watchlist`,FAVORITE_MOVIES:`/favorite/movies`,FAVORITE_TV:`/favorite/tv`,WATCHLIST_MOVIES:`/watchlist/movies`,WATCHLIST_TV:`/watchlist/tv`,RATED_MOVIES:`/rated/movies`,RATED_TV:`/rated/tv`,RATED_TV_EPISODES:`/rated/tv/episodes`,LISTS:`/lists`},CONFIGURATION:{DETAILS:`/configuration`,COUNTRIES:`/configuration/countries`,JOBS:`/configuration/jobs`,LANGUAGES:`/configuration/languages`,TIMEZONES:`/configuration/timezones`,PRIMARY_TRANSLATIONS:`/configuration/primary_translations`},CERTIFICATIONS:{MOVIE_CERTIFICATIONS:`/certification/movie/list`,TV_CERTIFICATIONS:`/certification/tv/list`},CHANGES:{MOVIE_LIST:`/movie/changes`,PEOPLE_LIST:`/person/changes`,TV_LIST:`/tv/changes`},DISCOVER:{MOVIE:`/discover/movie`,TV:`/discover/tv`},FIND:`/find`,CREDITS:{DETAILS:`/credit`},COMPANIES:{DETAILS:`/company`,ALTERNATIVE_NAMES:`/alternative_names`,IMAGES:`/images`},COLLECTIONS:{DETAILS:`/collection`,IMAGES:`/images`,TRANSLATIONS:`/translations`},GENRES:{MOVIE_LIST:`/genre/movie/list`,TV_LIST:`/genre/tv/list`},KEYWORDS:{DETAILS:`/keyword`,MOVIES:`/movies`},MOVIES:{DETAILS:`/movie`,ALTERNATIVE_TITLES:`/alternative_titles`,CREDITS:`/credits`,EXTERNAL_IDS:`/external_ids`,KEYWORDS:`/keywords`,CHANGES:`/changes`,IMAGES:`/images`,LATEST:`/latest`,NOW_PLAYING:`/now_playing`,POPULAR:`/popular`,RECOMMENDATIONS:`/recommendations`,RELEASE_DATES:`/release_dates`,REVIEWS:`/reviews`,SIMILAR:`/similar`,TOP_RATED:`/top_rated`,TRANSLATIONS:`/translations`,UPCOMING:`/upcoming`,VIDEOS:`/videos`,WATCH_PROVIDERS:`/watch/providers`},NETWORKS:{DETAILS:`/network`,ALTERNATIVE_NAMES:`/alternative_names`,IMAGES:`/images`},PEOPLE:{DETAILS:`/person`,CHANGES:`/changes`,COMBINED_CREDITS:`/combined_credits`,EXTERNAL_IDS:`/external_ids`,IMAGES:`/images`,LATEST:`/latest`,MOVIE_CREDITS:`/movie_credits`,TAGGED_IMAGES:`/tagged_images`,TRANSLATIONS:`/translations`,TV_CREDITS:`/tv_credits`},SEARCH:{MOVIE:`/search/movie`,COLLECTION:`/search/collection`,COMPANY:`/search/company`,KEYWORD:`/search/keyword`,MULTI:`/search/multi`,PERSON:`/search/person`,TV:`/search/tv`},TV_SERIES:{DETAILS:`/tv`,AGGREGATE_CREDITS:`/aggregate_credits`,AIRING_TODAY:`/airing_today`,ALTERNATIVE_TITLES:`/alternative_titles`,CHANGES:`/changes`,CONTENT_RATINGS:`/content_ratings`,CREDITS:`/credits`,EPISODE_GROUPS:`/episode_groups`,EXTERNAL_IDS:`/external_ids`,IMAGES:`/images`,KEYWORDS:`/keywords`,LATEST:`/latest`,LISTS:`/lists`,ON_THE_AIR:`/on_the_air`,POPULAR:`/popular`,RECOMMENDATIONS:`/recommendations`,REVIEWS:`/reviews`,SCREENED_THEATRICALLY:`/screened_theatrically`,SIMILAR:`/similar`,TOP_RATED:`/top_rated`,TRANSLATIONS:`/translations`,VIDEOS:`/videos`,WATCH_PROVIDERS:`/watch/providers`},TV_SEASONS:{DETAILS:`/season`,AGGREGATE_CREDITS:`/aggregate_credits`,CHANGES:`/changes`,CREDITS:`/credits`,EXTERNAL_IDS:`/external_ids`,IMAGES:`/images`,TRANSLATIONS:`/translations`,VIDEOS:`/videos`,WATCH_PROVIDERS:`/watch/providers`},TV_EPISODES:{DETAILS:`/episode`,CHANGES:`/changes`,CREDITS:`/credits`,EXTERNAL_IDS:`/external_ids`,IMAGES:`/images`,TRANSLATIONS:`/translations`,VIDEOS:`/videos`},TV_EPISODE_GROUPS:{DETAILS:`/tv/episode_group`},WATCH_PROVIDERS:{MOVIE:`/watch/providers/movie`,TV:`/watch/providers/tv`,REGIONS:`/watch/providers/regions`},TRENDING:{ALL:`/trending/all`,MOVIE:`/trending/movie`,TV:`/trending/tv`,PERSON:`/trending/person`},REVIEWS:{DETAILS:`/review`},PEOPLE_LISTS:{POPULAR:`/person/popular`},LISTS:{DETAILS:`/list`,ADD_ITEM:`/add_item`,ITEM_STATUS:`/item_status`,CLEAR:`/clear`,REMOVE_ITEM:`/remove_item`},GUEST_SESSIONS:{DETAILS:`/guest_session`,RATED_MOVIES:`/rated/movies`,RATED_TV:`/rated/tv`,RATED_TV_EPISODES:`/rated/tv/episodes`}},w={AUTH:{REQUEST_TOKEN:`/auth/request_token`,ACCESS_TOKEN:`/auth/access_token`},ACCOUNT:{DETAILS:`/account`,LISTS:`/lists`,FAVORITE_MOVIES:`/favorite/movies`,FAVORITE_TV:`/favorite/tv`,WATCHLIST_MOVIES:`/watchlist/movies`,WATCHLIST_TV:`/watchlist/tv`,RATED_MOVIES:`/rated/movies`,RATED_TV:`/rated/tv`},LISTS:{DETAILS:`/list`,ITEMS:`/items`,ITEM_STATUS:`/item_status`,CLEAR:`/clear`}};var T=class{client;defaultOptions;constructor(e,t={}){if(typeof e==`string`){if(!e)throw Error(v.NO_ACCESS_TOKEN);this.client=new S(e,{logger:t.logger,deduplication:t.deduplication,rate_limit:t.rate_limit,interceptors:t.interceptors})}else if(e instanceof S)this.client=e;else throw Error(e==null?v.NO_ACCESS_TOKEN:v.INVALID_CLIENT);this.defaultOptions=t}applyDefaults(e){let{language:t,region:n}=this.defaultOptions;return{...t!==void 0&&{language:t},...n!==void 0&&{region:n},...e}}withLanguage(e){let t=this.defaultOptions?.language;return e?e.language!==void 0||t===void 0?e:{...e,language:t}:t===void 0?void 0:{language:t}}injectImageLanguage(e){if(!this.defaultOptions.images?.auto_include_image_language||e.include_image_language!==void 0)return e;let t=this.defaultOptions.images?.image_language_priority;if(!t)return e;let n=[...new Set(Object.values(t).flat().filter(e=>e!==`*`))];return n.length?{...e,include_image_language:n}:e}},E=class extends T{async movie_certifications(){return this.client.request(C.CERTIFICATIONS.MOVIE_CERTIFICATIONS)}async tv_certifications(){return this.client.request(C.CERTIFICATIONS.TV_CERTIFICATIONS)}},D=class extends T{async movie_list(e){return this.client.request(C.CHANGES.MOVIE_LIST,e)}async people_list(e){return this.client.request(C.CHANGES.PEOPLE_LIST,e)}async tv_list(e){return this.client.request(C.CHANGES.TV_LIST,e)}},O=class extends T{companyPath(e){return`${C.COMPANIES.DETAILS}/${e}`}async details(e){let t=this.companyPath(e.company_id);return this.client.request(t)}async alternative_names(e){let t=`${this.companyPath(e.company_id)}${C.COMPANIES.ALTERNATIVE_NAMES}`;return this.client.request(t)}async images(e){let{company_id:t,...n}=e,r=`${this.companyPath(t)}${C.COMPANIES.IMAGES}`;return this.client.request(r,this.injectImageLanguage(this.withLanguage(n)??n))}},k=class extends T{creditPath(e){return`${C.CREDITS.DETAILS}/${e}`}async details(e){let{credit_id:t,...n}=e,r=this.creditPath(t);return this.client.request(r,this.withLanguage(n))}},A=class extends T{collectionPath(e){return`${C.COLLECTIONS.DETAILS}/${e}`}async details(e){let{language:t=this.defaultOptions.language,collection_id:n}=e,r=this.collectionPath(n);return this.client.request(r,{language:t})}async images(e){let{collection_id:t,...n}=e,r=`${this.collectionPath(t)}${C.COLLECTIONS.IMAGES}`;return this.client.request(r,this.injectImageLanguage(this.withLanguage(n)??n))}async translations(e){let t=`${this.collectionPath(e.collection_id)}${C.COLLECTIONS.TRANSLATIONS}`;return this.client.request(t)}},j=class extends T{async details(){return this.client.request(C.CONFIGURATION.DETAILS)}async countries(e){return this.client.request(C.CONFIGURATION.COUNTRIES,this.withLanguage(e))}async jobs(){return this.client.request(C.CONFIGURATION.JOBS)}async languages(){return this.client.request(C.CONFIGURATION.LANGUAGES)}async primary_translations(){return this.client.request(C.CONFIGURATION.PRIMARY_TRANSLATIONS)}async timezones(){return this.client.request(C.CONFIGURATION.TIMEZONES)}},M=class extends T{withMovieDefaults(e){if(!e&&!this.defaultOptions.language&&!this.defaultOptions.region)return;let t=e?.language??this.defaultOptions.language,n=e?.region??this.defaultOptions.region;return{...e,language:t,region:n}}withTVDefaults(e){if(!e&&!this.defaultOptions.language&&!this.defaultOptions.timezone)return;let t=e?.language??this.defaultOptions.language,n=e?.timezone??this.defaultOptions.timezone;return{...e,language:t,timezone:n}}async movie(e={}){return this.client.request(C.DISCOVER.MOVIE,this.withMovieDefaults(e))}async tv(e={}){return this.client.request(C.DISCOVER.TV,this.withTVDefaults(e))}},N=class extends T{async by_id(e){let{external_id:t,...n}=e,r=`${C.FIND}/${encodeURIComponent(t)}`,i=this.withLanguage(n);return this.client.request(r,i)}},P=class extends T{async movie_list(e){return this.client.request(C.GENRES.MOVIE_LIST,this.withLanguage(e))}async tv_list(e){return this.client.request(C.GENRES.TV_LIST,this.withLanguage(e))}},F=class extends T{keywordPath(e){return`${C.KEYWORDS.DETAILS}/${e}`}async details(e){let t=this.keywordPath(e.keyword_id);return this.client.request(t)}async movies(e){let{keyword_id:t,...n}=e,r=`${this.keywordPath(t)}${C.KEYWORDS.MOVIES}`,i=this.withLanguage(n);return this.client.request(r,i)}},I=class extends T{withDefaults(e){let{language:t=this.defaultOptions.language,region:n=this.defaultOptions.region,...r}=e;return{language:t,region:n,...r}}fetch_movie_list(e,t={}){return this.client.request(C.MOVIES.DETAILS+e,this.withDefaults(t))}async now_playing(e={}){return this.client.request(C.MOVIES.DETAILS+C.MOVIES.NOW_PLAYING,this.withDefaults(e))}async popular(e={}){return this.fetch_movie_list(C.MOVIES.POPULAR,e)}async top_rated(e={}){return this.fetch_movie_list(C.MOVIES.TOP_RATED,e)}async upcoming(e={}){return this.client.request(C.MOVIES.DETAILS+C.MOVIES.UPCOMING,this.withDefaults(e))}},L=class extends T{moviePath(e){return`${C.MOVIES.DETAILS}/${e}`}movieSubPath(e,t){return`${this.moviePath(e)}${t}`}async details(e){let{language:t=this.defaultOptions.language,movie_id:n,append_to_response:r}=e,i=this.moviePath(n);return this.client.request(i,{language:t,append_to_response:r})}async alternative_titles(e){let{movie_id:t,...n}=e,r=this.movieSubPath(t,C.MOVIES.ALTERNATIVE_TITLES);return this.client.request(r,n)}async credits(e){let{movie_id:t,language:n=this.defaultOptions.language,...r}=e,i=this.movieSubPath(t,C.MOVIES.CREDITS);return this.client.request(i,{language:n,...r})}async external_ids(e){let t=this.movieSubPath(e.movie_id,C.MOVIES.EXTERNAL_IDS);return this.client.request(t)}async keywords(e){let t=this.movieSubPath(e.movie_id,C.MOVIES.KEYWORDS);return this.client.request(t)}async changes(e){let{movie_id:t,...n}=e,r=this.movieSubPath(t,C.MOVIES.CHANGES);return this.client.request(r,n)}async images(e){let{movie_id:t,language:n=this.defaultOptions.language,...r}=e,i=this.movieSubPath(t,C.MOVIES.IMAGES);return this.client.request(i,this.injectImageLanguage({language:n,...r}))}async latest(){let e=`${C.MOVIES.DETAILS}${C.MOVIES.LATEST}`;return this.client.request(e)}async recommendations(e){let{movie_id:t,language:n=this.defaultOptions.language,...r}=e,i=this.movieSubPath(t,C.MOVIES.RECOMMENDATIONS);return this.client.request(i,{language:n,...r})}async release_dates(e){let t=this.movieSubPath(e.movie_id,C.MOVIES.RELEASE_DATES);return this.client.request(t)}async reviews(e){let{movie_id:t,language:n=this.defaultOptions.language,...r}=e,i=this.movieSubPath(t,C.MOVIES.REVIEWS);return this.client.request(i,{language:n,...r})}async similar(e){let{movie_id:t,language:n=this.defaultOptions.language,...r}=e,i=this.movieSubPath(t,C.MOVIES.SIMILAR);return this.client.request(i,{language:n,...r})}async translations(e){let t=this.movieSubPath(e.movie_id,C.MOVIES.TRANSLATIONS);return this.client.request(t)}async videos(e){let{movie_id:t,language:n=this.defaultOptions.language,...r}=e,i=this.movieSubPath(t,C.MOVIES.VIDEOS);return this.client.request(i,{language:n,...r})}async watch_providers(e){let t=this.movieSubPath(e.movie_id,C.MOVIES.WATCH_PROVIDERS);return this.client.request(t)}},R=class extends T{async collections(e){return this.client.request(C.SEARCH.COLLECTION,this.applyDefaults(e))}async movies(e){return this.client.request(C.SEARCH.MOVIE,this.applyDefaults(e))}async company(e){return this.client.request(C.SEARCH.COMPANY,this.applyDefaults(e))}async keyword(e){return this.client.request(C.SEARCH.KEYWORD,this.applyDefaults(e))}async person(e){return this.client.request(C.SEARCH.PERSON,this.applyDefaults(e))}async tv_series(e){return this.client.request(C.SEARCH.TV,this.applyDefaults(e))}async multi(e){return this.client.request(C.SEARCH.MULTI,this.applyDefaults(e))}},z=class extends T{seriesPath(e){return`${C.TV_SERIES.DETAILS}/${e}`}seriesSubPath(e,t){return`${this.seriesPath(e)}${t}`}async details(e){let{language:t=this.defaultOptions.language,series_id:n,...r}=e,i=this.seriesPath(n);return this.client.request(i,{language:t,...r})}async aggregate_credits(e){let{language:t=this.defaultOptions.language,series_id:n,...r}=e,i=this.seriesSubPath(n,C.TV_SERIES.AGGREGATE_CREDITS);return this.client.request(i,{language:t,...r})}async alternative_titles(e){let t=this.seriesSubPath(e.series_id,C.TV_SERIES.ALTERNATIVE_TITLES);return this.client.request(t)}async changes(e){let{series_id:t,...n}=e,r=this.seriesSubPath(t,C.TV_SERIES.CHANGES);return this.client.request(r,{...n})}async content_ratings(e){let t=this.seriesSubPath(e.series_id,C.TV_SERIES.CONTENT_RATINGS);return this.client.request(t)}async credits(e){let{language:t=this.defaultOptions.language,series_id:n,...r}=e,i=this.seriesSubPath(n,C.TV_SERIES.CREDITS);return this.client.request(i,{language:t,...r})}async episode_groups(e){let t=this.seriesSubPath(e.series_id,C.TV_SERIES.EPISODE_GROUPS);return this.client.request(t)}async external_ids(e){let t=this.seriesSubPath(e.series_id,C.TV_SERIES.EXTERNAL_IDS);return this.client.request(t)}async images(e){let{language:t=this.defaultOptions.language,series_id:n,...r}=e,i=this.seriesSubPath(n,C.TV_SERIES.IMAGES);return this.client.request(i,this.injectImageLanguage({language:t,...r}))}async keywords(e){let t=this.seriesSubPath(e.series_id,C.TV_SERIES.KEYWORDS);return this.client.request(t)}async latest(){let e=`${C.TV_SERIES.DETAILS}${C.TV_SERIES.LATEST}`;return this.client.request(e)}async lists(e){let{language:t=this.defaultOptions.language,series_id:n,...r}=e,i=this.seriesSubPath(n,C.TV_SERIES.LISTS);return this.client.request(i,{language:t,...r})}async recommendations(e){let{language:t=this.defaultOptions.language,series_id:n,...r}=e,i=this.seriesSubPath(n,C.TV_SERIES.RECOMMENDATIONS);return this.client.request(i,{language:t,...r})}async reviews(e){let{language:t=this.defaultOptions.language,series_id:n,...r}=e,i=this.seriesSubPath(n,C.TV_SERIES.REVIEWS);return this.client.request(i,{language:t,...r})}async screened_theatrically(e){let t=this.seriesSubPath(e.series_id,C.TV_SERIES.SCREENED_THEATRICALLY);return this.client.request(t)}async similar(e){let{language:t=this.defaultOptions.language,series_id:n,...r}=e,i=this.seriesSubPath(n,C.TV_SERIES.SIMILAR);return this.client.request(i,{language:t,...r})}async translations(e){let t=this.seriesSubPath(e.series_id,C.TV_SERIES.TRANSLATIONS);return this.client.request(t)}async videos(e){let t=this.seriesSubPath(e.series_id,C.TV_SERIES.VIDEOS);return this.client.request(t)}async watch_providers(e){let t=this.seriesSubPath(e.series_id,C.TV_SERIES.WATCH_PROVIDERS);return this.client.request(t)}},B=class extends T{withDefaults(e){let{language:t=this.defaultOptions.language,timezone:n=this.defaultOptions.timezone,...r}=e;return{language:t,timezone:n,...r}}fetch_tv_series_list(e,t={}){return this.client.request(C.TV_SERIES.DETAILS+e,this.withDefaults(t))}async airing_today(e={}){return this.fetch_tv_series_list(C.TV_SERIES.AIRING_TODAY,e)}async on_the_air(e={}){return this.fetch_tv_series_list(C.TV_SERIES.ON_THE_AIR,e)}async popular(e={}){return this.fetch_tv_series_list(C.TV_SERIES.POPULAR,e)}async top_rated(e={}){return this.fetch_tv_series_list(C.TV_SERIES.TOP_RATED,e)}},V=class extends T{async movie_providers(e){let t=e?.language??this.defaultOptions.language,n=t===void 0?e:{...e,language:t};return this.client.request(C.WATCH_PROVIDERS.MOVIE,n)}async tv_providers(e){let t=e?.language??this.defaultOptions.language,n=t===void 0?e:{...e,language:t};return this.client.request(C.WATCH_PROVIDERS.TV,n)}async available_regions(e){let t=e?.language??this.defaultOptions.language,n=t===void 0?e:{...e,language:t};return this.client.request(C.WATCH_PROVIDERS.REGIONS,n)}},H=class extends T{networkPath(e){return`${C.NETWORKS.DETAILS}/${e}`}async details(e){let t=this.networkPath(e.network_id);return this.client.request(t)}async alternative_names(e){let t=`${this.networkPath(e.network_id)}${C.NETWORKS.ALTERNATIVE_NAMES}`;return this.client.request(t)}async images(e){let t=`${this.networkPath(e.network_id)}${C.NETWORKS.IMAGES}`;return this.client.request(t)}},U=class extends T{episodePath(e){return`${C.TV_SERIES.DETAILS}/${e.series_id}${C.TV_SEASONS.DETAILS}/${e.season_number}${C.TV_EPISODES.DETAILS}/${e.episode_number}`}episodeSubPath(e,t){return`${this.episodePath(e)}${t}`}async details(e){let{language:t=this.defaultOptions.language,append_to_response:n,...r}=e,i=this.episodePath(r);return this.client.request(i,{language:t,append_to_response:n})}async changes(e){let{episode_id:t,...n}=e,r=`${C.TV_SERIES.DETAILS}${C.TV_EPISODES.DETAILS}/${t}${C.TV_EPISODES.CHANGES}`;return this.client.request(r,{...n})}async credits(e){let{language:t=this.defaultOptions.language,...n}=e,r=this.episodeSubPath(n,C.TV_EPISODES.CREDITS);return this.client.request(r,{language:t})}async external_ids(e){let t=this.episodeSubPath(e,C.TV_EPISODES.EXTERNAL_IDS);return this.client.request(t)}async images(e){let{language:t=this.defaultOptions.language,include_image_language:n,...r}=e,i=this.episodeSubPath(r,C.TV_EPISODES.IMAGES);return this.client.request(i,this.injectImageLanguage({language:t,include_image_language:n}))}async translations(e){let t=this.episodeSubPath(e,C.TV_EPISODES.TRANSLATIONS);return this.client.request(t)}async videos(e){let t=this.episodeSubPath(e,C.TV_EPISODES.VIDEOS);return this.client.request(t)}},W=class extends T{async details(e){let t=`${C.TV_EPISODE_GROUPS.DETAILS}/${e.episode_group_id}`;return this.client.request(t)}},G=class extends T{seasonPath(e){return`${C.TV_SERIES.DETAILS}/${e.series_id}${C.TV_SEASONS.DETAILS}/${e.season_number}`}seasonSubPath(e,t){return`${this.seasonPath(e)}${t}`}async details(e){let{language:t=this.defaultOptions.language,append_to_response:n,...r}=e,i=this.seasonPath(r);return this.client.request(i,{language:t,append_to_response:n})}async aggregate_credits(e){let{language:t=this.defaultOptions.language,...n}=e,r=this.seasonSubPath(n,C.TV_SEASONS.AGGREGATE_CREDITS);return this.client.request(r,{language:t})}async changes(e){let{season_id:t,...n}=e,r=`${C.TV_SERIES.DETAILS}${C.TV_SEASONS.DETAILS}/${t}${C.TV_SEASONS.CHANGES}`;return this.client.request(r,{...n})}async credits(e){let{language:t=this.defaultOptions.language,...n}=e,r=this.seasonSubPath(n,C.TV_SEASONS.CREDITS);return this.client.request(r,{language:t})}async external_ids(e){let t=this.seasonSubPath(e,C.TV_SEASONS.EXTERNAL_IDS);return this.client.request(t)}async images(e){let{language:t=this.defaultOptions.language,include_image_language:n,...r}=e,i=this.seasonSubPath(r,C.TV_SEASONS.IMAGES);return this.client.request(i,this.injectImageLanguage({language:t,include_image_language:n}))}async translations(e){let t=this.seasonSubPath(e,C.TV_SEASONS.TRANSLATIONS);return this.client.request(t)}async videos(e){let{language:t=this.defaultOptions.language,include_video_language:n,...r}=e,i=this.seasonSubPath(r,C.TV_SEASONS.VIDEOS);return this.client.request(i,{language:t,include_video_language:n})}async watch_providers(e){let{language:t=this.defaultOptions.language,...n}=e,r=this.seasonSubPath(n,C.TV_SEASONS.WATCH_PROVIDERS);return this.client.request(r,{language:t})}},K=class extends T{async all(e){let{time_window:t,language:n=this.defaultOptions.language,...r}=e;return this.client.request(`${C.TRENDING.ALL}/${t}`,{language:n,...r})}async movies(e){let{time_window:t,language:n=this.defaultOptions.language,...r}=e;return this.client.request(`${C.TRENDING.MOVIE}/${t}`,{language:n,...r})}async tv(e){let{time_window:t,language:n=this.defaultOptions.language,...r}=e;return this.client.request(`${C.TRENDING.TV}/${t}`,{language:n,...r})}async people(e){let{time_window:t,language:n=this.defaultOptions.language,...r}=e;return this.client.request(`${C.TRENDING.PERSON}/${t}`,{language:n,...r})}},q=class extends T{async details(e){return this.client.request(`${C.REVIEWS.DETAILS}/${e.review_id}`)}},J=class extends T{async popular(e={}){return this.client.request(C.PEOPLE_LISTS.POPULAR,this.withLanguage(e))}},Y=class extends T{personPath(e){return`${C.PEOPLE.DETAILS}/${e}`}personSubPath(e,t){return`${this.personPath(e)}${t}`}async details(e){let{language:t=this.defaultOptions.language,person_id:n,...r}=e;return this.client.request(this.personPath(n),{language:t,...r})}async changes(e){let{person_id:t,...n}=e;return this.client.request(this.personSubPath(t,C.PEOPLE.CHANGES),n)}async combined_credits(e){let{language:t=this.defaultOptions.language,person_id:n,...r}=e;return this.client.request(this.personSubPath(n,C.PEOPLE.COMBINED_CREDITS),{language:t,...r})}async external_ids(e){return this.client.request(this.personSubPath(e.person_id,C.PEOPLE.EXTERNAL_IDS))}async images(e){return this.client.request(this.personSubPath(e.person_id,C.PEOPLE.IMAGES))}async latest(){return this.client.request(`${C.PEOPLE.DETAILS}${C.PEOPLE.LATEST}`)}async movie_credits(e){let{language:t=this.defaultOptions.language,person_id:n,...r}=e;return this.client.request(this.personSubPath(n,C.PEOPLE.MOVIE_CREDITS),{language:t,...r})}async tagged_images(e){let{person_id:t,...n}=e;return this.client.request(this.personSubPath(t,C.PEOPLE.TAGGED_IMAGES),n)}async translations(e){return this.client.request(this.personSubPath(e.person_id,C.PEOPLE.TRANSLATIONS))}async tv_credits(e){let{language:t=this.defaultOptions.language,person_id:n,...r}=e;return this.client.request(this.personSubPath(n,C.PEOPLE.TV_CREDITS),{language:t,...r})}},X=class extends T{accountPath(e){return`${C.ACCOUNT.DETAILS}/${e}`}accountSubPath(e,t){return`${this.accountPath(e)}${t}`}async details(e){let{account_id:t,...n}=e;return this.client.request(this.accountPath(t),n)}async add_favorite(e,t){let{account_id:n,...r}=e;return this.client.mutate(`POST`,this.accountSubPath(n,C.ACCOUNT.ADD_FAVORITE),t,r)}async add_to_watchlist(e,t){let{account_id:n,...r}=e;return this.client.mutate(`POST`,this.accountSubPath(n,C.ACCOUNT.ADD_TO_WATCHLIST),t,r)}async favorite_movies(e){let{account_id:t,language:n=this.defaultOptions.language,...r}=e;return this.client.request(this.accountSubPath(t,C.ACCOUNT.FAVORITE_MOVIES),{language:n,...r})}async favorite_tv(e){let{account_id:t,language:n=this.defaultOptions.language,...r}=e;return this.client.request(this.accountSubPath(t,C.ACCOUNT.FAVORITE_TV),{language:n,...r})}async watchlist_movies(e){let{account_id:t,language:n=this.defaultOptions.language,...r}=e;return this.client.request(this.accountSubPath(t,C.ACCOUNT.WATCHLIST_MOVIES),{language:n,...r})}async watchlist_tv(e){let{account_id:t,language:n=this.defaultOptions.language,...r}=e;return this.client.request(this.accountSubPath(t,C.ACCOUNT.WATCHLIST_TV),{language:n,...r})}async rated_movies(e){let{account_id:t,language:n=this.defaultOptions.language,...r}=e;return this.client.request(this.accountSubPath(t,C.ACCOUNT.RATED_MOVIES),{language:n,...r})}async rated_tv(e){let{account_id:t,language:n=this.defaultOptions.language,...r}=e;return this.client.request(this.accountSubPath(t,C.ACCOUNT.RATED_TV),{language:n,...r})}async rated_tv_episodes(e){let{account_id:t,language:n=this.defaultOptions.language,...r}=e;return this.client.request(this.accountSubPath(t,C.ACCOUNT.RATED_TV_EPISODES),{language:n,...r})}async lists(e){let{account_id:t,...n}=e;return this.client.request(this.accountSubPath(t,C.ACCOUNT.LISTS),n)}},Z=class extends T{async validate_key(){return this.client.request(C.AUTHENTICATION.VALIDATE)}async create_guest_session(){return this.client.request(C.AUTHENTICATION.GUEST_SESSION)}async create_request_token(){return this.client.request(C.AUTHENTICATION.REQUEST_TOKEN)}async create_session(e){return this.client.mutate(`POST`,C.AUTHENTICATION.CREATE_SESSION,e)}async create_session_with_login(e){return this.client.mutate(`POST`,C.AUTHENTICATION.CREATE_SESSION_WITH_LOGIN,e)}async delete_session(e){return this.client.mutate(`DELETE`,C.AUTHENTICATION.DELETE_SESSION,e)}},Q=class extends T{guestSessionPath(e){return`${C.GUEST_SESSIONS.DETAILS}/${e}`}guestSessionSubPath(e,t){return`${this.guestSessionPath(e)}${t}`}async rated_movies(e){let{guest_session_id:t,language:n=this.defaultOptions.language,...r}=e;return this.client.request(this.guestSessionSubPath(t,C.GUEST_SESSIONS.RATED_MOVIES),{language:n,...r})}async rated_tv(e){let{guest_session_id:t,language:n=this.defaultOptions.language,...r}=e;return this.client.request(this.guestSessionSubPath(t,C.GUEST_SESSIONS.RATED_TV),{language:n,...r})}async rated_tv_episodes(e){let{guest_session_id:t,language:n=this.defaultOptions.language,...r}=e;return this.client.request(this.guestSessionSubPath(t,C.GUEST_SESSIONS.RATED_TV_EPISODES),{language:n,...r})}},he=class extends T{listPath(e){return`${C.LISTS.DETAILS}/${e}`}listSubPath(e,t){return`${this.listPath(e)}${t}`}async details(e){let{list_id:t,language:n=this.defaultOptions.language,...r}=e;return this.client.request(this.listPath(t),{language:n,...r})}async create(e,t){return this.client.mutate(`POST`,C.LISTS.DETAILS,t,e)}async delete(e){let{list_id:t,...n}=e;return this.client.mutate(`DELETE`,this.listPath(t),void 0,n)}async add_movie(e,t){let{list_id:n,...r}=e;return this.client.mutate(`POST`,this.listSubPath(n,C.LISTS.ADD_ITEM),t,r)}async remove_movie(e,t){let{list_id:n,...r}=e;return this.client.mutate(`POST`,this.listSubPath(n,C.LISTS.REMOVE_ITEM),t,r)}async check_item_status(e){let{list_id:t,language:n=this.defaultOptions.language,...r}=e;return this.client.request(this.listSubPath(t,C.LISTS.ITEM_STATUS),{language:n,...r})}async clear(e){let{list_id:t,...n}=e;return this.client.mutate(`POST`,this.listSubPath(t,C.LISTS.CLEAR),void 0,n)}},ge=class extends T{async create_request_token(e){return this.client.mutate(`POST`,w.AUTH.REQUEST_TOKEN,e??{})}async create_access_token(e){return this.client.mutate(`POST`,w.AUTH.ACCESS_TOKEN,e)}async delete_access_token(e){return this.client.mutate(`DELETE`,w.AUTH.ACCESS_TOKEN,e)}},_e=class extends T{},ve=class extends T{listPath(e){return`${w.LISTS.DETAILS}/${e}`}async create(e){return this.client.mutate(`POST`,w.LISTS.DETAILS,e)}async details({list_id:e,...t}){return this.client.request(this.listPath(e),this.withLanguage(t))}async update({list_id:e,...t}){return this.client.mutate(`PUT`,this.listPath(e),t)}async delete({list_id:e}){return this.client.mutate(`DELETE`,this.listPath(e),{})}async add_items(e,t){return this.client.mutate(`POST`,`${this.listPath(e)}${w.LISTS.ITEMS}`,t)}async update_items(e,t){return this.client.mutate(`PUT`,`${this.listPath(e)}${w.LISTS.ITEMS}`,t)}async remove_items(e,t){return this.client.mutate(`DELETE`,`${this.listPath(e)}${w.LISTS.ITEMS}`,t)}async item_status({list_id:e,...t}){return this.client.request(`${this.listPath(e)}${w.LISTS.ITEM_STATUS}`,t)}async clear(e){return this.client.mutate(`GET`,`${this.listPath(e)}${w.LISTS.CLEAR}`)}},$=class{client;auth;account;lists;constructor(e,t={}){if(!e)throw Error(v.NO_ACCESS_TOKEN);this.client=new S(e,{...t,version:4}),this.auth=new ge(this.client,t),this.account=new _e(this.client,t),this.lists=new ve(this.client,t)}},ye=class{client;accessToken;options;movies;movie_lists;search;images;configuration;genres;keywords;tv_lists;tv_series;watch_providers;certifications;changes;companies;credits;collections;discover;find;networks;tv_episodes;tv_episode_groups;tv_seasons;trending;reviews;people_lists;people;account;authentication;guest_sessions;lists;get v4(){if(!m(this.accessToken))throw Error(v.V4_REQUIRES_JWT);return this._v4||=new $(this.accessToken,this.options),this._v4}_v4;get cache(){if(!this.options.cache)return;let e=this.client;return{clear(){e.clearCache()},invalidate(t,n){return e.invalidateCache(t,n)},get size(){return e.cacheSize}}}constructor(e,t={}){if(!e)throw Error(v.NO_ACCESS_TOKEN);this.accessToken=e,this.options=t,this.client=new S(e,{logger:t.logger,deduplication:t.deduplication,images:t.images,rate_limit:t.rate_limit,retry:t.retry,cache:t.cache,interceptors:t.interceptors}),this.movies=new L(this.client,this.options),this.movie_lists=new I(this.client,this.options),this.search=new R(this.client,this.options),this.images=new x(this.options.images),this.configuration=new j(this.client,this.options),this.genres=new P(this.client,this.options),this.keywords=new F(this.client,this.options),this.tv_lists=new B(this.client,this.options),this.tv_series=new z(this.client,this.options),this.watch_providers=new V(this.client,this.options),this.certifications=new E(this.client,this.options),this.changes=new D(this.client,this.options),this.companies=new O(this.client,this.options),this.credits=new k(this.client,this.options),this.collections=new A(this.client,this.options),this.discover=new M(this.client,this.options),this.find=new N(this.client,this.options),this.networks=new H(this.client,this.options),this.tv_episodes=new U(this.client,this.options),this.tv_episode_groups=new W(this.client,this.options),this.tv_seasons=new G(this.client,this.options),this.trending=new K(this.client,this.options),this.reviews=new q(this.client,this.options),this.people_lists=new J(this.client,this.options),this.people=new Y(this.client,this.options),this.account=new X(this.client,this.options),this.authentication=new Z(this.client,this.options),this.guest_sessions=new Q(this.client,this.options),this.lists=new he(this.client,this.options)}};const be={Premiere:1,TheatricalLimited:2,Theatrical:3,Digital:4,Physical:5,TV:6},xe={1:`Premiere`,2:`Theatrical (Limited)`,3:`Theatrical`,4:`Digital`,5:`Physical`,6:`TV`},Se={ReturningSeries:0,Planned:1,InProduction:2,Ended:3,Canceled:4,Pilot:5},Ce={0:`Returning Series`,1:`Planned`,2:`In Production`,3:`Ended`,4:`Canceled`,5:`Pilot`},we={Documentary:0,News:1,Miniseries:2,Reality:3,Scripted:4,TalkShow:5,Video:6},Te={0:`Documentary`,1:`News`,2:`Miniseries`,3:`Reality`,4:`Scripted`,5:`Talk Show`,6:`Video`},Ee={OriginalAirDate:1,Absolute:2,Dvd:3,Digital:4,StoryArc:5,Production:6,TV:7},De={1:`Original Air Date`,2:`Absolute`,3:`DVD`,4:`Digital`,5:`Story Arc`,6:`Production`,7:`TV`},Oe=[{iso_3166_1:`AD`,english_name:`Andorra`,native_name:`Andorra`},{iso_3166_1:`AE`,english_name:`United Arab Emirates`,native_name:`United Arab Emirates`},{iso_3166_1:`AF`,english_name:`Afghanistan`,native_name:`Afghanistan`},{iso_3166_1:`AG`,english_name:`Antigua and Barbuda`,native_name:`Antigua & Barbuda`},{iso_3166_1:`AI`,english_name:`Anguilla`,native_name:`Anguilla`},{iso_3166_1:`AL`,english_name:`Albania`,native_name:`Albania`},{iso_3166_1:`AM`,english_name:`Armenia`,native_name:`Armenia`},{iso_3166_1:`AN`,english_name:`Netherlands Antilles`,native_name:`Netherlands Antilles`},{iso_3166_1:`AO`,english_name:`Angola`,native_name:`Angola`},{iso_3166_1:`AQ`,english_name:`Antarctica`,native_name:`Antarctica`},{iso_3166_1:`AR`,english_name:`Argentina`,native_name:`Argentina`},{iso_3166_1:`AS`,english_name:`American Samoa`,native_name:`American Samoa`},{iso_3166_1:`AT`,english_name:`Austria`,native_name:`Austria`},{iso_3166_1:`AU`,english_name:`Australia`,native_name:`Australia`},{iso_3166_1:`AW`,english_name:`Aruba`,native_name:`Aruba`},{iso_3166_1:`AZ`,english_name:`Azerbaijan`,native_name:`Azerbaijan`},{iso_3166_1:`BA`,english_name:`Bosnia and Herzegovina`,native_name:`Bosnia & Herzegovina`},{iso_3166_1:`BB`,english_name:`Barbados`,native_name:`Barbados`},{iso_3166_1:`BD`,english_name:`Bangladesh`,native_name:`Bangladesh`},{iso_3166_1:`BE`,english_name:`Belgium`,native_name:`Belgium`},{iso_3166_1:`BF`,english_name:`Burkina Faso`,native_name:`Burkina Faso`},{iso_3166_1:`BG`,english_name:`Bulgaria`,native_name:`Bulgaria`},{iso_3166_1:`BH`,english_name:`Bahrain`,native_name:`Bahrain`},{iso_3166_1:`BI`,english_name:`Burundi`,native_name:`Burundi`},{iso_3166_1:`BJ`,english_name:`Benin`,native_name:`Benin`},{iso_3166_1:`BM`,english_name:`Bermuda`,native_name:`Bermuda`},{iso_3166_1:`BN`,english_name:`Brunei Darussalam`,native_name:`Brunei`},{iso_3166_1:`BO`,english_name:`Bolivia`,native_name:`Bolivia`},{iso_3166_1:`BR`,english_name:`Brazil`,native_name:`Brazil`},{iso_3166_1:`BS`,english_name:`Bahamas`,native_name:`Bahamas`},{iso_3166_1:`BT`,english_name:`Bhutan`,native_name:`Bhutan`},{iso_3166_1:`BU`,english_name:`Burma`,native_name:`Burma`},{iso_3166_1:`BV`,english_name:`Bouvet Island`,native_name:`Bouvet Island`},{iso_3166_1:`BW`,english_name:`Botswana`,native_name:`Botswana`},{iso_3166_1:`BY`,english_name:`Belarus`,native_name:`Belarus`},{iso_3166_1:`BZ`,english_name:`Belize`,native_name:`Belize`},{iso_3166_1:`CA`,english_name:`Canada`,native_name:`Canada`},{iso_3166_1:`CC`,english_name:`Cocos Islands`,native_name:`Cocos (Keeling) Islands`},{iso_3166_1:`CD`,english_name:`Congo`,native_name:`Democratic Republic of the Congo (Kinshasa)`},{iso_3166_1:`CF`,english_name:`Central African Republic`,native_name:`Central African Republic`},{iso_3166_1:`CG`,english_name:`Congo`,native_name:`Republic of the Congo (Brazzaville)`},{iso_3166_1:`CH`,english_name:`Switzerland`,native_name:`Switzerland`},{iso_3166_1:`CI`,english_name:`Cote D'Ivoire`,native_name:`Côte d’Ivoire`},{iso_3166_1:`CK`,english_name:`Cook Islands`,native_name:`Cook Islands`},{iso_3166_1:`CL`,english_name:`Chile`,native_name:`Chile`},{iso_3166_1:`CM`,english_name:`Cameroon`,native_name:`Cameroon`},{iso_3166_1:`CN`,english_name:`China`,native_name:`China`},{iso_3166_1:`CO`,english_name:`Colombia`,native_name:`Colombia`},{iso_3166_1:`CR`,english_name:`Costa Rica`,native_name:`Costa Rica`},{iso_3166_1:`CS`,english_name:`Serbia and Montenegro`,native_name:`Serbia and Montenegro`},{iso_3166_1:`CU`,english_name:`Cuba`,native_name:`Cuba`},{iso_3166_1:`CV`,english_name:`Cape Verde`,native_name:`Cape Verde`},{iso_3166_1:`CX`,english_name:`Christmas Island`,native_name:`Christmas Island`},{iso_3166_1:`CY`,english_name:`Cyprus`,native_name:`Cyprus`},{iso_3166_1:`CZ`,english_name:`Czech Republic`,native_name:`Czech Republic`},{iso_3166_1:`DE`,english_name:`Germany`,native_name:`Germany`},{iso_3166_1:`DJ`,english_name:`Djibouti`,native_name:`Djibouti`},{iso_3166_1:`DK`,english_name:`Denmark`,native_name:`Denmark`},{iso_3166_1:`DM`,english_name:`Dominica`,native_name:`Dominica`},{iso_3166_1:`DO`,english_name:`Dominican Republic`,native_name:`Dominican Republic`},{iso_3166_1:`DZ`,english_name:`Algeria`,native_name:`Algeria`},{iso_3166_1:`EC`,english_name:`Ecuador`,native_name:`Ecuador`},{iso_3166_1:`EE`,english_name:`Estonia`,native_name:`Estonia`},{iso_3166_1:`EG`,english_name:`Egypt`,native_name:`Egypt`},{iso_3166_1:`EH`,english_name:`Western Sahara`,native_name:`Western Sahara`},{iso_3166_1:`ER`,english_name:`Eritrea`,native_name:`Eritrea`},{iso_3166_1:`ES`,english_name:`Spain`,native_name:`Spain`},{iso_3166_1:`ET`,english_name:`Ethiopia`,native_name:`Ethiopia`},{iso_3166_1:`FI`,english_name:`Finland`,native_name:`Finland`},{iso_3166_1:`FJ`,english_name:`Fiji`,native_name:`Fiji`},{iso_3166_1:`FK`,english_name:`Falkland Islands`,native_name:`Falkland Islands`},{iso_3166_1:`FM`,english_name:`Micronesia`,native_name:`Micronesia`},{iso_3166_1:`FO`,english_name:`Faeroe Islands`,native_name:`Faroe Islands`},{iso_3166_1:`FR`,english_name:`France`,native_name:`France`},{iso_3166_1:`GA`,english_name:`Gabon`,native_name:`Gabon`},{iso_3166_1:`GB`,english_name:`United Kingdom`,native_name:`United Kingdom`},{iso_3166_1:`GD`,english_name:`Grenada`,native_name:`Grenada`},{iso_3166_1:`GE`,english_name:`Georgia`,native_name:`Georgia`},{iso_3166_1:`GF`,english_name:`French Guiana`,native_name:`French Guiana`},{iso_3166_1:`GH`,english_name:`Ghana`,native_name:`Ghana`},{iso_3166_1:`GI`,english_name:`Gibraltar`,native_name:`Gibraltar`},{iso_3166_1:`GL`,english_name:`Greenland`,native_name:`Greenland`},{iso_3166_1:`GM`,english_name:`Gambia`,native_name:`Gambia`},{iso_3166_1:`GN`,english_name:`Guinea`,native_name:`Guinea`},{iso_3166_1:`GP`,english_name:`Guadaloupe`,native_name:`Guadeloupe`},{iso_3166_1:`GQ`,english_name:`Equatorial Guinea`,native_name:`Equatorial Guinea`},{iso_3166_1:`GR`,english_name:`Greece`,native_name:`Greece`},{iso_3166_1:`GS`,english_name:`South Georgia and the South Sandwich Islands`,native_name:`South Georgia & South Sandwich Islands`},{iso_3166_1:`GT`,english_name:`Guatemala`,native_name:`Guatemala`},{iso_3166_1:`GU`,english_name:`Guam`,native_name:`Guam`},{iso_3166_1:`GW`,english_name:`Guinea-Bissau`,native_name:`Guinea-Bissau`},{iso_3166_1:`GY`,english_name:`Guyana`,native_name:`Guyana`},{iso_3166_1:`HK`,english_name:`Hong Kong`,native_name:`Hong Kong SAR China`},{iso_3166_1:`HM`,english_name:`Heard and McDonald Islands`,native_name:`Heard & McDonald Islands`},{iso_3166_1:`HN`,english_name:`Honduras`,native_name:`Honduras`},{iso_3166_1:`HR`,english_name:`Croatia`,native_name:`Croatia`},{iso_3166_1:`HT`,english_name:`Haiti`,native_name:`Haiti`},{iso_3166_1:`HU`,english_name:`Hungary`,native_name:`Hungary`},{iso_3166_1:`ID`,english_name:`Indonesia`,native_name:`Indonesia`},{iso_3166_1:`IE`,english_name:`Ireland`,native_name:`Ireland`},{iso_3166_1:`IL`,english_name:`Israel`,native_name:`Israel`},{iso_3166_1:`IN`,english_name:`India`,native_name:`India`},{iso_3166_1:`IO`,english_name:`British Indian Ocean Territory`,native_name:`British Indian Ocean Territory`},{iso_3166_1:`IQ`,english_name:`Iraq`,native_name:`Iraq`},{iso_3166_1:`IR`,english_name:`Iran`,native_name:`Iran`},{iso_3166_1:`IS`,english_name:`Iceland`,native_name:`Iceland`},{iso_3166_1:`IT`,english_name:`Italy`,native_name:`Italy`},{iso_3166_1:`JM`,english_name:`Jamaica`,native_name:`Jamaica`},{iso_3166_1:`JO`,english_name:`Jordan`,native_name:`Jordan`},{iso_3166_1:`JP`,english_name:`Japan`,native_name:`Japan`},{iso_3166_1:`KE`,english_name:`Kenya`,native_name:`Kenya`},{iso_3166_1:`KG`,english_name:`Kyrgyz Republic`,native_name:`Kyrgyzstan`},{iso_3166_1:`KH`,english_name:`Cambodia`,native_name:`Cambodia`},{iso_3166_1:`KI`,english_name:`Kiribati`,native_name:`Kiribati`},{iso_3166_1:`KM`,english_name:`Comoros`,native_name:`Comoros`},{iso_3166_1:`KN`,english_name:`St. Kitts and Nevis`,native_name:`St. Kitts & Nevis`},{iso_3166_1:`KP`,english_name:`North Korea`,native_name:`North Korea`},{iso_3166_1:`KR`,english_name:`South Korea`,native_name:`South Korea`},{iso_3166_1:`KW`,english_name:`Kuwait`,native_name:`Kuwait`},{iso_3166_1:`KY`,english_name:`Cayman Islands`,native_name:`Cayman Islands`},{iso_3166_1:`KZ`,english_name:`Kazakhstan`,native_name:`Kazakhstan`},{iso_3166_1:`LA`,english_name:`Lao People's Democratic Republic`,native_name:`Laos`},{iso_3166_1:`LB`,english_name:`Lebanon`,native_name:`Lebanon`},{iso_3166_1:`LC`,english_name:`St. Lucia`,native_name:`St. Lucia`},{iso_3166_1:`LI`,english_name:`Liechtenstein`,native_name:`Liechtenstein`},{iso_3166_1:`LK`,english_name:`Sri Lanka`,native_name:`Sri Lanka`},{iso_3166_1:`LR`,english_name:`Liberia`,native_name:`Liberia`},{iso_3166_1:`LS`,english_name:`Lesotho`,native_name:`Lesotho`},{iso_3166_1:`LT`,english_name:`Lithuania`,native_name:`Lithuania`},{iso_3166_1:`LU`,english_name:`Luxembourg`,native_name:`Luxembourg`},{iso_3166_1:`LV`,english_name:`Latvia`,native_name:`Latvia`},{iso_3166_1:`LY`,english_name:`Libyan Arab Jamahiriya`,native_name:`Libya`},{iso_3166_1:`MA`,english_name:`Morocco`,native_name:`Morocco`},{iso_3166_1:`MC`,english_name:`Monaco`,native_name:`Monaco`},{iso_3166_1:`MD`,english_name:`Moldova`,native_name:`Moldova`},{iso_3166_1:`ME`,english_name:`Montenegro`,native_name:`Montenegro`},{iso_3166_1:`MG`,english_name:`Madagascar`,native_name:`Madagascar`},{iso_3166_1:`MH`,english_name:`Marshall Islands`,native_name:`Marshall Islands`},{iso_3166_1:`MK`,english_name:`Macedonia`,native_name:`Macedonia`},{iso_3166_1:`ML`,english_name:`Mali`,native_name:`Mali`},{iso_3166_1:`MM`,english_name:`Myanmar`,native_name:`Myanmar (Burma)`},{iso_3166_1:`MN`,english_name:`Mongolia`,native_name:`Mongolia`},{iso_3166_1:`MO`,english_name:`Macao`,native_name:`Macau SAR China`},{iso_3166_1:`MP`,english_name:`Northern Mariana Islands`,native_name:`Northern Mariana Islands`},{iso_3166_1:`MQ`,english_name:`Martinique`,native_name:`Martinique`},{iso_3166_1:`MR`,english_name:`Mauritania`,native_name:`Mauritania`},{iso_3166_1:`MS`,english_name:`Montserrat`,native_name:`Montserrat`},{iso_3166_1:`MT`,english_name:`Malta`,native_name:`Malta`},{iso_3166_1:`MU`,english_name:`Mauritius`,native_name:`Mauritius`},{iso_3166_1:`MV`,english_name:`Maldives`,native_name:`Maldives`},{iso_3166_1:`MW`,english_name:`Malawi`,native_name:`Malawi`},{iso_3166_1:`MX`,english_name:`Mexico`,native_name:`Mexico`},{iso_3166_1:`MY`,english_name:`Malaysia`,native_name:`Malaysia`},{iso_3166_1:`MZ`,english_name:`Mozambique`,native_name:`Mozambique`},{iso_3166_1:`NA`,english_name:`Namibia`,native_name:`Namibia`},{iso_3166_1:`NC`,english_name:`New Caledonia`,native_name:`New Caledonia`},{iso_3166_1:`NE`,english_name:`Niger`,native_name:`Niger`},{iso_3166_1:`NF`,english_name:`Norfolk Island`,native_name:`Norfolk Island`},{iso_3166_1:`NG`,english_name:`Nigeria`,native_name:`Nigeria`},{iso_3166_1:`NI`,english_name:`Nicaragua`,native_name:`Nicaragua`},{iso_3166_1:`NL`,english_name:`Netherlands`,native_name:`Netherlands`},{iso_3166_1:`NO`,english_name:`Norway`,native_name:`Norway`},{iso_3166_1:`NP`,english_name:`Nepal`,native_name:`Nepal`},{iso_3166_1:`NR`,english_name:`Nauru`,native_name:`Nauru`},{iso_3166_1:`NU`,english_name:`Niue`,native_name:`Niue`},{iso_3166_1:`NZ`,english_name:`New Zealand`,native_name:`New Zealand`},{iso_3166_1:`OM`,english_name:`Oman`,native_name:`Oman`},{iso_3166_1:`PA`,english_name:`Panama`,native_name:`Panama`},{iso_3166_1:`PE`,english_name:`Peru`,native_name:`Peru`},{iso_3166_1:`PF`,english_name:`French Polynesia`,native_name:`French Polynesia`},{iso_3166_1:`PG`,english_name:`Papua New Guinea`,native_name:`Papua New Guinea`},{iso_3166_1:`PH`,english_name:`Philippines`,native_name:`Philippines`},{iso_3166_1:`PK`,english_name:`Pakistan`,native_name:`Pakistan`},{iso_3166_1:`PL`,english_name:`Poland`,native_name:`Poland`},{iso_3166_1:`PM`,english_name:`St. Pierre and Miquelon`,native_name:`St. Pierre & Miquelon`},{iso_3166_1:`PN`,english_name:`Pitcairn Island`,native_name:`Pitcairn Islands`},{iso_3166_1:`PR`,english_name:`Puerto Rico`,native_name:`Puerto Rico`},{iso_3166_1:`PS`,english_name:`Palestinian Territory`,native_name:`Palestinian Territories`},{iso_3166_1:`PT`,english_name:`Portugal`,native_name:`Portugal`},{iso_3166_1:`PW`,english_name:`Palau`,native_name:`Palau`},{iso_3166_1:`PY`,english_name:`Paraguay`,native_name:`Paraguay`},{iso_3166_1:`QA`,english_name:`Qatar`,native_name:`Qatar`},{iso_3166_1:`RE`,english_name:`Reunion`,native_name:`Réunion`},{iso_3166_1:`RO`,english_name:`Romania`,native_name:`Romania`},{iso_3166_1:`RS`,english_name:`Serbia`,native_name:`Serbia`},{iso_3166_1:`RU`,english_name:`Russia`,native_name:`Russia`},{iso_3166_1:`RW`,english_name:`Rwanda`,native_name:`Rwanda`},{iso_3166_1:`SA`,english_name:`Saudi Arabia`,native_name:`Saudi Arabia`},{iso_3166_1:`SB`,english_name:`Solomon Islands`,native_name:`Solomon Islands`},{iso_3166_1:`SC`,english_name:`Seychelles`,native_name:`Seychelles`},{iso_3166_1:`SD`,english_name:`Sudan`,native_name:`Sudan`},{iso_3166_1:`SE`,english_name:`Sweden`,native_name:`Sweden`},{iso_3166_1:`SG`,english_name:`Singapore`,native_name:`Singapore`},{iso_3166_1:`SH`,english_name:`St. Helena`,native_name:`St. Helena`},{iso_3166_1:`SI`,english_name:`Slovenia`,native_name:`Slovenia`},{iso_3166_1:`SJ`,english_name:`Svalbard & Jan Mayen Islands`,native_name:`Svalbard & Jan Mayen`},{iso_3166_1:`SK`,english_name:`Slovakia`,native_name:`Slovakia`},{iso_3166_1:`SL`,english_name:`Sierra Leone`,native_name:`Sierra Leone`},{iso_3166_1:`SM`,english_name:`San Marino`,native_name:`San Marino`},{iso_3166_1:`SN`,english_name:`Senegal`,native_name:`Senegal`},{iso_3166_1:`SO`,english_name:`Somalia`,native_name:`Somalia`},{iso_3166_1:`SR`,english_name:`Suriname`,native_name:`Suriname`},{iso_3166_1:`SS`,english_name:`South Sudan`,native_name:`South Sudan`},{iso_3166_1:`ST`,english_name:`Sao Tome and Principe`,native_name:`São Tomé & Príncipe`},{iso_3166_1:`SU`,english_name:`Soviet Union`,native_name:`Soviet Union`},{iso_3166_1:`SV`,english_name:`El Salvador`,native_name:`El Salvador`},{iso_3166_1:`SY`,english_name:`Syrian Arab Republic`,native_name:`Syria`},{iso_3166_1:`SZ`,english_name:`Swaziland`,native_name:`Eswatini (Swaziland)`},{iso_3166_1:`TC`,english_name:`Turks and Caicos Islands`,native_name:`Turks & Caicos Islands`},{iso_3166_1:`TD`,english_name:`Chad`,native_name:`Chad`},{iso_3166_1:`TF`,english_name:`French Southern Territories`,native_name:`French Southern Territories`},{iso_3166_1:`TG`,english_name:`Togo`,native_name:`Togo`},{iso_3166_1:`TH`,english_name:`Thailand`,native_name:`Thailand`},{iso_3166_1:`TJ`,english_name:`Tajikistan`,native_name:`Tajikistan`},{iso_3166_1:`TK`,english_name:`Tokelau`,native_name:`Tokelau`},{iso_3166_1:`TL`,english_name:`Timor-Leste`,native_name:`Timor-Leste`},{iso_3166_1:`TM`,english_name:`Turkmenistan`,native_name:`Turkmenistan`},{iso_3166_1:`TN`,english_name:`Tunisia`,native_name:`Tunisia`},{iso_3166_1:`TO`,english_name:`Tonga`,native_name:`Tonga`},{iso_3166_1:`TP`,english_name:`East Timor`,native_name:`East Timor`},{iso_3166_1:`TR`,english_name:`Turkey`,native_name:`Turkey`},{iso_3166_1:`TT`,english_name:`Trinidad and Tobago`,native_name:`Trinidad & Tobago`},{iso_3166_1:`TV`,english_name:`Tuvalu`,native_name:`Tuvalu`},{iso_3166_1:`TW`,english_name:`Taiwan`,native_name:`Taiwan`},{iso_3166_1:`TZ`,english_name:`Tanzania`,native_name:`Tanzania`},{iso_3166_1:`UA`,english_name:`Ukraine`,native_name:`Ukraine`},{iso_3166_1:`UG`,english_name:`Uganda`,native_name:`Uganda`},{iso_3166_1:`UM`,english_name:`United States Minor Outlying Islands`,native_name:`U.S. Outlying Islands`},{iso_3166_1:`US`,english_name:`United States of America`,native_name:`United States`},{iso_3166_1:`UY`,english_name:`Uruguay`,native_name:`Uruguay`},{iso_3166_1:`UZ`,english_name:`Uzbekistan`,native_name:`Uzbekistan`},{iso_3166_1:`VA`,english_name:`Holy See`,native_name:`Vatican City`},{iso_3166_1:`VC`,english_name:`St. Vincent and the Grenadines`,native_name:`St. Vincent & Grenadines`},{iso_3166_1:`VE`,english_name:`Venezuela`,native_name:`Venezuela`},{iso_3166_1:`VG`,english_name:`British Virgin Islands`,native_name:`British Virgin Islands`},{iso_3166_1:`VI`,english_name:`US Virgin Islands`,native_name:`U.S. Virgin Islands`},{iso_3166_1:`VN`,english_name:`Vietnam`,native_name:`Vietnam`},{iso_3166_1:`VU`,english_name:`Vanuatu`,native_name:`Vanuatu`},{iso_3166_1:`WF`,english_name:`Wallis and Futuna Islands`,native_name:`Wallis & Futuna`},{iso_3166_1:`WS`,english_name:`Samoa`,native_name:`Samoa`},{iso_3166_1:`XC`,english_name:`Czechoslovakia`,native_name:`Czechoslovakia`},{iso_3166_1:`XG`,english_name:`East Germany`,native_name:`East Germany`},{iso_3166_1:`XI`,english_name:`Northern Ireland`,native_name:`Northern Ireland`},{iso_3166_1:`XK`,english_name:`Kosovo`,native_name:`Kosovo`},{iso_3166_1:`YE`,english_name:`Yemen`,native_name:`Yemen`},{iso_3166_1:`YT`,english_name:`Mayotte`,native_name:`Mayotte`},{iso_3166_1:`YU`,english_name:`Yugoslavia`,native_name:`Yugoslavia`},{iso_3166_1:`ZA`,english_name:`South Africa`,native_name:`South Africa`},{iso_3166_1:`ZM`,english_name:`Zambia`,native_name:`Zambia`},{iso_3166_1:`ZR`,english_name:`Zaire`,native_name:`Zaire`},{iso_3166_1:`ZW`,english_name:`Zimbabwe`,native_name:`Zimbabwe`}];function ke(e){return e.media_type===`movie`}function Ae(e){return e.media_type===`tv`}export{X as AccountAPI,Z as AuthenticationAPI,r as BACKDROP_SIZES,E as CertificationsAPI,D as ChangesAPI,A as CollectionsAPI,O as CompaniesAPI,j as ConfigurationAPI,k as CreditsAPI,M as DiscoverAPI,Se as DiscoverTVStatus,Ce as DiscoverTVStatusLabel,we as DiscoverTVType,Te as DiscoverTVTypeLabel,N as FindAPI,P as GenresAPI,Q as GuestSessionsAPI,t as IMAGE_BASE_URL,n as IMAGE_SECURE_BASE_URL,x as ImageAPI,F as KeywordsAPI,i as LOGO_SIZES,he as ListsAPI,I as MovieListsAPI,be as MovieReleaseType,xe as MovieReleaseTypeLabel,L as MoviesAPI,H as NetworksAPI,a as POSTER_SIZES,o as PROFILE_SIZES,Y as PeopleAPI,J as PeopleListsAPI,q as ReviewsAPI,s as STILL_SIZES,R as SearchAPI,ye as TMDB,Oe as TMDBCountries,e as TMDBError,c as TMDBLogger,$ as TMDBv4,Ee as TVEpisodeGroupType,De as TVEpisodeGroupTypeLabel,W as TVEpisodeGroupsAPI,U as TVEpisodesAPI,G as TVSeasonsAPI,z as TVSeriesAPI,B as TVSeriesListsAPI,K as TrendingAPI,_e as V4AccountAPI,ge as V4AuthAPI,ve as V4ListsAPI,V as WatchProvidersAPI,ae as fetchAllPages,ce as getPageInfo,ee as hasBackdropPath,re as hasLogoPath,oe as hasNextPage,_ as hasPosterPath,se as hasPreviousPage,te as hasProfilePath,ne as hasStillPath,m as isJwt,ke as isKnownForMovie,Ae as isKnownForTV,g as isPlainObject,h as isRecord,ie as paginate};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lorenzopant/tmdb",
3
- "version": "1.22.2",
3
+ "version": "1.24.0",
4
4
  "description": "A completely type-safe The Movie Database (TMDB) API wrapper for typescript applications.",
5
5
  "keywords": [
6
6
  "api",
@@ -45,12 +45,14 @@
45
45
  "lint": "oxlint .",
46
46
  "lint:check": "oxlint --type-aware --type-check .",
47
47
  "test": "pnpm run test:unit",
48
- "test:unit": "vitest run --exclude '**/*.integration.test.ts'",
48
+ "test:unit": "vitest run --exclude '**/*.integration.test.ts' --exclude '**/*.drift.test.ts'",
49
49
  "test:integration": "vitest run integration",
50
+ "test:drift": "tsx scripts/gen-type-tree.ts && vitest run drift --coverage.enabled=false",
51
+ "gen:type-tree": "tsx scripts/gen-type-tree.ts",
50
52
  "test:watch": "vitest",
51
53
  "test:ui": "vitest --ui",
52
54
  "test:coverage": "vitest --coverage",
53
- "typecheck": "tsc --noEmit"
55
+ "typecheck": "tsc --noEmit && tsc -p scripts/tsconfig.json"
54
56
  },
55
57
  "devDependencies": {
56
58
  "@types/node": "^25.5.0",