{"version":3,"file":"SharePlayer-CWINSZ-6.mjs","names":[],"sources":["../src/components/display/sharing/SharePlayer.vue","../src/components/display/sharing/SharePlayer.vue"],"sourcesContent":["<template>\n  <section class=\"module-box overflow-visible\">\n    <div class=\"d-flex justify-content-between align-items-center\">\n      <h3 class=\"mb-3\">\n        {{ t(\"Embed\") }}\n      </h3>\n      <div\n        v-if=\"noAd && !generalStore.platformEducation\"\n        class=\"sticker\"\n        :title=\"t('You cannot insert advertising')\"\n      >\n        {{ t(\"No advertising\") }}\n      </div>\n    </div>\n    <template v-if=\"!exclusive && (authenticated || notExclusive)\">\n      <div class=\"d-flex\">\n        <iframe\n          id=\"miniplayerIframe\"\n          title=\"Miniplayer\"\n          allowfullscreen=\"true\"\n          allow=\"clipboard-read; clipboard-write; autoplay\"\n          referrerpolicy=\"no-referrer-when-downgrade\"\n          frameborder=\"0\"\n          :src=\"iFrameSrc\"\n          width=\"100%\"\n          :height=\"iFrameHeight\"\n          class=\"max-iframe mx-3\"\n        />\n        <div class=\"d-flex flex-column flex-grow-1\">\n          <SharePlayerTypes\n            v-model:i-frame-model=\"iFrameModel\"\n            v-model:type-custom-player=\"typeCustomPlayer\"\n            :podcast=\"podcast\"\n            :emission=\"emission\"\n            :playlist=\"playlist\"\n            :organisation-id=\"organisationId\"\n            :is-live=\"isLiveReadyToRecord\"\n          />\n          <SharePlayerColors\n            v-model:color=\"color\"\n            v-model:theme=\"theme\"\n            class=\"mt-3\"\n          />\n          <PlayerParameters\n            v-model:display-article=\"displayArticle\"\n            v-model:display-transcript=\"displayTranscript\"\n            v-model:display-wave=\"displayWave\"\n            v-model:is-visible=\"isVisible\"\n            v-model:player-auto-play=\"playerAutoPlay\"\n            v-model:episodes-number=\"episodesNumber\"\n            v-model:insert-code=\"insertCode\"\n            v-model:auto-height=\"autoHeight\"\n            :display-is-visible=\"displayIsVisible\"\n            :is-podcast-not-visible=\"isPodcastNotVisible\"\n            :chose-number-episode=\"displayChoiceAllEpisodes\"\n            :display-choice-all-episodes=\"displayChoiceAllEpisodes\"\n            :display-transcript-param=\"displayTranscriptParam\"\n            :display-article-param=\"displayArticleParam\"\n            :display-wave-param=\"displayWaveParam\"\n            :display-insert-code=\"displayInsertCode\"\n            :display-auto-height=\"iFrameModel.toLowerCase().includes('large')\"\n            @episode-choice-display=\"episodeChoiceDisplay = $event\"\n          />\n\n          <ShareModalPlayer\n            v-if=\"isShareModal\"\n            :embed-link=\"iFrame\"\n            :embedly-link=\"iFrameSrc\"\n            :direct-link=\"podcast\"\n            @close=\"isShareModal = false\"\n          />\n          <button\n            class=\"btn btn-primary w-fit-content mt-3\"\n            @click=\"isShareModal = true\"\n          >\n            {{ t(\"Share the player\") }}\n          </button>\n        </div>\n      </div>\n    </template>\n    <div v-else-if=\"exclusive && authenticated\">\n      {{ t(\"Only organisation members can share the content\") }}\n    </div>\n    <div v-else-if=\"!authenticated\">\n      {{ t(\"Only authenticated members can share the content\") }}\n    </div>\n  </section>\n</template>\n\n<script setup lang=\"ts\">\nimport { Podcast } from \"@/stores/class/general/podcast\";\nimport { Emission } from \"@/stores/class/general/emission\";\nimport { Playlist } from \"@/stores/class/general/playlist\";\nimport { useAuthStore } from \"../../../stores/AuthStore\";\nimport { useApiStore } from \"../../../stores/ApiStore\";\nimport { useSaveFetchStore } from \"../../../stores/SaveFetchStore\";\nimport { defineAsyncComponent, ref, Ref, computed, onBeforeMount } from \"vue\";\nimport { useGeneralStore } from \"../../../stores/GeneralStore\";\nimport { useI18n } from \"vue-i18n\";\nconst ShareModalPlayer = defineAsyncComponent(\n  () => import(\"../../misc/modal/ShareModalPlayer.vue\"),\n);\nconst PlayerParameters = defineAsyncComponent(\n  () => import(\"./PlayerParameters.vue\"),\n);\nconst SharePlayerTypes = defineAsyncComponent(\n  () => import(\"./SharePlayerTypes.vue\"),\n);\nconst SharePlayerColors = defineAsyncComponent(\n  () => import(\"./SharePlayerColors.vue\"),\n);\n\n\n//Props \nconst props = defineProps({\n  podcast: { default: undefined, type: Object as () => Podcast },\n  emission: { default: undefined, type: Object as () => Emission },\n  playlist: { default: undefined, type: Object as () => Playlist },\n  organisationId: { default: undefined, type: String },\n  exclusive: { default: false, type: Boolean },\n  notExclusive: { default: true, type: Boolean },\n})\n\n//Data \nconst typeCustomPlayer = ref(\"\");\nconst iFrameModel = ref(\"default\");\nconst isShareModal = ref(false);\nconst color = ref(\"#40a372\");\nconst theme = ref(\"#000000\");\nconst episodeChoiceDisplay = ref(\"number\");\nconst episodesNumber = ref(3);\nconst isVisible = ref(false);\nconst displayArticle = ref(true);\nconst displayTranscript = ref(true);\nconst displayWave = ref(false);\nconst playerAutoPlay = ref(false);\nconst insertCode = ref(false);\nconst autoHeight = ref(false);\nconst orgaAttributes : Ref<{ [key: string]: string | number | boolean | undefined }| undefined>= ref(undefined);\n\n\n//Composables\nconst { t } = useI18n();\nconst authStore = useAuthStore();\nconst apiStore = useApiStore();\nconst generalStore = useGeneralStore();\nconst saveFetchStore = useSaveFetchStore();\n\n\n//Computed\nconst authenticated = computed(() => undefined !== authStore.authOrgaId);\nconst displayWaveParam = computed(() => \"default\" === iFrameModel.value || \"emission\" === iFrameModel.value);\nconst displayIsVisible = computed(() => displayChoiceAllEpisodes.value || isPodcastNotVisible.value);\nconst isPodcastNotVisible = computed(() => {\n  return (\n    undefined !== props.podcast &&\n    !props.podcast.availability.visibility &&\n    !isTypeEmission.value\n  );\n});\nconst displayArticleParam = computed(() => {\n  return (\n    undefined !== props.podcast &&\n    undefined !== props.podcast.article &&\n    0 !== props.podcast.article.length &&\n    (\"default\" === iFrameModel.value ||\n      \"large\" === iFrameModel.value ||\n      \"largeMore\" === iFrameModel.value)\n  );\n});\nconst displayInsertCode = computed(() => {\n  let orgaResourceId = \"\";\n  if (props.podcast) {\n    orgaResourceId = props.podcast.organisation.id;\n  }\n  if (props.emission) {\n    orgaResourceId = props.emission.orga.id;\n  }\n  if (props.playlist) {\n    orgaResourceId = props.playlist.organisation?.id ?? \"\";\n  }\n  return orgaResourceId === authStore.authOrgaId;\n});\nconst displayTranscriptParam = computed(() => isTranscriptionAuthorize.value && (isDefault.value || isEmission.value));\nconst isTranscriptionAuthorize = computed(() => {\n  if (!orgaAttributes.value) {\n    return false;\n  }\n  return orgaAttributes.value &&\n    Object.hasOwn(orgaAttributes.value, \"speechtotext.active\")\n    ? (orgaAttributes.value[\"speechtotext.active\"] as boolean)\n    : false;\n});\nconst displayChoiceAllEpisodes = computed(() => !props.podcast || isTypeEmission.value);\nconst isDefault = computed(() => \"default\" === iFrameModel.value);\nconst isEmission = computed(() => \"emission\" === iFrameModel.value);\nconst isLargeEmission = computed(() => \"emissionLarge\" === iFrameModel.value);\nconst isTypeEmission = computed(() => {\n  return (\n    isEmission.value ||\n    isLargeEmission.value ||\n    \"EMISSION\" === typeCustomPlayer.value\n  );\n});\nconst isLiveReadyToRecord = computed(() => {\n  if (props.podcast)\n    return (\n      undefined !== props.podcast.conferenceId &&\n      0 !== props.podcast.conferenceId &&\n      props.podcast.processingStatus === \"READY_TO_RECORD\"\n    );\n  return false;\n});\n\nconst noAd = computed(() => {\n  return (\n    (props.podcast?.organisation.id !== props.organisationId &&\n      \"NO\" === props.podcast?.monetisable) ||\n    (\"UNDEFINED\" === props.podcast?.monetisable &&\n      \"NO\" === props.podcast?.emission.monetisable)\n  );\n});\nconst iFrameSrc = computed(() => {\n  if (\"video\" === iFrameModel.value) {\n    return (\n      \"https://www.ultimedia.com/deliver/generic/iframe/mdtk/01009833/zone/1/showtitle/1/src/\" +\n      props.podcast?.video?.videoId +\n      \"/sound/true\"\n    );\n  }\n  let url = [\"\"];\n  const iFrameNumber =\n    displayChoiceAllEpisodes.value && \"all\" === episodeChoiceDisplay.value\n      ? \"/0\"\n      : \"/\" + episodesNumber.value;\n  url.push(`${apiStore.miniplayerUrl}miniplayer/`);\n  if (!props.podcast && !props.playlist && props.emission) {\n    url = constructEmissionUrl(url);\n  } else if (props.playlist) {\n    url = constructPlaylistUrl(url);\n  } else if (props.emission && props.podcast) {\n    url.push(`${iFrameModel.value}/`);\n    if (isTypeEmission.value) {\n      url.push(\n        `${props.emission.emissionId}${iFrameNumber}/${props.podcast.podcastId}`,\n      );\n    } else {\n      url.push(`${props.podcast.podcastId}`);\n    }\n  }\n\n  return addUrlParameters(url).join(\"\");\n});\nconst iFrameHeight = computed(() => {\n  switch (iFrameModel.value) {\n    case \"video\":\n      return \"281px\";\n    case \"large\":\n      if (props.podcast) return \"140px\";\n      return \"350px\";\n    case \"largeMore\":\n      return \"210px\";\n    case \"emissionLarge\":\n      return \"350px\";\n    case \"emission\":\n      return \"540px\";\n    case \"videoLive\":\n      return \"450px\";\n    default:\n      return \"540px\";\n  }\n});\nconst iFrame = computed(() => {\n  const specialDigiteka = props.podcast?.video?.videoId\n    ? 'allowfullscreen=\"true\" referrerpolicy=\"no-referrer-when-downgrade\"'\n    : \"\";\n  return `<iframe src=\"${iFrameSrc.value}\" width=\"100%\" height=\"${iFrameHeight.value}\" frameborder=\"0\" scrolling=\"no\" ${specialDigiteka} allow=\"clipboard-read; clipboard-write; autoplay\"></iframe>`;\n});\nconst dataTitle = computed(() => {\n  if (props.podcast) return props.podcast.podcastId;\n  if (props.emission) return props.emission.emissionId;\n  if (props.playlist) return props.playlist.playlistId;\n  return 0;\n});\n\n\nonBeforeMount(()=>initSharePlayer())\n\n\n//Methods\nasync function initSharePlayer() {\n  orgaAttributes.value = await saveFetchStore.getOrgaAttributes(authStore.authOrgaId ?? \"\");\n  initColor();\n  if (isLiveReadyToRecord.value) {\n    iFrameModel.value = \"large\";\n  }\n  if (\"true\" === props.podcast?.annotations?.[\"fromTTS\"]) {\n    displayTranscript.value = false;\n  }\n}\nfunction getIframeNumber(): string {\n  return displayChoiceAllEpisodes.value && \"all\" === episodeChoiceDisplay.value\n    ? \"/0\"\n    : \"/\" + episodesNumber.value;\n}\nfunction constructEmissionUrl(url: Array<string>) {\n  if (!props.emission) {\n    return [];\n  }\n  switch (iFrameModel.value) {\n    case \"default\":\n      url.push(\"emission\");\n      break;\n    case \"large\":\n      url.push(\"emissionLarge\");\n      break;\n    default:\n      url.push(`${iFrameModel.value}`);\n      break;\n  }\n  url.push(`/${props.emission.emissionId}${getIframeNumber()}`);\n  return url;\n}\nfunction constructPlaylistUrl(url: Array<string>) {\n  if (!props.playlist) {\n    return [];\n  }\n  switch (iFrameModel.value) {\n    case \"default\":\n      url.push(\"playlist\");\n      break;\n    case \"large\":\n      url.push(\"playlistLarge\");\n      break;\n    default:\n      url.push(`${iFrameModel.value}`);\n      break;\n  }\n  url.push(`/${props.playlist.playlistId}`);\n  return url;\n}\nfunction addUrlParameters(url: Array<string>) {\n  url.push(\"?distributorId=\" + props.organisationId);\n  url.push(\n    `&color=${color.value.substring(1)}&theme=${theme.value.substring(1)}`,\n  );\n  if (!displayArticle.value && displayArticleParam.value) {\n    url.push(\"&article=false\");\n  }\n  if (!displayTranscript.value) {\n    url.push(\"&transcript=false\");\n  }\n  if (!displayWave.value) {\n    url.push(\"&wave=false\");\n  }\n  if (playerAutoPlay.value) {\n    url.push(\"&autoplay=true\");\n  }\n  if (isVisible.value) {\n    url.push(\"&key=\" + window.btoa(dataTitle.value.toString()));\n  }\n  if (insertCode.value) {\n    url.push(\"&insertCode=true\");\n  }\n  if (autoHeight.value) {\n    url.push(\"&autoHeight=true\");\n  }\n  return url;\n}\nfunction initColor(): void {\n  if (!orgaAttributes.value) {\n    return;\n  }\n  color.value = Object.hasOwn(orgaAttributes.value, \"COLOR\")\n    ? (orgaAttributes.value.COLOR as string)\n    : \"#40a372\";\n  theme.value = Object.hasOwn(orgaAttributes.value, \"THEME\")\n    ? (orgaAttributes.value.THEME as string)\n    : \"#ffffff\";\n}\n</script>\n\n<style lang=\"scss\">\n\n@use \"../../../style/iframe\";\n\n.octopus-app {\n  .sticker {\n    align-self: center;\n    background: var(--octopus-primary);\n    padding: 0.5rem;\n    transition: all 0.5s ease;\n    color: white;\n    font-weight: bold;\n    letter-spacing: 1px;\n    box-shadow: 10px 10px 34px -15px var(--octopus-shadow);\n    border-radius: 255px 15px 225px 15px/15px 225px 15px 255px;\n    border: solid 2px var(--octopus-gray-text);\n\n    &:hover {\n      box-shadow: 2px 8px 4px -6px var(--octopus-shadow);\n      background: transparent;\n      color: var(--octopus-primary);\n    }\n  }\n}\n</style>\n","<template>\n  <section class=\"module-box overflow-visible\">\n    <div class=\"d-flex justify-content-between align-items-center\">\n      <h3 class=\"mb-3\">\n        {{ t(\"Embed\") }}\n      </h3>\n      <div\n        v-if=\"noAd && !generalStore.platformEducation\"\n        class=\"sticker\"\n        :title=\"t('You cannot insert advertising')\"\n      >\n        {{ t(\"No advertising\") }}\n      </div>\n    </div>\n    <template v-if=\"!exclusive && (authenticated || notExclusive)\">\n      <div class=\"d-flex\">\n        <iframe\n          id=\"miniplayerIframe\"\n          title=\"Miniplayer\"\n          allowfullscreen=\"true\"\n          allow=\"clipboard-read; clipboard-write; autoplay\"\n          referrerpolicy=\"no-referrer-when-downgrade\"\n          frameborder=\"0\"\n          :src=\"iFrameSrc\"\n          width=\"100%\"\n          :height=\"iFrameHeight\"\n          class=\"max-iframe mx-3\"\n        />\n        <div class=\"d-flex flex-column flex-grow-1\">\n          <SharePlayerTypes\n            v-model:i-frame-model=\"iFrameModel\"\n            v-model:type-custom-player=\"typeCustomPlayer\"\n            :podcast=\"podcast\"\n            :emission=\"emission\"\n            :playlist=\"playlist\"\n            :organisation-id=\"organisationId\"\n            :is-live=\"isLiveReadyToRecord\"\n          />\n          <SharePlayerColors\n            v-model:color=\"color\"\n            v-model:theme=\"theme\"\n            class=\"mt-3\"\n          />\n          <PlayerParameters\n            v-model:display-article=\"displayArticle\"\n            v-model:display-transcript=\"displayTranscript\"\n            v-model:display-wave=\"displayWave\"\n            v-model:is-visible=\"isVisible\"\n            v-model:player-auto-play=\"playerAutoPlay\"\n            v-model:episodes-number=\"episodesNumber\"\n            v-model:insert-code=\"insertCode\"\n            v-model:auto-height=\"autoHeight\"\n            :display-is-visible=\"displayIsVisible\"\n            :is-podcast-not-visible=\"isPodcastNotVisible\"\n            :chose-number-episode=\"displayChoiceAllEpisodes\"\n            :display-choice-all-episodes=\"displayChoiceAllEpisodes\"\n            :display-transcript-param=\"displayTranscriptParam\"\n            :display-article-param=\"displayArticleParam\"\n            :display-wave-param=\"displayWaveParam\"\n            :display-insert-code=\"displayInsertCode\"\n            :display-auto-height=\"iFrameModel.toLowerCase().includes('large')\"\n            @episode-choice-display=\"episodeChoiceDisplay = $event\"\n          />\n\n          <ShareModalPlayer\n            v-if=\"isShareModal\"\n            :embed-link=\"iFrame\"\n            :embedly-link=\"iFrameSrc\"\n            :direct-link=\"podcast\"\n            @close=\"isShareModal = false\"\n          />\n          <button\n            class=\"btn btn-primary w-fit-content mt-3\"\n            @click=\"isShareModal = true\"\n          >\n            {{ t(\"Share the player\") }}\n          </button>\n        </div>\n      </div>\n    </template>\n    <div v-else-if=\"exclusive && authenticated\">\n      {{ t(\"Only organisation members can share the content\") }}\n    </div>\n    <div v-else-if=\"!authenticated\">\n      {{ t(\"Only authenticated members can share the content\") }}\n    </div>\n  </section>\n</template>\n\n<script setup lang=\"ts\">\nimport { Podcast } from \"@/stores/class/general/podcast\";\nimport { Emission } from \"@/stores/class/general/emission\";\nimport { Playlist } from \"@/stores/class/general/playlist\";\nimport { useAuthStore } from \"../../../stores/AuthStore\";\nimport { useApiStore } from \"../../../stores/ApiStore\";\nimport { useSaveFetchStore } from \"../../../stores/SaveFetchStore\";\nimport { defineAsyncComponent, ref, Ref, computed, onBeforeMount } from \"vue\";\nimport { useGeneralStore } from \"../../../stores/GeneralStore\";\nimport { useI18n } from \"vue-i18n\";\nconst ShareModalPlayer = defineAsyncComponent(\n  () => import(\"../../misc/modal/ShareModalPlayer.vue\"),\n);\nconst PlayerParameters = defineAsyncComponent(\n  () => import(\"./PlayerParameters.vue\"),\n);\nconst SharePlayerTypes = defineAsyncComponent(\n  () => import(\"./SharePlayerTypes.vue\"),\n);\nconst SharePlayerColors = defineAsyncComponent(\n  () => import(\"./SharePlayerColors.vue\"),\n);\n\n\n//Props \nconst props = defineProps({\n  podcast: { default: undefined, type: Object as () => Podcast },\n  emission: { default: undefined, type: Object as () => Emission },\n  playlist: { default: undefined, type: Object as () => Playlist },\n  organisationId: { default: undefined, type: String },\n  exclusive: { default: false, type: Boolean },\n  notExclusive: { default: true, type: Boolean },\n})\n\n//Data \nconst typeCustomPlayer = ref(\"\");\nconst iFrameModel = ref(\"default\");\nconst isShareModal = ref(false);\nconst color = ref(\"#40a372\");\nconst theme = ref(\"#000000\");\nconst episodeChoiceDisplay = ref(\"number\");\nconst episodesNumber = ref(3);\nconst isVisible = ref(false);\nconst displayArticle = ref(true);\nconst displayTranscript = ref(true);\nconst displayWave = ref(false);\nconst playerAutoPlay = ref(false);\nconst insertCode = ref(false);\nconst autoHeight = ref(false);\nconst orgaAttributes : Ref<{ [key: string]: string | number | boolean | undefined }| undefined>= ref(undefined);\n\n\n//Composables\nconst { t } = useI18n();\nconst authStore = useAuthStore();\nconst apiStore = useApiStore();\nconst generalStore = useGeneralStore();\nconst saveFetchStore = useSaveFetchStore();\n\n\n//Computed\nconst authenticated = computed(() => undefined !== authStore.authOrgaId);\nconst displayWaveParam = computed(() => \"default\" === iFrameModel.value || \"emission\" === iFrameModel.value);\nconst displayIsVisible = computed(() => displayChoiceAllEpisodes.value || isPodcastNotVisible.value);\nconst isPodcastNotVisible = computed(() => {\n  return (\n    undefined !== props.podcast &&\n    !props.podcast.availability.visibility &&\n    !isTypeEmission.value\n  );\n});\nconst displayArticleParam = computed(() => {\n  return (\n    undefined !== props.podcast &&\n    undefined !== props.podcast.article &&\n    0 !== props.podcast.article.length &&\n    (\"default\" === iFrameModel.value ||\n      \"large\" === iFrameModel.value ||\n      \"largeMore\" === iFrameModel.value)\n  );\n});\nconst displayInsertCode = computed(() => {\n  let orgaResourceId = \"\";\n  if (props.podcast) {\n    orgaResourceId = props.podcast.organisation.id;\n  }\n  if (props.emission) {\n    orgaResourceId = props.emission.orga.id;\n  }\n  if (props.playlist) {\n    orgaResourceId = props.playlist.organisation?.id ?? \"\";\n  }\n  return orgaResourceId === authStore.authOrgaId;\n});\nconst displayTranscriptParam = computed(() => isTranscriptionAuthorize.value && (isDefault.value || isEmission.value));\nconst isTranscriptionAuthorize = computed(() => {\n  if (!orgaAttributes.value) {\n    return false;\n  }\n  return orgaAttributes.value &&\n    Object.hasOwn(orgaAttributes.value, \"speechtotext.active\")\n    ? (orgaAttributes.value[\"speechtotext.active\"] as boolean)\n    : false;\n});\nconst displayChoiceAllEpisodes = computed(() => !props.podcast || isTypeEmission.value);\nconst isDefault = computed(() => \"default\" === iFrameModel.value);\nconst isEmission = computed(() => \"emission\" === iFrameModel.value);\nconst isLargeEmission = computed(() => \"emissionLarge\" === iFrameModel.value);\nconst isTypeEmission = computed(() => {\n  return (\n    isEmission.value ||\n    isLargeEmission.value ||\n    \"EMISSION\" === typeCustomPlayer.value\n  );\n});\nconst isLiveReadyToRecord = computed(() => {\n  if (props.podcast)\n    return (\n      undefined !== props.podcast.conferenceId &&\n      0 !== props.podcast.conferenceId &&\n      props.podcast.processingStatus === \"READY_TO_RECORD\"\n    );\n  return false;\n});\n\nconst noAd = computed(() => {\n  return (\n    (props.podcast?.organisation.id !== props.organisationId &&\n      \"NO\" === props.podcast?.monetisable) ||\n    (\"UNDEFINED\" === props.podcast?.monetisable &&\n      \"NO\" === props.podcast?.emission.monetisable)\n  );\n});\nconst iFrameSrc = computed(() => {\n  if (\"video\" === iFrameModel.value) {\n    return (\n      \"https://www.ultimedia.com/deliver/generic/iframe/mdtk/01009833/zone/1/showtitle/1/src/\" +\n      props.podcast?.video?.videoId +\n      \"/sound/true\"\n    );\n  }\n  let url = [\"\"];\n  const iFrameNumber =\n    displayChoiceAllEpisodes.value && \"all\" === episodeChoiceDisplay.value\n      ? \"/0\"\n      : \"/\" + episodesNumber.value;\n  url.push(`${apiStore.miniplayerUrl}miniplayer/`);\n  if (!props.podcast && !props.playlist && props.emission) {\n    url = constructEmissionUrl(url);\n  } else if (props.playlist) {\n    url = constructPlaylistUrl(url);\n  } else if (props.emission && props.podcast) {\n    url.push(`${iFrameModel.value}/`);\n    if (isTypeEmission.value) {\n      url.push(\n        `${props.emission.emissionId}${iFrameNumber}/${props.podcast.podcastId}`,\n      );\n    } else {\n      url.push(`${props.podcast.podcastId}`);\n    }\n  }\n\n  return addUrlParameters(url).join(\"\");\n});\nconst iFrameHeight = computed(() => {\n  switch (iFrameModel.value) {\n    case \"video\":\n      return \"281px\";\n    case \"large\":\n      if (props.podcast) return \"140px\";\n      return \"350px\";\n    case \"largeMore\":\n      return \"210px\";\n    case \"emissionLarge\":\n      return \"350px\";\n    case \"emission\":\n      return \"540px\";\n    case \"videoLive\":\n      return \"450px\";\n    default:\n      return \"540px\";\n  }\n});\nconst iFrame = computed(() => {\n  const specialDigiteka = props.podcast?.video?.videoId\n    ? 'allowfullscreen=\"true\" referrerpolicy=\"no-referrer-when-downgrade\"'\n    : \"\";\n  return `<iframe src=\"${iFrameSrc.value}\" width=\"100%\" height=\"${iFrameHeight.value}\" frameborder=\"0\" scrolling=\"no\" ${specialDigiteka} allow=\"clipboard-read; clipboard-write; autoplay\"></iframe>`;\n});\nconst dataTitle = computed(() => {\n  if (props.podcast) return props.podcast.podcastId;\n  if (props.emission) return props.emission.emissionId;\n  if (props.playlist) return props.playlist.playlistId;\n  return 0;\n});\n\n\nonBeforeMount(()=>initSharePlayer())\n\n\n//Methods\nasync function initSharePlayer() {\n  orgaAttributes.value = await saveFetchStore.getOrgaAttributes(authStore.authOrgaId ?? \"\");\n  initColor();\n  if (isLiveReadyToRecord.value) {\n    iFrameModel.value = \"large\";\n  }\n  if (\"true\" === props.podcast?.annotations?.[\"fromTTS\"]) {\n    displayTranscript.value = false;\n  }\n}\nfunction getIframeNumber(): string {\n  return displayChoiceAllEpisodes.value && \"all\" === episodeChoiceDisplay.value\n    ? \"/0\"\n    : \"/\" + episodesNumber.value;\n}\nfunction constructEmissionUrl(url: Array<string>) {\n  if (!props.emission) {\n    return [];\n  }\n  switch (iFrameModel.value) {\n    case \"default\":\n      url.push(\"emission\");\n      break;\n    case \"large\":\n      url.push(\"emissionLarge\");\n      break;\n    default:\n      url.push(`${iFrameModel.value}`);\n      break;\n  }\n  url.push(`/${props.emission.emissionId}${getIframeNumber()}`);\n  return url;\n}\nfunction constructPlaylistUrl(url: Array<string>) {\n  if (!props.playlist) {\n    return [];\n  }\n  switch (iFrameModel.value) {\n    case \"default\":\n      url.push(\"playlist\");\n      break;\n    case \"large\":\n      url.push(\"playlistLarge\");\n      break;\n    default:\n      url.push(`${iFrameModel.value}`);\n      break;\n  }\n  url.push(`/${props.playlist.playlistId}`);\n  return url;\n}\nfunction addUrlParameters(url: Array<string>) {\n  url.push(\"?distributorId=\" + props.organisationId);\n  url.push(\n    `&color=${color.value.substring(1)}&theme=${theme.value.substring(1)}`,\n  );\n  if (!displayArticle.value && displayArticleParam.value) {\n    url.push(\"&article=false\");\n  }\n  if (!displayTranscript.value) {\n    url.push(\"&transcript=false\");\n  }\n  if (!displayWave.value) {\n    url.push(\"&wave=false\");\n  }\n  if (playerAutoPlay.value) {\n    url.push(\"&autoplay=true\");\n  }\n  if (isVisible.value) {\n    url.push(\"&key=\" + window.btoa(dataTitle.value.toString()));\n  }\n  if (insertCode.value) {\n    url.push(\"&insertCode=true\");\n  }\n  if (autoHeight.value) {\n    url.push(\"&autoHeight=true\");\n  }\n  return url;\n}\nfunction initColor(): void {\n  if (!orgaAttributes.value) {\n    return;\n  }\n  color.value = Object.hasOwn(orgaAttributes.value, \"COLOR\")\n    ? (orgaAttributes.value.COLOR as string)\n    : \"#40a372\";\n  theme.value = Object.hasOwn(orgaAttributes.value, \"THEME\")\n    ? (orgaAttributes.value.THEME as string)\n    : \"#ffffff\";\n}\n</script>\n\n<style lang=\"scss\">\n\n@use \"../../../style/iframe\";\n\n.octopus-app {\n  .sticker {\n    align-self: center;\n    background: var(--octopus-primary);\n    padding: 0.5rem;\n    transition: all 0.5s ease;\n    color: white;\n    font-weight: bold;\n    letter-spacing: 1px;\n    box-shadow: 10px 10px 34px -15px var(--octopus-shadow);\n    border-radius: 255px 15px 225px 15px/15px 225px 15px 255px;\n    border: solid 2px var(--octopus-gray-text);\n\n    &:hover {\n      box-shadow: 2px 8px 4px -6px var(--octopus-shadow);\n      background: transparent;\n      color: var(--octopus-primary);\n    }\n  }\n}\n</style>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAmGA,MAAM,mBAAmB,2BACjB,OAAO,kCACf;EACA,MAAM,mBAAmB,2BACjB,OAAO,kCACf;EACA,MAAM,mBAAmB,2BACjB,OAAO,kCACf;EACA,MAAM,oBAAoB,2BAClB,OAAO,mCACf;EAIA,MAAM,QAAQ;EAUd,MAAM,mBAAmB,IAAI,EAAE;EAC/B,MAAM,cAAc,IAAI,SAAS;EACjC,MAAM,eAAe,IAAI,KAAK;EAC9B,MAAM,QAAQ,IAAI,SAAS;EAC3B,MAAM,QAAQ,IAAI,SAAS;EAC3B,MAAM,uBAAuB,IAAI,QAAQ;EACzC,MAAM,iBAAiB,IAAI,CAAC;EAC5B,MAAM,YAAY,IAAI,KAAK;EAC3B,MAAM,iBAAiB,IAAI,IAAI;EAC/B,MAAM,oBAAoB,IAAI,IAAI;EAClC,MAAM,cAAc,IAAI,KAAK;EAC7B,MAAM,iBAAiB,IAAI,KAAK;EAChC,MAAM,aAAa,IAAI,KAAK;EAC5B,MAAM,aAAa,IAAI,KAAK;EAC5B,MAAM,iBAA2F,IAAI,KAAA,CAAS;EAI9G,MAAM,EAAE,MAAM,QAAQ;EACtB,MAAM,YAAY,aAAa;EAC/B,MAAM,WAAW,YAAY;EAC7B,MAAM,eAAe,gBAAgB;EACrC,MAAM,iBAAiB,kBAAkB;EAIzC,MAAM,gBAAgB,eAAe,KAAA,MAAc,UAAU,UAAU;EACvE,MAAM,mBAAmB,eAAe,cAAc,YAAY,SAAS,eAAe,YAAY,KAAK;EAC3G,MAAM,mBAAmB,eAA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