{"version":3,"file":"podcast-Da9L7I5Q.mjs","names":[],"sources":["../src/stores/class/general/podcast.ts"],"sourcesContent":["import { Emission, emptyEmissionData } from \"./emission\";\nimport { Organisation } from \"./organisation\";\nimport { Participant } from \"./participant\";\nimport { Person } from \"../user/person\";\nimport { Video } from \"./video\";\n\n/**\n * State of processing of the audio file\n */\nexport enum PodcastProcessingStatus {\n  Planned = \"PLANNED\",\n  Processing = \"PROCESSING\",\n  Ready = \"READY\",\n  ReadyToRecord = \"READY_TO_RECORD\",\n  Error = \"ERROR\",\n  Cancelled = \"CANCELED\",\n  All = \"ALL\"\n}\n\n/** Type of episode */\nexport enum PodcastType {\n  FULL = 'full',\n  TRAILER = 'trailer',\n  BONUS = 'bonus'\n}\n\n/** Describe the availability of the podcast */\nexport interface PodcastAvailability {\n  date?: number | null;\n  visibility?: boolean;\n  immediate?: boolean;\n}\n\n/**\n * Data about a podcast/episode\n */\nexport interface Podcast {\n  /** ID of the podcast */\n  podcastId: number;\n  /** Emission the podcast belongs to */\n  emission: Emission;\n  /** Organisation the podcast belongs to */\n  organisation: Organisation;\n  /** URL to the image */\n  imageUrl?: string;\n  /** URL to the audio file (for downloading) */\n  audioUrl: string;\n  /** URL to the audio file (file on bucket) */\n  audioStorageUrl: string;\n  /** Title of the podcast */\n  title: string;\n  /** The availability of the podcast */\n  availability: PodcastAvailability;\n  /** Description of the podcast */\n  description?: string;\n  /** Optional summary of the podcast */\n  summary?: string;\n  /** Publishing date */\n  pubDate?: string;\n  /** The status of the processing of the audio file */\n  processingStatus?: PodcastProcessingStatus;\n  /** An optional list of tags */\n  tags?: Array<string>;\n  /** An optional list of tags for OuestFrance */\n  ofTags?: Array<string>;\n  /** List of beneficiaries/rights holders */\n  beneficiaries: Array<string>;\n  /** Indicates that the episode has explicit content */\n  explicit?: boolean;\n  /** Type of episode */\n  seasonEpisodeType: PodcastType;\n  /** Number of season in which podcast belongs */\n  seasonNumber?: number;\n  /** Order of the episode in the season */\n  seasonEpisodeNumber?: number;\n\n  createdAt?: string;\n  createdByUserId?: string;\n  annotations?: {\n    [key: string]: string | number | boolean | undefined;\n    /** Subtitle of the podcast */\n    subtitle?: string;\n  };\n  article?: string;\n  comments?: string;\n  conferenceId?: number;\n  valid?: boolean;\n  downloadCount?: number;\n  weekDownloadCount?: number;\n  duration: number;\n  email?: string;\n  monetisable?: string;\n\n  animators?: Array<Participant>;\n  guests?: Array<Participant>;\n  processorId?: string;\n  publisher?: Person;\n  rubriqueIds?: Array<number>;\n  rssEpisode?:string;\n  score?: number;\n  size?: number;\n  order?: number;\n  video?: Video;\n}\n\n/**\n * A podcast with incomplete data\n */\nexport interface SimplifiedPodcast extends\n  Omit<Podcast, 'emission'|'organisation'|'animators'|'guests'|'ofTags'|'comments'|'email'|'processorId'|'publisher'|'order'|'video'> {\n\n  /** The ID of the emission */\n  emissionId: number;\n  /** The ID of the organisation */\n  organisationId: string;\n  /** The ID of the animators */\n  animatorId?: Array<number>;\n}\n\n/**\n * Convert a simplified podcast to a complete one\n * @param simplified The incomplete podcast\n * @param organisation The organisation the podcast belongs to\n * @param emission The emission the podcast belongs to\n */\nexport function simplifiedToFull(simplified: SimplifiedPodcast, organisation: Organisation, emission: Emission): Podcast {\n  return {\n    ...simplified,\n    organisation,\n    emission\n  };\n}\n\nexport function podcastToSimplified(full: Podcast): SimplifiedPodcast {\n  return {\n    ...full,\n    emissionId: full.emission.emissionId,\n    organisationId: full.organisation.id\n  };\n}\n\nexport function emptyPodcastData(): Podcast {\n  return {\n    podcastId: 0,\n    audioUrl: \"\",\n    audioStorageUrl: \"\",\n    article: \"\",\n    imageUrl: \"\",\n    animators: [],\n    guests: [],\n    emission: emptyEmissionData(),\n    title: \"\",\n    description: undefined,\n    tags: [],\n    beneficiaries: [],\n    availability: {\n      visibility: true,\n      date: undefined,\n    },\n    monetisable: \"UNDEFINED\",\n    organisation: {\n      id: \"\",\n      name: \"\",\n      imageUrl: \"\",\n    },\n    pubDate: undefined,\n    conferenceId: undefined,\n    duration: 0,\n    seasonEpisodeType: PodcastType.FULL\n  };\n}\n"],"mappings":";;;;;AASA,IAAY,0BAAL,yBAAA,yBAAA;CACL,wBAAA,aAAA;CACA,wBAAA,gBAAA;CACA,wBAAA,WAAA;CACA,wBAAA,mBAAA;CACA,wBAAA,WAAA;CACA,wBAAA,eAAA;CACA,wBAAA,SAAA;;AACF,EAAA,CAAA,CAAA;;AAGA,IAAY,cAAL,yBAAA,aAAA;CACL,YAAA,UAAA;CACA,YAAA,aAAA;CACA,YAAA,WAAA;;AACF,EAAA,CAAA,CAAA;;;;;;;AAqGA,SAAgB,iBAAiB,YAA+B,cAA4B,UAA6B;CACvH,OAAO;EACL,GAAG;EACH;EACA;CACF;AACF;AAEA,SAAgB,oBAAoB,MAAkC;CACpE,OAAO;EACL,GAAG;EACH,YAAY,KAAK,SAAS;EAC1B,gBAAgB,KAAK,aAAa;CACpC;AACF;AAEA,SAAgB,mBAA4B;CAC1C,OAAO;EACL,WAAW;EACX,UAAU;EACV,iBAAiB;EACjB,SAAS;EACT,UAAU;EACV,WAAW,CAAC;EACZ,QAAQ,CAAC;EACT,UAAU,kBAAkB;EAC5B,OAAO;EACP,aAAa,KAAA;EACb,MAAM,CAAC;EACP,eAAe,CAAC;EAChB,cAAc;GACZ,YAAY;GACZ,MAAM,KAAA;EACR;EACA,aAAa;EACb,cAAc;GACZ,IAAI;GACJ,MAAM;GACN,UAAU;EACZ;EACA,SAAS,KAAA;EACT,cAAc,KAAA;EACd,UAAU;EACV,mBAAA;CACF;AACF"}