{"version":3,"file":"PlaylistPage-BzFsLUfK.mjs","names":[],"sources":["../src/components/pages/PlaylistPage.vue","../src/components/pages/PlaylistPage.vue"],"sourcesContent":["<template>\n  <section class=\"page-box\">\n    <template v-if=\"loaded && !error && playlist\">\n      <PodcastmakerHeader\n        v-if=\"isPodcastmaker\"\n        :page-title=\"pageTitle\"\n        :img-url=\"playlist.imageUrl\"\n      />\n      <div\n        class=\"d-flex flex-column page-element\"\n        :class=\"isPodcastmaker ? 'page-element-podcastmaker' : ''\"\n      >\n        <section class=\"module-box\">\n          <slot\n            v-if=\"editRight && !isPodcastmaker\"\n            name=\"edit-box\"\n            :playlist=\"playlist\"\n          />\n\n          <div class=\"mb-5 mt-3 description-text\">\n            <img\n              v-lazy=\"useProxyImageUrl(playlist.imageUrl, '250')\"\n              width=\"250\"\n              height=\"250\"\n              aria-hidden=\"true\"\n              alt=\"\"\n              :title=\"t('Playlist name image', { name: name })\"\n              class=\"img-box float-start me-3 mb-3\"\n            />\n            <div class=\"d-flex align-items-center justify-content-between\">\n              <h2>{{ name }}</h2>\n              <ShareAnonymous v-if=\"!editRight\" class=\"d-flex justify-content-end flex-grow-1\" :playlist=\"playlist\" :organisation-id=\"playlist.organisation?.id\"/>\n            </div>\n            <!-- eslint-disable vue/no-v-html -->\n            <p class=\"html-wysiwyg-content\" v-html=\"urlify(description)\" />\n            <!-- eslint-enable -->\n          </div>\n          <SubscribeButtons\n            v-if=\"isPodcastmaker\"\n            class=\"mt-4\"\n            :content=\"playlist\"\n            :window-width=\"1000\"\n            :justify-center=\"false\"\n          />\n        </section>\n        <SharePlayer\n          v-if=\"!isPodcastmaker && editRight\"\n          :playlist=\"playlist\"\n          :organisation-id=\"authOrgaId\"\n        />\n        <ShareSocialsButtons\n          v-if=\"state.podcastPage.ShareButtons\"\n          :organisation-id=\"playlist.organisation.id\"\n        />\n        <section class=\"module-box\">\n          <PodcastList \n            v-if=\"isInit\"\n            v-model:query=\"searchPattern\"\n            :first=\"paginateFirst\"\n            :size=\"ps\"\n            :playlist=\"playlist\"\n          />\n        </section>\n      </div>\n\n      <slot name=\"bottom\" v-bind=\"{ playlist }\" />\n    </template>\n    <ClassicLoading\n      :loading-text=\"!loaded ? t('Loading content ...') : undefined\"\n      :error-text=\"error ? t(`Playlist doesn't exist`) : undefined\"\n    />\n  </section>\n</template>\n\n<script setup lang=\"ts\">\nimport { useGeneralStore } from \"../../stores/GeneralStore\";\nimport { useAuthStore } from \"../../stores/AuthStore\";\nimport {useOrgaComputed} from \"../composable/useOrgaComputed\";\nimport {useSeoTitleUrl} from \"../composable/route/useSeoTitleUrl\";\nimport ClassicLoading from \"../form/ClassicLoading.vue\";\nimport PodcastList from \"../display/playlist/PodcastList.vue\";\nimport { useFilterStore } from \"../../stores/FilterStore\";\nimport { state } from \"../../stores/ParamSdkStore\";\nimport displayHelper from \"../../helper/displayHelper\";\nimport {useImageProxy} from \"../composable/useImageProxy\";\nimport {useErrorHandler} from \"../composable/useErrorHandler\";\nimport { Playlist } from \"@/stores/class/general/playlist\";\nimport {defineAsyncComponent, ref, Ref, computed, watch, onBeforeUnmount } from \"vue\";\nimport { AxiosError } from \"axios\";\nimport { useI18n } from \"vue-i18n\";\nimport { useRoute } from \"vue-router\";\nimport { useSimplePageParam } from \"../composable/route/useSimplePageParam\";\nimport { playlistApi } from \"../../api/playlistApi\";\n\nimport SubscribeButtons from \"../display/sharing/SubscribeButtons.vue\"; \nconst ShareSocialsButtons = defineAsyncComponent(\n  () => import(\"../display/sharing/ShareSocialsButtons.vue\"),\n);\nconst SharePlayer = defineAsyncComponent(\n  () => import(\"../display/sharing/SharePlayer.vue\"),\n);\nconst PodcastmakerHeader = defineAsyncComponent(\n  () => import(\"../display/podcastmaker/PodcastmakerHeader.vue\"),\n);\nconst ShareAnonymous = defineAsyncComponent(() => import(\"../display/sharing/ShareAnonymous.vue\"));\n\n\n//Props\nconst props = defineProps({\n  playlistId: { default: undefined, type: Number },\n  pr: { default: 0, type: Number },\n  ps: { default: 30, type: Number },\n  routeQuery: { default: \"\", type: String },\n});\n\n\n//Data \nconst loaded = ref(false);\nconst error = ref(false);\nconst playlist : Ref<Playlist | undefined> = ref(undefined);\n\n\n//Composables\nconst route = useRoute();\nconst { t } = useI18n();\nconst { useProxyImageUrl } = useImageProxy();\nconst { isPodcastmaker, isEditRights, authOrgaId } = useOrgaComputed();\nconst { updatePathParams } = useSeoTitleUrl();\nconst {handle403} = useErrorHandler();\nconst authStore = useAuthStore();\nconst filterStore = useFilterStore();\nconst generalStore = useGeneralStore();\nconst {\n  searchPattern,\n  paginateFirst,\n  isInit\n} = useSimplePageParam(props, true);\n\n\n//Computed\nconst playlistRadio = computed(() =>{\n  return (\n    \"AMBIANCE\" === playlist.value?.ambianceType ||\n    \"AMBIANCE_PROGRAMMED\" === playlist.value?.ambianceType\n  );\n});\nconst pageTitle = computed(() =>playlistRadio.value? t(\"Mix of episodes\"): t(\"Playlist\"));\nconst name = computed(() =>playlist.value?.title ?? \"\");\nconst description = computed(() =>playlist.value?.description ?? \"\");\nconst editRight = computed(() =>{\n  return isEditRights(\n    playlist.value?.organisation?.id,\n    authStore.isRolePlaylists,\n  );\n});\n\n\n//Watch\nwatch(()=>props.playlistId, () => {getPlaylistDetails()}, {immediate: true});\n\n\nonBeforeUnmount(() => {\n  generalStore.contentToDisplayUpdate(null);\n});\n\n\n//Methods\nfunction urlify(text:string|undefined){\n  return displayHelper.urlify(text);\n}\nfunction initError(): void {\n  error.value = true;\n  loaded.value = true;\n}\nasync function getPlaylistDetails(): Promise<void> {\n  try {\n    loaded.value = false;\n    error.value = false;\n    playlist.value = await playlistApi.get(props.playlistId);\n    filterStore.updateOrgaIfNecessary(playlist.value.organisation?.id);\n    if (\n      (!editRight.value && playlistRadio.value) ||\n      (\"PUBLIC\" !== playlist.value.organisation?.privacy &&\n      filterStore.filterOrgaId !== playlist.value.organisation?.id &&\n      route.query.productor !== playlist.value.organisation?.id)\n    ) {\n      initError();\n      return;\n    }\n    generalStore.contentToDisplayUpdate(playlist.value);\n    updatePathParams(playlist.value.title);\n  } catch (error) {\n    handle403(error as AxiosError);\n    initError();\n  }\n  loaded.value = true;\n}\n\n</script>\n","<template>\n  <section class=\"page-box\">\n    <template v-if=\"loaded && !error && playlist\">\n      <PodcastmakerHeader\n        v-if=\"isPodcastmaker\"\n        :page-title=\"pageTitle\"\n        :img-url=\"playlist.imageUrl\"\n      />\n      <div\n        class=\"d-flex flex-column page-element\"\n        :class=\"isPodcastmaker ? 'page-element-podcastmaker' : ''\"\n      >\n        <section class=\"module-box\">\n          <slot\n            v-if=\"editRight && !isPodcastmaker\"\n            name=\"edit-box\"\n            :playlist=\"playlist\"\n          />\n\n          <div class=\"mb-5 mt-3 description-text\">\n            <img\n              v-lazy=\"useProxyImageUrl(playlist.imageUrl, '250')\"\n              width=\"250\"\n              height=\"250\"\n              aria-hidden=\"true\"\n              alt=\"\"\n              :title=\"t('Playlist name image', { name: name })\"\n              class=\"img-box float-start me-3 mb-3\"\n            />\n            <div class=\"d-flex align-items-center justify-content-between\">\n              <h2>{{ name }}</h2>\n              <ShareAnonymous v-if=\"!editRight\" class=\"d-flex justify-content-end flex-grow-1\" :playlist=\"playlist\" :organisation-id=\"playlist.organisation?.id\"/>\n            </div>\n            <!-- eslint-disable vue/no-v-html -->\n            <p class=\"html-wysiwyg-content\" v-html=\"urlify(description)\" />\n            <!-- eslint-enable -->\n          </div>\n          <SubscribeButtons\n            v-if=\"isPodcastmaker\"\n            class=\"mt-4\"\n            :content=\"playlist\"\n            :window-width=\"1000\"\n            :justify-center=\"false\"\n          />\n        </section>\n        <SharePlayer\n          v-if=\"!isPodcastmaker && editRight\"\n          :playlist=\"playlist\"\n          :organisation-id=\"authOrgaId\"\n        />\n        <ShareSocialsButtons\n          v-if=\"state.podcastPage.ShareButtons\"\n          :organisation-id=\"playlist.organisation.id\"\n        />\n        <section class=\"module-box\">\n          <PodcastList \n            v-if=\"isInit\"\n            v-model:query=\"searchPattern\"\n            :first=\"paginateFirst\"\n            :size=\"ps\"\n            :playlist=\"playlist\"\n          />\n        </section>\n      </div>\n\n      <slot name=\"bottom\" v-bind=\"{ playlist }\" />\n    </template>\n    <ClassicLoading\n      :loading-text=\"!loaded ? t('Loading content ...') : undefined\"\n      :error-text=\"error ? t(`Playlist doesn't exist`) : undefined\"\n    />\n  </section>\n</template>\n\n<script setup lang=\"ts\">\nimport { useGeneralStore } from \"../../stores/GeneralStore\";\nimport { useAuthStore } from \"../../stores/AuthStore\";\nimport {useOrgaComputed} from \"../composable/useOrgaComputed\";\nimport {useSeoTitleUrl} from \"../composable/route/useSeoTitleUrl\";\nimport ClassicLoading from \"../form/ClassicLoading.vue\";\nimport PodcastList from \"../display/playlist/PodcastList.vue\";\nimport { useFilterStore } from \"../../stores/FilterStore\";\nimport { state } from \"../../stores/ParamSdkStore\";\nimport displayHelper from \"../../helper/displayHelper\";\nimport {useImageProxy} from \"../composable/useImageProxy\";\nimport {useErrorHandler} from \"../composable/useErrorHandler\";\nimport { Playlist } from \"@/stores/class/general/playlist\";\nimport {defineAsyncComponent, ref, Ref, computed, watch, onBeforeUnmount } from \"vue\";\nimport { AxiosError } from \"axios\";\nimport { useI18n } from \"vue-i18n\";\nimport { useRoute } from \"vue-router\";\nimport { useSimplePageParam } from \"../composable/route/useSimplePageParam\";\nimport { playlistApi } from \"../../api/playlistApi\";\n\nimport SubscribeButtons from \"../display/sharing/SubscribeButtons.vue\"; \nconst ShareSocialsButtons = defineAsyncComponent(\n  () => import(\"../display/sharing/ShareSocialsButtons.vue\"),\n);\nconst SharePlayer = defineAsyncComponent(\n  () => import(\"../display/sharing/SharePlayer.vue\"),\n);\nconst PodcastmakerHeader = defineAsyncComponent(\n  () => import(\"../display/podcastmaker/PodcastmakerHeader.vue\"),\n);\nconst ShareAnonymous = defineAsyncComponent(() => import(\"../display/sharing/ShareAnonymous.vue\"));\n\n\n//Props\nconst props = defineProps({\n  playlistId: { default: undefined, type: Number },\n  pr: { default: 0, type: Number },\n  ps: { default: 30, type: Number },\n  routeQuery: { default: \"\", type: String },\n});\n\n\n//Data \nconst loaded = ref(false);\nconst error = ref(false);\nconst playlist : Ref<Playlist | undefined> = ref(undefined);\n\n\n//Composables\nconst route = useRoute();\nconst { t } = useI18n();\nconst { useProxyImageUrl } = useImageProxy();\nconst { isPodcastmaker, isEditRights, authOrgaId } = useOrgaComputed();\nconst { updatePathParams } = useSeoTitleUrl();\nconst {handle403} = useErrorHandler();\nconst authStore = useAuthStore();\nconst filterStore = useFilterStore();\nconst generalStore = useGeneralStore();\nconst {\n  searchPattern,\n  paginateFirst,\n  isInit\n} = useSimplePageParam(props, true);\n\n\n//Computed\nconst playlistRadio = computed(() =>{\n  return (\n    \"AMBIANCE\" === playlist.value?.ambianceType ||\n    \"AMBIANCE_PROGRAMMED\" === playlist.value?.ambianceType\n  );\n});\nconst pageTitle = computed(() =>playlistRadio.value? t(\"Mix of episodes\"): t(\"Playlist\"));\nconst name = computed(() =>playlist.value?.title ?? \"\");\nconst description = computed(() =>playlist.value?.description ?? \"\");\nconst editRight = computed(() =>{\n  return isEditRights(\n    playlist.value?.organisation?.id,\n    authStore.isRolePlaylists,\n  );\n});\n\n\n//Watch\nwatch(()=>props.playlistId, () => {getPlaylistDetails()}, {immediate: true});\n\n\nonBeforeUnmount(() => {\n  generalStore.contentToDisplayUpdate(null);\n});\n\n\n//Methods\nfunction urlify(text:string|undefined){\n  return displayHelper.urlify(text);\n}\nfunction initError(): void {\n  error.value = true;\n  loaded.value = true;\n}\nasync function getPlaylistDetails(): Promise<void> {\n  try {\n    loaded.value = false;\n    error.value = false;\n    playlist.value = await playlistApi.get(props.playlistId);\n    filterStore.updateOrgaIfNecessary(playlist.value.organisation?.id);\n    if (\n      (!editRight.value && playlistRadio.value) ||\n      (\"PUBLIC\" !== playlist.value.organisation?.privacy &&\n      filterStore.filterOrgaId !== playlist.value.organisation?.id &&\n      route.query.productor !== playlist.value.organisation?.id)\n    ) {\n      initError();\n      return;\n    }\n    generalStore.contentToDisplayUpdate(playlist.value);\n    updatePathParams(playlist.value.title);\n  } catch (error) {\n    handle403(error as AxiosError);\n    initError();\n  }\n  loaded.value = true;\n}\n\n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA+FA,MAAM,sBAAsB,2BACpB,OAAO,qCACf;EACA,MAAM,cAAc,2BACZ,OAAO,8BAAA,MAAA,MAAA,EAAA,CAAA,CACf;EACA,MAAM,qBAAqB,2BACnB,OAAO,oCACf;EACA,MAAM,iBAAiB,2BAA2B,OAAO,gCAAwC;EAIjG,MAAM,QAAQ;EASd,MAAM,SAAS,IAAI,KAAK;EACxB,MAAM,QAAQ,IAAI,KAAK;EACvB,MAAM,WAAuC,IAAI,KAAA,CAAS;EAI1D,MAAM,QAAQ,SAAS;EACvB,MAAM,EAAE,MAAM,QAAQ;EACtB,MAAM,EAAE,qBAAqB,cAAc;EAC3C,MAAM,EAAE,gBAAgB,cAAc,eAAe,gBAAgB;EACrE,MAAM,EAAE,qBAAqB,eAAe;EAC5C,MAAM,EAAC,cAAa,gBAAgB;EACpC,MAAM,YAAY,aAAa;EAC/B,MAAM,cAAc,eAAe;EACnC,MAAM,eAAe,gBAAgB;EACrC,MAAM,EACJ,eACA,eACA,WACE,mBAAmB,OAAO,IAAI;EAIlC,MAAM,gBAAgB,eAAc;GAClC,OACE,eAAe,SAAS,OAAO,gBAC/B,0BAA0B,SAAS,OAAO;EAE9C,CAAC;EACD,MAAM,YAAY,eAAc,cAAc,QAAO,EAAE,iBAAiB,IAAG,EAAE,UAAU,CAAC;EACxF,MAAM,OAAO,eAAc,SAAS,OAAO,SAAS,EAAE;EACtD,MAAM,cAAc,eAAc,SAAS,OAAO,eAAe,EAAE;EACnE,MAAM,YAAY,eAAc;GAC9B,OAAO,aACL,SAAS,OAAO,cAAc,IAC9B,UAAU,eACZ;EACF,CAAC;EAID,YAAU,MAAM,kBAAkB;GAAC,mBAAmB;EAAC,GAAG,EAAC,WAAW,KAAI,CAAC;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