@clickview/lite 0.104.0-rc.4 → 0.104.0-rc.5

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 (35) hide show
  1. package/dist/.vite/manifest.json +341 -341
  2. package/dist/bundles.json +1 -1
  3. package/dist/en.json +1 -1
  4. package/dist/scripts/{CW1i-QHv.chunk.js → -7qiRMLt.chunk.js} +2 -2
  5. package/dist/scripts/{CW1i-QHv.chunk.js.map → -7qiRMLt.chunk.js.map} +1 -1
  6. package/dist/scripts/{C3PXfYEd.chunk.js → B3AhKFfz.chunk.js} +2 -2
  7. package/dist/scripts/{C3PXfYEd.chunk.js.map → B3AhKFfz.chunk.js.map} +1 -1
  8. package/dist/scripts/{CwYg3Mqk.chunk.js → B3y60nT5.chunk.js} +2 -2
  9. package/dist/scripts/{CwYg3Mqk.chunk.js.map → B3y60nT5.chunk.js.map} +1 -1
  10. package/dist/scripts/{DN82USWW2.chunk.js → B_TE5XUR2.chunk.js} +2 -2
  11. package/dist/scripts/{DN82USWW2.chunk.js.map → B_TE5XUR2.chunk.js.map} +1 -1
  12. package/dist/scripts/{BlsbWOzw2.chunk.js → Bld7iWR52.chunk.js} +2 -2
  13. package/dist/scripts/{BlsbWOzw2.chunk.js.map → Bld7iWR52.chunk.js.map} +1 -1
  14. package/dist/scripts/CCBk_ENs.chunk.js +1 -0
  15. package/dist/scripts/{pKtXmGbN.chunk.js → CMHxOVI7.chunk.js} +2 -2
  16. package/dist/scripts/{pKtXmGbN.chunk.js.map → CMHxOVI7.chunk.js.map} +1 -1
  17. package/dist/scripts/{CpzveYo2.chunk.js → CVL6bQWp.chunk.js} +2 -2
  18. package/dist/scripts/{CpzveYo2.chunk.js.map → CVL6bQWp.chunk.js.map} +1 -1
  19. package/dist/scripts/{DWo8DfD9.chunk.js → CmnbQiBA.chunk.js} +2 -2
  20. package/dist/scripts/{DWo8DfD9.chunk.js.map → CmnbQiBA.chunk.js.map} +1 -1
  21. package/dist/scripts/CpsbRDII.chunk.js +2 -0
  22. package/dist/scripts/{jAtAipGN.chunk.js.map → CpsbRDII.chunk.js.map} +1 -1
  23. package/dist/scripts/{BUVko1EF2.chunk.js → D3ncynN72.chunk.js} +3 -3
  24. package/dist/scripts/{BUVko1EF2.chunk.js.map → D3ncynN72.chunk.js.map} +1 -1
  25. package/dist/scripts/{DH_0KtTK2.chunk.js → DICsRDM42.chunk.js} +2 -2
  26. package/dist/scripts/{DH_0KtTK2.chunk.js.map → DICsRDM42.chunk.js.map} +1 -1
  27. package/dist/scripts/{B2wDqI1S.chunk.js → DSPMbDdF.chunk.js} +2 -2
  28. package/dist/scripts/{B2wDqI1S.chunk.js.map → DSPMbDdF.chunk.js.map} +1 -1
  29. package/dist/scripts/{app-CfAhMxn1.js → app-BzH1hkoU.js} +4 -4
  30. package/dist/scripts/{app-CfAhMxn1.js.map → app-BzH1hkoU.js.map} +1 -1
  31. package/dist/scripts/{BYbQI3CA.chunk.js → fMgBORUX.chunk.js} +2 -2
  32. package/dist/scripts/{BYbQI3CA.chunk.js.map → fMgBORUX.chunk.js.map} +1 -1
  33. package/package.json +1 -1
  34. package/dist/scripts/BILyzh0I.chunk.js +0 -1
  35. package/dist/scripts/jAtAipGN.chunk.js +0 -2
@@ -1,2 +1,2 @@
1
- import{o as e}from"./DAXXjFlN.chunk.js";import{_ as t}from"./BftnFbcr.chunk.js";import{t as n}from"./DMnm3Ewv.chunk.js";import"./DFZS3Ffo.chunk.js";import{n as ee}from"./B785hxeE.chunk.js";import{t as r}from"./CQyJ7YGa.chunk.js";import{t as te}from"./e57H3T-k.chunk.js";import{t as i}from"./C2w0pmFW.chunk.js";import{t as a}from"./wrLrTezN.chunk.js";import{t as o}from"./BXTI9cmX.chunk.js";import{d as ne,u as s}from"./BX0wDJmp.chunk.js";import{y as re}from"./NlCAcBdo.chunk.js";import{t as ie}from"./DGmmTRu72.chunk.js";import{t as ae}from"./DbSUQ2A12.chunk.js";import{t as oe}from"./DZssmXj6.chunk.js";import{t as se}from"./BC8PeYqm.chunk.js";import{t as c}from"./LoQS6GjP.chunk.js";import{t as l}from"./CqrjHjAN.chunk.js";import{t as u}from"./eoAypzU3.chunk.js";import{t as d}from"./D_gWf2lC.chunk.js";import{t as f}from"./CZbN8PTA.chunk.js";import{t as p}from"./XIE88U01.chunk.js";import{n as ce,t as le}from"./C6-aC3vu.chunk.js";import{t as ue}from"./7LGxCHGV.chunk.js";import{t as m}from"./Bbv3vbm7.chunk.js";import{t as de}from"./B3gsVN-_.chunk.js";import{l as fe,r as h}from"./D-iyHqNw2.chunk.js";import{t as g}from"./B_-pJtOI2.chunk.js";import{t as _}from"./DBkEQkKm2.chunk.js";import{t as v}from"./C1loT8MD2.chunk.js";import{t as y}from"./CgW21-1J.chunk.js";import{n as b}from"./ChnNWPOK2.chunk.js";import{t as x}from"./1IFtXPNY.chunk.js";import{t as S}from"./DMaQV7L2.chunk.js";import{t as C}from"./CCb14vhF.chunk.js";import{t as w}from"./C9XBZFiR.chunk.js";import{t as T}from"./BnuuRu_J2.chunk.js";import{t as E}from"./CC5Dr9aG.chunk.js";import{t as D}from"./DNuJUXpr2.chunk.js";import{v as O}from"./BlsbWOzw2.chunk.js";import{n as k,r as A,t as j}from"./C3PXfYEd.chunk.js";var M=e(i()),N=a(),P=r.encloseNamespace(`shared.play`),F={notFound:y,forbidden:{privacy:m}};I.defaultProps={queryParams:{}};function I(e){let{context:r,contextId:i,playNext:a,mtv:m,resourceId:y}=e.queryParams,{commonVideoProps:I,hasCommonVideoPropsCompleted:L}=T({locationContext:re.PlayPage,mtv:m}),{hasPermissions:pe}=de(),{activePresentation:R}=f(),{hasPlayPageTranscript:z,hasNewSearch:B,clickViewLive:V}=ie(null),H=s(x.streamableLearning()),U=s(l.currentUser()),W=s(c.video(e.id)),G=v({objectId:W.data?.id,objectTypeId:W.data?.typeId}),me=s(G.canViewClips&&oe.videoClips(e.id)),he=s(G.canViewInteractives&&se.videoInteractives(e.id)),ge=s(R&&S.audiencesByPresentationId(R.id)),{shouldFetchTranscript:K,shouldShowTranscript:_e}=j(e.id),{subtitles:q,chapters:ve}=s(K&&U.data?.contentRegion&&A.chaptersAndSubtitles(e.id,U.data.contentRegion))?.data||{},J=q?.filter(e=>!e.customer),Y=ne(J&&J.length>0?J.map(e=>A.subtitleVtt(e.url,e)):[]),ye=J?.filter(e=>Y.data.find(t=>t.id===e.id))||[],X=s(d.config()),be=O(),xe=s(W.statusCode===n.Forbidden&&c.video(e.id,ae.StripMetadata)),Se=C(e.id),Z=h({video:W.data,context:r,contextId:i,moviesAndTv:m,currentUser:U.data}),Q=fe(e.id,!0),$=s(c.regionAlternatives(e.id)),Ce=E({name:W.data?.name});return le(ce.getVideoMetadata({content:W.data,regionAlternatives:$.data,phraseContext:{phraseHandler:P,titlePhrase:`pageTitle`,descriptionPhrase:`pageDescription`},canonicalLink:g.getCanonicalLink({stripPresentationSlug:!0,customAppLink:_.getAppLink(W.data,{},e.presentationSlug)}),allowIndexing:g.allowIndexing(),hrefLang:g.getContentHrefLang($.data,(e,t)=>({application:o.VIDEOS,action:u.Videos.PLAY_VIDEO,args:[null,e,te.slugify(t)]}))})),w(W,F,{forbidden:!0}),D(Z.videos??[]),b({id:e.id,app:`videos`}),ue(xe),M.useEffect(()=>{V||!W.data||!H.data||!V&&W.data.libraries?.data.find(e=>e.id===H.data.objectId)&&t.throw(new p)},[W.hasCompleted,H.hasCompleted,V]),W.data&&U.hasCompleted&&Q.hasCompleted&&L?(0,N.jsx)(k,{presentationSlug:e.presentationSlug,video:W.data,clips:me.data?.data,interactives:he.data?.data,curriculums:Se,relatedVideos:Z,currentUser:U.data,pointsOfInterest:Q.items,playNext:a,featureAccess:G,audiences:ge.data,params:e.queryParams,canManageVideoAccess:pe(ee.ManageVideoAccess),shouldShowSideTableOfContents:be,tableOfContentsId:e.queryParams?.tocId,breadcrumbs:Ce,commonVideoProps:I,hasTheatreMode:z,shouldShowTranscript:_e&&(!K||Y.data?.length>0),vttSubtitles:Y.data||[],subtitles:ye,chapters:ve,isBot:g.isBot(),playerApiUrl:X.data?.playerApiUrl,hasNewSearch:B,liteUrl:X.data.liteUrl,resourcePopupId:y}):(0,N.jsx)(N.Fragment,{})}export{I as PlayView};
2
- //# sourceMappingURL=BYbQI3CA.chunk.js.map
1
+ import{o as e}from"./DAXXjFlN.chunk.js";import{_ as t}from"./BftnFbcr.chunk.js";import{t as n}from"./DMnm3Ewv.chunk.js";import"./DFZS3Ffo.chunk.js";import{n as ee}from"./B785hxeE.chunk.js";import{t as r}from"./CQyJ7YGa.chunk.js";import{t as te}from"./e57H3T-k.chunk.js";import{t as i}from"./C2w0pmFW.chunk.js";import{t as a}from"./wrLrTezN.chunk.js";import{t as o}from"./BXTI9cmX.chunk.js";import{d as ne,u as s}from"./BX0wDJmp.chunk.js";import{y as re}from"./NlCAcBdo.chunk.js";import{t as ie}from"./DGmmTRu72.chunk.js";import{t as ae}from"./DbSUQ2A12.chunk.js";import{t as oe}from"./DZssmXj6.chunk.js";import{t as se}from"./BC8PeYqm.chunk.js";import{t as c}from"./LoQS6GjP.chunk.js";import{t as l}from"./CqrjHjAN.chunk.js";import{t as u}from"./eoAypzU3.chunk.js";import{t as d}from"./D_gWf2lC.chunk.js";import{t as f}from"./CZbN8PTA.chunk.js";import{t as p}from"./XIE88U01.chunk.js";import{n as ce,t as le}from"./C6-aC3vu.chunk.js";import{t as ue}from"./7LGxCHGV.chunk.js";import{t as m}from"./Bbv3vbm7.chunk.js";import{t as de}from"./B3gsVN-_.chunk.js";import{l as fe,r as h}from"./D-iyHqNw2.chunk.js";import{t as g}from"./B_-pJtOI2.chunk.js";import{t as _}from"./DBkEQkKm2.chunk.js";import{t as v}from"./C1loT8MD2.chunk.js";import{t as y}from"./CgW21-1J.chunk.js";import{n as b}from"./ChnNWPOK2.chunk.js";import{t as x}from"./1IFtXPNY.chunk.js";import{t as S}from"./DMaQV7L2.chunk.js";import{t as C}from"./CCb14vhF.chunk.js";import{t as w}from"./C9XBZFiR.chunk.js";import{t as T}from"./BnuuRu_J2.chunk.js";import{t as E}from"./CC5Dr9aG.chunk.js";import{t as D}from"./DNuJUXpr2.chunk.js";import{v as O}from"./Bld7iWR52.chunk.js";import{n as k,r as A,t as j}from"./B3AhKFfz.chunk.js";var M=e(i()),N=a(),P=r.encloseNamespace(`shared.play`),F={notFound:y,forbidden:{privacy:m}};I.defaultProps={queryParams:{}};function I(e){let{context:r,contextId:i,playNext:a,mtv:m,resourceId:y}=e.queryParams,{commonVideoProps:I,hasCommonVideoPropsCompleted:L}=T({locationContext:re.PlayPage,mtv:m}),{hasPermissions:pe}=de(),{activePresentation:R}=f(),{hasPlayPageTranscript:z,hasNewSearch:B,clickViewLive:V}=ie(null),H=s(x.streamableLearning()),U=s(l.currentUser()),W=s(c.video(e.id)),G=v({objectId:W.data?.id,objectTypeId:W.data?.typeId}),me=s(G.canViewClips&&oe.videoClips(e.id)),he=s(G.canViewInteractives&&se.videoInteractives(e.id)),ge=s(R&&S.audiencesByPresentationId(R.id)),{shouldFetchTranscript:K,shouldShowTranscript:_e}=j(e.id),{subtitles:q,chapters:ve}=s(K&&U.data?.contentRegion&&A.chaptersAndSubtitles(e.id,U.data.contentRegion))?.data||{},J=q?.filter(e=>!e.customer),Y=ne(J&&J.length>0?J.map(e=>A.subtitleVtt(e.url,e)):[]),ye=J?.filter(e=>Y.data.find(t=>t.id===e.id))||[],X=s(d.config()),be=O(),xe=s(W.statusCode===n.Forbidden&&c.video(e.id,ae.StripMetadata)),Se=C(e.id),Z=h({video:W.data,context:r,contextId:i,moviesAndTv:m,currentUser:U.data}),Q=fe(e.id,!0),$=s(c.regionAlternatives(e.id)),Ce=E({name:W.data?.name});return le(ce.getVideoMetadata({content:W.data,regionAlternatives:$.data,phraseContext:{phraseHandler:P,titlePhrase:`pageTitle`,descriptionPhrase:`pageDescription`},canonicalLink:g.getCanonicalLink({stripPresentationSlug:!0,customAppLink:_.getAppLink(W.data,{},e.presentationSlug)}),allowIndexing:g.allowIndexing(),hrefLang:g.getContentHrefLang($.data,(e,t)=>({application:o.VIDEOS,action:u.Videos.PLAY_VIDEO,args:[null,e,te.slugify(t)]}))})),w(W,F,{forbidden:!0}),D(Z.videos??[]),b({id:e.id,app:`videos`}),ue(xe),M.useEffect(()=>{V||!W.data||!H.data||!V&&W.data.libraries?.data.find(e=>e.id===H.data.objectId)&&t.throw(new p)},[W.hasCompleted,H.hasCompleted,V]),W.data&&U.hasCompleted&&Q.hasCompleted&&L?(0,N.jsx)(k,{presentationSlug:e.presentationSlug,video:W.data,clips:me.data?.data,interactives:he.data?.data,curriculums:Se,relatedVideos:Z,currentUser:U.data,pointsOfInterest:Q.items,playNext:a,featureAccess:G,audiences:ge.data,params:e.queryParams,canManageVideoAccess:pe(ee.ManageVideoAccess),shouldShowSideTableOfContents:be,tableOfContentsId:e.queryParams?.tocId,breadcrumbs:Ce,commonVideoProps:I,hasTheatreMode:z,shouldShowTranscript:_e&&(!K||Y.data?.length>0),vttSubtitles:Y.data||[],subtitles:ye,chapters:ve,isBot:g.isBot(),playerApiUrl:X.data?.playerApiUrl,hasNewSearch:B,liteUrl:X.data.liteUrl,resourcePopupId:y}):(0,N.jsx)(N.Fragment,{})}export{I as PlayView};
2
+ //# sourceMappingURL=fMgBORUX.chunk.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"BYbQI3CA.chunk.js","names":[],"sources":["../../src/shared/views/play/PlayView.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport { HttpStatus } from 'libs/common/backbone/enums/HttpStatus';\nimport { Core } from 'libs/common/backbone/index';\nimport { LanguageService } from 'libs/common/backbone/services/LanguageService';\nimport { Flight } from 'libs/common/flight';\nimport { HashObject } from 'libs/common/react/interfaces/HashObject';\nimport { TextHelper } from 'libs/common/react/utils/TextHelper';\n\nimport { LocationContext } from 'libs/analytics/interfaces';\n\nimport { PermissionFilterOption } from 'libs/shared/enums/PermissionFilterOption';\nimport { PermissionName } from 'libs/shared/enums/PermissionName';\nimport { NotFoundError } from 'libs/shared/errors/general/not-found/NotFoundError';\nimport { VideoNotFoundError } from 'libs/shared/errors/videos/video-not-found/VideoNotFoundError';\nimport { VideoPrivateError } from 'libs/shared/errors/videos/video-private/VideoPrivateError';\nimport { AudienceRequests } from 'libs/shared/flight-requests/AudienceRequests';\nimport { ClipRequests } from 'libs/shared/flight-requests/ClipRequests';\nimport { ConfigRequests } from 'libs/shared/flight-requests/ConfigRequests';\nimport { InteractiveRequests } from 'libs/shared/flight-requests/InteractiveRequests';\nimport { LibraryRequests } from 'libs/shared/flight-requests/LibraryRequests';\nimport { UserRequests } from 'libs/shared/flight-requests/UserRequests';\nimport { VideoRequests } from 'libs/shared/flight-requests/VideoRequests';\nimport { useBreadcrumbs } from 'libs/shared/hooks/useBreadcrumbs';\nimport { useCannotConsumeError } from 'libs/shared/hooks/useCannotConsumeError';\nimport { useHandleObjectError } from 'libs/shared/hooks/UseHandleObjectError';\nimport { usePermissions } from 'libs/shared/hooks/usePermissions';\nimport { useSetPageMetadata } from 'libs/shared/hooks/useSetPageMetadata';\nimport { useSettings } from 'libs/shared/hooks/useSettings';\nimport { ClipCollection, Config, CurrentUser, InteractiveCollection, PresentationAudience, RegionAlternative, Video, VttSubtitleResponse } from 'libs/shared/interfaces';\nimport { PlayViewQueryParams } from 'libs/shared/interfaces/query-params/PlayViewQueryParams';\nimport { PageMetadataHelper } from 'libs/shared/utils/PageMetadataHelper';\n\nimport { Actions } from 'shared/constants/LiteActions';\nimport { AppChannels } from 'shared/constants/LiteRadioChannels';\nimport { TranscriptRequests, TranscriptResponse } from 'shared/flight-requests/TranscriptRequests';\nimport { useActivePresentation } from 'shared/hooks/presentations/useActivePresentation';\nimport { useCommonVideoProps } from 'shared/hooks/useCommonVideoProps';\nimport { useCurriculums } from 'shared/hooks/useCurriculums';\nimport { useDeepLinks } from 'shared/hooks/useDeepLinks';\nimport { useFetchPointsOfInterest } from 'shared/hooks/useFetchPointsOfInterest';\nimport { useGetRelatedVideos } from 'shared/hooks/useGetRelatedVideos';\nimport { useVideoFeatureAccess } from 'shared/hooks/useVideoFeatureAccess';\nimport { useVideoMixin } from 'shared/hooks/useVideoMixin';\nimport { SeoHelper } from 'shared/utils/SeoHelper';\nimport { VideoAppLinkHelper } from 'shared/utils/VideoAppLinkHelper';\nimport { useShouldShowSideTableOfContents } from 'shared/views/play/hooks/useShouldShowTableOfContents';\nimport { useShowTranscriptForVideo } from 'shared/views/play/hooks/useShowVideoTranscript';\n\nimport { PlayPage } from './components/play-page/PlayPage';\n\nconst namespace = 'shared.play';\nconst getPhrase = LanguageService.encloseNamespace(namespace);\n\nconst videoErrors = {\n notFound: VideoNotFoundError,\n forbidden: {\n privacy: VideoPrivateError\n }\n};\n\nexport interface PlayViewProps {\n presentationSlug: string;\n id: string;\n queryParams?: PlayViewQueryParams;\n}\n\nPlayView.defaultProps = {\n queryParams: {}\n};\n\nexport function PlayView(props: PlayViewProps): React.ReactElement {\n const { context, contextId, playNext, mtv, resourceId } = props.queryParams;\n\n const {\n commonVideoProps,\n hasCommonVideoPropsCompleted\n } = useCommonVideoProps({ locationContext: LocationContext.PlayPage, mtv });\n\n const { hasPermissions } = usePermissions();\n\n const { activePresentation } = useActivePresentation();\n const { hasPlayPageTranscript, hasNewSearch, clickViewLive } = useSettings(null);\n\n const streamableLibrary = Flight.useBasicFetch<HashObject>(LibraryRequests.streamableLearning());\n\n const currentUser = Flight.useBasicFetch<CurrentUser>(UserRequests.currentUser());\n const video = Flight.useBasicFetch<Video>(VideoRequests.video(props.id));\n\n const featureAccess = useVideoFeatureAccess({\n objectId: video.data?.id,\n objectTypeId: video.data?.typeId\n });\n \n const clips = Flight.useBasicFetch<ClipCollection>(\n featureAccess.canViewClips && ClipRequests.videoClips(props.id)\n );\n const interactives = Flight.useBasicFetch<InteractiveCollection>(\n featureAccess.canViewInteractives && InteractiveRequests.videoInteractives(props.id)\n );\n \n const audiences = Flight.useBasicFetch<PresentationAudience[]>(\n activePresentation &&\n AudienceRequests.audiencesByPresentationId(activePresentation.id)\n );\n\n const { shouldFetchTranscript, shouldShowTranscript } = useShowTranscriptForVideo(props.id);\n const transcript = Flight.useBasicFetch<TranscriptResponse>(\n shouldFetchTranscript && currentUser.data?.contentRegion &&\n TranscriptRequests.chaptersAndSubtitles(props.id, currentUser.data.contentRegion)\n );\n const { subtitles: allSubtitles, chapters } = transcript?.data || {};\n // only show transcript for ClickView produced subtitle\n const subtitles = allSubtitles?.filter(subtitle => !subtitle.customer);\n\n const captionsRequests = (subtitles && subtitles.length > 0) ?\n subtitles.map(subtitle => TranscriptRequests.subtitleVtt(subtitle.url, subtitle)) :\n [];\n const captions = Flight.useBasicFetchAll<VttSubtitleResponse>(captionsRequests);\n const filteredSubtitles = subtitles?.filter(\n subtitle => captions.data.find(caption => caption.id === subtitle.id)\n ) || [];\n const config = Flight.useBasicFetch<Config>(ConfigRequests.config());\n\n const shouldShowSideTableOfContents = useShouldShowSideTableOfContents();\n\n const strippedVideo = Flight.useBasicFetch<Video>(video.statusCode === HttpStatus.Forbidden &&\n VideoRequests.video(props.id, PermissionFilterOption.StripMetadata));\n\n const curriculums = useCurriculums(props.id);\n\n const relatedVideos = useGetRelatedVideos({\n video: video.data,\n context,\n contextId,\n moviesAndTv: mtv,\n currentUser: currentUser.data\n });\n const pointsOfInterest = useFetchPointsOfInterest(props.id, true);\n\n const regionAlternatives = Flight.useBasicFetch<RegionAlternative[]>(\n VideoRequests.regionAlternatives(props.id)\n );\n\n const breadcrumbs = useBreadcrumbs({ name: video.data?.name });\n\n useSetPageMetadata(PageMetadataHelper.getVideoMetadata({\n content: video.data,\n regionAlternatives: regionAlternatives.data,\n phraseContext: {\n phraseHandler: getPhrase,\n titlePhrase: 'pageTitle',\n descriptionPhrase: 'pageDescription'\n },\n canonicalLink: SeoHelper.getCanonicalLink({\n stripPresentationSlug: true,\n customAppLink: VideoAppLinkHelper.getAppLink(video.data, {}, props.presentationSlug)\n }),\n allowIndexing: SeoHelper.allowIndexing(),\n hrefLang: SeoHelper.getContentHrefLang(regionAlternatives.data, (id: string, name: string) => ({\n application: AppChannels.VIDEOS,\n action: Actions.Videos.PLAY_VIDEO,\n args: [ null, id, TextHelper.slugify(name) ]\n }))\n }));\n\n useHandleObjectError(video, videoErrors, { forbidden: true });\n useVideoMixin(relatedVideos.videos ?? []);\n useDeepLinks({ id: props.id, app: 'videos' });\n useCannotConsumeError(strippedVideo);\n\n React.useEffect(() => {\n if (clickViewLive)\n return;\n\n if (!video.data || !streamableLibrary.data)\n return;\n \n if (!clickViewLive && video.data.libraries?.data.find(library => library.id === streamableLibrary.data.objectId))\n Core.ErrorHelper.throw(new NotFoundError());\n }, [ video.hasCompleted, streamableLibrary.hasCompleted, clickViewLive ]);\n\n const dataLoaded = (\n video.data &&\n currentUser.hasCompleted &&\n pointsOfInterest.hasCompleted &&\n hasCommonVideoPropsCompleted\n );\n\n if (!dataLoaded)\n return <></>;\n\n return (\n <PlayPage\n presentationSlug={props.presentationSlug}\n video={video.data}\n clips={clips.data?.data}\n interactives={interactives.data?.data}\n curriculums={curriculums}\n relatedVideos={relatedVideos}\n currentUser={currentUser.data}\n pointsOfInterest={pointsOfInterest.items}\n playNext={playNext}\n featureAccess={featureAccess}\n audiences={audiences.data}\n params={props.queryParams}\n canManageVideoAccess={hasPermissions(PermissionName.ManageVideoAccess)}\n shouldShowSideTableOfContents={shouldShowSideTableOfContents}\n tableOfContentsId={props.queryParams?.tocId}\n breadcrumbs={breadcrumbs}\n commonVideoProps={commonVideoProps}\n hasTheatreMode={hasPlayPageTranscript}\n shouldShowTranscript={shouldShowTranscript && (!shouldFetchTranscript || captions.data?.length > 0)}\n vttSubtitles={captions.data || []}\n subtitles={filteredSubtitles}\n chapters={chapters}\n isBot={SeoHelper.isBot()}\n playerApiUrl={config.data?.playerApiUrl}\n hasNewSearch={hasNewSearch}\n liteUrl={config.data.liteUrl}\n resourcePopupId={resourceId}\n />\n );\n}\n"],"mappings":"yqDAoDM,EAAY,EAAgB,iBAAiB,aAAS,EAE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AkB,aAAc,CAAc,CAAC,EAGtE,EAAM,MACN,EAAY,cACZ,EAAiB,cACjB,GAOA,EAAA,EAAA,IAAA,CAAC,EAAD,CACE,iBAAkB,EAAM,iBACxB,MAAO,EAAM,KACb,MAAO,GAAM,MAAM,KACnB,aAAc,GAAa,MAAM,KACpB,eACE,gBACf,YAAa,EAAY,KACzB,iBAAkB,EAAiB,MACzB,WACK,gBACf,UAAW,GAAU,KACrB,OAAQ,EAAM,YACd,qBAAsB,GAAe,GAAe,iBAAiB,EACtC,iCAC/B,kBAAmB,EAAM,aAAa,MACzB,eACK,mBAClB,eAAgB,EAChB,qBAAsB,KAAyB,CAAC,GAAyB,EAAS,MAAM,OAAS,GACjG,aAAc,EAAS,MAAQ,CAAC,EAChC,UAAW,GACD,YACV,MAAO,EAAU,MAAM,EACvB,aAAc,EAAO,MAAM,aACb,eACd,QAAS,EAAO,KAAK,QACrB,gBAAiB,CAClB,CAAA,GA/BM,EAAA,EAAA,IAAA,CAAA,EAAA,SAAA,CAAI,CAAA,CAiCf"}
1
+ {"version":3,"file":"fMgBORUX.chunk.js","names":[],"sources":["../../src/shared/views/play/PlayView.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport { HttpStatus } from 'libs/common/backbone/enums/HttpStatus';\nimport { Core } from 'libs/common/backbone/index';\nimport { LanguageService } from 'libs/common/backbone/services/LanguageService';\nimport { Flight } from 'libs/common/flight';\nimport { HashObject } from 'libs/common/react/interfaces/HashObject';\nimport { TextHelper } from 'libs/common/react/utils/TextHelper';\n\nimport { LocationContext } from 'libs/analytics/interfaces';\n\nimport { PermissionFilterOption } from 'libs/shared/enums/PermissionFilterOption';\nimport { PermissionName } from 'libs/shared/enums/PermissionName';\nimport { NotFoundError } from 'libs/shared/errors/general/not-found/NotFoundError';\nimport { VideoNotFoundError } from 'libs/shared/errors/videos/video-not-found/VideoNotFoundError';\nimport { VideoPrivateError } from 'libs/shared/errors/videos/video-private/VideoPrivateError';\nimport { AudienceRequests } from 'libs/shared/flight-requests/AudienceRequests';\nimport { ClipRequests } from 'libs/shared/flight-requests/ClipRequests';\nimport { ConfigRequests } from 'libs/shared/flight-requests/ConfigRequests';\nimport { InteractiveRequests } from 'libs/shared/flight-requests/InteractiveRequests';\nimport { LibraryRequests } from 'libs/shared/flight-requests/LibraryRequests';\nimport { UserRequests } from 'libs/shared/flight-requests/UserRequests';\nimport { VideoRequests } from 'libs/shared/flight-requests/VideoRequests';\nimport { useBreadcrumbs } from 'libs/shared/hooks/useBreadcrumbs';\nimport { useCannotConsumeError } from 'libs/shared/hooks/useCannotConsumeError';\nimport { useHandleObjectError } from 'libs/shared/hooks/UseHandleObjectError';\nimport { usePermissions } from 'libs/shared/hooks/usePermissions';\nimport { useSetPageMetadata } from 'libs/shared/hooks/useSetPageMetadata';\nimport { useSettings } from 'libs/shared/hooks/useSettings';\nimport { ClipCollection, Config, CurrentUser, InteractiveCollection, PresentationAudience, RegionAlternative, Video, VttSubtitleResponse } from 'libs/shared/interfaces';\nimport { PlayViewQueryParams } from 'libs/shared/interfaces/query-params/PlayViewQueryParams';\nimport { PageMetadataHelper } from 'libs/shared/utils/PageMetadataHelper';\n\nimport { Actions } from 'shared/constants/LiteActions';\nimport { AppChannels } from 'shared/constants/LiteRadioChannels';\nimport { TranscriptRequests, TranscriptResponse } from 'shared/flight-requests/TranscriptRequests';\nimport { useActivePresentation } from 'shared/hooks/presentations/useActivePresentation';\nimport { useCommonVideoProps } from 'shared/hooks/useCommonVideoProps';\nimport { useCurriculums } from 'shared/hooks/useCurriculums';\nimport { useDeepLinks } from 'shared/hooks/useDeepLinks';\nimport { useFetchPointsOfInterest } from 'shared/hooks/useFetchPointsOfInterest';\nimport { useGetRelatedVideos } from 'shared/hooks/useGetRelatedVideos';\nimport { useVideoFeatureAccess } from 'shared/hooks/useVideoFeatureAccess';\nimport { useVideoMixin } from 'shared/hooks/useVideoMixin';\nimport { SeoHelper } from 'shared/utils/SeoHelper';\nimport { VideoAppLinkHelper } from 'shared/utils/VideoAppLinkHelper';\nimport { useShouldShowSideTableOfContents } from 'shared/views/play/hooks/useShouldShowTableOfContents';\nimport { useShowTranscriptForVideo } from 'shared/views/play/hooks/useShowVideoTranscript';\n\nimport { PlayPage } from './components/play-page/PlayPage';\n\nconst namespace = 'shared.play';\nconst getPhrase = LanguageService.encloseNamespace(namespace);\n\nconst videoErrors = {\n notFound: VideoNotFoundError,\n forbidden: {\n privacy: VideoPrivateError\n }\n};\n\nexport interface PlayViewProps {\n presentationSlug: string;\n id: string;\n queryParams?: PlayViewQueryParams;\n}\n\nPlayView.defaultProps = {\n queryParams: {}\n};\n\nexport function PlayView(props: PlayViewProps): React.ReactElement {\n const { context, contextId, playNext, mtv, resourceId } = props.queryParams;\n\n const {\n commonVideoProps,\n hasCommonVideoPropsCompleted\n } = useCommonVideoProps({ locationContext: LocationContext.PlayPage, mtv });\n\n const { hasPermissions } = usePermissions();\n\n const { activePresentation } = useActivePresentation();\n const { hasPlayPageTranscript, hasNewSearch, clickViewLive } = useSettings(null);\n\n const streamableLibrary = Flight.useBasicFetch<HashObject>(LibraryRequests.streamableLearning());\n\n const currentUser = Flight.useBasicFetch<CurrentUser>(UserRequests.currentUser());\n const video = Flight.useBasicFetch<Video>(VideoRequests.video(props.id));\n\n const featureAccess = useVideoFeatureAccess({\n objectId: video.data?.id,\n objectTypeId: video.data?.typeId\n });\n \n const clips = Flight.useBasicFetch<ClipCollection>(\n featureAccess.canViewClips && ClipRequests.videoClips(props.id)\n );\n const interactives = Flight.useBasicFetch<InteractiveCollection>(\n featureAccess.canViewInteractives && InteractiveRequests.videoInteractives(props.id)\n );\n \n const audiences = Flight.useBasicFetch<PresentationAudience[]>(\n activePresentation &&\n AudienceRequests.audiencesByPresentationId(activePresentation.id)\n );\n\n const { shouldFetchTranscript, shouldShowTranscript } = useShowTranscriptForVideo(props.id);\n const transcript = Flight.useBasicFetch<TranscriptResponse>(\n shouldFetchTranscript && currentUser.data?.contentRegion &&\n TranscriptRequests.chaptersAndSubtitles(props.id, currentUser.data.contentRegion)\n );\n const { subtitles: allSubtitles, chapters } = transcript?.data || {};\n // only show transcript for ClickView produced subtitle\n const subtitles = allSubtitles?.filter(subtitle => !subtitle.customer);\n\n const captionsRequests = (subtitles && subtitles.length > 0) ?\n subtitles.map(subtitle => TranscriptRequests.subtitleVtt(subtitle.url, subtitle)) :\n [];\n const captions = Flight.useBasicFetchAll<VttSubtitleResponse>(captionsRequests);\n const filteredSubtitles = subtitles?.filter(\n subtitle => captions.data.find(caption => caption.id === subtitle.id)\n ) || [];\n const config = Flight.useBasicFetch<Config>(ConfigRequests.config());\n\n const shouldShowSideTableOfContents = useShouldShowSideTableOfContents();\n\n const strippedVideo = Flight.useBasicFetch<Video>(video.statusCode === HttpStatus.Forbidden &&\n VideoRequests.video(props.id, PermissionFilterOption.StripMetadata));\n\n const curriculums = useCurriculums(props.id);\n\n const relatedVideos = useGetRelatedVideos({\n video: video.data,\n context,\n contextId,\n moviesAndTv: mtv,\n currentUser: currentUser.data\n });\n const pointsOfInterest = useFetchPointsOfInterest(props.id, true);\n\n const regionAlternatives = Flight.useBasicFetch<RegionAlternative[]>(\n VideoRequests.regionAlternatives(props.id)\n );\n\n const breadcrumbs = useBreadcrumbs({ name: video.data?.name });\n\n useSetPageMetadata(PageMetadataHelper.getVideoMetadata({\n content: video.data,\n regionAlternatives: regionAlternatives.data,\n phraseContext: {\n phraseHandler: getPhrase,\n titlePhrase: 'pageTitle',\n descriptionPhrase: 'pageDescription'\n },\n canonicalLink: SeoHelper.getCanonicalLink({\n stripPresentationSlug: true,\n customAppLink: VideoAppLinkHelper.getAppLink(video.data, {}, props.presentationSlug)\n }),\n allowIndexing: SeoHelper.allowIndexing(),\n hrefLang: SeoHelper.getContentHrefLang(regionAlternatives.data, (id: string, name: string) => ({\n application: AppChannels.VIDEOS,\n action: Actions.Videos.PLAY_VIDEO,\n args: [ null, id, TextHelper.slugify(name) ]\n }))\n }));\n\n useHandleObjectError(video, videoErrors, { forbidden: true });\n useVideoMixin(relatedVideos.videos ?? []);\n useDeepLinks({ id: props.id, app: 'videos' });\n useCannotConsumeError(strippedVideo);\n\n React.useEffect(() => {\n if (clickViewLive)\n return;\n\n if (!video.data || !streamableLibrary.data)\n return;\n \n if (!clickViewLive && video.data.libraries?.data.find(library => library.id === streamableLibrary.data.objectId))\n Core.ErrorHelper.throw(new NotFoundError());\n }, [ video.hasCompleted, streamableLibrary.hasCompleted, clickViewLive ]);\n\n const dataLoaded = (\n video.data &&\n currentUser.hasCompleted &&\n pointsOfInterest.hasCompleted &&\n hasCommonVideoPropsCompleted\n );\n\n if (!dataLoaded)\n return <></>;\n\n return (\n <PlayPage\n presentationSlug={props.presentationSlug}\n video={video.data}\n clips={clips.data?.data}\n interactives={interactives.data?.data}\n curriculums={curriculums}\n relatedVideos={relatedVideos}\n currentUser={currentUser.data}\n pointsOfInterest={pointsOfInterest.items}\n playNext={playNext}\n featureAccess={featureAccess}\n audiences={audiences.data}\n params={props.queryParams}\n canManageVideoAccess={hasPermissions(PermissionName.ManageVideoAccess)}\n shouldShowSideTableOfContents={shouldShowSideTableOfContents}\n tableOfContentsId={props.queryParams?.tocId}\n breadcrumbs={breadcrumbs}\n commonVideoProps={commonVideoProps}\n hasTheatreMode={hasPlayPageTranscript}\n shouldShowTranscript={shouldShowTranscript && (!shouldFetchTranscript || captions.data?.length > 0)}\n vttSubtitles={captions.data || []}\n subtitles={filteredSubtitles}\n chapters={chapters}\n isBot={SeoHelper.isBot()}\n playerApiUrl={config.data?.playerApiUrl}\n hasNewSearch={hasNewSearch}\n liteUrl={config.data.liteUrl}\n resourcePopupId={resourceId}\n />\n );\n}\n"],"mappings":"yqDAoDM,EAAY,EAAgB,iBAAiB,aAAS,EAEtD,EAAc,CAClB,SAAU,EACV,UAAW,CACT,QAAS,CACX,CACF,EAQA,EAAS,aAAe,CACtB,YAAa,CAAC,CAChB,EAEA,SAAgB,EAAS,EAA0C,CACjE,GAAM,CAAE,UAAS,YAAW,WAAU,MAAK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,KACnB,aAAc,GAAa,MAAM,KACpB,eACE,gBACf,YAAa,EAAY,KACzB,iBAAkB,EAAiB,MACzB,WACK,gBACf,UAAW,GAAU,KACrB,OAAQ,EAAM,YACd,qBAAsB,GAAe,GAAe,iBAAiB,EACtC,iCAC/B,kBAAmB,EAAM,aAAa,MACzB,eACK,mBAClB,eAAgB,EAChB,qBAAsB,KAAyB,CAAC,GAAyB,EAAS,MAAM,OAAS,GACjG,aAAc,EAAS,MAAQ,CAAC,EAChC,UAAW,GACD,YACV,MAAO,EAAU,MAAM,EACvB,aAAc,EAAO,MAAM,aACb,eACd,QAAS,EAAO,KAAK,QACrB,gBAAiB,CAClB,CAAA,GA/BM,EAAA,EAAA,IAAA,CAAA,EAAA,SAAA,CAAI,CAAA,CAiCf"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@clickview/lite",
3
- "version": "0.104.0-rc.4",
3
+ "version": "0.104.0-rc.5",
4
4
  "description": "ClickView Lite",
5
5
  "main": "dist/scripts/bundle.js",
6
6
  "types": "dist/projects/lite/src/index.d.ts",
@@ -1 +0,0 @@
1
- import"./jAtAipGN.chunk.js";
@@ -1,2 +0,0 @@
1
- import{o as e}from"./DAXXjFlN.chunk.js";import{y as t}from"./BftnFbcr.chunk.js";import"./DFZS3Ffo.chunk.js";import{t as n}from"./e57H3T-k.chunk.js";import{t as r}from"./C2w0pmFW.chunk.js";import{t as i}from"./BXTI9cmX.chunk.js";import{n as a}from"./BVnMI-dl.chunk.js";import{t as o}from"./C1SLt-ar.chunk.js";import{U as s,d as c,z as l}from"./NlCAcBdo.chunk.js";import{t as u}from"./1LRpIhCn.chunk.js";import{n as d}from"./DTGfiG8Y.chunk.js";import{t as f}from"./eoAypzU3.chunk.js";import{t as p}from"./7-GJWRH82.chunk.js";import{t as m}from"./DpCWroEe2.chunk.js";import{t as h}from"./DYDxLHiV2.chunk.js";import{t as g}from"./DBkEQkKm2.chunk.js";import{t as _}from"./BUoougrH.chunk.js";import{t as v}from"./CzuHD4Ht.chunk.js";import{n as y,o as b,t as x}from"./CsWeCs8U2.chunk.js";import{t as S}from"./BwelEZs92.chunk.js";import{t as C}from"./HT_TXzUd2.chunk.js";import{t as w}from"./DFIgRAfX2.chunk.js";import{t as T}from"./DBHDBu1Y.chunk.js";import{t as E}from"./ryLD1Tv-.chunk.js";var D=e(r(),1),O={getCompanyAppLink(e,t){return{application:i.MOVIES_AND_TV,action:f.MoviesAndTv.COMPANY_DASHBOARD,args:[t,e.id,n.slugify(e.name)]}},getClassificationAppLink(e,t,n){return _.getAppLink(e,t?{moviesAndTv:!0}:{},n)},getCollectionActions(e,t,n,r){return t?[{svg:E,appLink:{application:i.SHARE,action:f.Share.SHARE,args:[e.id],params:{entityType:n}},analyticsData:{id:e.id},analyticsOptions:{...r,actionType:l.Share,workflowPhase:s.Start,eventVersion:c.V3},button:!0}]:[]},getSeriesAppLink(e,t,n){return h.getSeriesAppLink(e,t?{mtv:!0}:{},n)},getPlaylistAppLink(e,t,r){return{application:i.PLAYLISTS,action:f.Playlists.PLAYLIST,args:[r,e.id,n.slugify(e.name)],params:t?{mtv:!0}:null}},getAppLinks(e,t,n,r){return{getVideoAppLink:(e,t)=>g.getAppLink(e,{...t,moviesAndTv:n},r),getPlaylistAppLink:e=>O.getPlaylistAppLink(e,n,r),getSeriesAppLink:e=>O.getSeriesAppLink(e,n,r),getCompanyAppLink:n=>{let r=u.getPresentationSlugByCompany(n,e,t);return O.getCompanyAppLink(n,r)},getClassificationAppLink:e=>O.getClassificationAppLink(e,n,t),getPreviewQuestionsAppLink:e=>v.getPreviewQuestionsAppLink(e),getCollectionActions:O.getCollectionActions,searchSettings:{application:i.SETTINGS,action:f.Settings.PLATFORM_SETTINGS}}},isSearchAppLink(e){return e.application===i.SEARCH&&e.action===f.Search.HOME},useReferrerAppLink(){let e={application:i.DASHBOARD,action:f.Dashboard.HOME,args:[null]},[t,n]=D.useState(e),r=m.getCurrentRoute();return D.useEffect(()=>{O.isSearchAppLink(r.appLink)||n(r.appLink)},[r.appLink.application,r.appLink.action]),t},useOnFilterChange(e,t){let n={...t};delete n.query;let r=Object.keys(n).map(e=>n[e]).sort((e,t)=>e-t);D.useEffect(()=>{e()},[r.join(`:`)])},triggerAppLink(e,r={},o){let s={};r=o?a.omit(r,[`query`]):{},e&&(s.query=n.removeExtraSpace(e)),Object.keys(r).length&&(s={...s,...r}),t.trigger({application:i.SEARCH,action:f.Search.HOME,params:s},{replace:o})},getInitialQuery(){let e=m.getCurrentRoute().appLink;return O.isSearchAppLink(e)?e.params?.query??``:``},isValidSearch(e,t){if(e?.trim())return!0;if(!O.isSearchAppLink(t))return!1;let n=t?.params?.tagOrClassification,r=t?.params?.rating,i=t?.params?.moviesAndTv,a=t?.params?.source,o=t?.params?.scopeId;return Array.isArray(n)?!!n.length:!!n?.length||!!r?.length||!!i?.length||!!a?.length||!!o?.length},getFirstSeries(e){return o.first(e.items)},getFirstPlaylist(e){return o.first(e.items)},getVideoAppLink(e,t){return{application:i.VIDEOS,action:f.Videos.PLAY_VIDEO,args:[t,e.id,n.slugify(e.name)]}},getQuery(e){return e.query?e.query:e.tagOrClassification?(Array.isArray(e.tagOrClassification)?e.tagOrClassification:[e.tagOrClassification]).join(` `):``},getInaccessibleIndices(e){let{isLearner:t,queryParams:n,hasMoviesAndTv:r}=e,i=[];return(t||n.moviesAndTv)&&(i.push(`clip`),i.push(`interactive`)),r||i.push(`company`),i},getFilters(e){let{data:t,inaccessibleIndices:n,tagsAndClassifications:r,_hasNewSearch:i,_hasPartnerProfiles:a,hasCVFilters:o}=e;if(!t.hasDataLoaded||!i&&r&&!r.hasCompleted)return null;let{moviesAndTvDashboard:s,ratings:c,yearGroups:l,userDetails:u,schoolLevels:d,availableTopics:f,libraries:m,currentUser:h,isLearner:g,hasCustomLibraries:_,hasMoviesAndTv:v,isGuest:S,showStreamableSearchResults:T}=t,E=C.IS_XMAS?y.MoviesAndTv(p.MoviesAndTv.XMAS_SOCK,p.MoviesAndTv.XMAS_GIFTS):y.MoviesAndTv(p.MoviesAndTv.POPCORN_BOX,p.MoviesAndTv.POPCORN_BITS),D=C.IS_XMAS?y.MoviesAndTv(p.MoviesAndTv.POPCORN_BOX,p.MoviesAndTv.POPCORN_BITS):null,O=[];o?(v&&s.data?.id?O.push(E):O.push(D),h.data?.isAuthenticated&&O.push(y.Source(b.getOptions({libraries:m,isLearner:g,isGuest:S,hasCustomLibraries:_,liveStreams:T}))),S||O.push(y.Rating(c.data,l.data&&u.data&&w.getStudentMaxRating(l.data,u.data))),O.push(y.HasResources()),O.push(y.ObjectTypes(n,i,a)),i||O.push(y.TagOrClassification(r.data))):h.data?.isAuthenticated&&O.push(y.Source(b.getOptions({libraries:m,isLearner:g,isGuest:S,hasCustomLibraries:_,hideCVLibrary:!0,liveStreams:T})));let k=y.Presentation(d.data?.schoolLevels,i);x.showPresentationFilter(k)&&O.unshift(k);let A=y.Topics(f.data?.topics.map(e=>({name:e.name,id:e.topicIds.join(`:`)})));A.options&&A.options.length>1&&O.unshift(A);let j=[y.ProductionYear(),y.HasSubtitles(),y.IsHD()];return o&&j.push(y.IsClickViewContent()),j.push(y.Duration()),{mainFilters:O.filter(Boolean),moreFilters:x.getMoreFilters(j)}},getSearchAppLink(e,t){return{application:i.SEARCH,action:f.Search.HOME,params:{...t,query:e}}},getBackendFilters(e){if(!e.hasDataLoaded)return null;let{queryParams:t,ratings:n,currentPresentationId:r,isLearner:i,libraries:a,hasMoviesAndTv:o,streamableLibraryId:s,exchangeLibraryId:c,showExchangeSearchResults:l,showStreamableSearchResults:u}=e,d=x.buildBackendFilterParams(t,n.data,[r],i,a,s),f=`${S.FILTER_PARAM_PREFIX}excludeLibraryExclusive`,p=[];s&&!u&&p.push(s),c&&!l&&p.push(c),d[f]=p;let m=O.getInaccessibleIndices({isLearner:i,hasMoviesAndTv:o,queryParams:t});return{queryParams:t,backendFilters:d,appliedIndices:x.getAppliedIndices(e.queryParams).filter(e=>e!==`classification`&&e!==`company`).filter(e=>!m.find(t=>t===e)),inaccessibleIndices:m}},getBackendFiltersV2(e){if(!e.hasDataLoaded)return null;let{queryParams:t,ratings:n,isLearner:r,libraries:i,hasMoviesAndTv:a,streamableLibraryId:o,exchangeLibraryId:s,showExchangeSearchResults:c,availablePresentations:l,showStreamableSearchResults:u}=e,f=x.buildBackendFilterParams(t,n.data,l?.map(e=>e.id),r,i,o),p=[];o&&!u&&p.push(o),s&&!c&&p.push(s);let m=O.getInaccessibleIndices({isLearner:r,hasMoviesAndTv:a,queryParams:t}),h=`${S.FILTER_PARAM_PREFIX}indicesFilters`,g=x.getAppliedIndices(e.queryParams,!0,e.settings.hasPartnerProfiles).filter(e=>!m.find(t=>t===e)),_=l?.map(e=>e.id);return f[h]=g.map(e=>{let t={index:e};if(e===`video`&&p.length)return{...t,filters:{excludeLibraryExclusive:[...p]}};if(e===`classification`){let e={...t,filters:{classificationType:d.Subject,status:[T.Published,T.ComingSoon]}};return l?.length&&(e.filters.presentation=_),e}return e===`company`?{...t,filters:{presentation:_}}:t}),{queryParams:t,backendFilters:f,appliedIndices:g,inaccessibleIndices:m}}};export{O as t};
2
- //# sourceMappingURL=jAtAipGN.chunk.js.map