@clickview/streamable-learning 0.48.0-rc.1 → 0.48.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.
Files changed (115) hide show
  1. package/dist/.vite/manifest.json +605 -605
  2. package/dist/bundles.json +1 -1
  3. package/dist/en.json +1 -1
  4. package/dist/scripts/{CN8PeBwg.chunk.js → BIisq8ZO.chunk.js} +2 -2
  5. package/dist/scripts/{CN8PeBwg.chunk.js.map → BIisq8ZO.chunk.js.map} +1 -1
  6. package/dist/scripts/{BaMNOAYj2.chunk.js → BWU6_pPN2.chunk.js} +2 -2
  7. package/dist/scripts/{BaMNOAYj2.chunk.js.map → BWU6_pPN2.chunk.js.map} +1 -1
  8. package/dist/scripts/{BvJXPFoz2.chunk.js → BcZFo9Vw2.chunk.js} +2 -2
  9. package/dist/scripts/{BvJXPFoz2.chunk.js.map → BcZFo9Vw2.chunk.js.map} +1 -1
  10. package/dist/scripts/Bd2bbHru.chunk.js +1 -0
  11. package/dist/scripts/{CkYqp83j.chunk.js → BfNy0Hvk.chunk.js} +2 -2
  12. package/dist/scripts/{CkYqp83j.chunk.js.map → BfNy0Hvk.chunk.js.map} +1 -1
  13. package/dist/scripts/{D0SYGnyF.chunk.js → BivP7X20.chunk.js} +2 -2
  14. package/dist/scripts/{D0SYGnyF.chunk.js.map → BivP7X20.chunk.js.map} +1 -1
  15. package/dist/scripts/{BihZ4r0z2.chunk.js → BjbY4Fbp2.chunk.js} +3 -3
  16. package/dist/scripts/{BihZ4r0z2.chunk.js.map → BjbY4Fbp2.chunk.js.map} +1 -1
  17. package/dist/scripts/{DO8_mR5i2.chunk.js → BmxcE73n2.chunk.js} +2 -2
  18. package/dist/scripts/{DO8_mR5i2.chunk.js.map → BmxcE73n2.chunk.js.map} +1 -1
  19. package/dist/scripts/{bycmewy72.chunk.js → BnEMhkEE2.chunk.js} +2 -2
  20. package/dist/scripts/{bycmewy72.chunk.js.map → BnEMhkEE2.chunk.js.map} +1 -1
  21. package/dist/scripts/{jWpq99N3.chunk.js → Buc8GegC.chunk.js} +2 -2
  22. package/dist/scripts/{jWpq99N3.chunk.js.map → Buc8GegC.chunk.js.map} +1 -1
  23. package/dist/scripts/{CrCAJmt6.chunk.js → Byczy1lS.chunk.js} +2 -2
  24. package/dist/scripts/{CrCAJmt6.chunk.js.map → Byczy1lS.chunk.js.map} +1 -1
  25. package/dist/scripts/{BZOcEcTA2.chunk.js → C2itEpvc2.chunk.js} +2 -2
  26. package/dist/scripts/{BZOcEcTA2.chunk.js.map → C2itEpvc2.chunk.js.map} +1 -1
  27. package/dist/scripts/{smdLElLq.chunk.js → CEFKXxac.chunk.js} +2 -2
  28. package/dist/scripts/{smdLElLq.chunk.js.map → CEFKXxac.chunk.js.map} +1 -1
  29. package/dist/scripts/{B-qOny0I2.chunk.js → CEYjJAp52.chunk.js} +2 -2
  30. package/dist/scripts/{B-qOny0I2.chunk.js.map → CEYjJAp52.chunk.js.map} +1 -1
  31. package/dist/scripts/{CNJrD44-2.chunk.js → CJSc4YDq2.chunk.js} +2 -2
  32. package/dist/scripts/{CNJrD44-2.chunk.js.map → CJSc4YDq2.chunk.js.map} +1 -1
  33. package/dist/scripts/{Br0Uc4GG.chunk.js → CKUA5J3R.chunk.js} +2 -2
  34. package/dist/scripts/{Br0Uc4GG.chunk.js.map → CKUA5J3R.chunk.js.map} +1 -1
  35. package/dist/scripts/{CWFInhB82.chunk.js → CYrzupmS2.chunk.js} +2 -2
  36. package/dist/scripts/{CWFInhB82.chunk.js.map → CYrzupmS2.chunk.js.map} +1 -1
  37. package/dist/scripts/{Llxar-VU.chunk.js → CcGYZb9f.chunk.js} +2 -2
  38. package/dist/scripts/{Llxar-VU.chunk.js.map → CcGYZb9f.chunk.js.map} +1 -1
  39. package/dist/scripts/{BTYwcYPL2.chunk.js → CeQGaFi-2.chunk.js} +2 -2
  40. package/dist/scripts/{BTYwcYPL2.chunk.js.map → CeQGaFi-2.chunk.js.map} +1 -1
  41. package/dist/scripts/{D7tastET2.chunk.js → Cr3Blj6H2.chunk.js} +2 -2
  42. package/dist/scripts/{D7tastET2.chunk.js.map → Cr3Blj6H2.chunk.js.map} +1 -1
  43. package/dist/scripts/{Dr1flAez.chunk.js → CxCkwLio.chunk.js} +2 -2
  44. package/dist/scripts/{Dr1flAez.chunk.js.map → CxCkwLio.chunk.js.map} +1 -1
  45. package/dist/scripts/{DyT1OGvP2.chunk.js → Cxj75Dqe2.chunk.js} +2 -2
  46. package/dist/scripts/{DyT1OGvP2.chunk.js.map → Cxj75Dqe2.chunk.js.map} +1 -1
  47. package/dist/scripts/{CsC3VVvE2.chunk.js → D-VNmhoM2.chunk.js} +2 -2
  48. package/dist/scripts/{CsC3VVvE2.chunk.js.map → D-VNmhoM2.chunk.js.map} +1 -1
  49. package/dist/scripts/{CKdklY2o2.chunk.js → D2FqnK9m2.chunk.js} +2 -2
  50. package/dist/scripts/{CKdklY2o2.chunk.js.map → D2FqnK9m2.chunk.js.map} +1 -1
  51. package/dist/scripts/{qcrBN1zR2.chunk.js → D3sdyN2Q2.chunk.js} +2 -2
  52. package/dist/scripts/{qcrBN1zR2.chunk.js.map → D3sdyN2Q2.chunk.js.map} +1 -1
  53. package/dist/scripts/{Ce1TZZdV2.chunk.js → D6IzS-bj2.chunk.js} +2 -2
  54. package/dist/scripts/{Ce1TZZdV2.chunk.js.map → D6IzS-bj2.chunk.js.map} +1 -1
  55. package/dist/scripts/{B703cBe72.chunk.js → D8g6nOG92.chunk.js} +2 -2
  56. package/dist/scripts/{B703cBe72.chunk.js.map → D8g6nOG92.chunk.js.map} +1 -1
  57. package/dist/scripts/{CCoZQmgX.chunk.js → DCKKwz9L.chunk.js} +2 -2
  58. package/dist/scripts/{CCoZQmgX.chunk.js.map → DCKKwz9L.chunk.js.map} +1 -1
  59. package/dist/scripts/{DIavEegC.chunk.js → DL4UFxRK.chunk.js} +2 -2
  60. package/dist/scripts/{DIavEegC.chunk.js.map → DL4UFxRK.chunk.js.map} +1 -1
  61. package/dist/scripts/{C5i1HsPp2.chunk.js → DLofRa642.chunk.js} +2 -2
  62. package/dist/scripts/{C5i1HsPp2.chunk.js.map → DLofRa642.chunk.js.map} +1 -1
  63. package/dist/scripts/{B5jBIPaP.chunk.js → DMZ--ok1.chunk.js} +2 -2
  64. package/dist/scripts/{B5jBIPaP.chunk.js.map → DMZ--ok1.chunk.js.map} +1 -1
  65. package/dist/scripts/{CUUUI6pl.chunk.js → DQFcbMMk.chunk.js} +2 -2
  66. package/dist/scripts/{CUUUI6pl.chunk.js.map → DQFcbMMk.chunk.js.map} +1 -1
  67. package/dist/scripts/{Dj4AeYQQ2.chunk.js → DVeqPzBe2.chunk.js} +2 -2
  68. package/dist/scripts/{Dj4AeYQQ2.chunk.js.map → DVeqPzBe2.chunk.js.map} +1 -1
  69. package/dist/scripts/{CGxa1Jzq.chunk.js → DWerltCT.chunk.js} +2 -2
  70. package/dist/scripts/{CGxa1Jzq.chunk.js.map → DWerltCT.chunk.js.map} +1 -1
  71. package/dist/scripts/{CbLL7dIz2.chunk.js → DatscYpA2.chunk.js} +2 -2
  72. package/dist/scripts/{CbLL7dIz2.chunk.js.map → DatscYpA2.chunk.js.map} +1 -1
  73. package/dist/scripts/{DwzBzBlI2.chunk.js → DkaGC5IU2.chunk.js} +2 -2
  74. package/dist/scripts/{DwzBzBlI2.chunk.js.map → DkaGC5IU2.chunk.js.map} +1 -1
  75. package/dist/scripts/{BLrjbrp8.chunk.js → DqZWSPDJ.chunk.js} +2 -2
  76. package/dist/scripts/{BLrjbrp8.chunk.js.map → DqZWSPDJ.chunk.js.map} +1 -1
  77. package/dist/scripts/{BKnxYKDu2.chunk.js → Dql-1E6g2.chunk.js} +2 -2
  78. package/dist/scripts/{BKnxYKDu2.chunk.js.map → Dql-1E6g2.chunk.js.map} +1 -1
  79. package/dist/scripts/{B7iwtSij.chunk.js → DuBHin02.chunk.js} +2 -2
  80. package/dist/scripts/{B7iwtSij.chunk.js.map → DuBHin02.chunk.js.map} +1 -1
  81. package/dist/scripts/{BpgHKWR52.chunk.js → QMuFwiiF2.chunk.js} +2 -2
  82. package/dist/scripts/{BpgHKWR52.chunk.js.map → QMuFwiiF2.chunk.js.map} +1 -1
  83. package/dist/scripts/{Ces-KTwe.chunk.js → U_sIlzAD.chunk.js} +2 -2
  84. package/dist/scripts/{Ces-KTwe.chunk.js.map → U_sIlzAD.chunk.js.map} +1 -1
  85. package/dist/scripts/{ACTQklJQ.chunk.js → WLyOm9Lj.chunk.js} +2 -2
  86. package/dist/scripts/{ACTQklJQ.chunk.js.map → WLyOm9Lj.chunk.js.map} +1 -1
  87. package/dist/scripts/{DR80oZtZ.chunk.js → Ymq7JLkU.chunk.js} +2 -2
  88. package/dist/scripts/{DR80oZtZ.chunk.js.map → Ymq7JLkU.chunk.js.map} +1 -1
  89. package/dist/scripts/{app-BIigh9wv.js → app-gjHxcZG3.js} +4 -4
  90. package/dist/scripts/app-gjHxcZG3.js.map +1 -0
  91. package/dist/scripts/{CNmmq34f.chunk.js → djRnI462.chunk.js} +2 -2
  92. package/dist/scripts/{CNmmq34f.chunk.js.map → djRnI462.chunk.js.map} +1 -1
  93. package/dist/scripts/{oTYyWWB-.chunk.js → e2K2YU7z.chunk.js} +2 -2
  94. package/dist/scripts/{oTYyWWB-.chunk.js.map → e2K2YU7z.chunk.js.map} +1 -1
  95. package/dist/scripts/{BxypZGPK.chunk.js → fnfhCa1P.chunk.js} +2 -2
  96. package/dist/scripts/{BxypZGPK.chunk.js.map → fnfhCa1P.chunk.js.map} +1 -1
  97. package/dist/scripts/{BsAo7Lri2.chunk.js → iyIL3kim2.chunk.js} +2 -2
  98. package/dist/scripts/{BsAo7Lri2.chunk.js.map → iyIL3kim2.chunk.js.map} +1 -1
  99. package/dist/scripts/{DK3xia1t.chunk.js → kfFYr9dc.chunk.js} +2 -2
  100. package/dist/scripts/{DK3xia1t.chunk.js.map → kfFYr9dc.chunk.js.map} +1 -1
  101. package/dist/scripts/{BXJetawx2.chunk.js → kts5xiiM2.chunk.js} +2 -2
  102. package/dist/scripts/{BXJetawx2.chunk.js.map → kts5xiiM2.chunk.js.map} +1 -1
  103. package/dist/scripts/{tYi-sUb22.chunk.js → lLAYbgAy2.chunk.js} +2 -2
  104. package/dist/scripts/{tYi-sUb22.chunk.js.map → lLAYbgAy2.chunk.js.map} +1 -1
  105. package/dist/scripts/{BCBfXCYM2.chunk.js → p9ukva5a2.chunk.js} +2 -2
  106. package/dist/scripts/{BCBfXCYM2.chunk.js.map → p9ukva5a2.chunk.js.map} +1 -1
  107. package/dist/scripts/{DKnZ8BaN.chunk.js → wOeN2ls0.chunk.js} +2 -2
  108. package/dist/scripts/{DKnZ8BaN.chunk.js.map → wOeN2ls0.chunk.js.map} +1 -1
  109. package/dist/scripts/{DU1SE31v2.chunk.js → zp2BHOp82.chunk.js} +2 -2
  110. package/dist/scripts/{DU1SE31v2.chunk.js.map → zp2BHOp82.chunk.js.map} +1 -1
  111. package/dist/scripts/{DnSy_Myx.chunk.js → zyVwH8JF.chunk.js} +2 -2
  112. package/dist/scripts/{DnSy_Myx.chunk.js.map → zyVwH8JF.chunk.js.map} +1 -1
  113. package/package.json +1 -1
  114. package/dist/scripts/C4MLxDS-.chunk.js +0 -1
  115. package/dist/scripts/app-BIigh9wv.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"D7tastET2.chunk.js","names":[],"sources":["../../../../libs/shared/src/flight-requests/PreferenceRequests.ts","../../src/apps/videos/hooks/useCurriculums.ts"],"sourcesContent":["import { HttpVerbs } from 'libs/common/backbone/enums/HttpVerbs';\nimport { UrlHelper } from 'libs/common/backbone/utils/UrlHelper';\nimport { Flight } from 'libs/common/flight';\n\nimport { SharedWithStatements } from 'libs/shared/constants/WithStatements';\nimport { PresentationType } from 'libs/shared/enums/PresentationType';\nimport { Presentation, PresentationAudience } from 'libs/shared/interfaces';\n\nconst classificationQuery = SharedWithStatements.CLASSIFICATION_COLLECTION;\n\nconst endpoints = {\n // Subjects\n allSubjectPreferences: () => `{gateway}/v1/users/me/classifications/preferences?query=${classificationQuery}&type=subject`,\n mySubjectPreferences: () => `{gateway}/v1/users/me/classifications/following?query=${classificationQuery}`,\n followSubjects: () => '{gateway}/v1/users/me/classifications/following',\n unfollowSubjects: (ids: string[]) => UrlHelper.urlBuilder('{gateway}/v1/users/me/classifications/following', { id: ids }),\n\n // Levels\n allLevelPreferences: () => `{gateway}/v1/users/me/audiences?type=subject`,\n myLevelPreferences: () => `{gateway}/v1/users/me/audiences/following`,\n followLevels: () => `{gateway}/v1/users/me/audiences/following`,\n unfollowLevels: (ids: string[]) => UrlHelper.urlBuilder('{gateway}/v1/users/me/audiences/following', { id: ids }),\n\n getCurrentPresentations: (type?: PresentationType) =>\n `{gateway}/v1/users/me/presentations${type ? `?type=${type}` : ''}`,\n getAvailablePresentations: (type?: PresentationType) =>\n `{gateway}/v1/users/me/presentations/available${type ? `?type=${type}` : ''}`,\n setPresentation: (id: string) => `{gateway}/v1/users/me/presentations/${id}`\n};\n\nexport const PreferenceRequests = {\n /**\n * Presentations\n */\n\n availablePresentations(type?: PresentationType): Flight.Request {\n return {\n url: endpoints.getAvailablePresentations(type),\n key: `available:presentations:${type}`,\n normalizeOptions: {\n namespace: 'presentation'\n }\n };\n },\n\n setPresentation(\n presentation: Presentation,\n type: PresentationType,\n success?: () => void,\n error?: () => void\n ): Flight.Request {\n return {\n url: endpoints.setPresentation(presentation.id),\n key: `set:${type}:presentation`,\n type: HttpVerbs.POST,\n data: {},\n normalizeOptions: {\n namespace: 'presentation'\n },\n invalidationKeys: [\n `current:presentation:${type.toLocaleLowerCase()}`,\n 'subject:preference:options',\n 'my:subject:preferences',\n 'level:preference:options',\n 'my:level:preferences',\n 'classifications',\n 'presentation:audiences',\n 'widgets:v3',\n 'content:update:videos',\n 'content:updates'\n ],\n success,\n error\n };\n },\n\n /**\n * Subjects\n */\n allSubjectPreferences(): Flight.Request {\n return {\n url: endpoints.allSubjectPreferences(),\n key: `subject:preference:options`\n };\n },\n\n mySubjectPreferences(success?: (data: any) => void): Flight.Request {\n return {\n url: endpoints.mySubjectPreferences(),\n key: `my:subject:preferences`,\n normalize: false,\n success\n };\n },\n\n followSubjects(\n subjectIds: string[],\n success?: () => void,\n error?: () => void,\n always?: () => void\n ): Flight.Request {\n return {\n url: endpoints.followSubjects(),\n key: `follow:subjects`,\n data: subjectIds,\n type: HttpVerbs.POST,\n success,\n error,\n always,\n invalidationKeys: [ ...subjectIds.map(id => `classification:${id}`), 'my:subject:preferences', 'classifications', 'content:updates' ]\n };\n },\n\n unfollowSubjects(\n subjectIds: string[],\n success?: () => void,\n error?: () => void,\n always?: () => void\n ): Flight.Request {\n return {\n url: endpoints.unfollowSubjects(subjectIds),\n key: `unfollow:subjects`,\n type: HttpVerbs.DELETE,\n success,\n error,\n always,\n invalidationKeys: [ ...subjectIds.map(id => `classification:${id}`), 'my:subject:preferences', 'classifications', 'content:updates' ]\n };\n },\n\n /**\n * Levels\n */\n allLevelPreferences(): Flight.Request {\n return {\n url: endpoints.allLevelPreferences(),\n key: `level:preference:options`,\n normalize: false\n };\n },\n\n myLevelPreferences(success?: (data: any) => void): Flight.Request {\n return {\n url: endpoints.myLevelPreferences(),\n key: `my:level:preferences`,\n normalizeOptions: {\n idAttribute: 'masterId'\n },\n success\n };\n },\n\n followLevels(\n levels: PresentationAudience[],\n success?: () => void,\n error?: () => void,\n always?: () => void\n ): Flight.Request {\n return {\n url: endpoints.followLevels(),\n key: `follow:levels`,\n data: levels.map(l => l.masterId),\n normalize: false,\n // Update the store to immediately reflect changes\n updateState: {\n keys: 'my:level:preferences',\n updateData: storeData => {\n const preferences = storeData['my:level:preferences'] ?? [] as PresentationAudience[];\n\n levels.forEach(newLevel => {\n if (preferences.find((p: PresentationAudience) => p.masterId === newLevel.masterId))\n return;\n\n preferences.push(newLevel);\n });\n\n return {\n 'my:level:preferences': preferences\n };\n }\n },\n type: HttpVerbs.POST,\n success,\n error,\n always\n };\n },\n\n unfollowLevels(\n levels: PresentationAudience[],\n success?: () => void,\n error?: () => void,\n always?: () => void\n ): Flight.Request {\n return {\n url: endpoints.unfollowLevels(levels.map(l => l.masterId)),\n key: `unfollow:levels`,\n normalize: false,\n // Update the store to immediately reflect changes\n updateState: {\n keys: 'my:level:preferences',\n updateData: storeData => {\n let preferences = storeData['my:level:preferences'] ?? [] as PresentationAudience[];\n\n levels.forEach(oldLevel => {\n if (!preferences.find((p: PresentationAudience) => p.masterId === oldLevel.masterId))\n return;\n\n const idxOfValue = preferences.findIndex((p: PresentationAudience) => p.masterId === oldLevel.masterId);\n\n preferences = [ ...preferences.slice(0, idxOfValue), ...preferences.slice(idxOfValue + 1) ];\n });\n\n return {\n 'my:level:preferences': preferences\n };\n }\n },\n type: HttpVerbs.DELETE,\n success,\n error,\n always\n };\n }\n};\n","import React from 'react';\n\nimport { LanguageService } from 'libs/common/backbone/services/LanguageService';\nimport { StorageType } from 'libs/common/backbone/utils/LocalStorageHelper';\nimport { Flight } from 'libs/common/flight';\nimport { useViewModel } from 'libs/common/react/hooks/UseViewModel';\nimport { ArrayHelper } from 'libs/common/react/utils/ArrayHelper';\n\nimport { AnalyticsHelper } from 'libs/analytics/AnalyticsHelper';\nimport { EntityType, HashObject, PresentationDescriptor, UserAction } from 'libs/analytics/interfaces';\n\nimport { SharedViewModelKeys } from 'libs/shared/constants/SharedViewModelKeys';\nimport { LocalPermissionName } from 'libs/shared/enums/PermissionName';\nimport { PresentationType } from 'libs/shared/enums/PresentationType';\nimport { ClassificationRequests } from 'libs/shared/flight-requests/ClassificationRequests';\nimport { PreferenceRequests } from 'libs/shared/flight-requests/PreferenceRequests';\nimport { UserRequests } from 'libs/shared/flight-requests/UserRequests';\nimport { useAlerts } from 'libs/shared/hooks/UseAlerts';\nimport { usePermissions } from 'libs/shared/hooks/usePermissions';\nimport { CurrentUser, Curriculum, CurriculumAnalyticsOptions, CurriculumData, Presentation } from 'libs/shared/interfaces';\n\nconst namespace = 'videos.hooks';\n\nconst curriculumLinksCache = new Map<string, Curriculum[][]>();\n\nexport const useCurriculums = (videoId?: string): CurriculumData => {\n function getPublicPresentationLocalStorageKey(type: PresentationType): string {\n return `${type.toLowerCase()}:${SharedViewModelKeys.PRESENTATION_ID}`;\n }\n\n const [ publicPresentationId, setPublicPresentationId ] = useViewModel<string>(\n getPublicPresentationLocalStorageKey(PresentationType.Curriculum),\n undefined,\n { storage: StorageType.LocalStorage }\n );\n\n const [ activeCurriculum, setActiveCurriculum ] = React.useState<Presentation>(null);\n const [ curriculumLinks, setCurriculumLinks ] = React.useState<Curriculum[][]>(null);\n const [ isFetching, setIsFetching ] = React.useState<boolean>(false);\n\n const currentUser = Flight.useBasicFetch<CurrentUser>(UserRequests.currentUser());\n const availableCurriculums = Flight.useBasicFetch<Presentation[]>(\n ClassificationRequests.availablePresentations(PresentationType.Curriculum)\n );\n\n const fetchAsync = Flight.useGetFetchAsync();\n const alerts = useAlerts();\n const { hasLocalPermissions } = usePermissions();\n const canManagePublicPresentation = hasLocalPermissions(LocalPermissionName.ManagePublicPresentation);\n \n function getAnonPresentationId(): string {\n /**\n * Where a public user has already nominated a presentation and \n * it's persisted in LocalStorage retrieve that.\n */\n const hasValidPublicPresentationId = !isNaN(+publicPresentationId);\n if (hasValidPublicPresentationId)\n return publicPresentationId;\n\n /**\n * Where the public user has yet to nominate a presentation, we'll preload with a Level 1 presentation\n * They'll be prompted to select a presentation\n */\n return ArrayHelper.first(availableCurriculums.data)?.id;\n }\n\n function getPreferredCurriculumRequest() {\n if (currentUser.data?.isAuthenticated)\n return ClassificationRequests.presentation(PresentationType.Curriculum);\n\n const anonPresentationId = getAnonPresentationId();\n\n if (!anonPresentationId)\n return null;\n\n return ClassificationRequests.presentationById(anonPresentationId);\n }\n\n const preferredCurriculum = Flight.useBasicFetch<Presentation>(getPreferredCurriculumRequest());\n\n React.useEffect(() => {\n if (!preferredCurriculum.data)\n return;\n\n setActiveCurriculum(preferredCurriculum.data);\n\n if (videoId && !curriculumLinks) {\n fetchAsync<Curriculum[][]>(ClassificationRequests.curriculumLinks(videoId, preferredCurriculum.data?.id))\n .then(links => {\n setCurriculumLinks(links);\n curriculumLinksCache.set(preferredCurriculum.data?.id?.toString(), links);\n });\n }\n }, [preferredCurriculum.data?.id]);\n \n const availableCurriculumIds = availableCurriculums.data?.map(c => c.id) ?? [];\n\n const mappedCurriculums = Flight.useBasicFetch<Presentation[]>(\n videoId &&\n availableCurriculumIds.length &&\n ClassificationRequests.getMappedCurriculums(\n videoId,\n availableCurriculumIds\n )\n );\n\n async function updateCurriculum(\n curriculumId: string,\n analyticsOptions: CurriculumAnalyticsOptions\n ): Promise<void> {\n if (activeCurriculum.id.toString() === curriculumId.toString())\n return;\n\n const curriculum = availableCurriculums.data.find(c => c.id.toString() === curriculumId.toString());\n\n setActiveCurriculum(curriculum);\n\n /**\n * In a public context, we'll persist the selected presentation's id to Local Storage\n */\n if (canManagePublicPresentation)\n setPublicPresentationId(curriculumId);\n\n try {\n if (videoId)\n await updateCurriculumLinks(curriculumId);\n\n if (canManagePublicPresentation)\n return;\n\n await fetchAsync(\n PreferenceRequests.setPresentation(curriculum, PresentationType.Curriculum)\n );\n\n logCurriculumChangeEvent(curriculum, analyticsOptions);\n } catch {\n alerts.error(LanguageService.getPhrase(namespace, 'curriculumUpdateError'));\n\n // If we fail to update, rollback to the previous curriculum\n setActiveCurriculum(activeCurriculum);\n }\n }\n\n async function updateCurriculumLinks(curriculumId: string) {\n if (!videoId)\n return;\n\n // If we've already fetched the links for this curriculum, use the cached data\n if (curriculumLinksCache.has(curriculumId.toString())) {\n setCurriculumLinks(curriculumLinksCache.get(curriculumId.toString()));\n return;\n }\n \n // If we don't have any curriculums mapped to our video, set the links to an empty array\n if (!mappedCurriculums.data.find(c => c.id.toString() === curriculumId.toString())) {\n setCurriculumLinks([]);\n return;\n }\n\n // Fetch the curriculum links for our video\n setIsFetching(true);\n\n const links = await fetchAsync<Curriculum[][]>(\n ClassificationRequests.curriculumLinks(videoId, curriculumId)\n );\n\n setCurriculumLinks(links);\n curriculumLinksCache.set(curriculumId.toString(), links);\n\n setIsFetching(false);\n }\n\n function logCurriculumChangeEvent(curriculum: Presentation, analyticsOptions: CurriculumAnalyticsOptions): void {\n if (!analyticsOptions.shouldLog)\n return;\n\n const analyticsData: HashObject = {\n id: curriculum.id,\n name: curriculum.id,\n description: curriculum.description\n };\n\n if (analyticsOptions.video) {\n analyticsData.videoId = analyticsOptions.video.id;\n analyticsData.videoName = analyticsOptions.video.name;\n }\n\n AnalyticsHelper.logUserAction(analyticsData, {\n entity: EntityType.Presentation,\n actionType: UserAction.Select,\n descriptor: PresentationDescriptor.Curriculum,\n location: analyticsOptions.locationContext\n });\n }\n\n function hasCompleted(): boolean {\n if (!activeCurriculum)\n return false;\n\n if (!videoId)\n return true;\n\n return !!curriculumLinks && mappedCurriculums.hasCompleted;\n }\n\n return {\n preferredCurriculum: activeCurriculum || preferredCurriculum.data,\n curriculumLinks: curriculumLinks || [],\n availableCurriculums: availableCurriculums.data || [],\n mappedCurriculums: mappedCurriculums.data || [],\n updateCurriculum,\n hasCompleted: hasCompleted(),\n isFetching\n };\n};\n"],"mappings":"qoBAQA,IAAM,EAAsB,EAAqB,0BAE3C,EAAY,CAEhB,0BAA6B,2DAA2D,EAAoB,eAC5G,yBAA4B,yDAAyD,IACrF,mBAAsB,kDACtB,iBAAmB,GAAkB,EAAU,WAAW,kDAAmD,CAAE,GAAI,EAAK,CAAC,CAGzH,wBAA2B,+CAC3B,uBAA0B,4CAC1B,iBAAoB,4CACpB,eAAiB,GAAkB,EAAU,WAAW,4CAA6C,CAAE,GAAI,EAAK,CAAC,CAEjH,wBAA0B,GACxB,sCAAsC,EAAO,SAAS,IAAS,KACjE,0BAA4B,GAC1B,gDAAgD,EAAO,SAAS,IAAS,KAC3E,gBAAkB,GAAe,uCAAuC,IACzE,CAEY,EAAqB,CAKhC,uBAAuB,EAAyC,CAC9D,MAAO,CACL,IAAK,EAAU,0BAA0B,EAAK,CAC9C,IAAK,2B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MAChD,CACN,EAAO,MAAM,EAAgB,UAAU,EAAW,wBAAwB,CAAC,CAG3E,EAAoB,EAAiB,EAIzC,eAAe,EAAsB,EAAsB,CACzD,GAAI,CAAC,EACH,OAGF,GAAI,EAAqB,IAAI,EAAa,UAAU,CAAC,CAAE,CACrD,EAAmB,EAAqB,IAAI,EAAa,UAAU,CAAC,CAAC,CACrE,OAIF,GAAI,CAAC,EAAkB,KAAK,KAAK,GAAK,EAAE,GAAG,UAAU,GAAK,EAAa,UAAU,CAAC,CAAE,CAClF,EAAmB,EAAE,CAAC,CACtB,OAIF,EAAc,GAAK,CAEnB,IAAM,EAAQ,MAAM,EAClB,EAAuB,gBAAgB,EAAS,EAAa,CAC9D,CAED,EAAmB,EAAM,CACzB,EAAqB,IAAI,EAAa,UAAU,CAAE,EAAM,CAExD,EAAc,GAAM,CAGtB,SAAS,EAAyB,EAA0B,EAAoD,CAC9G,GAAI,CAAC,EAAiB,UACpB,OAEF,IAAM,EAA4B,CAChC,GAAI,EAAW,GACf,KAAM,EAAW,GACjB,YAAa,EAAW,YACzB,CAEG,EAAiB,QACnB,EAAc,QAAU,EAAiB,MAAM,GAC/C,EAAc,UAAY,EAAiB,MAAM,MAGnD,EAAgB,cAAc,EAAe,CAC3C,OAAQ,EAAW,aACnB,WAAY,EAAW,OACvB,WAAY,EAAuB,WACnC,SAAU,EAAiB,gBAC5B,CAAC,CAGJ,SAAS,GAAwB,CAO/B,OANK,EAGA,EAGE,CAAC,CAAC,GAAmB,EAAkB,aAFrC,GAHA,GAQX,MAAO,CACL,oBAAqB,GAAoB,EAAoB,KAC7D,gBAAiB,GAAmB,EAAE,CACtC,qBAAsB,EAAqB,MAAQ,EAAE,CACrD,kBAAmB,EAAkB,MAAQ,EAAE,CAC/C,mBACA,aAAc,GAAc,CAC5B,aACD"}
1
+ {"version":3,"file":"Cr3Blj6H2.chunk.js","names":[],"sources":["../../../../libs/shared/src/flight-requests/PreferenceRequests.ts","../../src/apps/videos/hooks/useCurriculums.ts"],"sourcesContent":["import { HttpVerbs } from 'libs/common/backbone/enums/HttpVerbs';\nimport { UrlHelper } from 'libs/common/backbone/utils/UrlHelper';\nimport { Flight } from 'libs/common/flight';\n\nimport { SharedWithStatements } from 'libs/shared/constants/WithStatements';\nimport { PresentationType } from 'libs/shared/enums/PresentationType';\nimport { Presentation, PresentationAudience } from 'libs/shared/interfaces';\n\nconst classificationQuery = SharedWithStatements.CLASSIFICATION_COLLECTION;\n\nconst endpoints = {\n // Subjects\n allSubjectPreferences: () => `{gateway}/v1/users/me/classifications/preferences?query=${classificationQuery}&type=subject`,\n mySubjectPreferences: () => `{gateway}/v1/users/me/classifications/following?query=${classificationQuery}`,\n followSubjects: () => '{gateway}/v1/users/me/classifications/following',\n unfollowSubjects: (ids: string[]) => UrlHelper.urlBuilder('{gateway}/v1/users/me/classifications/following', { id: ids }),\n\n // Levels\n allLevelPreferences: () => `{gateway}/v1/users/me/audiences?type=subject`,\n myLevelPreferences: () => `{gateway}/v1/users/me/audiences/following`,\n followLevels: () => `{gateway}/v1/users/me/audiences/following`,\n unfollowLevels: (ids: string[]) => UrlHelper.urlBuilder('{gateway}/v1/users/me/audiences/following', { id: ids }),\n\n getCurrentPresentations: (type?: PresentationType) =>\n `{gateway}/v1/users/me/presentations${type ? `?type=${type}` : ''}`,\n getAvailablePresentations: (type?: PresentationType) =>\n `{gateway}/v1/users/me/presentations/available${type ? `?type=${type}` : ''}`,\n setPresentation: (id: string) => `{gateway}/v1/users/me/presentations/${id}`\n};\n\nexport const PreferenceRequests = {\n /**\n * Presentations\n */\n\n availablePresentations(type?: PresentationType): Flight.Request {\n return {\n url: endpoints.getAvailablePresentations(type),\n key: `available:presentations:${type}`,\n normalizeOptions: {\n namespace: 'presentation'\n }\n };\n },\n\n setPresentation(\n presentation: Presentation,\n type: PresentationType,\n success?: () => void,\n error?: () => void\n ): Flight.Request {\n return {\n url: endpoints.setPresentation(presentation.id),\n key: `set:${type}:presentation`,\n type: HttpVerbs.POST,\n data: {},\n normalizeOptions: {\n namespace: 'presentation'\n },\n invalidationKeys: [\n `current:presentation:${type.toLocaleLowerCase()}`,\n 'subject:preference:options',\n 'my:subject:preferences',\n 'level:preference:options',\n 'my:level:preferences',\n 'classifications',\n 'presentation:audiences',\n 'widgets:v3',\n 'content:update:videos',\n 'content:updates'\n ],\n success,\n error\n };\n },\n\n /**\n * Subjects\n */\n allSubjectPreferences(): Flight.Request {\n return {\n url: endpoints.allSubjectPreferences(),\n key: `subject:preference:options`\n };\n },\n\n mySubjectPreferences(success?: (data: any) => void): Flight.Request {\n return {\n url: endpoints.mySubjectPreferences(),\n key: `my:subject:preferences`,\n normalize: false,\n success\n };\n },\n\n followSubjects(\n subjectIds: string[],\n success?: () => void,\n error?: () => void,\n always?: () => void\n ): Flight.Request {\n return {\n url: endpoints.followSubjects(),\n key: `follow:subjects`,\n data: subjectIds,\n type: HttpVerbs.POST,\n success,\n error,\n always,\n invalidationKeys: [ ...subjectIds.map(id => `classification:${id}`), 'my:subject:preferences', 'classifications', 'content:updates' ]\n };\n },\n\n unfollowSubjects(\n subjectIds: string[],\n success?: () => void,\n error?: () => void,\n always?: () => void\n ): Flight.Request {\n return {\n url: endpoints.unfollowSubjects(subjectIds),\n key: `unfollow:subjects`,\n type: HttpVerbs.DELETE,\n success,\n error,\n always,\n invalidationKeys: [ ...subjectIds.map(id => `classification:${id}`), 'my:subject:preferences', 'classifications', 'content:updates' ]\n };\n },\n\n /**\n * Levels\n */\n allLevelPreferences(): Flight.Request {\n return {\n url: endpoints.allLevelPreferences(),\n key: `level:preference:options`,\n normalize: false\n };\n },\n\n myLevelPreferences(success?: (data: any) => void): Flight.Request {\n return {\n url: endpoints.myLevelPreferences(),\n key: `my:level:preferences`,\n normalizeOptions: {\n idAttribute: 'masterId'\n },\n success\n };\n },\n\n followLevels(\n levels: PresentationAudience[],\n success?: () => void,\n error?: () => void,\n always?: () => void\n ): Flight.Request {\n return {\n url: endpoints.followLevels(),\n key: `follow:levels`,\n data: levels.map(l => l.masterId),\n normalize: false,\n // Update the store to immediately reflect changes\n updateState: {\n keys: 'my:level:preferences',\n updateData: storeData => {\n const preferences = storeData['my:level:preferences'] ?? [] as PresentationAudience[];\n\n levels.forEach(newLevel => {\n if (preferences.find((p: PresentationAudience) => p.masterId === newLevel.masterId))\n return;\n\n preferences.push(newLevel);\n });\n\n return {\n 'my:level:preferences': preferences\n };\n }\n },\n type: HttpVerbs.POST,\n success,\n error,\n always\n };\n },\n\n unfollowLevels(\n levels: PresentationAudience[],\n success?: () => void,\n error?: () => void,\n always?: () => void\n ): Flight.Request {\n return {\n url: endpoints.unfollowLevels(levels.map(l => l.masterId)),\n key: `unfollow:levels`,\n normalize: false,\n // Update the store to immediately reflect changes\n updateState: {\n keys: 'my:level:preferences',\n updateData: storeData => {\n let preferences = storeData['my:level:preferences'] ?? [] as PresentationAudience[];\n\n levels.forEach(oldLevel => {\n if (!preferences.find((p: PresentationAudience) => p.masterId === oldLevel.masterId))\n return;\n\n const idxOfValue = preferences.findIndex((p: PresentationAudience) => p.masterId === oldLevel.masterId);\n\n preferences = [ ...preferences.slice(0, idxOfValue), ...preferences.slice(idxOfValue + 1) ];\n });\n\n return {\n 'my:level:preferences': preferences\n };\n }\n },\n type: HttpVerbs.DELETE,\n success,\n error,\n always\n };\n }\n};\n","import React from 'react';\n\nimport { LanguageService } from 'libs/common/backbone/services/LanguageService';\nimport { StorageType } from 'libs/common/backbone/utils/LocalStorageHelper';\nimport { Flight } from 'libs/common/flight';\nimport { useViewModel } from 'libs/common/react/hooks/UseViewModel';\nimport { ArrayHelper } from 'libs/common/react/utils/ArrayHelper';\n\nimport { AnalyticsHelper } from 'libs/analytics/AnalyticsHelper';\nimport { EntityType, HashObject, PresentationDescriptor, UserAction } from 'libs/analytics/interfaces';\n\nimport { SharedViewModelKeys } from 'libs/shared/constants/SharedViewModelKeys';\nimport { LocalPermissionName } from 'libs/shared/enums/PermissionName';\nimport { PresentationType } from 'libs/shared/enums/PresentationType';\nimport { ClassificationRequests } from 'libs/shared/flight-requests/ClassificationRequests';\nimport { PreferenceRequests } from 'libs/shared/flight-requests/PreferenceRequests';\nimport { UserRequests } from 'libs/shared/flight-requests/UserRequests';\nimport { useAlerts } from 'libs/shared/hooks/UseAlerts';\nimport { usePermissions } from 'libs/shared/hooks/usePermissions';\nimport { CurrentUser, Curriculum, CurriculumAnalyticsOptions, CurriculumData, Presentation } from 'libs/shared/interfaces';\n\nconst namespace = 'videos.hooks';\n\nconst curriculumLinksCache = new Map<string, Curriculum[][]>();\n\nexport const useCurriculums = (videoId?: string): CurriculumData => {\n function getPublicPresentationLocalStorageKey(type: PresentationType): string {\n return `${type.toLowerCase()}:${SharedViewModelKeys.PRESENTATION_ID}`;\n }\n\n const [ publicPresentationId, setPublicPresentationId ] = useViewModel<string>(\n getPublicPresentationLocalStorageKey(PresentationType.Curriculum),\n undefined,\n { storage: StorageType.LocalStorage }\n );\n\n const [ activeCurriculum, setActiveCurriculum ] = React.useState<Presentation>(null);\n const [ curriculumLinks, setCurriculumLinks ] = React.useState<Curriculum[][]>(null);\n const [ isFetching, setIsFetching ] = React.useState<boolean>(false);\n\n const currentUser = Flight.useBasicFetch<CurrentUser>(UserRequests.currentUser());\n const availableCurriculums = Flight.useBasicFetch<Presentation[]>(\n ClassificationRequests.availablePresentations(PresentationType.Curriculum)\n );\n\n const fetchAsync = Flight.useGetFetchAsync();\n const alerts = useAlerts();\n const { hasLocalPermissions } = usePermissions();\n const canManagePublicPresentation = hasLocalPermissions(LocalPermissionName.ManagePublicPresentation);\n \n function getAnonPresentationId(): string {\n /**\n * Where a public user has already nominated a presentation and \n * it's persisted in LocalStorage retrieve that.\n */\n const hasValidPublicPresentationId = !isNaN(+publicPresentationId);\n if (hasValidPublicPresentationId)\n return publicPresentationId;\n\n /**\n * Where the public user has yet to nominate a presentation, we'll preload with a Level 1 presentation\n * They'll be prompted to select a presentation\n */\n return ArrayHelper.first(availableCurriculums.data)?.id;\n }\n\n function getPreferredCurriculumRequest() {\n if (currentUser.data?.isAuthenticated)\n return ClassificationRequests.presentation(PresentationType.Curriculum);\n\n const anonPresentationId = getAnonPresentationId();\n\n if (!anonPresentationId)\n return null;\n\n return ClassificationRequests.presentationById(anonPresentationId);\n }\n\n const preferredCurriculum = Flight.useBasicFetch<Presentation>(getPreferredCurriculumRequest());\n\n React.useEffect(() => {\n if (!preferredCurriculum.data)\n return;\n\n setActiveCurriculum(preferredCurriculum.data);\n\n if (videoId && !curriculumLinks) {\n fetchAsync<Curriculum[][]>(ClassificationRequests.curriculumLinks(videoId, preferredCurriculum.data?.id))\n .then(links => {\n setCurriculumLinks(links);\n curriculumLinksCache.set(preferredCurriculum.data?.id?.toString(), links);\n });\n }\n }, [preferredCurriculum.data?.id]);\n \n const availableCurriculumIds = availableCurriculums.data?.map(c => c.id) ?? [];\n\n const mappedCurriculums = Flight.useBasicFetch<Presentation[]>(\n videoId &&\n availableCurriculumIds.length &&\n ClassificationRequests.getMappedCurriculums(\n videoId,\n availableCurriculumIds\n )\n );\n\n async function updateCurriculum(\n curriculumId: string,\n analyticsOptions: CurriculumAnalyticsOptions\n ): Promise<void> {\n if (activeCurriculum.id.toString() === curriculumId.toString())\n return;\n\n const curriculum = availableCurriculums.data.find(c => c.id.toString() === curriculumId.toString());\n\n setActiveCurriculum(curriculum);\n\n /**\n * In a public context, we'll persist the selected presentation's id to Local Storage\n */\n if (canManagePublicPresentation)\n setPublicPresentationId(curriculumId);\n\n try {\n if (videoId)\n await updateCurriculumLinks(curriculumId);\n\n if (canManagePublicPresentation)\n return;\n\n await fetchAsync(\n PreferenceRequests.setPresentation(curriculum, PresentationType.Curriculum)\n );\n\n logCurriculumChangeEvent(curriculum, analyticsOptions);\n } catch {\n alerts.error(LanguageService.getPhrase(namespace, 'curriculumUpdateError'));\n\n // If we fail to update, rollback to the previous curriculum\n setActiveCurriculum(activeCurriculum);\n }\n }\n\n async function updateCurriculumLinks(curriculumId: string) {\n if (!videoId)\n return;\n\n // If we've already fetched the links for this curriculum, use the cached data\n if (curriculumLinksCache.has(curriculumId.toString())) {\n setCurriculumLinks(curriculumLinksCache.get(curriculumId.toString()));\n return;\n }\n \n // If we don't have any curriculums mapped to our video, set the links to an empty array\n if (!mappedCurriculums.data.find(c => c.id.toString() === curriculumId.toString())) {\n setCurriculumLinks([]);\n return;\n }\n\n // Fetch the curriculum links for our video\n setIsFetching(true);\n\n const links = await fetchAsync<Curriculum[][]>(\n ClassificationRequests.curriculumLinks(videoId, curriculumId)\n );\n\n setCurriculumLinks(links);\n curriculumLinksCache.set(curriculumId.toString(), links);\n\n setIsFetching(false);\n }\n\n function logCurriculumChangeEvent(curriculum: Presentation, analyticsOptions: CurriculumAnalyticsOptions): void {\n if (!analyticsOptions.shouldLog)\n return;\n\n const analyticsData: HashObject = {\n id: curriculum.id,\n name: curriculum.id,\n description: curriculum.description\n };\n\n if (analyticsOptions.video) {\n analyticsData.videoId = analyticsOptions.video.id;\n analyticsData.videoName = analyticsOptions.video.name;\n }\n\n AnalyticsHelper.logUserAction(analyticsData, {\n entity: EntityType.Presentation,\n actionType: UserAction.Select,\n descriptor: PresentationDescriptor.Curriculum,\n location: analyticsOptions.locationContext\n });\n }\n\n function hasCompleted(): boolean {\n if (!activeCurriculum)\n return false;\n\n if (!videoId)\n return true;\n\n return !!curriculumLinks && mappedCurriculums.hasCompleted;\n }\n\n return {\n preferredCurriculum: activeCurriculum || preferredCurriculum.data,\n curriculumLinks: curriculumLinks || [],\n availableCurriculums: availableCurriculums.data || [],\n mappedCurriculums: mappedCurriculums.data || [],\n updateCurriculum,\n hasCompleted: hasCompleted(),\n isFetching\n };\n};\n"],"mappings":"qoBAQA,IAAM,EAAsB,EAAqB,0BAE3C,EAAY,CAEhB,0BAA6B,2DAA2D,EAAoB,eAC5G,yBAA4B,yDAAyD,IACrF,mBAAsB,kDACtB,iBAAmB,GAAkB,EAAU,WAAW,kDAAmD,CAAE,GAAI,EAAK,CAAC,CAGzH,wBAA2B,+CAC3B,uBAA0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,GAAmB,EAAkB,aAFrC,GAHA,GAQX,MAAO,CACL,oBAAqB,GAAoB,EAAoB,KAC7D,gBAAiB,GAAmB,EAAE,CACtC,qBAAsB,EAAqB,MAAQ,EAAE,CACrD,kBAAmB,EAAkB,MAAQ,EAAE,CAC/C,mBACA,aAAc,GAAc,CAC5B,aACD"}
@@ -1,2 +1,2 @@
1
- import{gt as e}from"./Dp9qJj1C.chunk.js";import{n as t,t as n}from"./BJvPfCvt.chunk.js";import{t as r}from"./ImQRQGZr.chunk.js";import{lt as i,ut as a}from"./Dun43GrB.chunk.js";import{t as o}from"./Ca1QPe-q2.chunk.js";import{t as s}from"./B13dpWxS2.chunk.js";import{w as c}from"./app-BIigh9wv.js";import{t as l}from"./DXfGdqxs.chunk.js";import{t as u}from"./CE7XVl4t.chunk.js";var d=e(a()),f=i(),p=r.encloseNamespace(`shared.breadcrumbComponent`),m=64,h=48,g=d.forwardRef((e,r)=>{let{breadcrumb:{name:i,appLink:a,active:s},withBackIcon:c,linkClassName:u}=e,d=i,p=null;return d.length>h&&(d=i.slice(0,h)+`...`,p=i),(0,f.jsx)(`li`,{className:`breadcrumb-item${s?` active`:``}`,title:p,children:s?(0,f.jsx)(`strong`,{children:d}):(0,f.jsxs)(o,{appLink:a,ref:r,className:a?u:``,children:[c&&(0,f.jsx)(n,{svg:l,size:t.Small}),(0,f.jsx)(`span`,{className:c?`ms-2`:``,children:d})]})})}),_=({breadcrumbs:e,linkClassName:t})=>{let n=s(c.XS),r=e?.length||0,[i,a]=d.useState(!1),[o,l]=d.useState(!1),u=d.useRef(null);d.useEffect(()=>{let t=e?.reduce((e,t)=>e+t.name.length,0)??0;r>4&&t>m&&a(!0)},[e?.length]),d.useLayoutEffect(()=>{o&&u.current?.focus()},[u.current,o]);function h(){a(!1),l(!0)}if(!r||n&&r<2)return(0,f.jsx)(f.Fragment,{});if(n)return(0,f.jsx)(`nav`,{"aria-label":`breadcrumb`,children:(0,f.jsx)(`ol`,{className:`breadcrumb m-0 p-0`,children:(0,f.jsx)(g,{breadcrumb:e[r-2],withBackIcon:!0,linkClassName:t})})});let _=(0,f.jsx)(g,{breadcrumb:e[0],linkClassName:t}),v=r>2?(0,f.jsx)(g,{breadcrumb:e[1],linkClassName:t}):(0,f.jsx)(f.Fragment,{}),y=r>3?(0,f.jsx)(g,{breadcrumb:e[r-2],linkClassName:t}):(0,f.jsx)(f.Fragment,{}),b=r>1?(0,f.jsx)(g,{breadcrumb:e[r-1],linkClassName:t}):(0,f.jsx)(f.Fragment,{}),x=e.slice(2,r-2);return(0,f.jsx)(`nav`,{"aria-label":`breadcrumb`,children:(0,f.jsxs)(`ol`,{className:`breadcrumb m-0 p-0`,children:[_,v,i?(0,f.jsx)(`li`,{className:`breadcrumb-item`,children:(0,f.jsx)(`button`,{className:`btn-link`,onClick:h,"aria-label":p(`expand`),children:`...`})}):x.map((e,n)=>(0,f.jsx)(g,{breadcrumb:e,ref:n===0?u:null,linkClassName:t},n)),y,b]})})},v=d.memo(function({numItems:e=3}){return s(c.XS)?(0,f.jsx)(`div`,{className:`partial-loading-background`,style:{height:`1.3125rem`,width:`6rem`}}):(0,f.jsx)(`nav`,{"aria-label":`breadcrumb`,children:(0,f.jsx)(`ol`,{className:`breadcrumb m-0 p-0`,children:u.getPartialLoadingItems({numItems:e}).map(({width:e},t)=>(0,f.jsx)(`li`,{className:`breadcrumb-item`,children:(0,f.jsx)(`span`,{className:`d-inline-block partial-loading-background`,style:{width:e},dangerouslySetInnerHTML:{__html:`&nbsp`}})},t))})})});export{v as n,_ as t};
2
- //# sourceMappingURL=Dr1flAez.chunk.js.map
1
+ import{gt as e}from"./Dp9qJj1C.chunk.js";import{n as t,t as n}from"./BJvPfCvt.chunk.js";import{t as r}from"./ImQRQGZr.chunk.js";import{lt as i,ut as a}from"./Dun43GrB.chunk.js";import{t as o}from"./Ca1QPe-q2.chunk.js";import{t as s}from"./B13dpWxS2.chunk.js";import{w as c}from"./app-gjHxcZG3.js";import{t as l}from"./DXfGdqxs.chunk.js";import{t as u}from"./CE7XVl4t.chunk.js";var d=e(a()),f=i(),p=r.encloseNamespace(`shared.breadcrumbComponent`),m=64,h=48,g=d.forwardRef((e,r)=>{let{breadcrumb:{name:i,appLink:a,active:s},withBackIcon:c,linkClassName:u}=e,d=i,p=null;return d.length>h&&(d=i.slice(0,h)+`...`,p=i),(0,f.jsx)(`li`,{className:`breadcrumb-item${s?` active`:``}`,title:p,children:s?(0,f.jsx)(`strong`,{children:d}):(0,f.jsxs)(o,{appLink:a,ref:r,className:a?u:``,children:[c&&(0,f.jsx)(n,{svg:l,size:t.Small}),(0,f.jsx)(`span`,{className:c?`ms-2`:``,children:d})]})})}),_=({breadcrumbs:e,linkClassName:t})=>{let n=s(c.XS),r=e?.length||0,[i,a]=d.useState(!1),[o,l]=d.useState(!1),u=d.useRef(null);d.useEffect(()=>{let t=e?.reduce((e,t)=>e+t.name.length,0)??0;r>4&&t>m&&a(!0)},[e?.length]),d.useLayoutEffect(()=>{o&&u.current?.focus()},[u.current,o]);function h(){a(!1),l(!0)}if(!r||n&&r<2)return(0,f.jsx)(f.Fragment,{});if(n)return(0,f.jsx)(`nav`,{"aria-label":`breadcrumb`,children:(0,f.jsx)(`ol`,{className:`breadcrumb m-0 p-0`,children:(0,f.jsx)(g,{breadcrumb:e[r-2],withBackIcon:!0,linkClassName:t})})});let _=(0,f.jsx)(g,{breadcrumb:e[0],linkClassName:t}),v=r>2?(0,f.jsx)(g,{breadcrumb:e[1],linkClassName:t}):(0,f.jsx)(f.Fragment,{}),y=r>3?(0,f.jsx)(g,{breadcrumb:e[r-2],linkClassName:t}):(0,f.jsx)(f.Fragment,{}),b=r>1?(0,f.jsx)(g,{breadcrumb:e[r-1],linkClassName:t}):(0,f.jsx)(f.Fragment,{}),x=e.slice(2,r-2);return(0,f.jsx)(`nav`,{"aria-label":`breadcrumb`,children:(0,f.jsxs)(`ol`,{className:`breadcrumb m-0 p-0`,children:[_,v,i?(0,f.jsx)(`li`,{className:`breadcrumb-item`,children:(0,f.jsx)(`button`,{className:`btn-link`,onClick:h,"aria-label":p(`expand`),children:`...`})}):x.map((e,n)=>(0,f.jsx)(g,{breadcrumb:e,ref:n===0?u:null,linkClassName:t},n)),y,b]})})},v=d.memo(function({numItems:e=3}){return s(c.XS)?(0,f.jsx)(`div`,{className:`partial-loading-background`,style:{height:`1.3125rem`,width:`6rem`}}):(0,f.jsx)(`nav`,{"aria-label":`breadcrumb`,children:(0,f.jsx)(`ol`,{className:`breadcrumb m-0 p-0`,children:u.getPartialLoadingItems({numItems:e}).map(({width:e},t)=>(0,f.jsx)(`li`,{className:`breadcrumb-item`,children:(0,f.jsx)(`span`,{className:`d-inline-block partial-loading-background`,style:{width:e},dangerouslySetInnerHTML:{__html:`&nbsp`}})},t))})})});export{v as n,_ as t};
2
+ //# sourceMappingURL=CxCkwLio.chunk.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Dr1flAez.chunk.js","names":[],"sources":["../../../../libs/shared/src/components/breadcrumbs/Breadcrumbs.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport { LanguageService } from 'libs/common/backbone/services/LanguageService';\nimport { Core } from 'libs/common/core';\n\nimport { AppLink } from 'libs/shared/components/app-link/AppLink';\nimport { MediaQueryStrings } from 'libs/shared/enums/MediaQueries';\nimport { useMediaQuery } from 'libs/shared/hooks/UseMediaQuery';\nimport { ChevronLeftSvg } from 'libs/shared/images/svg/arrows/ChevronLeftSvg';\nimport { PartialLoadingHelper } from 'libs/shared/utils/PartialLoadingHelper';\n\nimport { SvgContainer, SvgContainerSize } from '../svg-container/SvgContainer';\n\nconst namespace = 'shared.breadcrumbComponent';\nconst getPhrase = LanguageService.encloseNamespace(namespace);\n\nconst COLLAPSE_CHARACTER_COUNT = 64;\nconst MAX_SEGMENT_LENGTH = 48;\n\nexport interface Breadcrumb {\n name: string;\n appLink?: Core.AppLink;\n active?: boolean;\n}\n\ninterface BreadcrumbItemProps {\n breadcrumb: Breadcrumb;\n withBackIcon?: boolean;\n linkClassName?: string;\n}\n\nexport const BreadcrumbItem = React.forwardRef((\n props: BreadcrumbItemProps,\n ref: React.ForwardedRef<HTMLElement>\n) => {\n const { breadcrumb: { name, appLink, active }, withBackIcon, linkClassName } = props;\n\n let trimmedName = name;\n let title: string = null;\n\n if (trimmedName.length > MAX_SEGMENT_LENGTH) {\n trimmedName = name.slice(0, MAX_SEGMENT_LENGTH) + '...';\n\n // Only setting the title when we trim, because otherwise it's really not needed - Sha\n title = name;\n }\n\n return (\n <li\n className={`breadcrumb-item${active ? ' active' : ''}`}\n title={title}\n >\n {active ?\n <strong>{trimmedName}</strong> :\n <AppLink appLink={appLink} ref={ref} className={appLink ? linkClassName : ''}>\n {withBackIcon && <SvgContainer svg={ChevronLeftSvg} size={SvgContainerSize.Small} />}\n <span className={withBackIcon ? 'ms-2' : ''}>{trimmedName}</span>\n </AppLink>\n }\n </li>\n );\n});\n\ninterface BreadcrumbsProps {\n breadcrumbs: Breadcrumb[];\n linkClassName?: string;\n}\n\nexport const Breadcrumbs = ({ breadcrumbs, linkClassName }: BreadcrumbsProps) => {\n const isMobile = useMediaQuery(MediaQueryStrings.XS);\n\n const length = breadcrumbs?.length || 0;\n \n const [ collapse, setCollapse ] = React.useState(false);\n const [ shouldFocus, setShouldFocus ] = React.useState(false);\n const expandRef = React.useRef<HTMLElement>(null);\n\n React.useEffect(() => {\n const characterLength = breadcrumbs?.reduce((prev, next) => prev + next.name.length, 0) ?? 0;\n\n if (length > 4 && characterLength > COLLAPSE_CHARACTER_COUNT)\n setCollapse(true);\n }, [breadcrumbs?.length]);\n\n /**\n * Focus our first expanded item the first time it appears.\n */\n React.useLayoutEffect(() => {\n if (shouldFocus)\n expandRef.current?.focus();\n }, [ expandRef.current, shouldFocus ]);\n\n function onClickExpand() {\n setCollapse(false);\n setShouldFocus(true);\n }\n\n if (!length || (isMobile && length < 2))\n return <></>;\n\n if (isMobile)\n return (\n <nav aria-label='breadcrumb'>\n <ol className='breadcrumb m-0 p-0'>\n <BreadcrumbItem breadcrumb={breadcrumbs[length - 2]} withBackIcon linkClassName={linkClassName} />\n </ol>\n </nav>\n );\n\n const first = <BreadcrumbItem breadcrumb={breadcrumbs[0]} linkClassName={linkClassName} />;\n const second = length > 2 ?\n <BreadcrumbItem breadcrumb={breadcrumbs[1]} linkClassName={linkClassName} /> :\n <></>;\n const secondLast = length > 3 ?\n <BreadcrumbItem breadcrumb={breadcrumbs[length - 2]} linkClassName={linkClassName} /> :\n <></>;\n const last = length > 1 ?\n <BreadcrumbItem breadcrumb={breadcrumbs[length - 1]} linkClassName={linkClassName} /> :\n <></>;\n const rest = breadcrumbs.slice(2, length - 2);\n\n return (\n <nav aria-label='breadcrumb'>\n <ol className='breadcrumb m-0 p-0'>\n {first}\n {second}\n {collapse ?\n <li className='breadcrumb-item'>\n <button\n className='btn-link'\n onClick={onClickExpand}\n aria-label={getPhrase('expand')}\n >\n ...\n </button>\n </li> :\n rest.map((breadcrumb, idx) => (\n <BreadcrumbItem\n key={idx}\n breadcrumb={breadcrumb}\n ref={idx === 0 ? expandRef : null}\n linkClassName={linkClassName}\n />\n ))\n }\n {secondLast}\n {last}\n </ol>\n </nav>\n );\n};\n\nexport const PartialBreadcrumbs = React.memo(function({ numItems = 3 }: { numItems?: number }) {\n const isMobile = useMediaQuery(MediaQueryStrings.XS);\n\n if (isMobile) {\n return (\n <div className='partial-loading-background' style={{ height: '1.3125rem', width: '6rem' }} />\n );\n }\n\n return (\n <nav aria-label='breadcrumb'>\n <ol className='breadcrumb m-0 p-0'>\n {PartialLoadingHelper.getPartialLoadingItems({ numItems }).map(({ width }, idx) => (\n <li key={idx} className='breadcrumb-item'>\n <span className='d-inline-block partial-loading-background' style={{ width }} dangerouslySetInnerHTML={{ __html: '&nbsp' }} />\n </li>\n ))}\n </ol>\n </nav>\n );\n});\n"],"mappings":"4YAcM,EAAY,EAAgB,iBADhB,6BAC2C,CAEvD,EAA2B,GAC3B,EAAqB,GAcd,EAAA,EAAuB,YAClC,EACA,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,CAAK,UAAU,6BAA6B,MAAO,CAAE,OAAQ,YAAa,MAAO,QAAY,CAAA,EAK/F,EAAA,EAAA,KAAC,MAAD,CAAK,aAAW,uBACd,EAAA,EAAA,KAAC,KAAD,CAAI,UAAU,8BACX,EAAqB,uBAAuB,CAAE,WAAU,CAAC,CAAC,KAAK,CAAE,SAAS,KACzE,EAAA,EAAA,KAAC,KAAD,CAAc,UAAU,4BACtB,EAAA,EAAA,KAAC,OAAD,CAAM,UAAU,4CAA4C,MAAO,CAAE,QAAO,CAAE,wBAAyB,CAAE,OAAQ,QAAA,CAAa,CAAA,CAC3H,CAFI,EAEJ,CAAA,CAEJ,CAAA,CACD,CAAA,EAER"}
1
+ {"version":3,"file":"CxCkwLio.chunk.js","names":[],"sources":["../../../../libs/shared/src/components/breadcrumbs/Breadcrumbs.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport { LanguageService } from 'libs/common/backbone/services/LanguageService';\nimport { Core } from 'libs/common/core';\n\nimport { AppLink } from 'libs/shared/components/app-link/AppLink';\nimport { MediaQueryStrings } from 'libs/shared/enums/MediaQueries';\nimport { useMediaQuery } from 'libs/shared/hooks/UseMediaQuery';\nimport { ChevronLeftSvg } from 'libs/shared/images/svg/arrows/ChevronLeftSvg';\nimport { PartialLoadingHelper } from 'libs/shared/utils/PartialLoadingHelper';\n\nimport { SvgContainer, SvgContainerSize } from '../svg-container/SvgContainer';\n\nconst namespace = 'shared.breadcrumbComponent';\nconst getPhrase = LanguageService.encloseNamespace(namespace);\n\nconst COLLAPSE_CHARACTER_COUNT = 64;\nconst MAX_SEGMENT_LENGTH = 48;\n\nexport interface Breadcrumb {\n name: string;\n appLink?: Core.AppLink;\n active?: boolean;\n}\n\ninterface BreadcrumbItemProps {\n breadcrumb: Breadcrumb;\n withBackIcon?: boolean;\n linkClassName?: string;\n}\n\nexport const BreadcrumbItem = React.forwardRef((\n props: BreadcrumbItemProps,\n ref: React.ForwardedRef<HTMLElement>\n) => {\n const { breadcrumb: { name, appLink, active }, withBackIcon, linkClassName } = props;\n\n let trimmedName = name;\n let title: string = null;\n\n if (trimmedName.length > MAX_SEGMENT_LENGTH) {\n trimmedName = name.slice(0, MAX_SEGMENT_LENGTH) + '...';\n\n // Only setting the title when we trim, because otherwise it's really not needed - Sha\n title = name;\n }\n\n return (\n <li\n className={`breadcrumb-item${active ? ' active' : ''}`}\n title={title}\n >\n {active ?\n <strong>{trimmedName}</strong> :\n <AppLink appLink={appLink} ref={ref} className={appLink ? linkClassName : ''}>\n {withBackIcon && <SvgContainer svg={ChevronLeftSvg} size={SvgContainerSize.Small} />}\n <span className={withBackIcon ? 'ms-2' : ''}>{trimmedName}</span>\n </AppLink>\n }\n </li>\n );\n});\n\ninterface BreadcrumbsProps {\n breadcrumbs: Breadcrumb[];\n linkClassName?: string;\n}\n\nexport const Breadcrumbs = ({ breadcrumbs, linkClassName }: BreadcrumbsProps) => {\n const isMobile = useMediaQuery(MediaQueryStrings.XS);\n\n const length = breadcrumbs?.length || 0;\n \n const [ collapse, setCollapse ] = React.useState(false);\n const [ shouldFocus, setShouldFocus ] = React.useState(false);\n const expandRef = React.useRef<HTMLElement>(null);\n\n React.useEffect(() => {\n const characterLength = breadcrumbs?.reduce((prev, next) => prev + next.name.length, 0) ?? 0;\n\n if (length > 4 && characterLength > COLLAPSE_CHARACTER_COUNT)\n setCollapse(true);\n }, [breadcrumbs?.length]);\n\n /**\n * Focus our first expanded item the first time it appears.\n */\n React.useLayoutEffect(() => {\n if (shouldFocus)\n expandRef.current?.focus();\n }, [ expandRef.current, shouldFocus ]);\n\n function onClickExpand() {\n setCollapse(false);\n setShouldFocus(true);\n }\n\n if (!length || (isMobile && length < 2))\n return <></>;\n\n if (isMobile)\n return (\n <nav aria-label='breadcrumb'>\n <ol className='breadcrumb m-0 p-0'>\n <BreadcrumbItem breadcrumb={breadcrumbs[length - 2]} withBackIcon linkClassName={linkClassName} />\n </ol>\n </nav>\n );\n\n const first = <BreadcrumbItem breadcrumb={breadcrumbs[0]} linkClassName={linkClassName} />;\n const second = length > 2 ?\n <BreadcrumbItem breadcrumb={breadcrumbs[1]} linkClassName={linkClassName} /> :\n <></>;\n const secondLast = length > 3 ?\n <BreadcrumbItem breadcrumb={breadcrumbs[length - 2]} linkClassName={linkClassName} /> :\n <></>;\n const last = length > 1 ?\n <BreadcrumbItem breadcrumb={breadcrumbs[length - 1]} linkClassName={linkClassName} /> :\n <></>;\n const rest = breadcrumbs.slice(2, length - 2);\n\n return (\n <nav aria-label='breadcrumb'>\n <ol className='breadcrumb m-0 p-0'>\n {first}\n {second}\n {collapse ?\n <li className='breadcrumb-item'>\n <button\n className='btn-link'\n onClick={onClickExpand}\n aria-label={getPhrase('expand')}\n >\n ...\n </button>\n </li> :\n rest.map((breadcrumb, idx) => (\n <BreadcrumbItem\n key={idx}\n breadcrumb={breadcrumb}\n ref={idx === 0 ? expandRef : null}\n linkClassName={linkClassName}\n />\n ))\n }\n {secondLast}\n {last}\n </ol>\n </nav>\n );\n};\n\nexport const PartialBreadcrumbs = React.memo(function({ numItems = 3 }: { numItems?: number }) {\n const isMobile = useMediaQuery(MediaQueryStrings.XS);\n\n if (isMobile) {\n return (\n <div className='partial-loading-background' style={{ height: '1.3125rem', width: '6rem' }} />\n );\n }\n\n return (\n <nav aria-label='breadcrumb'>\n <ol className='breadcrumb m-0 p-0'>\n {PartialLoadingHelper.getPartialLoadingItems({ numItems }).map(({ width }, idx) => (\n <li key={idx} className='breadcrumb-item'>\n <span className='d-inline-block partial-loading-background' style={{ width }} dangerouslySetInnerHTML={{ __html: '&nbsp' }} />\n </li>\n ))}\n </ol>\n </nav>\n );\n});\n"],"mappings":"4YAcM,EAAY,EAAgB,iBADhB,6BAC2C,CAEvD,EAA2B,GAC3B,EAAqB,GAcd,EAAA,EAAuB,YAClC,EACA,IACG,CACH,GAAM,CAAE,WAAY,CAAE,OAAM,UAAS,UAAU,eAAc,iBAAkB,EAE3E,EAAc,EACd,EAAgB,KASpB,OAPI,EAAY,OAAS,I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AA,EAAA,KAAC,KAAD,CAAI,UAAU,8BACX,EAAqB,uBAAuB,CAAE,WAAU,CAAC,CAAC,KAAK,CAAE,SAAS,KACzE,EAAA,EAAA,KAAC,KAAD,CAAc,UAAU,4BACtB,EAAA,EAAA,KAAC,OAAD,CAAM,UAAU,4CAA4C,MAAO,CAAE,QAAO,CAAE,wBAAyB,CAAE,OAAQ,QAAA,CAAa,CAAA,CAC3H,CAFI,EAEJ,CAAA,CAEJ,CAAA,CACD,CAAA,EAER"}
@@ -1,2 +1,2 @@
1
- import{v as e}from"./Dp9qJj1C.chunk.js";import{t}from"./BJvPfCvt.chunk.js";import{t as n}from"./ImQRQGZr.chunk.js";import{lt as r,ut as i}from"./Dun43GrB.chunk.js";import{t as a}from"./B-OL6Vs7.chunk.js";import{t as o}from"./CxwN2xIE.chunk.js";import{t as s}from"./DeldjYRc.chunk.js";import{t as c}from"./Ca1QPe-q2.chunk.js";import{n as l}from"./D7d5XFW82.chunk.js";import{A as u,D as d,z as f}from"./app-BIigh9wv.js";i();var p={logo:`_logo_15b07_1`},m=r(),h=`streamableVideos.signInPopup`,g=n.encloseNamespace(h);function _(n){let r=e.getHref(o.getCurrentRoute().appLink),i=r===`/`?{}:{redirectUrl:r};return(0,m.jsxs)(f,{title:g(`signInHeading`),hideTitle:!0,closePopup:n.closePopup,bodyClassName:`p-5`,children:[(0,m.jsx)(`button`,{className:`btn-close position-absolute top-0 end-0 p-3`,onClick:n.closePopup}),(0,m.jsx)(`div`,{className:`${p.logo} position-absolute top-0 start-0 m-3`,children:(0,m.jsx)(d,{})}),(0,m.jsx)(`h1`,{className:`h2 text-center`,children:(0,m.jsx)(l,{namespace:h,phrase:`signInHeading`})}),(0,m.jsx)(`p`,{className:`text-center mb-3`,children:(0,m.jsx)(l,{namespace:h,phrase:`signInDescription`})}),(0,m.jsxs)(c,{className:`mt-3 btn btn-dark w-100`,appLink:{application:a.DEFAULT,action:s.Default.CHALLENGE,params:i},children:[(0,m.jsx)(t,{svg:u}),(0,m.jsx)(`span`,{className:`ms-1`,children:(0,m.jsx)(l,{namespace:h,phrase:`signInButton`})})]}),(0,m.jsx)(c,{className:`d-flex justify-content-center align-items-center mt-3 text-info`,appLink:{application:a.DEFAULT,action:s.Default.CONTACT_US_POPUP},children:(0,m.jsx)(l,{namespace:h,phrase:`contactUsLink`})})]})}export{_ as SignInPopupView};
2
- //# sourceMappingURL=DyT1OGvP2.chunk.js.map
1
+ import{v as e}from"./Dp9qJj1C.chunk.js";import{t}from"./BJvPfCvt.chunk.js";import{t as n}from"./ImQRQGZr.chunk.js";import{lt as r,ut as i}from"./Dun43GrB.chunk.js";import{t as a}from"./B-OL6Vs7.chunk.js";import{t as o}from"./CxwN2xIE.chunk.js";import{t as s}from"./DeldjYRc.chunk.js";import{t as c}from"./Ca1QPe-q2.chunk.js";import{n as l}from"./D7d5XFW82.chunk.js";import{A as u,D as d,z as f}from"./app-gjHxcZG3.js";i();var p={logo:`_logo_15b07_1`},m=r(),h=`streamableVideos.signInPopup`,g=n.encloseNamespace(h);function _(n){let r=e.getHref(o.getCurrentRoute().appLink),i=r===`/`?{}:{redirectUrl:r};return(0,m.jsxs)(f,{title:g(`signInHeading`),hideTitle:!0,closePopup:n.closePopup,bodyClassName:`p-5`,children:[(0,m.jsx)(`button`,{className:`btn-close position-absolute top-0 end-0 p-3`,onClick:n.closePopup}),(0,m.jsx)(`div`,{className:`${p.logo} position-absolute top-0 start-0 m-3`,children:(0,m.jsx)(d,{})}),(0,m.jsx)(`h1`,{className:`h2 text-center`,children:(0,m.jsx)(l,{namespace:h,phrase:`signInHeading`})}),(0,m.jsx)(`p`,{className:`text-center mb-3`,children:(0,m.jsx)(l,{namespace:h,phrase:`signInDescription`})}),(0,m.jsxs)(c,{className:`mt-3 btn btn-dark w-100`,appLink:{application:a.DEFAULT,action:s.Default.CHALLENGE,params:i},children:[(0,m.jsx)(t,{svg:u}),(0,m.jsx)(`span`,{className:`ms-1`,children:(0,m.jsx)(l,{namespace:h,phrase:`signInButton`})})]}),(0,m.jsx)(c,{className:`d-flex justify-content-center align-items-center mt-3 text-info`,appLink:{application:a.DEFAULT,action:s.Default.CONTACT_US_POPUP},children:(0,m.jsx)(l,{namespace:h,phrase:`contactUsLink`})})]})}export{_ as SignInPopupView};
2
+ //# sourceMappingURL=Cxj75Dqe2.chunk.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"DyT1OGvP2.chunk.js","names":[],"sources":["../../src/apps/videos/views/sign-in-popup/sign-in-popup.module.scss","../../src/apps/videos/views/sign-in-popup/SignInPopupView.tsx"],"sourcesContent":[":local {\n .logo {\n height: 2.5rem;\n width: 2.5rem;\n }\n}","import React from 'react';\n\nimport { Core } from 'libs/common/backbone/index';\nimport { LanguageService } from 'libs/common/backbone/services/LanguageService';\n\nimport { AppLink } from 'libs/shared/components/app-link/AppLink';\nimport { Popup, PopupProps } from 'libs/shared/components/popup/Popup';\nimport { SvgContainer } from 'libs/shared/components/svg-container/SvgContainer';\nimport { Text } from 'libs/shared/components/text/Text';\nimport { NewWindowSvg } from 'libs/shared/images/svg/actions/NewWindowSvg';\nimport { ContextService } from 'libs/shared/services/ContextService';\n\nimport { StreamableIconLogo } from 'shared/components/streamable-logo/StreamableLogo';\nimport { Actions } from 'shared/constants/StreamableActions';\nimport { AppChannels } from 'shared/constants/StreamableRadioChannels';\n\nimport styles from './sign-in-popup.module.scss';\n\nconst namespace = 'streamableVideos.signInPopup';\nconst getPhrase = LanguageService.encloseNamespace(namespace);\n\ninterface SignInPopupViewProps extends PopupProps { }\n\nexport function SignInPopupView(props: SignInPopupViewProps) {\n const redirectUrl = Core.AppLinkHelper.getHref(ContextService.getCurrentRoute().appLink);\n const params = redirectUrl !== '/' ? { redirectUrl } : {};\n\n return (\n <Popup\n title={getPhrase('signInHeading')}\n hideTitle\n closePopup={props.closePopup}\n bodyClassName='p-5'\n >\n <button className='btn-close position-absolute top-0 end-0 p-3' onClick={props.closePopup} />\n <div className={`${styles.logo} position-absolute top-0 start-0 m-3`}>\n <StreamableIconLogo />\n </div>\n <h1 className='h2 text-center'><Text namespace={namespace} phrase='signInHeading' /></h1>\n <p className='text-center mb-3'><Text namespace={namespace} phrase='signInDescription' /></p>\n <AppLink\n className='mt-3 btn btn-dark w-100'\n appLink={{\n application: AppChannels.DEFAULT,\n action: Actions.Default.CHALLENGE,\n params\n }}\n >\n <SvgContainer svg={NewWindowSvg} />\n <span className='ms-1'>\n <Text namespace={namespace} phrase='signInButton' />\n </span>\n </AppLink>\n <AppLink\n className='d-flex justify-content-center align-items-center mt-3 text-info'\n appLink={{\n application: AppChannels.DEFAULT,\n action: Actions.Default.CONTACT_US_POPUP\n }}\n >\n <Text namespace={namespace} phrase='contactUsLink' />\n </AppLink>\n </Popup>\n );\n}\n"],"mappings":"ycCkBM,EAAY,+BACZ,EAAY,EAAgB,iBAAiB,EAAU,CAI7D,SAAgB,EAAgB,EAA6B,CAC3D,IAAM,EAAA,EAAiC,QAAQ,EAAe,iBAAiB,CAAC,QAAQ,CAClF,EAAS,IAAgB,IAAwB,EAAE,CAApB,CAAE,cAAa,CAEpD,OACE,EAAA,EAAA,MAAC,EAAD,CACE,MAAO,EAAU,gBAAgB,CACjC,UAAA,GACA,WAAY,EAAM,WAClB,cAAc,eAJhB,EAME,EAAA,EAAA,KAAC,SAAD,CAAQ,UAAU,8CAA8C,QAAS,EAAM,WAAc,CAAA,EAC7F,EAAA,EAAA,KAAC,MAAD,CAAK,UAAW,GAAG,EAAO,KAAK,gDAC7B,EAAA,EAAA,KAAC,EAAD,EAAsB,CAAA,CAClB,CAAA,EACN,EAAA,EAAA,KAAC,KAAD,CAAI,UAAU,2BAAiB,EAAA,EAAA,KAAC,EAAD,CAAiB,YAAW,OAAO,gBAAkB,CAAA,CAAK,CAAA,EACzF,EAAA,EAAA,KAAC,IAAD,CAAG,UAAU,6BAAmB,EAAA,EAAA,KAAC,EAAD,CAAiB,YAAW,OAAO,oBAAsB,CAAA,CAAI,CAAA,EAC7F,EAAA,EAAA,MAAC,EAAD,CACE,UAAU,0BACV,QAAS,CACP,YAAa,EAAY,QACzB,OAAQ,EAAQ,QAAQ,UACxB,SACD,UANH,EAQE,EAAA,EAAA,KAAC,EAAD,CAAc,IAAK,EAAgB,CAAA,EACnC,EAAA,EAAA,KAAC,OAAD,CAAM,UAAU,iBACd,EAAA,EAAA,KAAC,EAAD,CAAiB,YAAW,OAAO,eAAiB,CAAA,CAC/C,CAAA,CAAA,IAET,EAAA,EAAA,KAAC,EAAD,CACE,UAAU,kEACV,QAAS,CACP,YAAa,EAAY,QACzB,OAAQ,EAAQ,QAAQ,iBACzB,WAED,EAAA,EAAA,KAAC,EAAD,CAAiB,YAAW,OAAO,gBAAkB,CAAA,CAC7C,CAAA"}
1
+ {"version":3,"file":"Cxj75Dqe2.chunk.js","names":[],"sources":["../../src/apps/videos/views/sign-in-popup/sign-in-popup.module.scss","../../src/apps/videos/views/sign-in-popup/SignInPopupView.tsx"],"sourcesContent":[":local {\n .logo {\n height: 2.5rem;\n width: 2.5rem;\n }\n}","import React from 'react';\n\nimport { Core } from 'libs/common/backbone/index';\nimport { LanguageService } from 'libs/common/backbone/services/LanguageService';\n\nimport { AppLink } from 'libs/shared/components/app-link/AppLink';\nimport { Popup, PopupProps } from 'libs/shared/components/popup/Popup';\nimport { SvgContainer } from 'libs/shared/components/svg-container/SvgContainer';\nimport { Text } from 'libs/shared/components/text/Text';\nimport { NewWindowSvg } from 'libs/shared/images/svg/actions/NewWindowSvg';\nimport { ContextService } from 'libs/shared/services/ContextService';\n\nimport { StreamableIconLogo } from 'shared/components/streamable-logo/StreamableLogo';\nimport { Actions } from 'shared/constants/StreamableActions';\nimport { AppChannels } from 'shared/constants/StreamableRadioChannels';\n\nimport styles from './sign-in-popup.module.scss';\n\nconst namespace = 'streamableVideos.signInPopup';\nconst getPhrase = LanguageService.encloseNamespace(namespace);\n\ninterface SignInPopupViewProps extends PopupProps { }\n\nexport function SignInPopupView(props: SignInPopupViewProps) {\n const redirectUrl = Core.AppLinkHelper.getHref(ContextService.getCurrentRoute().appLink);\n const params = redirectUrl !== '/' ? { redirectUrl } : {};\n\n return (\n <Popup\n title={getPhrase('signInHeading')}\n hideTitle\n closePopup={props.closePopup}\n bodyClassName='p-5'\n >\n <button className='btn-close position-absolute top-0 end-0 p-3' onClick={props.closePopup} />\n <div className={`${styles.logo} position-absolute top-0 start-0 m-3`}>\n <StreamableIconLogo />\n </div>\n <h1 className='h2 text-center'><Text namespace={namespace} phrase='signInHeading' /></h1>\n <p className='text-center mb-3'><Text namespace={namespace} phrase='signInDescription' /></p>\n <AppLink\n className='mt-3 btn btn-dark w-100'\n appLink={{\n application: AppChannels.DEFAULT,\n action: Actions.Default.CHALLENGE,\n params\n }}\n >\n <SvgContainer svg={NewWindowSvg} />\n <span className='ms-1'>\n <Text namespace={namespace} phrase='signInButton' />\n </span>\n </AppLink>\n <AppLink\n className='d-flex justify-content-center align-items-center mt-3 text-info'\n appLink={{\n application: AppChannels.DEFAULT,\n action: Actions.Default.CONTACT_US_POPUP\n }}\n >\n <Text namespace={namespace} phrase='contactUsLink' />\n </AppLink>\n </Popup>\n );\n}\n"],"mappings":"ycCkBM,EAAY,+BACZ,EAAY,EAAgB,iBAAiB,EAAU,CAI7D,SAAgB,EAAgB,EAA6B,CAC3D,IAAM,EAAA,EAAiC,QAAQ,EAAe,iBAAiB,CAAC,QAAQ,CAClF,EAAS,IAAgB,IAAwB,EAAE,CAApB,CAAE,cAAa,CAEpD,OACE,EAAA,EAAA,MAAC,EAAD,CACE,MAAO,EAAU,gBAAgB,CACjC,UAAA,GACA,WAAY,EAAM,WAClB,cAAc,eAJhB,EAME,EAAA,EAAA,KAAC,SAAD,CAAQ,UAAU,8CAA8C,QAAS,EAAM,WAAc,CAAA,EAC7F,EAAA,EAAA,KAAC,MAAD,CAAK,UAAW,GAAG,EAAO,KAAK,gDAC7B,EAAA,EAAA,KAAC,EAAD,EAAsB,CAAA,CAClB,CAAA,EACN,EAAA,EAAA,KAAC,KAAD,CAAI,UAAU,2BAAiB,EAAA,EAAA,KAAC,EAAD,CAAiB,YAAW,OAAO,gBAAkB,CAAA,CAAK,CAAA,EACzF,EAAA,EAAA,KAAC,IAAD,CAAG,UAAU,6BAAmB,EAAA,EAAA,KAAC,EAAD,CAAiB,YAAW,OAAO,oBAAsB,CAAA,CAAI,CAAA,EAC7F,EAAA,EAAA,MAAC,EAAD,CACE,UAAU,0BACV,QAAS,CACP,YAAa,EAAY,QACzB,OAAQ,EAAQ,QAAQ,UACxB,SACD,UANH,EAQE,EAAA,EAAA,KAAC,EAAD,CAAc,IAAK,EAAgB,CAAA,EACnC,EAAA,EAAA,KAAC,OAAD,CAAM,UAAU,iBACd,EAAA,EAAA,KAAC,EAAD,CAAiB,YAAW,OAAO,eAAiB,CAAA,CAC/C,CAAA,CAAA,IAET,EAAA,EAAA,KAAC,EAAD,CACE,UAAU,kEACV,QAAS,CACP,YAAa,EAAY,QACzB,OAAQ,EAAQ,QAAQ,iBACzB,WAED,EAAA,EAAA,KAAC,EAAD,CAAiB,YAAW,OAAO,gBAAkB,CAAA,CAC7C,CAAA"}
@@ -1,2 +1,2 @@
1
- import"./Dp9qJj1C.chunk.js";import{lt as e,ut as t}from"./Dun43GrB.chunk.js";import{g as n}from"./app-BIigh9wv.js";t();var r=e();function i({error:e}){return(0,r.jsx)(n,{error:e})}export{i as NotFoundView};
2
- //# sourceMappingURL=CsC3VVvE2.chunk.js.map
1
+ import"./Dp9qJj1C.chunk.js";import{lt as e,ut as t}from"./Dun43GrB.chunk.js";import{g as n}from"./app-gjHxcZG3.js";t();var r=e();function i({error:e}){return(0,r.jsx)(n,{error:e})}export{i as NotFoundView};
2
+ //# sourceMappingURL=D-VNmhoM2.chunk.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"CsC3VVvE2.chunk.js","names":[],"sources":["../../src/apps/default/views/not-found/StreamableNotFoundView.tsx"],"sourcesContent":["import React from 'react';\n\nimport { ErrorPageError } from 'libs/shared/errors/primitives/ErrorPageError';\n\nimport { ErrorView } from 'apps/default/views/error/StreamableErrorView';\n\ninterface NotFoundViewProps {\n error: ErrorPageError;\n}\n\n// eslint-disable-next-line rulesdir/require-view-title\nexport function NotFoundView({ error }: NotFoundViewProps): React.ReactElement {\n return <ErrorView error={error} />;\n}\n"],"mappings":"iIAWA,SAAgB,EAAa,CAAE,SAAgD,CAC7E,OAAO,EAAA,EAAA,KAAC,EAAD,CAAkB,QAAS,CAAA"}
1
+ {"version":3,"file":"D-VNmhoM2.chunk.js","names":[],"sources":["../../src/apps/default/views/not-found/StreamableNotFoundView.tsx"],"sourcesContent":["import React from 'react';\n\nimport { ErrorPageError } from 'libs/shared/errors/primitives/ErrorPageError';\n\nimport { ErrorView } from 'apps/default/views/error/StreamableErrorView';\n\ninterface NotFoundViewProps {\n error: ErrorPageError;\n}\n\n// eslint-disable-next-line rulesdir/require-view-title\nexport function NotFoundView({ error }: NotFoundViewProps): React.ReactElement {\n return <ErrorView error={error} />;\n}\n"],"mappings":"iIAWA,SAAgB,EAAa,CAAE,SAAgD,CAC7E,OAAO,EAAA,EAAA,KAAC,EAAD,CAAkB,QAAS,CAAA"}
@@ -1,2 +1,2 @@
1
- import"./Dp9qJj1C.chunk.js";import{t as e}from"./BJvPfCvt.chunk.js";import{C as t,dt as n,l as r,lt as i,m as a,n as o,ut as s}from"./Dun43GrB.chunk.js";import{t as c}from"./CFXUbsBS.chunk.js";import{t as l}from"./B-OL6Vs7.chunk.js";import{t as u}from"./DeldjYRc.chunk.js";import{t as d}from"./BYYiNmLB.chunk.js";import{t as f}from"./Ca1QPe-q2.chunk.js";import{n as p}from"./D7d5XFW82.chunk.js";import{$ as m,H as h,Q as g,Z as _}from"./app-BIigh9wv.js";import{t as v}from"./CyxOxJjg2.chunk.js";import{t as y}from"./BsAo7Lri2.chunk.js";import{t as b}from"./DrgVCnQA2.chunk.js";import{t as x}from"./DpDQnXqh2.chunk.js";import{t as S}from"./LdxNQaUZ2.chunk.js";import{n as C}from"./C5i1HsPp2.chunk.js";import{t as w}from"./C9tPKnK22.chunk.js";import{t as T}from"./BF6BdGN-.chunk.js";var E={modalWidth:`_modalWidth_1p617_1`,banner:`_banner_1p617_5`,pill:`_pill_1p617_10`,logo:`_logo_1p617_13`};s();var D=i(),O=`shared.specialEventListItem`;function k(e){return`audiences`in e&&`endDateTime`in e&&`startDateTime`in e}function A(i){let s=i.getAppLink(i.event.content,n.slugify(i.event.name)),l=i.getBackgroundColor?.(i.event.content),u=i.getIconUrl?.(i.event.content),d=i.getBannerUrl?.(i.event.content),m=!!i.event.endDate,g=i.event.content.status===b.ComingSoon,_=i.getStartTime?.(i.event.content),T=i.getActionLabel?.(),A=i.isPastEvent?.(i.event.content),j={actionType:t.Click,entity:r.SpecialEvent,location:i.inPopup?a.CalendarPopup:a.CalendarDay},M={topicId:i.event.content.id,eventId:i.event.specialEventId,presentationId:i.presentationId,date:c.format(new Date(i.event.startDate),`YYYY-MM-DD`),status:i.event.content.status};return(0,D.jsxs)(`div`,{children:[_&&(0,D.jsx)(`h6`,{children:_}),(0,D.jsxs)(`div`,{onClick:()=>{g&&o.logUserAction(M,j)},children:[(0,D.jsx)(f,{appLink:!g&&s,className:`${g?``:`cursor-pointer`} text-decoration-none mb-2`,onClick:i.onClick,analyticsOptions:j,analyticsData:M,children:(0,D.jsxs)(`div`,{className:`banner rounded-3 position-relative position-relative ${E.banner}`,style:{backgroundColor:l,backgroundImage:`url('${d}')`},children:[A&&(0,D.jsx)(`div`,{className:`bg-white w-100 h-100 opacity-50 position-absolute top-0 left-0 z-0`}),(0,D.jsxs)(`div`,{className:`d-flex justify-content-between align-items-center w-100 h-100 px-3`,children:[(0,D.jsxs)(`div`,{className:`d-flex align-items-center z-1`,children:[u&&(0,D.jsx)(`div`,{className:`${E.logo} rounded-circle flex-shrink-0 overflow-hidden me-2`,children:(0,D.jsx)(S,{data:u})}),(0,D.jsxs)(`div`,{children:[g&&(0,D.jsx)(v,{className:`pe-2 fw-semibold mb-1 rounded-pill justify-content-start ${E.pill}`}),A&&(0,D.jsxs)(`div`,{className:`d-inline-block rounded-pill bg-light-green mb-1`,children:[(0,D.jsx)(e,{svg:C}),(0,D.jsx)(`p`,{className:`d-inline ms-1 mb-0`,children:(0,D.jsx)(p,{namespace:O,phrase:`pastEvent`})})]}),m&&(0,D.jsx)(`p`,{className:`text-white text-shadow mb-1`,children:y.getDisplayDate(i.event.startDate,i.event.endDate)}),(0,D.jsx)(`h2`,{className:`h4 text-white text-shadow ${i.event.description?`clamp-2`:`clamp-1`}`,title:i.event.name,children:i.event.name})]})]}),(0,D.jsx)(`div`,{className:`d-none d-sm-block flex-shrink-0 z-1`,children:!g&&(0,D.jsx)(h,{className:`btn ${A?`btn-outline-dark`:`btn-dark`} fw-semibold`,children:T})})]})]})}),(0,D.jsx)(`div`,{className:`pre-wrap text-break mb-3`,dangerouslySetInnerHTML:{__html:x.linkifyText(i.event.description||i.event.content.description)}}),k(i.event.content)&&(0,D.jsxs)(`div`,{className:`d-flex mb-3`,children:[(0,D.jsx)(`div`,{className:`rounded-pill border border-dark px-2 bg-white d-inline-block me-2`,children:w.getMergedPresentationAudienceString(i.event.content.audiences)?.name}),(0,D.jsx)(`div`,{className:`rounded-pill fw-semibold bg-dark text-white d-inline-block px-2`,children:`${c.diffBetween(i.event.content.endDateTime,i.event.content.startDateTime,`minutes`)}m`})]})]})]})}function j(){return(0,D.jsxs)(`div`,{children:[(0,D.jsx)(e,{svg:T}),(0,D.jsx)(`span`,{className:`ms-1`,children:g[m.ET]?.name})]})}var M={getStartTime(e){return c.format(_.convertUTCToTimezoneDate(e.startDateTime),`h:mm a`)},isSameTime(e,t){return t===0?!1:c.isSame(e[t].content.startDateTime,e[t-1].content.startDateTime)},isPastEvent(e){return c.isBefore(e.endDateTime,new Date)}};function N(){return{emptyState:d.EmptyStates.CALENDAR.NO_EVENTS,errorState:d.EmptyStates.CALENDAR.INVALID_DATE}}function P(){return{calendar:()=>({application:l.CALENDAR,action:u.Calendar.CALENDAR}),month:e=>({application:l.CALENDAR,action:u.Calendar.CALENDAR_MONTH,args:[e]}),event:(e,t)=>({application:l.LIVESTREAMS,action:u.Livestreams.LIVESTREAM,args:[e.id,t]}),eventList:(e,t,n)=>({application:l.CALENDAR,action:u.Calendar.SPECIAL_EVENT_LIST,params:{...e,date:t.toString(),presentationId:n}})}}export{A as a,j as i,N as n,M as r,P as t};
2
- //# sourceMappingURL=CKdklY2o2.chunk.js.map
1
+ import"./Dp9qJj1C.chunk.js";import{t as e}from"./BJvPfCvt.chunk.js";import{C as t,dt as n,l as r,lt as i,m as a,n as o,ut as s}from"./Dun43GrB.chunk.js";import{t as c}from"./CFXUbsBS.chunk.js";import{t as l}from"./B-OL6Vs7.chunk.js";import{t as u}from"./DeldjYRc.chunk.js";import{t as d}from"./BYYiNmLB.chunk.js";import{t as f}from"./Ca1QPe-q2.chunk.js";import{n as p}from"./D7d5XFW82.chunk.js";import{$ as m,H as h,Q as g,Z as _}from"./app-gjHxcZG3.js";import{t as v}from"./CyxOxJjg2.chunk.js";import{t as y}from"./iyIL3kim2.chunk.js";import{t as b}from"./DrgVCnQA2.chunk.js";import{t as x}from"./DpDQnXqh2.chunk.js";import{t as S}from"./LdxNQaUZ2.chunk.js";import{n as C}from"./DLofRa642.chunk.js";import{t as w}from"./C9tPKnK22.chunk.js";import{t as T}from"./BF6BdGN-.chunk.js";var E={modalWidth:`_modalWidth_1p617_1`,banner:`_banner_1p617_5`,pill:`_pill_1p617_10`,logo:`_logo_1p617_13`};s();var D=i(),O=`shared.specialEventListItem`;function k(e){return`audiences`in e&&`endDateTime`in e&&`startDateTime`in e}function A(i){let s=i.getAppLink(i.event.content,n.slugify(i.event.name)),l=i.getBackgroundColor?.(i.event.content),u=i.getIconUrl?.(i.event.content),d=i.getBannerUrl?.(i.event.content),m=!!i.event.endDate,g=i.event.content.status===b.ComingSoon,_=i.getStartTime?.(i.event.content),T=i.getActionLabel?.(),A=i.isPastEvent?.(i.event.content),j={actionType:t.Click,entity:r.SpecialEvent,location:i.inPopup?a.CalendarPopup:a.CalendarDay},M={topicId:i.event.content.id,eventId:i.event.specialEventId,presentationId:i.presentationId,date:c.format(new Date(i.event.startDate),`YYYY-MM-DD`),status:i.event.content.status};return(0,D.jsxs)(`div`,{children:[_&&(0,D.jsx)(`h6`,{children:_}),(0,D.jsxs)(`div`,{onClick:()=>{g&&o.logUserAction(M,j)},children:[(0,D.jsx)(f,{appLink:!g&&s,className:`${g?``:`cursor-pointer`} text-decoration-none mb-2`,onClick:i.onClick,analyticsOptions:j,analyticsData:M,children:(0,D.jsxs)(`div`,{className:`banner rounded-3 position-relative position-relative ${E.banner}`,style:{backgroundColor:l,backgroundImage:`url('${d}')`},children:[A&&(0,D.jsx)(`div`,{className:`bg-white w-100 h-100 opacity-50 position-absolute top-0 left-0 z-0`}),(0,D.jsxs)(`div`,{className:`d-flex justify-content-between align-items-center w-100 h-100 px-3`,children:[(0,D.jsxs)(`div`,{className:`d-flex align-items-center z-1`,children:[u&&(0,D.jsx)(`div`,{className:`${E.logo} rounded-circle flex-shrink-0 overflow-hidden me-2`,children:(0,D.jsx)(S,{data:u})}),(0,D.jsxs)(`div`,{children:[g&&(0,D.jsx)(v,{className:`pe-2 fw-semibold mb-1 rounded-pill justify-content-start ${E.pill}`}),A&&(0,D.jsxs)(`div`,{className:`d-inline-block rounded-pill bg-light-green mb-1`,children:[(0,D.jsx)(e,{svg:C}),(0,D.jsx)(`p`,{className:`d-inline ms-1 mb-0`,children:(0,D.jsx)(p,{namespace:O,phrase:`pastEvent`})})]}),m&&(0,D.jsx)(`p`,{className:`text-white text-shadow mb-1`,children:y.getDisplayDate(i.event.startDate,i.event.endDate)}),(0,D.jsx)(`h2`,{className:`h4 text-white text-shadow ${i.event.description?`clamp-2`:`clamp-1`}`,title:i.event.name,children:i.event.name})]})]}),(0,D.jsx)(`div`,{className:`d-none d-sm-block flex-shrink-0 z-1`,children:!g&&(0,D.jsx)(h,{className:`btn ${A?`btn-outline-dark`:`btn-dark`} fw-semibold`,children:T})})]})]})}),(0,D.jsx)(`div`,{className:`pre-wrap text-break mb-3`,dangerouslySetInnerHTML:{__html:x.linkifyText(i.event.description||i.event.content.description)}}),k(i.event.content)&&(0,D.jsxs)(`div`,{className:`d-flex mb-3`,children:[(0,D.jsx)(`div`,{className:`rounded-pill border border-dark px-2 bg-white d-inline-block me-2`,children:w.getMergedPresentationAudienceString(i.event.content.audiences)?.name}),(0,D.jsx)(`div`,{className:`rounded-pill fw-semibold bg-dark text-white d-inline-block px-2`,children:`${c.diffBetween(i.event.content.endDateTime,i.event.content.startDateTime,`minutes`)}m`})]})]})]})}function j(){return(0,D.jsxs)(`div`,{children:[(0,D.jsx)(e,{svg:T}),(0,D.jsx)(`span`,{className:`ms-1`,children:g[m.ET]?.name})]})}var M={getStartTime(e){return c.format(_.convertUTCToTimezoneDate(e.startDateTime),`h:mm a`)},isSameTime(e,t){return t===0?!1:c.isSame(e[t].content.startDateTime,e[t-1].content.startDateTime)},isPastEvent(e){return c.isBefore(e.endDateTime,new Date)}};function N(){return{emptyState:d.EmptyStates.CALENDAR.NO_EVENTS,errorState:d.EmptyStates.CALENDAR.INVALID_DATE}}function P(){return{calendar:()=>({application:l.CALENDAR,action:u.Calendar.CALENDAR}),month:e=>({application:l.CALENDAR,action:u.Calendar.CALENDAR_MONTH,args:[e]}),event:(e,t)=>({application:l.LIVESTREAMS,action:u.Livestreams.LIVESTREAM,args:[e.id,t]}),eventList:(e,t,n)=>({application:l.CALENDAR,action:u.Calendar.SPECIAL_EVENT_LIST,params:{...e,date:t.toString(),presentationId:n}})}}export{A as a,j as i,N as n,M as r,P as t};
2
+ //# sourceMappingURL=D2FqnK9m2.chunk.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"CKdklY2o2.chunk.js","names":[],"sources":["../../../../libs/shared/src/apps/calendar/components/special-event-list-item/special-event-list-item.module.scss","../../../../libs/shared/src/apps/calendar/components/special-event-list-item/SpecialEventListItem.tsx","../../../../libs/shared/src/apps/streamable-learning/components/timezone-indicator/TimezoneIndicator.tsx","../../src/apps/calendar/utils/CalendarUtils.ts","../../src/apps/calendar/views/calendar-view/CalendarViewUtils.ts"],"sourcesContent":[":local {\n .modalWidth {\n width: 40rem;\n max-width: 40rem;\n }\n\n .banner {\n background-position: center;\n background-size: cover; \n height: 6.25rem;\n }\n\n .pill {\n width:fit-content\n }\n\n .logo {\n height: 3.75rem;\n width: 3.75rem;\n }\n}","import React from 'react';\n\nimport { Core } from 'libs/common/backbone/index';\nimport { DateHelper } from 'libs/common/react/utils/DateHelper';\nimport { LinkifyHelper } from 'libs/common/react/utils/LinkifyHelper';\nimport { TextHelper } from 'libs/common/react/utils/TextHelper';\n\nimport { AnalyticsHelper } from 'libs/analytics/AnalyticsHelper';\nimport { AnalyticsOptions, EntityType, LocationContext, UserAction } from 'libs/analytics/interfaces';\n\nimport { ComingSoonTag } from 'libs/shared/apps/calendar/components/coming-soon-tag/ComingSoonTag';\nimport { SpecialEventHelper } from 'libs/shared/apps/calendar/utils/SpecialEventHelper';\nimport { ActionButton } from 'libs/shared/components/actions/ActionButton';\nimport { AppLink } from 'libs/shared/components/app-link/AppLink';\nimport { BaseImage } from 'libs/shared/components/image/BaseImage';\nimport { SvgContainer } from 'libs/shared/components/svg-container/SvgContainer';\nimport { Text } from 'libs/shared/components/text/Text';\nimport { ClassificationStatus } from 'libs/shared/enums/ClassificationStatus';\nimport { CalendarCheckSvg } from 'libs/shared/images/svg/objects/CalendarCheckSvg';\nimport { CalendarEvent, CalendarEventContent, Livestream, PresentationAudience } from 'libs/shared/interfaces';\nimport { AudienceHelper } from 'libs/shared/utils/audience-helper/AudienceHelper';\n\nimport styles from './special-event-list-item.module.scss';\n\nconst namespace = 'shared.specialEventListItem';\n\nfunction isLiveStream(obj: CalendarEventContent): obj is Livestream {\n return 'audiences' in obj &&\n 'endDateTime' in obj &&\n 'startDateTime' in obj;\n}\n\ninterface SpecialEventListItemProps {\n getAppLink: (content: CalendarEventContent, name: string) => Core.AppLink;\n event: CalendarEvent<CalendarEventContent>;\n onClick?: () => void;\n inPopup?: boolean;\n presentationId: string;\n headingClassName?: string;\n getIconUrl?: (content: CalendarEventContent) => string;\n getBackgroundColor?: (content: CalendarEventContent) => string;\n getBannerUrl?: (content: CalendarEventContent) => string;\n getActionLabel?: () => string;\n getStartTime?: (content: CalendarEventContent) => string;\n isPastEvent?: (content: CalendarEventContent) => boolean;\n}\n\nexport function SpecialEventListItem(props: SpecialEventListItemProps): JSX.Element {\n const appLink = props.getAppLink(props.event.content, TextHelper.slugify(props.event.name));\n\n const backgroundColor = props.getBackgroundColor?.(props.event.content);\n const iconUrl = props.getIconUrl?.(props.event.content);\n const bannerUrl = props.getBannerUrl?.(props.event.content);\n const multiDayEvent = !!props.event.endDate;\n const isComingSoon = props.event.content.status === ClassificationStatus.ComingSoon;\n const startTime = props.getStartTime?.(props.event.content);\n const actionLabel = props.getActionLabel?.();\n const isPastEvent = props.isPastEvent?.(props.event.content);\n\n const analyticsOptions: AnalyticsOptions = {\n actionType: UserAction.Click,\n entity: EntityType.SpecialEvent,\n location: props.inPopup ? LocationContext.CalendarPopup : LocationContext.CalendarDay\n };\n const analyticsData = {\n topicId: props.event.content.id,\n eventId: props.event.specialEventId,\n presentationId: props.presentationId,\n date: DateHelper.format(new Date(props.event.startDate), 'YYYY-MM-DD'),\n status: props.event.content.status\n };\n\n return (\n <div>\n {startTime && (\n <h6>{startTime}</h6>\n )}\n\n <div onClick={() => {\n if (isComingSoon)\n AnalyticsHelper.logUserAction(analyticsData, analyticsOptions);\n }}>\n <AppLink\n appLink={!isComingSoon && appLink}\n className={`${!isComingSoon ? 'cursor-pointer' : ''} text-decoration-none mb-2`}\n onClick={props.onClick}\n analyticsOptions={analyticsOptions}\n analyticsData={analyticsData}\n >\n <div\n className={`banner rounded-3 position-relative position-relative ${styles.banner}`}\n style={{ backgroundColor, backgroundImage: `url('${bannerUrl}')` }}\n >\n {isPastEvent && (\n <div className='bg-white w-100 h-100 opacity-50 position-absolute top-0 left-0 z-0' />\n )}\n <div className='d-flex justify-content-between align-items-center w-100 h-100 px-3'>\n <div className='d-flex align-items-center z-1'>\n {iconUrl && (\n <div className={`${styles.logo} rounded-circle flex-shrink-0 overflow-hidden me-2`}>\n <BaseImage data={iconUrl} />\n </div>\n )}\n <div>\n {isComingSoon && <ComingSoonTag className={`pe-2 fw-semibold mb-1 rounded-pill justify-content-start ${styles.pill}`}/>}\n\n {isPastEvent &&\n <div className='d-inline-block rounded-pill bg-light-green mb-1'>\n <SvgContainer svg={CalendarCheckSvg} />\n <p className='d-inline ms-1 mb-0'><Text namespace={namespace} phrase='pastEvent' /></p>\n </div>}\n \n {multiDayEvent && (\n <p className='text-white text-shadow mb-1'>{SpecialEventHelper.getDisplayDate(props.event.startDate, props.event.endDate)}</p>\n )}\n <h2 className={`h4 text-white text-shadow ${props.event.description ? 'clamp-2' : 'clamp-1'}`} title={props.event.name}>{props.event.name}</h2>\n \n </div>\n </div>\n\n <div className='d-none d-sm-block flex-shrink-0 z-1'>\n {!isComingSoon && (\n <ActionButton className={`btn ${isPastEvent ? 'btn-outline-dark' : 'btn-dark'} fw-semibold`}>\n {actionLabel}\n </ActionButton>\n )}\n </div>\n </div>\n </div>\n </AppLink>\n <div className='pre-wrap text-break mb-3' dangerouslySetInnerHTML={{ __html: LinkifyHelper.linkifyText(props.event.description || props.event.content.description) }}/>\n {(isLiveStream(props.event.content) &&\n <div className='d-flex mb-3'>\n <div className='rounded-pill border border-dark px-2 bg-white d-inline-block me-2'>\n {AudienceHelper.getMergedPresentationAudienceString(\n props.event.content.audiences as PresentationAudience[]\n )?.name}\n </div>\n <div className='rounded-pill fw-semibold bg-dark text-white d-inline-block px-2'>\n {`${DateHelper.diffBetween(props.event.content.endDateTime, props.event.content.startDateTime, 'minutes')}m`}\n </div>\n </div>\n )}\n </div>\n </div>\n );\n}\n","import React from 'react';\n\nimport { Timezone, TIMEZONES_US } from 'libs/shared/apps/streamable-learning/constants/Timezones';\nimport { SvgContainer } from 'libs/shared/components/svg-container/SvgContainer';\nimport { GlobeSvg } from 'libs/shared/images/svg/objects/GlobeSvg';\n\nexport function TimezoneIndicator() {\n return (\n <div>\n <SvgContainer svg={GlobeSvg} />\n <span className='ms-1'>{TIMEZONES_US[Timezone.ET]?.name}</span>\n </div>\n );\n}\n","import { DateHelper } from 'libs/common/react/utils/DateHelper';\n\nimport { TimezoneHelper } from 'libs/shared/apps/streamable-learning/utils/TimezoneHelper';\nimport { CalendarEvent, Livestream } from 'libs/shared/interfaces';\n\nexport const CalendarUtils = {\n getStartTime(livestream: Livestream): string {\n return DateHelper.format(\n TimezoneHelper.convertUTCToTimezoneDate(livestream.startDateTime),\n 'h:mm a'\n );\n },\n isSameTime(events: CalendarEvent<Livestream>[], index: number): boolean {\n if (index === 0) return false;\n \n return DateHelper.isSame(\n events[index].content.startDateTime,\n events[index - 1].content.startDateTime\n );\n },\n isPastEvent(livestream: Livestream): boolean {\n return DateHelper.isBefore(livestream.endDateTime, new Date());\n }\n};\n","import { CalendarAppLinks } from 'libs/shared/apps/calendar/interfaces/CalendarAppLinks';\nimport { CalendarImageUrls } from 'libs/shared/apps/calendar/interfaces/CalendarImageUrls';\nimport { MonthQuery } from 'libs/shared/apps/calendar/interfaces/MonthQuery';\nimport { PatchedDate } from 'libs/shared/apps/calendar/utils/CalendarHelper';\nimport { Livestream } from 'libs/shared/interfaces';\n\nimport { ImageUrls } from 'shared/constants/ImageUrls';\nimport { Actions } from 'shared/constants/StreamableActions';\nimport { AppChannels } from 'shared/constants/StreamableRadioChannels';\n\nexport function getCalendarImageUrls(): CalendarImageUrls {\n return {\n emptyState: ImageUrls.EmptyStates.CALENDAR.NO_EVENTS,\n errorState: ImageUrls.EmptyStates.CALENDAR.INVALID_DATE\n };\n}\n\nexport function getCalendarAppLinks(): CalendarAppLinks {\n return {\n calendar: () => ({ application: AppChannels.CALENDAR, action: Actions.Calendar.CALENDAR }),\n month: (month: string) => ({\n application: AppChannels.CALENDAR,\n action: Actions.Calendar.CALENDAR_MONTH,\n args: [month]\n }),\n event: (livestream: Livestream, slug: string) => ({\n application: AppChannels.LIVESTREAMS,\n action: Actions.Livestreams.LIVESTREAM,\n args: [ livestream.id, slug ]\n }),\n eventList: (monthQuery: MonthQuery, date: PatchedDate, presentationId: string) => ({\n application: AppChannels.CALENDAR,\n action: Actions.Calendar.SPECIAL_EVENT_LIST,\n params: {\n ...monthQuery,\n date: date.toString(),\n presentationId: presentationId\n }\n })\n };\n}\n"],"mappings":"y4BCwBM,EAAY,8BAElB,SAAS,EAAa,EAA8C,CAClE,MAAO,cAAe,GACpB,gBAAiB,GACjB,kBAAmB,EAkBvB,SAAgB,EAAqB,EAA+C,CAClF,IAAM,EAAU,EAAM,WAAW,EAAM,MAAM,QAAS,EAAW,QAAQ,EAAM,MAAM,KAAK,CAAC,CAErF,EAAkB,EAAM,qBAAqB,EAAM,MAAM,QAAQ,CACjE,EAAU,EAAM,aAAa,EAAM,MAAM,QAAQ,CACjD,EAAY,EAAM,eAAe,EAAM,MAAM,QAAQ,CACrD,EAAgB,CAAC,CAAC,EAAM,MAAM,QAC9B,EAAe,EAAM,MAAM,QAAQ,SAAW,EAAqB,WACnE,EAAY,EAAM,eAAe,EAAM,MAAM,QAAQ,CACrD,EAAc,EAAM,kBAAkB,CACtC,EAAc,EAAM,cAAc,EAAM,MAAM,QAAQ,CAEtD,EAAqC,CACzC,WAAY,EAAW,MACvB,OAAQ,EAAW,aACnB,SAAU,EAAM,QAAU,EAAgB,cAAgB,EAAgB,YAC3E,CACK,EAAgB,CACpB,QAAS,EAAM,MAAM,QAAQ,GAC7B,QAAS,EAAM,MAAM,eACrB,eAAgB,EAAM,eACtB,KAAM,EAAW,OAAO,IAAI,KAAK,EAAM,MAAM,UAAU,CAAE,aAAa,CACtE,OAAQ,EAAM,MAAM,QAAQ,OAC7B,CAED,OACE,EAAA,EAAA,MAAC,MAAD,CAAA,SAAA,CACG,IACC,EAAA,EAAA,KAAC,KAAD,CAAA,SAAK,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,GAA0C,CACxD,MAAO,CACL,WAAY,EAAU,YAAY,SAAS,UAC3C,WAAY,EAAU,YAAY,SAAS,aAC5C,CAGH,SAAgB,GAAwC,CACtD,MAAO,CACL,cAAiB,CAAE,YAAa,EAAY,SAAU,OAAQ,EAAQ,SAAS,SAAU,EACzF,MAAQ,IAAmB,CACzB,YAAa,EAAY,SACzB,OAAQ,EAAQ,SAAS,eACzB,KAAM,CAAC,EAAM,CACd,EACD,OAAQ,EAAwB,KAAkB,CAChD,YAAa,EAAY,YACzB,OAAQ,EAAQ,YAAY,WAC5B,KAAM,CAAE,EAAW,GAAI,EAAM,CAC9B,EACD,WAAY,EAAwB,EAAmB,KAA4B,CACjF,YAAa,EAAY,SACzB,OAAQ,EAAQ,SAAS,mBACzB,OAAQ,CACN,GAAG,EACH,KAAM,EAAK,UAAU,CACL,iBACjB,CACF,EACF"}
1
+ {"version":3,"file":"D2FqnK9m2.chunk.js","names":[],"sources":["../../../../libs/shared/src/apps/calendar/components/special-event-list-item/special-event-list-item.module.scss","../../../../libs/shared/src/apps/calendar/components/special-event-list-item/SpecialEventListItem.tsx","../../../../libs/shared/src/apps/streamable-learning/components/timezone-indicator/TimezoneIndicator.tsx","../../src/apps/calendar/utils/CalendarUtils.ts","../../src/apps/calendar/views/calendar-view/CalendarViewUtils.ts"],"sourcesContent":[":local {\n .modalWidth {\n width: 40rem;\n max-width: 40rem;\n }\n\n .banner {\n background-position: center;\n background-size: cover; \n height: 6.25rem;\n }\n\n .pill {\n width:fit-content\n }\n\n .logo {\n height: 3.75rem;\n width: 3.75rem;\n }\n}","import React from 'react';\n\nimport { Core } from 'libs/common/backbone/index';\nimport { DateHelper } from 'libs/common/react/utils/DateHelper';\nimport { LinkifyHelper } from 'libs/common/react/utils/LinkifyHelper';\nimport { TextHelper } from 'libs/common/react/utils/TextHelper';\n\nimport { AnalyticsHelper } from 'libs/analytics/AnalyticsHelper';\nimport { AnalyticsOptions, EntityType, LocationContext, UserAction } from 'libs/analytics/interfaces';\n\nimport { ComingSoonTag } from 'libs/shared/apps/calendar/components/coming-soon-tag/ComingSoonTag';\nimport { SpecialEventHelper } from 'libs/shared/apps/calendar/utils/SpecialEventHelper';\nimport { ActionButton } from 'libs/shared/components/actions/ActionButton';\nimport { AppLink } from 'libs/shared/components/app-link/AppLink';\nimport { BaseImage } from 'libs/shared/components/image/BaseImage';\nimport { SvgContainer } from 'libs/shared/components/svg-container/SvgContainer';\nimport { Text } from 'libs/shared/components/text/Text';\nimport { ClassificationStatus } from 'libs/shared/enums/ClassificationStatus';\nimport { CalendarCheckSvg } from 'libs/shared/images/svg/objects/CalendarCheckSvg';\nimport { CalendarEvent, CalendarEventContent, Livestream, PresentationAudience } from 'libs/shared/interfaces';\nimport { AudienceHelper } from 'libs/shared/utils/audience-helper/AudienceHelper';\n\nimport styles from './special-event-list-item.module.scss';\n\nconst namespace = 'shared.specialEventListItem';\n\nfunction isLiveStream(obj: CalendarEventContent): obj is Livestream {\n return 'audiences' in obj &&\n 'endDateTime' in obj &&\n 'startDateTime' in obj;\n}\n\ninterface SpecialEventListItemProps {\n getAppLink: (content: CalendarEventContent, name: string) => Core.AppLink;\n event: CalendarEvent<CalendarEventContent>;\n onClick?: () => void;\n inPopup?: boolean;\n presentationId: string;\n headingClassName?: string;\n getIconUrl?: (content: CalendarEventContent) => string;\n getBackgroundColor?: (content: CalendarEventContent) => string;\n getBannerUrl?: (content: CalendarEventContent) => string;\n getActionLabel?: () => string;\n getStartTime?: (content: CalendarEventContent) => string;\n isPastEvent?: (content: CalendarEventContent) => boolean;\n}\n\nexport function SpecialEventListItem(props: SpecialEventListItemProps): JSX.Element {\n const appLink = props.getAppLink(props.event.content, TextHelper.slugify(props.event.name));\n\n const backgroundColor = props.getBackgroundColor?.(props.event.content);\n const iconUrl = props.getIconUrl?.(props.event.content);\n const bannerUrl = props.getBannerUrl?.(props.event.content);\n const multiDayEvent = !!props.event.endDate;\n const isComingSoon = props.event.content.status === ClassificationStatus.ComingSoon;\n const startTime = props.getStartTime?.(props.event.content);\n const actionLabel = props.getActionLabel?.();\n const isPastEvent = props.isPastEvent?.(props.event.content);\n\n const analyticsOptions: AnalyticsOptions = {\n actionType: UserAction.Click,\n entity: EntityType.SpecialEvent,\n location: props.inPopup ? LocationContext.CalendarPopup : LocationContext.CalendarDay\n };\n const analyticsData = {\n topicId: props.event.content.id,\n eventId: props.event.specialEventId,\n presentationId: props.presentationId,\n date: DateHelper.format(new Date(props.event.startDate), 'YYYY-MM-DD'),\n status: props.event.content.status\n };\n\n return (\n <div>\n {startTime && (\n <h6>{startTime}</h6>\n )}\n\n <div onClick={() => {\n if (isComingSoon)\n AnalyticsHelper.logUserAction(analyticsData, analyticsOptions);\n }}>\n <AppLink\n appLink={!isComingSoon && appLink}\n className={`${!isComingSoon ? 'cursor-pointer' : ''} text-decoration-none mb-2`}\n onClick={props.onClick}\n analyticsOptions={analyticsOptions}\n analyticsData={analyticsData}\n >\n <div\n className={`banner rounded-3 position-relative position-relative ${styles.banner}`}\n style={{ backgroundColor, backgroundImage: `url('${bannerUrl}')` }}\n >\n {isPastEvent && (\n <div className='bg-white w-100 h-100 opacity-50 position-absolute top-0 left-0 z-0' />\n )}\n <div className='d-flex justify-content-between align-items-center w-100 h-100 px-3'>\n <div className='d-flex align-items-center z-1'>\n {iconUrl && (\n <div className={`${styles.logo} rounded-circle flex-shrink-0 overflow-hidden me-2`}>\n <BaseImage data={iconUrl} />\n </div>\n )}\n <div>\n {isComingSoon && <ComingSoonTag className={`pe-2 fw-semibold mb-1 rounded-pill justify-content-start ${styles.pill}`}/>}\n\n {isPastEvent &&\n <div className='d-inline-block rounded-pill bg-light-green mb-1'>\n <SvgContainer svg={CalendarCheckSvg} />\n <p className='d-inline ms-1 mb-0'><Text namespace={namespace} phrase='pastEvent' /></p>\n </div>}\n \n {multiDayEvent && (\n <p className='text-white text-shadow mb-1'>{SpecialEventHelper.getDisplayDate(props.event.startDate, props.event.endDate)}</p>\n )}\n <h2 className={`h4 text-white text-shadow ${props.event.description ? 'clamp-2' : 'clamp-1'}`} title={props.event.name}>{props.event.name}</h2>\n \n </div>\n </div>\n\n <div className='d-none d-sm-block flex-shrink-0 z-1'>\n {!isComingSoon && (\n <ActionButton className={`btn ${isPastEvent ? 'btn-outline-dark' : 'btn-dark'} fw-semibold`}>\n {actionLabel}\n </ActionButton>\n )}\n </div>\n </div>\n </div>\n </AppLink>\n <div className='pre-wrap text-break mb-3' dangerouslySetInnerHTML={{ __html: LinkifyHelper.linkifyText(props.event.description || props.event.content.description) }}/>\n {(isLiveStream(props.event.content) &&\n <div className='d-flex mb-3'>\n <div className='rounded-pill border border-dark px-2 bg-white d-inline-block me-2'>\n {AudienceHelper.getMergedPresentationAudienceString(\n props.event.content.audiences as PresentationAudience[]\n )?.name}\n </div>\n <div className='rounded-pill fw-semibold bg-dark text-white d-inline-block px-2'>\n {`${DateHelper.diffBetween(props.event.content.endDateTime, props.event.content.startDateTime, 'minutes')}m`}\n </div>\n </div>\n )}\n </div>\n </div>\n );\n}\n","import React from 'react';\n\nimport { Timezone, TIMEZONES_US } from 'libs/shared/apps/streamable-learning/constants/Timezones';\nimport { SvgContainer } from 'libs/shared/components/svg-container/SvgContainer';\nimport { GlobeSvg } from 'libs/shared/images/svg/objects/GlobeSvg';\n\nexport function TimezoneIndicator() {\n return (\n <div>\n <SvgContainer svg={GlobeSvg} />\n <span className='ms-1'>{TIMEZONES_US[Timezone.ET]?.name}</span>\n </div>\n );\n}\n","import { DateHelper } from 'libs/common/react/utils/DateHelper';\n\nimport { TimezoneHelper } from 'libs/shared/apps/streamable-learning/utils/TimezoneHelper';\nimport { CalendarEvent, Livestream } from 'libs/shared/interfaces';\n\nexport const CalendarUtils = {\n getStartTime(livestream: Livestream): string {\n return DateHelper.format(\n TimezoneHelper.convertUTCToTimezoneDate(livestream.startDateTime),\n 'h:mm a'\n );\n },\n isSameTime(events: CalendarEvent<Livestream>[], index: number): boolean {\n if (index === 0) return false;\n \n return DateHelper.isSame(\n events[index].content.startDateTime,\n events[index - 1].content.startDateTime\n );\n },\n isPastEvent(livestream: Livestream): boolean {\n return DateHelper.isBefore(livestream.endDateTime, new Date());\n }\n};\n","import { CalendarAppLinks } from 'libs/shared/apps/calendar/interfaces/CalendarAppLinks';\nimport { CalendarImageUrls } from 'libs/shared/apps/calendar/interfaces/CalendarImageUrls';\nimport { MonthQuery } from 'libs/shared/apps/calendar/interfaces/MonthQuery';\nimport { PatchedDate } from 'libs/shared/apps/calendar/utils/CalendarHelper';\nimport { Livestream } from 'libs/shared/interfaces';\n\nimport { ImageUrls } from 'shared/constants/ImageUrls';\nimport { Actions } from 'shared/constants/StreamableActions';\nimport { AppChannels } from 'shared/constants/StreamableRadioChannels';\n\nexport function getCalendarImageUrls(): CalendarImageUrls {\n return {\n emptyState: ImageUrls.EmptyStates.CALENDAR.NO_EVENTS,\n errorState: ImageUrls.EmptyStates.CALENDAR.INVALID_DATE\n };\n}\n\nexport function getCalendarAppLinks(): CalendarAppLinks {\n return {\n calendar: () => ({ application: AppChannels.CALENDAR, action: Actions.Calendar.CALENDAR }),\n month: (month: string) => ({\n application: AppChannels.CALENDAR,\n action: Actions.Calendar.CALENDAR_MONTH,\n args: [month]\n }),\n event: (livestream: Livestream, slug: string) => ({\n application: AppChannels.LIVESTREAMS,\n action: Actions.Livestreams.LIVESTREAM,\n args: [ livestream.id, slug ]\n }),\n eventList: (monthQuery: MonthQuery, date: PatchedDate, presentationId: string) => ({\n application: AppChannels.CALENDAR,\n action: Actions.Calendar.SPECIAL_EVENT_LIST,\n params: {\n ...monthQuery,\n date: date.toString(),\n presentationId: presentationId\n }\n })\n };\n}\n"],"mappings":"y4BCwBM,EAAY,8BAElB,SAAS,EAAa,EAA8C,CAClE,MAAO,cAAe,GACpB,gBAAiB,GACjB,kBAAmB,EAkBvB,SAAgB,EAAqB,EAA+C,CAClF,IAAM,EAAU,EAAM,WAAW,EAAM,MAAM,QAAS,EAAW,QAAQ,EAAM,MAAM,KAAK,CAAC,CAErF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CACL,iBACjB,CACF,EACF"}
@@ -1,2 +1,2 @@
1
- import{gt as e,v as t}from"./Dp9qJj1C.chunk.js";import{r as n}from"./BJvPfCvt.chunk.js";import{t as r}from"./ImQRQGZr.chunk.js";import{C as i,E as a,M as o,l as s,lt as c,m as l,n as u,ut as d,x as f}from"./Dun43GrB.chunk.js";import{n as p}from"./Xo0rk19-.chunk.js";import{t as m}from"./B-OL6Vs7.chunk.js";import{l as h}from"./BQ5XMoHG.chunk.js";import{t as g}from"./B7tm2CBz.chunk.js";import{t as ee}from"./C9ET3pjZ.chunk.js";import{t as te}from"./ibuOpDkQ.chunk.js";import{t as ne}from"./CxwN2xIE.chunk.js";import{t as _}from"./DeldjYRc.chunk.js";import{t as v}from"./BVWg3YHX.chunk.js";import{t as y}from"./BYYiNmLB.chunk.js";import{a as re,c as b,i as x,n as ie,o as S,r as C,s as w,t as T}from"./oTYyWWB-.chunk.js";import{n as E,t as D}from"./Ca1QPe-q2.chunk.js";import{t as ae}from"./Cz6swPXe2.chunk.js";import{n as O,t as k}from"./D7d5XFW82.chunk.js";import{n as oe,t as se}from"./DjIdG9LL2.chunk.js";import{t as ce}from"./B13dpWxS2.chunk.js";import{n as le}from"./CL1ST5J62.chunk.js";import{t as ue}from"./DUNFBIIl2.chunk.js";import{s as de,t as fe}from"./BpgHKWR52.chunk.js";import{a as A,i as j,r as M}from"./B8R4YVaF2.chunk.js";import{n as N,t as P}from"./Bx_V3too2.chunk.js";import{t as F}from"./CoualKDX.chunk.js";import{t as I}from"./iTHYgnO8.chunk.js";import{H as pe,I as me,N as L,X as he,q as ge,w as _e}from"./app-BIigh9wv.js";import{t as ve}from"./BRiYVLuz.chunk.js";import{t as R}from"./DlFudnBx.chunk.js";import{t as ye}from"./CZb3E982.chunk.js";import{t as be}from"./CwttNCGZ.chunk.js";import{t as z}from"./C9tPKnK22.chunk.js";import{t as xe}from"./BTqtjOL02.chunk.js";import{a as Se}from"./DK3xia1t.chunk.js";import{t as Ce}from"./CCoZQmgX.chunk.js";import{t as B}from"./BlBCp_pE.chunk.js";import{n as we,r as Te,t as Ee}from"./DnSy_Myx.chunk.js";import{n as De,t as Oe}from"./B5jBIPaP.chunk.js";import{n as ke,t as Ae}from"./Dr1flAez.chunk.js";import{t as je}from"./DIavEegC.chunk.js";import{t as Me}from"./BOTX-kIq.chunk.js";import{t as V}from"./D0SYGnyF.chunk.js";import{t as Ne}from"./CUOEhUTb2.chunk.js";import{t as Pe}from"./BKnxYKDu2.chunk.js";import{t as Fe}from"./D7tastET2.chunk.js";var H=e(d()),U=c(),W=`subject.classificationHeaderDetails`,G=({className:e})=>(0,U.jsx)(`span`,{className:e,children:`•`});function Ie(e){let{dashboardVideoCount:t,childDashboardVideoCount:n,dashboardResourceCount:r,childDashboardResourceCount:i,childClassificationCount:a}=b.getCounts(e.classification),o=t+n,s=r+i;return(0,U.jsxs)(`p`,{className:`mb-n1 font-size-normal fw-normal mt-1`,children:[!!a&&(0,U.jsx)(O,{namespace:W,phrase:`topics`,options:{count:a.toLocaleString(),smartCount:a}}),!!o&&(0,U.jsxs)(U.Fragment,{children:[a>0&&(0,U.jsx)(G,{className:`mx-2`}),(0,U.jsx)(O,{namespace:W,phrase:`videos`,options:{count:o.toLocaleString(),smartCount:o}})]}),!!s&&(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(G,{className:`mx-2`}),(0,U.jsx)(O,{namespace:W,phrase:`resources`,options:{count:s.toLocaleString(),smartCount:s}})]})]})}var K=`subjects.curatedClassificationEmptyState`,Le=r.encloseNamespace(K);function Re(e){let t=e.dashboard?.status===P.Archived;return(0,U.jsx)(k.Provider,{value:K,children:(0,U.jsxs)(I,{children:[(0,U.jsx)(I.Image,{src:e.imageUrl,altText:Le(`headingForNP`)}),e.isReadonly?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(I.Heading,{children:(0,U.jsx)(O,{namespace:K,phrase:`headingForCurator`})}),(0,U.jsx)(I.Info,{children:(0,U.jsx)(O,{namespace:K,phrase:`info`})}),(0,U.jsx)(n,{title:t?r.getPhrase(K,`archivedCtaTooltip`):``,spanHack:!0,children:(0,U.jsx)(I.Cta,{text:r.getPhrase(K,`add`),appLink:e.addWidgetApplink?.(),className:`btn btn-dark`,icon:be,disabled:t})})]}):(0,U.jsx)(I.Heading,{children:(0,U.jsx)(O,{phrase:`headingForNP`})})]})})}var q={itemsWrapper:`_itemsWrapper_tzf1d_1`,anchorWrapper:`_anchorWrapper_tzf1d_5`,default:`_default_tzf1d_36`,selectedItem:`_selectedItem_tzf1d_47`,disabled:`_disabled_tzf1d_62`,floatIcon:`_floatIcon_tzf1d_69`,arrowIcon:`_arrowIcon_tzf1d_75`,listIcon:`_listIcon_tzf1d_78`,tocIndent1:`_tocIndent1_tzf1d_87`,tocIndent2:`_tocIndent2_tzf1d_90`};function ze(e){let t={actionType:i.Click,entity:s.Widget,location:l.TableOfContents};function n(t){Me.preventScrollTop(),e.setControlledId(t.id),e.onItemClick?.(t),setTimeout(()=>document.getElementById(t.id)?.focus())}function r(e){return e.tocIndentation===1?q.tocIndent1:e.tocIndentation===2?q.tocIndent2:``}return(0,U.jsx)(`div`,{className:`${q.itemsWrapper}`,children:e.items.map((i,a)=>e.localState?(0,U.jsx)(E,{className:`${q.anchorWrapper} ${e.activeId===i.id?q.selectedItem:``}`,onClick:()=>{n(i)},children:(0,U.jsx)(`div`,{className:`${!e.activeId&&a===0?q.default:``} `,children:i.name})},i.id):(0,U.jsx)(D,{appLink:e.getAppLink(i),appLinkOptions:{replace:!0},className:`${q.anchorWrapper} ${e.activeId===i.id?q.selectedItem:``}`,onClick:()=>{n(i)},analyticsData:{...e.analyticsData,id:i.id,name:i.name},analyticsOptions:t,children:(0,U.jsx)(`div`,{className:`${!e.activeId&&a===0?q.default:``} ${r(i)}`,children:i.name})},i.id))})}var J={container:`_container_1n8qw_1`,mobile:`_mobile_1n8qw_7`};function Be(e){let[t,n]=H.useState(!1);function r(){let n={actionType:t?i.Hide:i.Open,entity:s.TableOfContents,location:l.Dashboard};u.logUserAction(e.analyticsData,n)}function a(){n(!t),r()}return(0,U.jsxs)(`div`,{className:`${J.mobile} d-inline-flex gap-1`,children:[t&&(0,U.jsxs)(`div`,{className:`bg-white px-3 pt-3 pb-2 border border-dark rounded-1 ps-3`,children:[(0,U.jsx)(`h2`,{className:`h5`,children:e.title}),(0,U.jsx)(ze,{items:e.widgets.map(e=>({name:e.name,id:e.id,tocIndentation:e.metadata.tocIndentation})),activeId:e.activeId,appLink:e.appLink,analyticsData:e.analyticsData,setControlledId:e.setControlledId,getAppLink:e.getAppLink,onItemClick:()=>n(!1)})]}),(0,U.jsx)(`div`,{className:J.container,children:(0,U.jsx)(ae,{className:`btn btn-outline-dark`,svg:xe,onClick:a})})]})}function Ve(e){return(0,U.jsx)(`aside`,{className:`col-3 order-1`,children:(0,U.jsxs)(`div`,{className:`${J.container} ps-3`,children:[(0,U.jsx)(`h2`,{className:`h5`,children:e.title}),(0,U.jsx)(ze,{items:e.widgets.map(e=>({name:e.name,id:e.id,tocIndentation:e.metadata.tocIndentation})),activeId:e.activeId,appLink:e.appLink,analyticsData:e.analyticsData,setControlledId:e.setControlledId,getAppLink:e.getAppLink})]})})}function He(e){function t(e){let t=ne.getCurrentRoute().appLink,n=t.params?{...t.params}:{};return n.tocId=e.id,{...t,params:n}}return(0,U.jsx)(U.Fragment,{children:e.isSmallScreen?(0,U.jsx)(Be,{...e,getAppLink:t}):(0,U.jsx)(Ve,{...e,getAppLink:t})})}var Ue=`subjects.teacherOnlyEmptyState`,We=r.encloseNamespace(Ue);function Ge(e){return(0,U.jsx)(k.Provider,{value:Ue,children:(0,U.jsxs)(I,{children:[(0,U.jsx)(I.Image,{src:e.imageUrl,altText:We(`heading`)}),(0,U.jsx)(I.Heading,{children:(0,U.jsx)(O,{phrase:`heading`})}),(0,U.jsx)(I.Info,{children:(0,U.jsx)(O,{phrase:`info`})}),(0,U.jsx)(I.Cta,{text:We(`cta`),appLink:e.ctaAppLink?.(),className:`btn btn-dark`})]})})}function Ke(e,t){let{isSystemGeneratedDashboard:n,systemGeneratedVideoWidget:r}=H.useMemo(()=>e?{isSystemGeneratedDashboard:M.isSystemGeneratedDashboard(e.widgets),systemGeneratedVideoWidget:e.widgets.find(e=>e.widgetId===j.ClassificationPinnedVideos&&e.templateId!==A.ThumbnailVerticalList)}:{isSystemGeneratedDashboard:!1,systemGeneratedVideoWidget:null},[e?.id]),i=h(!!r&&V.dashboardWidgetContent(r?.id,M.getWidgetParams(r.widgetId,r.templateId,M.getDashboardTargetType(e),t?.map(e=>e.masterId)),r?.templateId));return n?{widgets:e?.widgets?.filter(e=>e.widgetId!==j.ClassificationPinnedVideos||e.templateId===A.ThumbnailVerticalList)??[],videoList:i.data?.content??[],videoListWidgetId:r?.id}:{widgets:g.sortBy(e?.widgets,`index`)}}var Y,qe=({setActiveId:e,headingElements:t,controlledId:n,setControlledId:r})=>{let i=H.useRef(0);H.useEffect(()=>{let a=new IntersectionObserver(a=>{a.forEach(a=>{if(n){e(n),Y=window.setTimeout(()=>{r(``)},800);return}if(a.isIntersecting)e(a.target.id),i.current=window.scrollY;else{let n=i.current-window.scrollY>0,r=t[t.findIndex(e=>e.id===a.target.id)-1];n&&r?.id&&e(r?.id)}})},{rootMargin:`-67px 0px -80% 0px`});return t.forEach(e=>a.observe(e)),()=>{Y&&window.clearTimeout(Y),a.disconnect()}},[e,t.length,n])};function Je(e){let t=H.useRef(null);return H.useEffect(()=>{t.current=e}),t.current}var Ye=80,Xe=(e,t)=>{let[n,r]=H.useState(!1),i=Je(t),a=t;H.useLayoutEffect(()=>{if(!n||i!==a){let t=e.find(e=>e&&e?.id===a);if(t){let e=t.getBoundingClientRect();window.scrollBy({top:e.top-Ye,behavior:`smooth`}),n||r(!0)}}},[e,i,a,n])},Ze=`subjects.classificationComingSoon`,Qe=r.encloseNamespace(Ze);function $e(e){let t=!!e.data.followers?.data?.length;function n(){e.onToggleFollow?.()}return(0,U.jsx)(k.Provider,{value:Ze,children:(0,U.jsxs)(I,{className:`pt-0`,children:[(0,U.jsx)(I.Image,{src:e.imageUrl,altText:Qe(`comingSoon`)}),(0,U.jsx)(I.Heading,{children:(0,U.jsx)(O,{phrase:`comingSoon`})}),(0,U.jsx)(I.Info,{children:(0,U.jsx)(O,{phrase:e.showSignUp?`infoAnon`:`info`})}),e.canFollowSubjects&&(0,U.jsx)(pe,{svg:t?x:C,onClick:n,showSpinner:e.showFollowButtonSpinner,className:`btn follow-btn me-2 ${t?`btn-outline-dark`:`btn-dark`}`,children:(0,U.jsx)(O,{phrase:t?`following`:`follow`})}),e.showSignUp&&!e.canFollowSubjects&&(0,U.jsx)(D,{appLink:e.signUpAppLink,className:`btn btn-dark d-none d-lg-inline-block`,analyticsOptions:{actionType:i.Click,location:l.ClassificationComingSoon,entity:s.AppLink,workflowPhase:a.Start,descriptor:f.SignUp},analyticsData:{},tag:`button`,children:Qe(`signUp`)})]})})}function et(e){return(0,U.jsx)(we,{audiences:e.audiences,activeAudiences:e.activeAudiences,disabled:e.disabled,appLink:e.appLink,disablePersist:e.disablePersist,tooltip:e.tooltip})}function tt(e){return(0,U.jsx)(`svg`,{...e,children:(0,U.jsx)(`path`,{d:`M4.5 4a.5.5 0 0 0 0 1h16a.5.5 0 0 1 .5.5v12a.5.5 0 0 0 1 0v-12A1.5 1.5 0 0 0 20.5 4zM9 10.26a.256.256 0 0 1 .39-.218l4.482 2.74a.256.256 0 0 1 0 .437L9.39 15.958A.256.256 0 0 1 9 15.739zM18.5 6A1.5 1.5 0 0 1 20 7.5v11a1.5 1.5 0 0 1-1.5 1.5h-15A1.5 1.5 0 0 1 2 18.5v-11A1.5 1.5 0 0 1 3.5 6zm-15 1a.5.5 0 0 0-.5.5v11a.5.5 0 0 0 .5.5h15a.5.5 0 0 0 .5-.5v-11a.5.5 0 0 0-.5-.5z`,fill:`currentColor`})})}function nt(e){let[t,n]=le(`directory:product:tip:switcher`,{on:!1,tab:e||`new-releases`});return H.useEffect(()=>{e&&n(`tab`,e)},[e]),H.useEffect(()=>{let e=null;return t.on&&(e=window.setInterval(()=>{t.tab===`new-releases`||t.tab===`all-topics`?n(`tab`,t.tab===`new-releases`?`all-topics`:`new-releases`):n(`tab`,t.tab===`curated-topic`?`video-list`:`curated-topic`)},2e3)),()=>{window.clearInterval(e)}},[t.on,t.tab]),{tab:t.tab,isHighlighting:t.on,start:()=>n(`on`,!0),stop:()=>{n({on:!1,tab:e||t.tab})}}}var X={curatedTopicTab:`_curatedTopicTab_1ji5o_1`,tabTransition:`_tabTransition_1ji5o_4`},Z=`shared.classificationDashboard`;function rt(e,n,a,o){let c=n.lg||n.xl||n.xxl||n.xs;function u(){let e=o?X.tabTransition:``;return n.xs?e+` w-100`:c?e=` ${X.curatedTopicTab}`:e}return b.isTopLevelTopic(e.classification)?[{name:c?r.getPhrase(Z,`newReleases`):``,appLink:e.appLinks?.classification?.(e.classification),active:a===`new-releases`,svg:re,analyticsData:{id:`new-releases`,classificationId:e.classification.id,classificationName:e.classification.name,presentationId:e.presentation.id,presentationDescription:e.presentation.description,name:r.getPhrase(Z,`newReleases`),url:t.getHref(e.appLinks?.classification?.(e.classification))},analyticsOptions:{actionType:i.Click,entity:s.Url,location:l.MagicTabs},className:`${n.xs?`w-100`:``} ${o?X.tabTransition:``}`},{name:c?r.getPhrase(Z,`allTopics`):``,appLink:e.appLinks?.classificationDirectory?.(e.classification),active:a===`all-topics`,svg:w,analyticsData:{id:`all-topics`,classificationId:e.classification.id,classificationName:e.classification.name,presentationId:e.presentation.id,presentationDescription:e.presentation.description,name:r.getPhrase(Z,`allTopics`),url:t.getHref(e.appLinks?.classificationDirectory?.(e.classification))},analyticsOptions:{actionType:i.Click,entity:s.Url,location:l.MagicTabs},className:`${n.xs?`w-100`:``} ${o?X.tabTransition:``}`}]:[{name:c?r.getPhrase(Z,`topic`):``,appLink:e.appLinks?.classification?.(e.classification),active:a===`curated-topic`,svg:S,analyticsData:{id:`curated-topic`,classificationId:e.classification.id,classificationName:e.classification.name,presentationId:e.presentation.id,presentationDescription:e.presentation.description,name:r.getPhrase(Z,`topic`),url:t.getHref(e.appLinks?.classification?.(e.classification))},analyticsOptions:{actionType:i.Click,entity:s.Url,location:l.MagicTabs},className:u()},{name:c?r.getPhrase(Z,`curriculum`):``,appLink:e.appLinks?.classificationCurriculum?.(e.classification),active:a===`curriculum`,svg:tt,analyticsData:{id:`curriculum`,classificationId:e.classification.id,classificationName:e.classification.name,presentationId:e.presentation.id,presentationDescription:e.presentation.description,name:r.getPhrase(Z,`curriculum`),url:t.getHref(e.appLinks?.classificationCurriculum?.(e.classification))},analyticsOptions:{actionType:i.Click,entity:s.Url,location:l.MagicTabs},className:`${n.xs?`w-100`:``} ${o?X.tabTransition:``}`}]}function it(e){let t=L(),{tab:n,isHighlighting:r}=nt(e.activeTab);return(0,U.jsx)(Ce,{borderRadius:`sm`,className:t.xs?`w-100`:``,listClassName:`d-flex flex-nowrap`,tabs:rt(e,t,n,r)})}function at(e,t,n,r,i){return!!(i||r&&!t?.length||!z.shouldShowAudiences(e)||n===`curriculum`)}function ot(e){let t=L(),n=at(e.audiences,e.activeAudiences,e.activeTab,e.isEmpty,e.isComingSoon);function r(){return!e.classification||!e.dashboard||M.isSystemGeneratedDashboard(e.dashboard.widgets)?!1:b.isTopLevelTopic(e.classification)?e.hasTopicDirectoryDashboard:!!(e.classification.externalMetadata?.isCurated&&e.hasTopicCurriculumDashboard)}function i(){let i=`d-flex flex-column py-3 mb-3`;return e.isComingSoon||(i+=` border-bottom`),(r()||n)&&!t.xs?i:i+` row-gap-3`}function a(){if(n)return t.xs?`d-flex flex-column justify-content-between row-gap-3`:`d-flex align-items-center justify-content-between`;let e=``;return e+=`d-flex align-items-center justify-content-between mb-1`,t.xs&&(e+=` row-gap-3 mb-0`),e}function o(){let e=`d-flex align-items-end justify-content-between`;return t.xs&&(e+=` row-gap-3 flex-wrap`),e}return(0,U.jsxs)(`div`,{className:i(),children:[(0,U.jsxs)(`div`,{className:a(),children:[(0,U.jsx)(Ae,{breadcrumbs:e.getBreadcrumbs?.()}),r()&&n&&(0,U.jsx)(it,{classification:e.classification,activeTab:e.activeTab,appLinks:e.appLinks,presentation:e.presentation})]}),(0,U.jsxs)(`div`,{className:o(),children:[!n&&(0,U.jsx)(et,{audiences:e.audiences,activeAudiences:e.activeAudiences,appLink:e.appLinks.audience?.(),disabled:e.disableAudiences,tooltip:e.audienceTooltip,disablePersist:!e.isViewingCurrentPresentation}),r()&&!n&&(0,U.jsx)(it,{classification:e.classification,activeTab:e.activeTab,appLinks:e.appLinks,presentation:e.presentation})]})]})}var st=`shared.classificationDashboard`;function Q(e){return e.widgetId===j.Blurb&&e.templateId===A.Heading}function ct(e){return e.widgetId===j.CuratedClassifications||e.widgetId===j.Classifications}lt.defaultProps={appLinks:{}};function lt(e){let{widgets:t,videoList:n,videoListWidgetId:i}=Ke(e.dashboard,e.activeAudiences),a=ce(_e.LGDown),o=H.useRef(new Set),s=H.useMemo(()=>t.reduce((e,t)=>(e[t.id]=!1,e),{}),[t?.length]),[c,u]=H.useState(s),[d,f]=H.useState(e.tableOfContentsId),[p,m]=H.useState(``),h=Array.from(o.current);Xe(h,d),qe({setActiveId:m,headingElements:h,controlledId:d,setControlledId:f});let g=e.classification.type===ye.Hub;function te(){return e.isComingSoon||e.isTeacherOnly?!1:!e.dashboard||e.dashboard.status===P.Archived&&!e.isReadonly||e.dashboard.status===P.Draft&&!e.isPreviewing||!t?.length?!0:n&&n.length?!1:Object.values(c).every(e=>!!e)}function ne(t,n,r){let i=M.getWidgetParams(n,r,M.getDashboardTargetType(e.dashboard),e.activeAudiences?.map(e=>e.masterId),e.curriculums.preferredCurriculum?.id);return e.getWidgetContentRequest(t,i,r)}let _=te();H.useEffect(()=>{_&&u(s)},[t?.length]);let v=H.useCallback((n,r)=>{if(c[n]===r)return;let i={...c,[n]:r};if(M.isType(e.dashboard,N.ClassificationDirectory)){u(i);return}let a=0;for(;a<t.length;){let e=t[a];if(!Q(e)){a++;continue}let n=!0,r=a+1;for(;n&&r<t.length;){let e=t[r];if(Q(e))break;!i[e.id]&&!ct(e)&&(n=!1),r++}a=r,i[e.id]=n}u(i)},[c,t]);function y(e){return Q(e)&&c[e.id]}function re(){let t=M.getDashboardTargetType(e.dashboard);return!(e.moviesAndTv||t===N.ClassificationCurriculum)}function x(e,n){return e.widgetId===j.ClassificationDashboardExternalMedia&&c[t[n-1].id]?e.name.replace(`Other videos`,`Videos`):e.name}let S=t.filter(e=>!y(e)&&!!e.metadata?.showInTableOfContents),C=t.every(ct),w=S.length>=2,T=w&&!a&&!g,E=e.settings?.hasTopicDirectories&&b.isTopLevelTopic(e.classification)&&!e.isTertiaryCustomerWithoutExchange;return(0,U.jsxs)(`div`,{className:`bg-white px-4 ${re()?`dashboard-spacing-lg`:``}`,children:[g&&(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`h1`,{className:`h2 mb-4`,children:e.classification.name}),(0,U.jsx)(`hr`,{className:`mt-2`})]}),!g&&(0,U.jsx)(Oe,{heading:e.classification.name,banner:e.classification.banner,imageCdnUrl:e.imageCdnUrl,actions:e.getBannerActions?.(),actionsDropdownClassName:`btn btn-outline-dark`,specialEvent:e.specialEvent,calendarTheme:{background:`bg-light-blue`,border:`border-light-blue`},showComingSoon:e.isComingSoon,detailsComponent:E?()=>(0,U.jsx)(Ie,{classification:e.classification}):null}),!g&&(0,U.jsx)(ot,{dashboard:e.dashboard,classification:e.classification,presentation:e.presentation,appLinks:e.appLinks,activeTab:e.tab,audiences:e.audiences,activeAudiences:e.activeAudiences,getBreadcrumbs:e.getBreadcrumbs,hasTopicDirectoryDashboard:e.hasTopicDirectoryDashboard,hasTopicCurriculumDashboard:e.hasTopicCurriculumDashboard,isComingSoon:e.isComingSoon,isEmpty:_,isViewingCurrentPresentation:e.isViewCurrentPresentation,disableAudiences:C||e.isReadonly,audienceTooltip:C?r.getPhrase(st,`audienceTooltip`):``}),e.isComingSoon&&(0,U.jsx)($e,{imageUrl:e.comingSoonImageUrl,data:e.classification,canFollowSubjects:e.canFollowSubjects,showFollowButtonSpinner:e.showFollowButtonSpinner,onToggleFollow:()=>e.onToggleFollow(e.classification,l.ClassificationComingSoon),showSignUp:!e.hasLocalPermissions(ee.FollowComingSoonTopics),signUpAppLink:e.appLinks.signUp?.()}),!e.isComingSoon&&(0,U.jsxs)(`div`,{className:`${T?`row no-wrap`:``}`,children:[w&&(0,U.jsx)(He,{widgets:S,title:e.classification.name,activeId:p,clickable:!e.isReadonly,analyticsData:e.analyticsData,setControlledId:f,isSmallScreen:a}),(0,U.jsx)(`div`,{className:T?`col-9 order-0`:``,children:t.map((t,n)=>y(t)?(0,U.jsx)(H.Fragment,{},t.id):(0,U.jsx)(ie,{widgetCollection:N.Classification,headingElementRef:o,id:t.id,name:x(t,n),description:t.description,classification:e.classification,templateId:t.templateId,widgetTypeId:t.widgetId,audiences:e.audiences,getContentRequest:ne,setIsEmpty:v,appLinks:e.appLinks,presentation:e.presentation,analyticsData:e.analyticsData,isScrollToTargetWidget:e.scrollToWidgetId===t.id,imageCdnUrl:e.imageCdnUrl,onSubmitFeedback:e.onSubmitFeedback,metadata:t.metadata,isBot:e.isBot,hasTableOfContents:T,lazyLoad:e.lazyLoad,dashboardTarget:M.getDashboardTargetType(e.dashboard),widgetIndex:n,hasPermissions:e.hasPermissions,hasLocalPermissions:e.hasLocalPermissions,isPreviewing:e.isReadonly,contentType:e.contentType,resourceThumbnailFallbackImageUrl:e.resourceThumbnailFallbackImageUrl,onToggleFollowClassification:e.onToggleFollow,settings:e.settings,isEditing:e.isReadonly,isTertiaryCustomerWithoutExchange:e.isTertiaryCustomerWithoutExchange,commonVideoProps:e.commonVideoProps,curriculums:e.curriculums,limitTotalItems:!1,seeMoreLink:null,onClickRemoveItem:null,badgeComponent:null},t.id))}),!!n?.length&&(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(Se,{name:r.getPhrase(st,`videos`)}),(0,U.jsx)(fe,{videos:n,getVideoAppLink:(t,n)=>e.appLinks.videoType(t,{...n,contextId:i,includeContext:n.includeContext}),hasPermissions:e.hasPermissions,presentationAudiences:e.audiences,getPreviewQuestionsAppLink:e.appLinks.previewQuestions,commonVideoProps:e.commonVideoProps})]})]}),_&&(0,U.jsx)(Re,{dashboard:e.dashboard,isReadonly:e.isReadonly,imageUrl:e.emptyImageUrl,addWidgetApplink:e.appLinks.widgetWizard}),e.isTeacherOnly&&(0,U.jsx)(Ge,{imageUrl:e.emptyImageUrl,ctaAppLink:()=>e.appLinks.allTopics(e.classification.presentationId)})]})}var $=`subjects.topicNotFoundError`,ut=class extends p{constructor(){super(`Topic doesn't exist`)}get name(){return`TopicNotFoundError`}get heading(){return r.getPhrase($,`heading`)}get description(){return r.getPhrase($,`description`)}get cta(){return{text:r.getPhrase($,`cta`),appLink:{application:m.SUBJECTS,action:_.Subjects.CLASSIFICATION_ALL}}}};function dt(){return(0,U.jsxs)(`div`,{className:`bg-white px-4`,children:[(0,U.jsx)(De,{}),(0,U.jsxs)(`div`,{className:`d-flex flex-column row-gap-3 py-3 mb-3 border-bottom`,children:[(0,U.jsx)(ke,{}),(0,U.jsx)(Te,{})]})]})}var ft=r.encloseNamespace(`subjects.classificationView`);function pt(e,t){return{...F,classification:n=>F.classification(n||e,t),classificationDirectory:()=>F.classificationDirectory(t),audience:()=>F.classification(e,t),previewQuestions:()=>null,series:()=>null,latestReleases:()=>null,classificationLatestReleases:()=>null,playlist:()=>null,signUp:()=>null,widgetWizard:()=>null,classificationCurriculum:()=>null,searchSettings:()=>null,searchHome:()=>null,search:()=>null,editCurriculum:()=>null,getPreviewQuestionsAppLink:()=>null}}function mt(e){let{classification:t,path:n,appLinks:r}=e,i=[{name:ft(`discover`),appLink:{application:m.DASHBOARD,action:_.Dashboard.HOME}},{name:ft(`exploreAllTopicsHeading`),appLink:{application:m.SUBJECTS,action:_.Subjects.CLASSIFICATION_ALL}}];return n.forEach(e=>{i.push({name:e.name,appLink:r.classification(e),active:e.name===t.name})}),i}var ht=r.encloseNamespace(`subjects.classificationView`);function gt(e){return e?o.pick(e,[`a`,`dashboardId`,`tocId`]):{}}function _t(e){let t=Ne(`video-list`),{commonVideoProps:n}=je(),r=h(he.config()),i=h(te.currentUser()),a=Fe(),o=h(ge.streamablePresentation()),s=h(R.classification(e.id,i.data?.id)),{dashboard:c,isPreviewing:l}=T({targetType:N.Classification,dashboardId:e.queryParams?.dashboardId,classificationId:e.id}),u=pt(s.data,e.queryParams);se(oe.getClassificationMetadata({content:{classification:s.data},phraseContext:{phraseHandler:ht,titlePhrase:`pageTitle`,descriptionPhrase:`pageDescription`},canonicalLink:B.getCanonicalLink({customAppLink:u.classification(s.data)}),allowIndexing:!0,product:me.PRODUCT_NAME})),Pe(s,{notFound:ut});let d=h(o.data&&ve.presentationAudiences(v.StreamableLearning,o.data.id)),f=h(R.path(e.id,v.StreamableLearning)),p=H.useMemo(()=>z.getActiveAudiencesFromParams(d.data,e.queryParams),[d.data,e.queryParams]),m=p?.map(e=>e.masterId)??[],g={presentationId:o.data?.id,presentationName:o.data?.name,currentClassificationId:s.data?.id,currentClassificationName:s.data?.name,followingCurrentClassification:!!s.data?.followers?.data?.length,activeAudienceNames:p?.length?p.map(e=>e.name):null,activeAudienceIds:m.length?m:null};function ee(){return()=>mt({appLinks:u,classification:s.data,path:f.data})}return r.data&&c.hasCompleted&&s.data&&o.data&&f.data&&d.data?(0,U.jsx)(de.Provider,{value:{getVideoActions:t},children:(0,U.jsxs)(`div`,{className:`position-relative`,children:[!!(l&&c.data)&&(0,U.jsx)(Ee,{status:c.data.status,type:`topic`}),(0,U.jsx)(lt,{dashboard:c.data,classification:s.data,getWidgetContentRequest:V.dashboardWidgetContent,getBreadcrumbs:ee(),hasPermissions:()=>!1,hasLocalPermissions:()=>!1,presentation:o.data,getBannerActions:()=>[],audiences:d.data,activeAudiences:p,analyticsData:g,imageCdnUrl:r.data.imageCdnUrl,resourceThumbnailFallbackImageUrl:y.Fallbacks.RESOURCE_THUMBNAIL,emptyImageUrl:y.EmptyStates.Topics.TOPIC,appLinks:u,isPreviewing:l,isViewCurrentPresentation:!0,canFollowSubjects:!1,tableOfContentsId:e.queryParams.tocId,lazyLoad:!B.isBot(),isTeacherOnly:!1,contentType:ue.Livestream,hasTopicDirectoryDashboard:!1,hasTopicCurriculumDashboard:!1,isTertiaryCustomerWithoutExchange:!1,tab:`curated-topic`,curriculums:a,commonVideoProps:n})]})}):(0,U.jsx)(dt,{})}export{_t as StreamableClassificationView,gt as sanitizeStreamableClassificationParams};
2
- //# sourceMappingURL=qcrBN1zR2.chunk.js.map
1
+ import{gt as e,v as t}from"./Dp9qJj1C.chunk.js";import{r as n}from"./BJvPfCvt.chunk.js";import{t as r}from"./ImQRQGZr.chunk.js";import{C as i,E as a,M as o,l as s,lt as c,m as l,n as u,ut as d,x as f}from"./Dun43GrB.chunk.js";import{n as p}from"./Xo0rk19-.chunk.js";import{t as m}from"./B-OL6Vs7.chunk.js";import{l as h}from"./BQ5XMoHG.chunk.js";import{t as g}from"./B7tm2CBz.chunk.js";import{t as ee}from"./C9ET3pjZ.chunk.js";import{t as te}from"./ibuOpDkQ.chunk.js";import{t as ne}from"./CxwN2xIE.chunk.js";import{t as _}from"./DeldjYRc.chunk.js";import{t as v}from"./BVWg3YHX.chunk.js";import{t as y}from"./BYYiNmLB.chunk.js";import{a as re,c as b,i as x,n as ie,o as S,r as C,s as w,t as T}from"./e2K2YU7z.chunk.js";import{n as E,t as D}from"./Ca1QPe-q2.chunk.js";import{t as ae}from"./Cz6swPXe2.chunk.js";import{n as O,t as k}from"./D7d5XFW82.chunk.js";import{n as oe,t as se}from"./DjIdG9LL2.chunk.js";import{t as ce}from"./B13dpWxS2.chunk.js";import{n as le}from"./CL1ST5J62.chunk.js";import{t as ue}from"./DUNFBIIl2.chunk.js";import{s as de,t as fe}from"./QMuFwiiF2.chunk.js";import{a as A,i as j,r as M}from"./B8R4YVaF2.chunk.js";import{n as N,t as P}from"./Bx_V3too2.chunk.js";import{t as F}from"./CoualKDX.chunk.js";import{t as I}from"./iTHYgnO8.chunk.js";import{H as pe,I as me,N as L,X as he,q as ge,w as _e}from"./app-gjHxcZG3.js";import{t as ve}from"./BRiYVLuz.chunk.js";import{t as R}from"./DlFudnBx.chunk.js";import{t as ye}from"./CZb3E982.chunk.js";import{t as be}from"./CwttNCGZ.chunk.js";import{t as z}from"./C9tPKnK22.chunk.js";import{t as xe}from"./BTqtjOL02.chunk.js";import{a as Se}from"./kfFYr9dc.chunk.js";import{t as Ce}from"./DCKKwz9L.chunk.js";import{t as B}from"./BlBCp_pE.chunk.js";import{n as we,r as Te,t as Ee}from"./zyVwH8JF.chunk.js";import{n as De,t as Oe}from"./DMZ--ok1.chunk.js";import{n as ke,t as Ae}from"./CxCkwLio.chunk.js";import{t as je}from"./DL4UFxRK.chunk.js";import{t as Me}from"./BOTX-kIq.chunk.js";import{t as V}from"./BivP7X20.chunk.js";import{t as Ne}from"./CUOEhUTb2.chunk.js";import{t as Pe}from"./Dql-1E6g2.chunk.js";import{t as Fe}from"./Cr3Blj6H2.chunk.js";var H=e(d()),U=c(),W=`subject.classificationHeaderDetails`,G=({className:e})=>(0,U.jsx)(`span`,{className:e,children:`•`});function Ie(e){let{dashboardVideoCount:t,childDashboardVideoCount:n,dashboardResourceCount:r,childDashboardResourceCount:i,childClassificationCount:a}=b.getCounts(e.classification),o=t+n,s=r+i;return(0,U.jsxs)(`p`,{className:`mb-n1 font-size-normal fw-normal mt-1`,children:[!!a&&(0,U.jsx)(O,{namespace:W,phrase:`topics`,options:{count:a.toLocaleString(),smartCount:a}}),!!o&&(0,U.jsxs)(U.Fragment,{children:[a>0&&(0,U.jsx)(G,{className:`mx-2`}),(0,U.jsx)(O,{namespace:W,phrase:`videos`,options:{count:o.toLocaleString(),smartCount:o}})]}),!!s&&(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(G,{className:`mx-2`}),(0,U.jsx)(O,{namespace:W,phrase:`resources`,options:{count:s.toLocaleString(),smartCount:s}})]})]})}var K=`subjects.curatedClassificationEmptyState`,Le=r.encloseNamespace(K);function Re(e){let t=e.dashboard?.status===P.Archived;return(0,U.jsx)(k.Provider,{value:K,children:(0,U.jsxs)(I,{children:[(0,U.jsx)(I.Image,{src:e.imageUrl,altText:Le(`headingForNP`)}),e.isReadonly?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(I.Heading,{children:(0,U.jsx)(O,{namespace:K,phrase:`headingForCurator`})}),(0,U.jsx)(I.Info,{children:(0,U.jsx)(O,{namespace:K,phrase:`info`})}),(0,U.jsx)(n,{title:t?r.getPhrase(K,`archivedCtaTooltip`):``,spanHack:!0,children:(0,U.jsx)(I.Cta,{text:r.getPhrase(K,`add`),appLink:e.addWidgetApplink?.(),className:`btn btn-dark`,icon:be,disabled:t})})]}):(0,U.jsx)(I.Heading,{children:(0,U.jsx)(O,{phrase:`headingForNP`})})]})})}var q={itemsWrapper:`_itemsWrapper_tzf1d_1`,anchorWrapper:`_anchorWrapper_tzf1d_5`,default:`_default_tzf1d_36`,selectedItem:`_selectedItem_tzf1d_47`,disabled:`_disabled_tzf1d_62`,floatIcon:`_floatIcon_tzf1d_69`,arrowIcon:`_arrowIcon_tzf1d_75`,listIcon:`_listIcon_tzf1d_78`,tocIndent1:`_tocIndent1_tzf1d_87`,tocIndent2:`_tocIndent2_tzf1d_90`};function ze(e){let t={actionType:i.Click,entity:s.Widget,location:l.TableOfContents};function n(t){Me.preventScrollTop(),e.setControlledId(t.id),e.onItemClick?.(t),setTimeout(()=>document.getElementById(t.id)?.focus())}function r(e){return e.tocIndentation===1?q.tocIndent1:e.tocIndentation===2?q.tocIndent2:``}return(0,U.jsx)(`div`,{className:`${q.itemsWrapper}`,children:e.items.map((i,a)=>e.localState?(0,U.jsx)(E,{className:`${q.anchorWrapper} ${e.activeId===i.id?q.selectedItem:``}`,onClick:()=>{n(i)},children:(0,U.jsx)(`div`,{className:`${!e.activeId&&a===0?q.default:``} `,children:i.name})},i.id):(0,U.jsx)(D,{appLink:e.getAppLink(i),appLinkOptions:{replace:!0},className:`${q.anchorWrapper} ${e.activeId===i.id?q.selectedItem:``}`,onClick:()=>{n(i)},analyticsData:{...e.analyticsData,id:i.id,name:i.name},analyticsOptions:t,children:(0,U.jsx)(`div`,{className:`${!e.activeId&&a===0?q.default:``} ${r(i)}`,children:i.name})},i.id))})}var J={container:`_container_1n8qw_1`,mobile:`_mobile_1n8qw_7`};function Be(e){let[t,n]=H.useState(!1);function r(){let n={actionType:t?i.Hide:i.Open,entity:s.TableOfContents,location:l.Dashboard};u.logUserAction(e.analyticsData,n)}function a(){n(!t),r()}return(0,U.jsxs)(`div`,{className:`${J.mobile} d-inline-flex gap-1`,children:[t&&(0,U.jsxs)(`div`,{className:`bg-white px-3 pt-3 pb-2 border border-dark rounded-1 ps-3`,children:[(0,U.jsx)(`h2`,{className:`h5`,children:e.title}),(0,U.jsx)(ze,{items:e.widgets.map(e=>({name:e.name,id:e.id,tocIndentation:e.metadata.tocIndentation})),activeId:e.activeId,appLink:e.appLink,analyticsData:e.analyticsData,setControlledId:e.setControlledId,getAppLink:e.getAppLink,onItemClick:()=>n(!1)})]}),(0,U.jsx)(`div`,{className:J.container,children:(0,U.jsx)(ae,{className:`btn btn-outline-dark`,svg:xe,onClick:a})})]})}function Ve(e){return(0,U.jsx)(`aside`,{className:`col-3 order-1`,children:(0,U.jsxs)(`div`,{className:`${J.container} ps-3`,children:[(0,U.jsx)(`h2`,{className:`h5`,children:e.title}),(0,U.jsx)(ze,{items:e.widgets.map(e=>({name:e.name,id:e.id,tocIndentation:e.metadata.tocIndentation})),activeId:e.activeId,appLink:e.appLink,analyticsData:e.analyticsData,setControlledId:e.setControlledId,getAppLink:e.getAppLink})]})})}function He(e){function t(e){let t=ne.getCurrentRoute().appLink,n=t.params?{...t.params}:{};return n.tocId=e.id,{...t,params:n}}return(0,U.jsx)(U.Fragment,{children:e.isSmallScreen?(0,U.jsx)(Be,{...e,getAppLink:t}):(0,U.jsx)(Ve,{...e,getAppLink:t})})}var Ue=`subjects.teacherOnlyEmptyState`,We=r.encloseNamespace(Ue);function Ge(e){return(0,U.jsx)(k.Provider,{value:Ue,children:(0,U.jsxs)(I,{children:[(0,U.jsx)(I.Image,{src:e.imageUrl,altText:We(`heading`)}),(0,U.jsx)(I.Heading,{children:(0,U.jsx)(O,{phrase:`heading`})}),(0,U.jsx)(I.Info,{children:(0,U.jsx)(O,{phrase:`info`})}),(0,U.jsx)(I.Cta,{text:We(`cta`),appLink:e.ctaAppLink?.(),className:`btn btn-dark`})]})})}function Ke(e,t){let{isSystemGeneratedDashboard:n,systemGeneratedVideoWidget:r}=H.useMemo(()=>e?{isSystemGeneratedDashboard:M.isSystemGeneratedDashboard(e.widgets),systemGeneratedVideoWidget:e.widgets.find(e=>e.widgetId===j.ClassificationPinnedVideos&&e.templateId!==A.ThumbnailVerticalList)}:{isSystemGeneratedDashboard:!1,systemGeneratedVideoWidget:null},[e?.id]),i=h(!!r&&V.dashboardWidgetContent(r?.id,M.getWidgetParams(r.widgetId,r.templateId,M.getDashboardTargetType(e),t?.map(e=>e.masterId)),r?.templateId));return n?{widgets:e?.widgets?.filter(e=>e.widgetId!==j.ClassificationPinnedVideos||e.templateId===A.ThumbnailVerticalList)??[],videoList:i.data?.content??[],videoListWidgetId:r?.id}:{widgets:g.sortBy(e?.widgets,`index`)}}var Y,qe=({setActiveId:e,headingElements:t,controlledId:n,setControlledId:r})=>{let i=H.useRef(0);H.useEffect(()=>{let a=new IntersectionObserver(a=>{a.forEach(a=>{if(n){e(n),Y=window.setTimeout(()=>{r(``)},800);return}if(a.isIntersecting)e(a.target.id),i.current=window.scrollY;else{let n=i.current-window.scrollY>0,r=t[t.findIndex(e=>e.id===a.target.id)-1];n&&r?.id&&e(r?.id)}})},{rootMargin:`-67px 0px -80% 0px`});return t.forEach(e=>a.observe(e)),()=>{Y&&window.clearTimeout(Y),a.disconnect()}},[e,t.length,n])};function Je(e){let t=H.useRef(null);return H.useEffect(()=>{t.current=e}),t.current}var Ye=80,Xe=(e,t)=>{let[n,r]=H.useState(!1),i=Je(t),a=t;H.useLayoutEffect(()=>{if(!n||i!==a){let t=e.find(e=>e&&e?.id===a);if(t){let e=t.getBoundingClientRect();window.scrollBy({top:e.top-Ye,behavior:`smooth`}),n||r(!0)}}},[e,i,a,n])},Ze=`subjects.classificationComingSoon`,Qe=r.encloseNamespace(Ze);function $e(e){let t=!!e.data.followers?.data?.length;function n(){e.onToggleFollow?.()}return(0,U.jsx)(k.Provider,{value:Ze,children:(0,U.jsxs)(I,{className:`pt-0`,children:[(0,U.jsx)(I.Image,{src:e.imageUrl,altText:Qe(`comingSoon`)}),(0,U.jsx)(I.Heading,{children:(0,U.jsx)(O,{phrase:`comingSoon`})}),(0,U.jsx)(I.Info,{children:(0,U.jsx)(O,{phrase:e.showSignUp?`infoAnon`:`info`})}),e.canFollowSubjects&&(0,U.jsx)(pe,{svg:t?x:C,onClick:n,showSpinner:e.showFollowButtonSpinner,className:`btn follow-btn me-2 ${t?`btn-outline-dark`:`btn-dark`}`,children:(0,U.jsx)(O,{phrase:t?`following`:`follow`})}),e.showSignUp&&!e.canFollowSubjects&&(0,U.jsx)(D,{appLink:e.signUpAppLink,className:`btn btn-dark d-none d-lg-inline-block`,analyticsOptions:{actionType:i.Click,location:l.ClassificationComingSoon,entity:s.AppLink,workflowPhase:a.Start,descriptor:f.SignUp},analyticsData:{},tag:`button`,children:Qe(`signUp`)})]})})}function et(e){return(0,U.jsx)(we,{audiences:e.audiences,activeAudiences:e.activeAudiences,disabled:e.disabled,appLink:e.appLink,disablePersist:e.disablePersist,tooltip:e.tooltip})}function tt(e){return(0,U.jsx)(`svg`,{...e,children:(0,U.jsx)(`path`,{d:`M4.5 4a.5.5 0 0 0 0 1h16a.5.5 0 0 1 .5.5v12a.5.5 0 0 0 1 0v-12A1.5 1.5 0 0 0 20.5 4zM9 10.26a.256.256 0 0 1 .39-.218l4.482 2.74a.256.256 0 0 1 0 .437L9.39 15.958A.256.256 0 0 1 9 15.739zM18.5 6A1.5 1.5 0 0 1 20 7.5v11a1.5 1.5 0 0 1-1.5 1.5h-15A1.5 1.5 0 0 1 2 18.5v-11A1.5 1.5 0 0 1 3.5 6zm-15 1a.5.5 0 0 0-.5.5v11a.5.5 0 0 0 .5.5h15a.5.5 0 0 0 .5-.5v-11a.5.5 0 0 0-.5-.5z`,fill:`currentColor`})})}function nt(e){let[t,n]=le(`directory:product:tip:switcher`,{on:!1,tab:e||`new-releases`});return H.useEffect(()=>{e&&n(`tab`,e)},[e]),H.useEffect(()=>{let e=null;return t.on&&(e=window.setInterval(()=>{t.tab===`new-releases`||t.tab===`all-topics`?n(`tab`,t.tab===`new-releases`?`all-topics`:`new-releases`):n(`tab`,t.tab===`curated-topic`?`video-list`:`curated-topic`)},2e3)),()=>{window.clearInterval(e)}},[t.on,t.tab]),{tab:t.tab,isHighlighting:t.on,start:()=>n(`on`,!0),stop:()=>{n({on:!1,tab:e||t.tab})}}}var X={curatedTopicTab:`_curatedTopicTab_1ji5o_1`,tabTransition:`_tabTransition_1ji5o_4`},Z=`shared.classificationDashboard`;function rt(e,n,a,o){let c=n.lg||n.xl||n.xxl||n.xs;function u(){let e=o?X.tabTransition:``;return n.xs?e+` w-100`:c?e=` ${X.curatedTopicTab}`:e}return b.isTopLevelTopic(e.classification)?[{name:c?r.getPhrase(Z,`newReleases`):``,appLink:e.appLinks?.classification?.(e.classification),active:a===`new-releases`,svg:re,analyticsData:{id:`new-releases`,classificationId:e.classification.id,classificationName:e.classification.name,presentationId:e.presentation.id,presentationDescription:e.presentation.description,name:r.getPhrase(Z,`newReleases`),url:t.getHref(e.appLinks?.classification?.(e.classification))},analyticsOptions:{actionType:i.Click,entity:s.Url,location:l.MagicTabs},className:`${n.xs?`w-100`:``} ${o?X.tabTransition:``}`},{name:c?r.getPhrase(Z,`allTopics`):``,appLink:e.appLinks?.classificationDirectory?.(e.classification),active:a===`all-topics`,svg:w,analyticsData:{id:`all-topics`,classificationId:e.classification.id,classificationName:e.classification.name,presentationId:e.presentation.id,presentationDescription:e.presentation.description,name:r.getPhrase(Z,`allTopics`),url:t.getHref(e.appLinks?.classificationDirectory?.(e.classification))},analyticsOptions:{actionType:i.Click,entity:s.Url,location:l.MagicTabs},className:`${n.xs?`w-100`:``} ${o?X.tabTransition:``}`}]:[{name:c?r.getPhrase(Z,`topic`):``,appLink:e.appLinks?.classification?.(e.classification),active:a===`curated-topic`,svg:S,analyticsData:{id:`curated-topic`,classificationId:e.classification.id,classificationName:e.classification.name,presentationId:e.presentation.id,presentationDescription:e.presentation.description,name:r.getPhrase(Z,`topic`),url:t.getHref(e.appLinks?.classification?.(e.classification))},analyticsOptions:{actionType:i.Click,entity:s.Url,location:l.MagicTabs},className:u()},{name:c?r.getPhrase(Z,`curriculum`):``,appLink:e.appLinks?.classificationCurriculum?.(e.classification),active:a===`curriculum`,svg:tt,analyticsData:{id:`curriculum`,classificationId:e.classification.id,classificationName:e.classification.name,presentationId:e.presentation.id,presentationDescription:e.presentation.description,name:r.getPhrase(Z,`curriculum`),url:t.getHref(e.appLinks?.classificationCurriculum?.(e.classification))},analyticsOptions:{actionType:i.Click,entity:s.Url,location:l.MagicTabs},className:`${n.xs?`w-100`:``} ${o?X.tabTransition:``}`}]}function it(e){let t=L(),{tab:n,isHighlighting:r}=nt(e.activeTab);return(0,U.jsx)(Ce,{borderRadius:`sm`,className:t.xs?`w-100`:``,listClassName:`d-flex flex-nowrap`,tabs:rt(e,t,n,r)})}function at(e,t,n,r,i){return!!(i||r&&!t?.length||!z.shouldShowAudiences(e)||n===`curriculum`)}function ot(e){let t=L(),n=at(e.audiences,e.activeAudiences,e.activeTab,e.isEmpty,e.isComingSoon);function r(){return!e.classification||!e.dashboard||M.isSystemGeneratedDashboard(e.dashboard.widgets)?!1:b.isTopLevelTopic(e.classification)?e.hasTopicDirectoryDashboard:!!(e.classification.externalMetadata?.isCurated&&e.hasTopicCurriculumDashboard)}function i(){let i=`d-flex flex-column py-3 mb-3`;return e.isComingSoon||(i+=` border-bottom`),(r()||n)&&!t.xs?i:i+` row-gap-3`}function a(){if(n)return t.xs?`d-flex flex-column justify-content-between row-gap-3`:`d-flex align-items-center justify-content-between`;let e=``;return e+=`d-flex align-items-center justify-content-between mb-1`,t.xs&&(e+=` row-gap-3 mb-0`),e}function o(){let e=`d-flex align-items-end justify-content-between`;return t.xs&&(e+=` row-gap-3 flex-wrap`),e}return(0,U.jsxs)(`div`,{className:i(),children:[(0,U.jsxs)(`div`,{className:a(),children:[(0,U.jsx)(Ae,{breadcrumbs:e.getBreadcrumbs?.()}),r()&&n&&(0,U.jsx)(it,{classification:e.classification,activeTab:e.activeTab,appLinks:e.appLinks,presentation:e.presentation})]}),(0,U.jsxs)(`div`,{className:o(),children:[!n&&(0,U.jsx)(et,{audiences:e.audiences,activeAudiences:e.activeAudiences,appLink:e.appLinks.audience?.(),disabled:e.disableAudiences,tooltip:e.audienceTooltip,disablePersist:!e.isViewingCurrentPresentation}),r()&&!n&&(0,U.jsx)(it,{classification:e.classification,activeTab:e.activeTab,appLinks:e.appLinks,presentation:e.presentation})]})]})}var st=`shared.classificationDashboard`;function Q(e){return e.widgetId===j.Blurb&&e.templateId===A.Heading}function ct(e){return e.widgetId===j.CuratedClassifications||e.widgetId===j.Classifications}lt.defaultProps={appLinks:{}};function lt(e){let{widgets:t,videoList:n,videoListWidgetId:i}=Ke(e.dashboard,e.activeAudiences),a=ce(_e.LGDown),o=H.useRef(new Set),s=H.useMemo(()=>t.reduce((e,t)=>(e[t.id]=!1,e),{}),[t?.length]),[c,u]=H.useState(s),[d,f]=H.useState(e.tableOfContentsId),[p,m]=H.useState(``),h=Array.from(o.current);Xe(h,d),qe({setActiveId:m,headingElements:h,controlledId:d,setControlledId:f});let g=e.classification.type===ye.Hub;function te(){return e.isComingSoon||e.isTeacherOnly?!1:!e.dashboard||e.dashboard.status===P.Archived&&!e.isReadonly||e.dashboard.status===P.Draft&&!e.isPreviewing||!t?.length?!0:n&&n.length?!1:Object.values(c).every(e=>!!e)}function ne(t,n,r){let i=M.getWidgetParams(n,r,M.getDashboardTargetType(e.dashboard),e.activeAudiences?.map(e=>e.masterId),e.curriculums.preferredCurriculum?.id);return e.getWidgetContentRequest(t,i,r)}let _=te();H.useEffect(()=>{_&&u(s)},[t?.length]);let v=H.useCallback((n,r)=>{if(c[n]===r)return;let i={...c,[n]:r};if(M.isType(e.dashboard,N.ClassificationDirectory)){u(i);return}let a=0;for(;a<t.length;){let e=t[a];if(!Q(e)){a++;continue}let n=!0,r=a+1;for(;n&&r<t.length;){let e=t[r];if(Q(e))break;!i[e.id]&&!ct(e)&&(n=!1),r++}a=r,i[e.id]=n}u(i)},[c,t]);function y(e){return Q(e)&&c[e.id]}function re(){let t=M.getDashboardTargetType(e.dashboard);return!(e.moviesAndTv||t===N.ClassificationCurriculum)}function x(e,n){return e.widgetId===j.ClassificationDashboardExternalMedia&&c[t[n-1].id]?e.name.replace(`Other videos`,`Videos`):e.name}let S=t.filter(e=>!y(e)&&!!e.metadata?.showInTableOfContents),C=t.every(ct),w=S.length>=2,T=w&&!a&&!g,E=e.settings?.hasTopicDirectories&&b.isTopLevelTopic(e.classification)&&!e.isTertiaryCustomerWithoutExchange;return(0,U.jsxs)(`div`,{className:`bg-white px-4 ${re()?`dashboard-spacing-lg`:``}`,children:[g&&(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`h1`,{className:`h2 mb-4`,children:e.classification.name}),(0,U.jsx)(`hr`,{className:`mt-2`})]}),!g&&(0,U.jsx)(Oe,{heading:e.classification.name,banner:e.classification.banner,imageCdnUrl:e.imageCdnUrl,actions:e.getBannerActions?.(),actionsDropdownClassName:`btn btn-outline-dark`,specialEvent:e.specialEvent,calendarTheme:{background:`bg-light-blue`,border:`border-light-blue`},showComingSoon:e.isComingSoon,detailsComponent:E?()=>(0,U.jsx)(Ie,{classification:e.classification}):null}),!g&&(0,U.jsx)(ot,{dashboard:e.dashboard,classification:e.classification,presentation:e.presentation,appLinks:e.appLinks,activeTab:e.tab,audiences:e.audiences,activeAudiences:e.activeAudiences,getBreadcrumbs:e.getBreadcrumbs,hasTopicDirectoryDashboard:e.hasTopicDirectoryDashboard,hasTopicCurriculumDashboard:e.hasTopicCurriculumDashboard,isComingSoon:e.isComingSoon,isEmpty:_,isViewingCurrentPresentation:e.isViewCurrentPresentation,disableAudiences:C||e.isReadonly,audienceTooltip:C?r.getPhrase(st,`audienceTooltip`):``}),e.isComingSoon&&(0,U.jsx)($e,{imageUrl:e.comingSoonImageUrl,data:e.classification,canFollowSubjects:e.canFollowSubjects,showFollowButtonSpinner:e.showFollowButtonSpinner,onToggleFollow:()=>e.onToggleFollow(e.classification,l.ClassificationComingSoon),showSignUp:!e.hasLocalPermissions(ee.FollowComingSoonTopics),signUpAppLink:e.appLinks.signUp?.()}),!e.isComingSoon&&(0,U.jsxs)(`div`,{className:`${T?`row no-wrap`:``}`,children:[w&&(0,U.jsx)(He,{widgets:S,title:e.classification.name,activeId:p,clickable:!e.isReadonly,analyticsData:e.analyticsData,setControlledId:f,isSmallScreen:a}),(0,U.jsx)(`div`,{className:T?`col-9 order-0`:``,children:t.map((t,n)=>y(t)?(0,U.jsx)(H.Fragment,{},t.id):(0,U.jsx)(ie,{widgetCollection:N.Classification,headingElementRef:o,id:t.id,name:x(t,n),description:t.description,classification:e.classification,templateId:t.templateId,widgetTypeId:t.widgetId,audiences:e.audiences,getContentRequest:ne,setIsEmpty:v,appLinks:e.appLinks,presentation:e.presentation,analyticsData:e.analyticsData,isScrollToTargetWidget:e.scrollToWidgetId===t.id,imageCdnUrl:e.imageCdnUrl,onSubmitFeedback:e.onSubmitFeedback,metadata:t.metadata,isBot:e.isBot,hasTableOfContents:T,lazyLoad:e.lazyLoad,dashboardTarget:M.getDashboardTargetType(e.dashboard),widgetIndex:n,hasPermissions:e.hasPermissions,hasLocalPermissions:e.hasLocalPermissions,isPreviewing:e.isReadonly,contentType:e.contentType,resourceThumbnailFallbackImageUrl:e.resourceThumbnailFallbackImageUrl,onToggleFollowClassification:e.onToggleFollow,settings:e.settings,isEditing:e.isReadonly,isTertiaryCustomerWithoutExchange:e.isTertiaryCustomerWithoutExchange,commonVideoProps:e.commonVideoProps,curriculums:e.curriculums,limitTotalItems:!1,seeMoreLink:null,onClickRemoveItem:null,badgeComponent:null},t.id))}),!!n?.length&&(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(Se,{name:r.getPhrase(st,`videos`)}),(0,U.jsx)(fe,{videos:n,getVideoAppLink:(t,n)=>e.appLinks.videoType(t,{...n,contextId:i,includeContext:n.includeContext}),hasPermissions:e.hasPermissions,presentationAudiences:e.audiences,getPreviewQuestionsAppLink:e.appLinks.previewQuestions,commonVideoProps:e.commonVideoProps})]})]}),_&&(0,U.jsx)(Re,{dashboard:e.dashboard,isReadonly:e.isReadonly,imageUrl:e.emptyImageUrl,addWidgetApplink:e.appLinks.widgetWizard}),e.isTeacherOnly&&(0,U.jsx)(Ge,{imageUrl:e.emptyImageUrl,ctaAppLink:()=>e.appLinks.allTopics(e.classification.presentationId)})]})}var $=`subjects.topicNotFoundError`,ut=class extends p{constructor(){super(`Topic doesn't exist`)}get name(){return`TopicNotFoundError`}get heading(){return r.getPhrase($,`heading`)}get description(){return r.getPhrase($,`description`)}get cta(){return{text:r.getPhrase($,`cta`),appLink:{application:m.SUBJECTS,action:_.Subjects.CLASSIFICATION_ALL}}}};function dt(){return(0,U.jsxs)(`div`,{className:`bg-white px-4`,children:[(0,U.jsx)(De,{}),(0,U.jsxs)(`div`,{className:`d-flex flex-column row-gap-3 py-3 mb-3 border-bottom`,children:[(0,U.jsx)(ke,{}),(0,U.jsx)(Te,{})]})]})}var ft=r.encloseNamespace(`subjects.classificationView`);function pt(e,t){return{...F,classification:n=>F.classification(n||e,t),classificationDirectory:()=>F.classificationDirectory(t),audience:()=>F.classification(e,t),previewQuestions:()=>null,series:()=>null,latestReleases:()=>null,classificationLatestReleases:()=>null,playlist:()=>null,signUp:()=>null,widgetWizard:()=>null,classificationCurriculum:()=>null,searchSettings:()=>null,searchHome:()=>null,search:()=>null,editCurriculum:()=>null,getPreviewQuestionsAppLink:()=>null}}function mt(e){let{classification:t,path:n,appLinks:r}=e,i=[{name:ft(`discover`),appLink:{application:m.DASHBOARD,action:_.Dashboard.HOME}},{name:ft(`exploreAllTopicsHeading`),appLink:{application:m.SUBJECTS,action:_.Subjects.CLASSIFICATION_ALL}}];return n.forEach(e=>{i.push({name:e.name,appLink:r.classification(e),active:e.name===t.name})}),i}var ht=r.encloseNamespace(`subjects.classificationView`);function gt(e){return e?o.pick(e,[`a`,`dashboardId`,`tocId`]):{}}function _t(e){let t=Ne(`video-list`),{commonVideoProps:n}=je(),r=h(he.config()),i=h(te.currentUser()),a=Fe(),o=h(ge.streamablePresentation()),s=h(R.classification(e.id,i.data?.id)),{dashboard:c,isPreviewing:l}=T({targetType:N.Classification,dashboardId:e.queryParams?.dashboardId,classificationId:e.id}),u=pt(s.data,e.queryParams);se(oe.getClassificationMetadata({content:{classification:s.data},phraseContext:{phraseHandler:ht,titlePhrase:`pageTitle`,descriptionPhrase:`pageDescription`},canonicalLink:B.getCanonicalLink({customAppLink:u.classification(s.data)}),allowIndexing:!0,product:me.PRODUCT_NAME})),Pe(s,{notFound:ut});let d=h(o.data&&ve.presentationAudiences(v.StreamableLearning,o.data.id)),f=h(R.path(e.id,v.StreamableLearning)),p=H.useMemo(()=>z.getActiveAudiencesFromParams(d.data,e.queryParams),[d.data,e.queryParams]),m=p?.map(e=>e.masterId)??[],g={presentationId:o.data?.id,presentationName:o.data?.name,currentClassificationId:s.data?.id,currentClassificationName:s.data?.name,followingCurrentClassification:!!s.data?.followers?.data?.length,activeAudienceNames:p?.length?p.map(e=>e.name):null,activeAudienceIds:m.length?m:null};function ee(){return()=>mt({appLinks:u,classification:s.data,path:f.data})}return r.data&&c.hasCompleted&&s.data&&o.data&&f.data&&d.data?(0,U.jsx)(de.Provider,{value:{getVideoActions:t},children:(0,U.jsxs)(`div`,{className:`position-relative`,children:[!!(l&&c.data)&&(0,U.jsx)(Ee,{status:c.data.status,type:`topic`}),(0,U.jsx)(lt,{dashboard:c.data,classification:s.data,getWidgetContentRequest:V.dashboardWidgetContent,getBreadcrumbs:ee(),hasPermissions:()=>!1,hasLocalPermissions:()=>!1,presentation:o.data,getBannerActions:()=>[],audiences:d.data,activeAudiences:p,analyticsData:g,imageCdnUrl:r.data.imageCdnUrl,resourceThumbnailFallbackImageUrl:y.Fallbacks.RESOURCE_THUMBNAIL,emptyImageUrl:y.EmptyStates.Topics.TOPIC,appLinks:u,isPreviewing:l,isViewCurrentPresentation:!0,canFollowSubjects:!1,tableOfContentsId:e.queryParams.tocId,lazyLoad:!B.isBot(),isTeacherOnly:!1,contentType:ue.Livestream,hasTopicDirectoryDashboard:!1,hasTopicCurriculumDashboard:!1,isTertiaryCustomerWithoutExchange:!1,tab:`curated-topic`,curriculums:a,commonVideoProps:n})]})}):(0,U.jsx)(dt,{})}export{_t as StreamableClassificationView,gt as sanitizeStreamableClassificationParams};
2
+ //# sourceMappingURL=D3sdyN2Q2.chunk.js.map