@clickview/lite 0.74.0-rc.2 → 0.74.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.
- package/dist/bundles.json +1 -1
- package/dist/scripts/3677-43784effdf-lite.chunk.js +2 -0
- package/dist/scripts/3677-43784effdf-lite.chunk.js.map +1 -0
- package/dist/scripts/3978-84811f1db1-lite.chunk.js +2 -0
- package/dist/scripts/3978-84811f1db1-lite.chunk.js.map +1 -0
- package/dist/scripts/4400-e6d6e73b2c-lite.chunk.js +2 -0
- package/dist/scripts/4400-e6d6e73b2c-lite.chunk.js.map +1 -0
- package/dist/scripts/5135-c6eae4df36-lite.chunk.js +2 -0
- package/dist/scripts/5135-c6eae4df36-lite.chunk.js.map +1 -0
- package/dist/scripts/618-d8d8f7d8c1-lite.chunk.js +2 -0
- package/dist/scripts/618-d8d8f7d8c1-lite.chunk.js.map +1 -0
- package/dist/scripts/6379-4b78ae2469-lite.chunk.js +2 -0
- package/dist/scripts/6379-4b78ae2469-lite.chunk.js.map +1 -0
- package/dist/scripts/647-ad2e2f0add-lite.chunk.js +2 -0
- package/dist/scripts/647-ad2e2f0add-lite.chunk.js.map +1 -0
- package/dist/scripts/6909-7a8ac9f30a-lite.chunk.js +2 -0
- package/dist/scripts/6909-7a8ac9f30a-lite.chunk.js.map +1 -0
- package/dist/scripts/7234-5ccd8259d1-lite.chunk.js +2 -0
- package/dist/scripts/7234-5ccd8259d1-lite.chunk.js.map +1 -0
- package/dist/scripts/7577-12a01937f0-lite.chunk.js +2 -0
- package/dist/scripts/7577-12a01937f0-lite.chunk.js.map +1 -0
- package/dist/scripts/7742-c9755a67d4-lite.chunk.js +2 -0
- package/dist/scripts/7742-c9755a67d4-lite.chunk.js.map +1 -0
- package/dist/scripts/8451-2ef1dfce61-lite.chunk.js +2 -0
- package/dist/scripts/8451-2ef1dfce61-lite.chunk.js.map +1 -0
- package/dist/scripts/9241-238326bcb2-lite.chunk.js +2 -0
- package/dist/scripts/9241-238326bcb2-lite.chunk.js.map +1 -0
- package/dist/scripts/9345-a373f08fe5-lite.chunk.js +3 -0
- package/dist/scripts/9345-a373f08fe5-lite.chunk.js.map +1 -0
- package/dist/scripts/9630-9ca1798eee-lite.chunk.js +2 -0
- package/dist/scripts/9630-9ca1798eee-lite.chunk.js.map +1 -0
- package/dist/scripts/{9767-a23d603cc5-lite.chunk.js → 9767-281d5e0883-lite.chunk.js} +2 -2
- package/dist/scripts/9767-281d5e0883-lite.chunk.js.map +1 -0
- package/dist/scripts/{bundle-6a0c1aecd5.min.js → bundle-0260bfcbaa.min.js} +3 -3
- package/dist/scripts/{bundle-6a0c1aecd5.min.js.map → bundle-0260bfcbaa.min.js.map} +1 -1
- package/package.json +1 -1
- package/dist/scripts/3677-aadf9fd2cc-lite.chunk.js +0 -2
- package/dist/scripts/3677-aadf9fd2cc-lite.chunk.js.map +0 -1
- package/dist/scripts/3978-0e2106b5aa-lite.chunk.js +0 -2
- package/dist/scripts/3978-0e2106b5aa-lite.chunk.js.map +0 -1
- package/dist/scripts/4400-7381394a2e-lite.chunk.js +0 -2
- package/dist/scripts/4400-7381394a2e-lite.chunk.js.map +0 -1
- package/dist/scripts/5135-9fa172bfc3-lite.chunk.js +0 -2
- package/dist/scripts/5135-9fa172bfc3-lite.chunk.js.map +0 -1
- package/dist/scripts/618-33ead82bb3-lite.chunk.js +0 -2
- package/dist/scripts/618-33ead82bb3-lite.chunk.js.map +0 -1
- package/dist/scripts/6379-1fac9e5c3c-lite.chunk.js +0 -2
- package/dist/scripts/6379-1fac9e5c3c-lite.chunk.js.map +0 -1
- package/dist/scripts/647-cf8ade72c6-lite.chunk.js +0 -2
- package/dist/scripts/647-cf8ade72c6-lite.chunk.js.map +0 -1
- package/dist/scripts/6909-0cc76e0fcc-lite.chunk.js +0 -2
- package/dist/scripts/6909-0cc76e0fcc-lite.chunk.js.map +0 -1
- package/dist/scripts/7234-4fdc8f5ae3-lite.chunk.js +0 -2
- package/dist/scripts/7234-4fdc8f5ae3-lite.chunk.js.map +0 -1
- package/dist/scripts/7577-a930db95e5-lite.chunk.js +0 -2
- package/dist/scripts/7577-a930db95e5-lite.chunk.js.map +0 -1
- package/dist/scripts/7742-8a303defe5-lite.chunk.js +0 -2
- package/dist/scripts/7742-8a303defe5-lite.chunk.js.map +0 -1
- package/dist/scripts/8451-9ab30b6e35-lite.chunk.js +0 -2
- package/dist/scripts/8451-9ab30b6e35-lite.chunk.js.map +0 -1
- package/dist/scripts/9241-c523dc7aac-lite.chunk.js +0 -2
- package/dist/scripts/9241-c523dc7aac-lite.chunk.js.map +0 -1
- package/dist/scripts/9345-df0cbb196f-lite.chunk.js +0 -3
- package/dist/scripts/9345-df0cbb196f-lite.chunk.js.map +0 -1
- package/dist/scripts/9630-6bcd453382-lite.chunk.js +0 -2
- package/dist/scripts/9630-6bcd453382-lite.chunk.js.map +0 -1
- package/dist/scripts/9767-a23d603cc5-lite.chunk.js.map +0 -1
- /package/dist/scripts/{9345-df0cbb196f-lite.chunk.js.LICENSE.txt → 9345-a373f08fe5-lite.chunk.js.LICENSE.txt} +0 -0
- /package/dist/scripts/{bundle-6a0c1aecd5.min.js.LICENSE.txt → bundle-0260bfcbaa.min.js.LICENSE.txt} +0 -0
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";(self.webpackChunk_clickview_lite=self.webpackChunk_clickview_lite||[]).push([[7742],{39902:(e,t,n)=>{n.d(t,{FN:()=>f,SW:()=>v,fh:()=>p});var r=n(32735),i=n(20354),a=n(75896);function o(e){return function(e){if(Array.isArray(e))return c(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||l(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function l(e,t){if(e){if("string"==typeof e)return c(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?c(e,t):void 0}}function c(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function u(e){return u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},u(e)}function s(e,t,n){return(t=function(e){var t=function(e){if("object"!=u(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=u(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==u(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var d=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n},m=50;function p(e,t){var n=a.m.chunk(e,m).map((function(e){return t(a.m.uniq(e))})),r=i.a.useBasicFetchAll(n),o=a.m.flatten(r.data),l=r.data.length?o.reduce((function(e,t){return Object.assign(Object.assign({},e),s({},t.id,t))}),{}):null;return{itemsArr:o,items:l,isFetching:r.isFetching}}function f(e,t,n){var i=v({getRequest:t,_getKey:n}),a=i.fetchItems,o=d(i,["fetchItems"]);return r.useEffect((function(){(null==e?void 0:e.length)&&a(e)}),[null==e?void 0:e.length]),o}function v(e){var t,n,c,d,p,f=null!==(t=e._getKey)&&void 0!==t?t:function(e){return"object"===u(e)?e.id:e},v=r.useRef(new Set),y=(d=r.useState([]),p=2,function(e){if(Array.isArray(e))return e}(d)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,a,o,l=[],c=!0,u=!1;try{if(a=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(e){u=!0,i=e}finally{try{if(!c&&null!=n.return&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw i}}return l}}(d,p)||l(d,p)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),h=y[0],g=y[1],b=i.a.useBasicFetchAll(h),E=a.m.flatten(b.data),k=b.data.length?E.reduce((function(e,t){return Object.assign(Object.assign({},e),s({},f(t),t))}),{}):null;return{hasFirstRequestCompleted:!!(null===(c=null===(n=b.responses)||void 0===n?void 0:n[0])||void 0===c?void 0:c.hasCompleted),itemsArr:E,items:k,isFetching:b.isFetching,fetchItems:function(t){if(null==t?void 0:t.length){var n=[];t.forEach((function(e){var t=f(e);v.current.has(t)||(n.push(e),v.current.add(t))})),n.length&&g((function(t){return[].concat(o(t),o(a.m.chunk(n,m).map(e.getRequest)))}))}}}}},37788:(e,t,n)=>{n.r(t),n.d(t,{MyVideosView:()=>X});var r=n(32735),i=n(70680),a=n(23481),o=n(20354),l=n(28400),c=n(65858),u=n(43500),s=n(73518),d=n(39958),m=n(1302),p=n(91693),f=n(37395),v=n(4201),y=n(83345),h=n(1860),g=n(30254),b=n(75100),E=n(51365),k=n(16714),V=n(183),A=n(31949),O=n(299),S=n(91286),w=n(22902),F=n(79612),M=n(35223),C=n(58535),j=n(14070),x=n(97291),L=n(58321),N=n(44110),I=n(97816),P=n(10741),D=n(22490),B=n(98860),R=n(12617),_=n(45967),T=n(65202),U=n(74796),q=n(14305),H=n(61970),Y=n(9218),W=n(18097);const K={uploadingList:"wg7hV"};var Q="default.myVideos";function X(e){var t,n,X,Z,$,J,z,G;(0,F.M)({title:a.T.getPhrase(Q,"pageTitle")});var ee=(0,i.I0)(),te=(0,L.U)({locationContext:c.LZ.VideoThumbnail}).commonVideoProps,ne=(0,w.T)(),re=ne.hasPermissions,ie=ne.hasLocalPermissions,ae=(0,_.q)().handleDragEnd,oe=(0,v.of)().focusSearchBar,le=o.a.useBasicFetch(A.N.currentUser()),ce=o.a.useBasicFetch((null===(t=le.data)||void 0===t?void 0:t.isAuthenticated)&&A.N.workspace()),ue=null===(X=null===(n=ce.data)||void 0===n?void 0:n.categoryTree)||void 0===X?void 0:X.id,se=(0,B.P)(ue),de=(0,H.y)(),me=(0,H.W)(null===(Z=ce.data)||void 0===Z?void 0:Z.id,null===($=ce.data)||void 0===$?void 0:$.categoryTree.id),pe=(0,N.i)(),fe=(0,U.f)(),ve=function(e,t){return ce.data?R.E.videos(ue,e,t):null},ye=!ie(k.E.ViewMyVideosLanding)&&le.hasCompleted,he=o.a.useBasicFetch(ye&&ve(e.cursor,e.typeFilter));(0,S.v)(he);var ge=(0,T.J)({onRemove:function(e,t){return o.a.getFetch(ee)(ve(e,t))}}),be=ge.uploadingVideos,Ee=ge.onClickAlternate,ke=ge.onClickDelete,Ve=ge.processingIds,Ae=(null===(J=he.data)||void 0===J?void 0:J.data.length)&&Ve?he.data.data.filter((function(e){return!Ve[e.id]})):[];(0,I.V)(Ae);var Oe=(0,O.X)(Ae);if(ie(k.E.ViewMyVideosLanding))return r.createElement(q.V,null);function Se(){return{action:j.e.MyVideos.MY_VIDEOS,application:x.O.MY_VIDEOS,params:{cursor:e.cursor,previous:e.previous,type:e.typeFilter}}}return r.createElement(E.M.Provider,{value:de},r.createElement("div",{className:"px-3"},r.createElement("div",{className:"d-flex justify-content-between"},r.createElement("h1",{className:"h2 mb-0"},r.createElement(y.x,{namespace:Q,phrase:"header"})),r.createElement("div",null,r.createElement("div",{className:"d-sm-none"},r.createElement(Y.c,{canUpload:re(k.C.UploadVideo)})),r.createElement("div",{className:"ms-2 d-sm-inline-block d-none"},r.createElement(p.h,{svgName:M.vn.Search,appLink:{application:x.O.SEARCH,action:j.e.Search.HOME,params:{source:u.fi.MyVideos}},className:"btn btn-outline-dark me-2",onClick:oe,analyticsData:{},analyticsOptions:{entity:c.py.SearchResults,location:c.LZ.MyVideos,actionType:c.Vw.Click,descriptor:c.Bk.MyVideos}},r.createElement(y.x,{namespace:Q,phrase:"searchMyVideos"})),r.createElement(p.h,{svgName:M.vn.Plus,appLink:{application:x.O.MY_VIDEOS,action:j.e.MyVideos.ADD_FOLDER,args:[null===(z=ce.data)||void 0===z?void 0:z.id]},className:"btn btn-outline-dark"},r.createElement(y.x,{namespace:Q,phrase:"addFolder"}))))),r.createElement("hr",null),r.createElement(s.p,{handleDragEnd:ae,dragOverlayComponent:C.U,source:ce.data},r.createElement("div",null,!(null==se?void 0:se.hasCompleted)&&r.createElement(m.i,null),!!(null===(G=null==se?void 0:se.items)||void 0===G?void 0:G.length)&&r.createElement("div",{className:"mx-n2"},r.createElement(d.$,{folders:se.items,getAppLink:function(e){return{application:x.O.MY_VIDEOS,action:j.e.MyVideos.MY_VIDEOS_FOLDER,args:[e.id,l.m.slugify(e.name)]}},expandFolders:!1,getFolderActions:function(e){return fe("folder",e)},drag:!0,drop:!0})),r.createElement(g.X,{allowBulkAction:!0,allowFilter:!0,checkboxHelper:Oe,getVideosBulkAction:me,locationContext:c.LZ.MyVideos,typeFilter:e.typeFilter,getAppLink:function(){return Se()}}),!!(null==be?void 0:be.length)&&r.createElement("div",{className:"position-relative ".concat(K.uploadingList)},be.map((function(e){return r.createElement(W.X,{item:e,onClickAlternate:Ee,onClickDelete:ke,key:e.id,allowBulkAction:!0})}))),function(){var t,n;return le.data&&he.data?(null==Ae?void 0:Ae.length)||(null==be?void 0:be.length)?r.createElement(r.Fragment,null,r.createElement(b.E4,{videos:Ae,getVideoAppLink:function(e,t){var n,r;return D.W.getAppLink(e,Object.assign(Object.assign({},t),{context:V.Q.CategoryTree,contextId:null===(n=ce.data)||void 0===n?void 0:n.categoryTree.id,includeContext:null===(r=le.data)||void 0===r?void 0:r.isAuthenticated}))},presentationAudiences:pe.data,canRemovePrivateVideos:!0,allowBulkAction:!0,getVideosBulkAction:me,typeFilter:e.typeFilter,checkboxHelper:Oe,hasPermissions:re,drag:!0,getPreviewQuestionsAppLink:function(e){return P.j.getPreviewQuestionsAppLink(e)},commonVideoProps:te}),!!(null===(n=null===(t=he.data)||void 0===t?void 0:t.pagination)||void 0===n?void 0:n.cursors)&&r.createElement(f.t,{appLink:Se(),cursors:{next:he.data.pagination.cursors.next,previous:e.cursor},buttonVariant:"outline-dark",className:"py-2 float-end",prevHack:!0})):r.createElement(q.K,{canUpload:re(k.C.UploadVideo)}):r.createElement("div",{className:"mx-n2"},r.createElement(h.S,{allowBulkActions:!0}))}()))))}},97816:(e,t,n)=>{n.d(t,{V:()=>l,l:()=>c});var r=n(1575),i=n(39902),a=n(31908);function o(e){return e?Array.isArray(e)?e.filter((function(e){return!!e&&(a.M.isVideo(e)||a.M.isClip(e))})):"data"in e?e.data.filter((function(e){return!!e&&(a.M.isVideo(e)||a.M.isClip(e))})):[]:[]}function l(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=o(e).map((function(e){return e.id}));(0,i.FN)(n,(function(e){return r.R.videoMixinAssocs(e,t.flightNamespace)}),null)}function c(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=(0,i.SW)({getRequest:function(t){return r.R.videoMixinAssocs(t,e.flightNamespace)}}).fetchItems;return{fetchObjects:function(e){return t(o(e).map((function(e){return e.id})))}}}}}]);
|
|
2
|
+
//# sourceMappingURL=7742-c9755a67d4-lite.chunk.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scripts/7742-c9755a67d4-lite.chunk.js","mappings":"g2DAOMA,EAAa,GAiBb,SAAUC,EACdC,EACAC,GAEA,IAEMC,EAFS,UAA0BF,EAASF,GAE1BK,KAAI,SAAAC,GAAK,OAAIH,EAAW,SAAiBG,GAAO,IAElE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B,WARlD,SAAoB0J,GAClB,OAAO,qBAA+BA,EAAKvI,EAAQwI,gBACrD,IAMQzI,WAER,MAAO,CAAE2I,aANT,SAAsBtJ,GACpB,OAAOW,EAAWkI,EAAgB7I,GAAOL,KAAI,SAAA0E,GAAC,OAAIA,EAAEhE,EAAE,IACxD,EAKF,C","sources":["file:///app/packages/libs/shared/src/hooks/UseBatchFetch.ts","file:///app/packages/projects/lite/src/apps/my-videos/views/my-videos/my-videos.scss","file:///app/packages/projects/lite/src/apps/my-videos/views/my-videos/MyVideosView.tsx","file:///app/packages/projects/lite/src/shared/hooks/useVideoMixin.ts"],"sourcesContent":["import React from 'react';\n\nimport { Flight } from 'libs/common/flight';\nimport { ArrayHelper } from 'libs/common/react/utils/ArrayHelper';\n\nimport { BaseObject } from 'libs/shared/interfaces';\n\nconst CHUNK_SIZE = 50;\n\nexport interface UseBatchFetchResult<T extends BaseObject> {\n itemsArr: T[];\n items: { [key: string]: T} | null;\n isFetching: boolean;\n}\n\n/**\n * Used to fetch multiple items by id with Flight. Will fetch 25 items at a time firing off multiple\n * requests if there are more than 25 items.\n * This will return items as null until we have all our items. Items will be returned as an object with\n * their ids as they key for easy mapping\n * \n * @param itemIds \n * @param getRequest \n */\nexport function useBatchFetch<T extends BaseObject>(\n itemIds: string[],\n getRequest: (ids: string[]) => Flight.Request\n): UseBatchFetchResult<T> {\n const chunks = ArrayHelper.chunk<string>(itemIds, CHUNK_SIZE);\n\n const requests = chunks.map(chunk => getRequest(ArrayHelper.uniq(chunk)));\n\n const responses = Flight.useBasicFetchAll<T[]>(requests);\n\n const itemsArr = ArrayHelper.flatten(responses.data);\n const items = responses.data.length\n ? itemsArr.reduce((acc, item) => ({ ...acc, [item.id]: item }), {})\n : null;\n\n return {\n itemsArr,\n items,\n isFetching: responses.isFetching\n };\n}\n\n/**\n * When you need the useBatchFetch() behavior, but your list of objects to hydrate\n * will grow, such as on a scrolling page. useGrowingBatchFetch() will use local state\n * to determine what we've already built a request for and what items are new\n * as to not re-fetch items - Sha\n */\nexport function useGrowingBatchFetch<T>(\n objs: T[],\n getRequest: (items: T[]) => Flight.Request,\n _getKey?: (obj: T) => string\n) {\n const { fetchItems, ...data } = useGrowingBatchFetchFunc({ getRequest, _getKey });\n\n React.useEffect(() => {\n if (!objs?.length)\n return;\n\n fetchItems(objs);\n }, [objs?.length]);\n\n return data;\n}\n\ninterface UseGrowingBatchFetchFuncOptions<T> {\n getRequest: (items: T[]) => Flight.Request;\n _getKey?: (obj: T) => string;\n}\n\n/**\n * When you need the useGrowingBatchFetch() behaviour, but need to trigger the\n * fetch manually and update the objects - Nish \n */\nexport function useGrowingBatchFetchFunc<T>(options: UseGrowingBatchFetchFuncOptions<T>) {\n const getKey = options._getKey ?? ((obj: any) => {\n if (typeof obj === 'object')\n return obj.id;\n\n return obj;\n });\n\n const fetchedItems = React.useRef<Set<string>>(new Set<string>());\n const [ requests, setRequests ] = React.useState<Flight.Request[]>([]);\n\n function fetchItems(objs: T[]) {\n if (!objs?.length)\n return;\n\n const unfetchedItems: T[] = [];\n \n objs.forEach(obj => {\n const key = getKey(obj);\n\n if (fetchedItems.current.has(key))\n return;\n\n unfetchedItems.push(obj);\n fetchedItems.current.add(key);\n });\n \n if (!unfetchedItems.length)\n return;\n \n setRequests(r => ([ ...r, ...ArrayHelper.chunk<T>(unfetchedItems, CHUNK_SIZE).map(options.getRequest) ]));\n }\n\n const responses = Flight.useBasicFetchAll<T[]>(requests);\n const itemsArr = ArrayHelper.flatten(responses.data);\n const items = responses.data.length\n ? itemsArr.reduce((acc, item) => ({ ...acc, [getKey(item)]: item }), {})\n : null;\n\n return {\n hasFirstRequestCompleted: !!responses.responses?.[0]?.hasCompleted,\n itemsArr,\n items,\n isFetching: responses.isFetching,\n fetchItems\n };\n}","// extracted by mini-css-extract-plugin\nexport default {\"uploadingList\":\"wg7hV\"};","import * as React from 'react';\nimport { useDispatch } from 'react-redux';\n\nimport { Core } from 'libs/common/backbone/index';\nimport { Cursors } from 'libs/common/backbone/interfaces';\nimport { LanguageService } from 'libs/common/backbone/services/LanguageService';\nimport { Flight } from 'libs/common/flight';\nimport { TextHelper } from 'libs/common/react/utils/TextHelper';\n\nimport { EntityType, LocationContext, SearchSourceDescriptor, UserAction } from 'libs/analytics/interfaces';\n\nimport { SearchIndices, SourceFilterOptions } from 'libs/shared/apps/search/interfaces';\nimport { DragDropMoveContext } from 'libs/shared/components/drag-drop-move/DragDropMoveContext';\nimport { FolderList } from 'libs/shared/components/folder-list/FolderList';\nimport { PartialFolderList } from 'libs/shared/components/folder-list/partial-loading/PartialFolderList';\nimport { IconButton } from 'libs/shared/components/icon-button/IconButton';\nimport { Pagination } from 'libs/shared/components/pagination/Pagination';\nimport { useFocusSearchBar } from 'libs/shared/components/search-bar/SearchUtils';\nimport { Text } from 'libs/shared/components/text/Text';\nimport { PartialVideoList } from 'libs/shared/components/video-list/partial-loading/PartialVideoList';\nimport { VideoListActions } from 'libs/shared/components/video-list/video-list-actions/VideoListActions';\nimport { VideoList } from 'libs/shared/components/video-list/VideoList';\nimport { VideoActionsContext } from 'libs/shared/context/VideoActionsContext';\nimport { LocalPermissionName, PermissionName } from 'libs/shared/enums/PermissionName';\nimport { RelatedVideosContext } from 'libs/shared/enums/RelatedVideosContext';\nimport { UserRequests } from 'libs/shared/flight-requests/UserRequests';\nimport { BulkCheckboxManager, useBulkCheckboxManager } from 'libs/shared/hooks/useBulkCheckboxManager';\nimport { useHandleObjectError } from 'libs/shared/hooks/UseHandleObjectError';\nimport { usePermissions } from 'libs/shared/hooks/usePermissions';\nimport { useSetPageMetadata } from 'libs/shared/hooks/useSetPageMetadata';\nimport { BasePaginatedCollection, CurrentUser, Folder, Library, VideoTypes } from 'libs/shared/interfaces';\nimport { cvSvgLibrary } from 'libs/shared/utils/SvgHelper';\n\nimport { DragDropOverlay } from 'shared/components/drag-drop-overlay/DragDropOverlay';\nimport { Actions } from 'shared/constants/LiteActions';\nimport { AppChannels } from 'shared/constants/LiteRadioChannels';\nimport { useCommonVideoProps } from 'shared/hooks/useCommonVideoProps';\nimport { usePresentationAudiences } from 'shared/hooks/usePresentationAudiences';\nimport { useVideoMixin } from 'shared/hooks/useVideoMixin';\nimport { InteractiveHelpers } from 'shared/utils/InteractiveHelper';\nimport { VideoAppLinkHelper } from 'shared/utils/VideoAppLinkHelper';\n\nimport { useFetchAllChildFolders } from 'apps/libraries/hooks/UseFetchAllChildFolders';\nimport { MyVideosRequests } from 'apps/my-videos/flight-requests/MyVideosRequests';\nimport { useDragDropMove } from 'apps/my-videos/hooks/useDragDropMove';\nimport { useUploadItems } from 'apps/my-videos/hooks/useUploadItems';\nimport { useGetFolderActions } from 'apps/my-videos/utils/getFolderActions';\nimport { MyVideosEmptyState, MyVideosPublicEmptyState } from 'apps/my-videos/views/my-videos/empty-state/MyVideosEmptyState';\nimport { useMyVideosViewActions, useMyVideosViewBulkActions } from 'apps/my-videos/views/my-videos/MyVideosViewUtils';\nimport { UploadFileSelect } from 'apps/upload/components/upload-file-select/UploadFileSelect';\nimport { UploadingItem } from 'apps/upload/components/uploading-item/UploadingItem';\n\nimport styles from './my-videos.scss';\n\nconst namespace = 'default.myVideos';\n\ninterface MyVideosViewProps {\n cursor?: string;\n previous?: string;\n typeFilter?: SearchIndices[];\n}\n\nexport function MyVideosView(props: MyVideosViewProps): JSX.Element {\n useSetPageMetadata({ title: LanguageService.getPhrase(namespace, 'pageTitle') });\n\n const dispatch = useDispatch();\n\n const { commonVideoProps } = useCommonVideoProps({ locationContext: LocationContext.VideoThumbnail });\n const { hasPermissions, hasLocalPermissions } = usePermissions();\n const { handleDragEnd } = useDragDropMove();\n\n const { focusSearchBar } = useFocusSearchBar();\n\n const currentUser = Flight.useBasicFetch<CurrentUser>(UserRequests.currentUser());\n\n const workspace = Flight.useBasicFetch<Library>(\n currentUser.data?.isAuthenticated && UserRequests.workspace()\n );\n const folderId = workspace.data?.categoryTree?.id;\n const folders = useFetchAllChildFolders(folderId);\n \n const videoActions = useMyVideosViewActions();\n const getVideosAction = useMyVideosViewBulkActions(workspace.data?.id, workspace.data?.categoryTree.id);\n\n const audiences = usePresentationAudiences();\n const getFolderActions = useGetFolderActions();\n\n const getMyVideosRequest = (cursor?: string, typeFilter?: SearchIndices | SearchIndices[]) => {\n if (!workspace.data)\n return null;\n\n // Delete the above when master supports the new assoc types.\n return MyVideosRequests.videos(folderId, cursor, typeFilter);\n };\n\n const fetchNext = (cursor?: string, typeFilter?: SearchIndices | SearchIndices[]) => {\n return Flight.getFetch(dispatch)(getMyVideosRequest(cursor, typeFilter));\n };\n\n const shouldFetch = !hasLocalPermissions(LocalPermissionName.ViewMyVideosLanding) && currentUser.hasCompleted;\n\n const videos = Flight.useBasicFetch<BasePaginatedCollection<VideoTypes>>(\n shouldFetch && getMyVideosRequest(props.cursor, props.typeFilter)\n );\n\n useHandleObjectError(videos);\n\n const {\n uploadingVideos,\n onClickAlternate,\n onClickDelete,\n processingIds\n } = useUploadItems({ onRemove: fetchNext });\n\n const omittedVideos = videos.data?.data.length && processingIds\n ? videos.data.data.filter(v => !processingIds[v.id])\n : [];\n \n useVideoMixin(omittedVideos);\n\n const CheckboxHelper: BulkCheckboxManager = useBulkCheckboxManager(omittedVideos);\n\n if (hasLocalPermissions(LocalPermissionName.ViewMyVideosLanding))\n return <MyVideosPublicEmptyState />;\n\n function getMyVideosAppLink(): Core.AppLink {\n return {\n action: Actions.MyVideos.MY_VIDEOS,\n application: AppChannels.MY_VIDEOS,\n params: { cursor: props.cursor, previous: props.previous, type: props.typeFilter }\n };\n }\n\n function getCursors(): Cursors {\n return { next: videos.data.pagination.cursors.next, previous: props.cursor };\n }\n \n return (\n <VideoActionsContext.Provider value={videoActions}>\n <div className='px-3'>\n <div className='d-flex justify-content-between'>\n <h1 className='h2 mb-0'><Text namespace={namespace} phrase='header' /></h1>\n <div>\n <div className='d-sm-none'>\n <UploadFileSelect canUpload={hasPermissions(PermissionName.UploadVideo)} />\n </div>\n <div className='ms-2 d-sm-inline-block d-none'>\n <IconButton\n svgName={cvSvgLibrary.Search}\n appLink={{\n application: AppChannels.SEARCH,\n action: Actions.Search.HOME,\n params: {\n source: SourceFilterOptions.MyVideos\n }\n }}\n className='btn btn-outline-dark me-2'\n onClick={focusSearchBar}\n analyticsData={{}}\n analyticsOptions={{\n entity: EntityType.SearchResults,\n location: LocationContext.MyVideos,\n actionType: UserAction.Click,\n descriptor: SearchSourceDescriptor.MyVideos\n }}\n >\n <Text namespace={namespace} phrase='searchMyVideos' />\n </IconButton>\n <IconButton\n svgName={cvSvgLibrary.Plus}\n appLink={{\n application: AppChannels.MY_VIDEOS,\n action: Actions.MyVideos.ADD_FOLDER,\n args: [workspace.data?.id]\n }}\n className='btn btn-outline-dark'\n >\n <Text namespace={namespace} phrase='addFolder' />\n </IconButton>\n </div>\n </div>\n </div>\n <hr />\n <DragDropMoveContext\n handleDragEnd={handleDragEnd}\n dragOverlayComponent={DragDropOverlay}\n source={workspace.data}>\n <div>\n {!folders?.hasCompleted && <PartialFolderList />}\n {!!folders?.items?.length &&\n <div className='mx-n2'>\n <FolderList\n folders={folders.items}\n getAppLink={(f: Folder) => ({\n application: AppChannels.MY_VIDEOS,\n action: Actions.MyVideos.MY_VIDEOS_FOLDER,\n args: [ f.id, TextHelper.slugify(f.name) ]\n })}\n expandFolders={false}\n getFolderActions={f => getFolderActions('folder', f)}\n drag\n drop\n />\n </div>\n }\n <VideoListActions\n allowBulkAction\n allowFilter\n checkboxHelper={CheckboxHelper}\n getVideosBulkAction={getVideosAction}\n locationContext={LocationContext.MyVideos}\n typeFilter={props.typeFilter}\n getAppLink={() => getMyVideosAppLink()}\n />\n {!!uploadingVideos?.length && (\n <div className={`position-relative ${styles.uploadingList}`}>\n {uploadingVideos.map(uploadingVideo => (\n <UploadingItem\n item={uploadingVideo}\n onClickAlternate={onClickAlternate}\n onClickDelete={onClickDelete}\n key={uploadingVideo.id}\n allowBulkAction\n />\n ))}\n </div>\n )}\n {(() => {\n if (!currentUser.data || !videos.data)\n return <div className='mx-n2'><PartialVideoList allowBulkActions /></div>;\n\n if (!omittedVideos?.length && !uploadingVideos?.length)\n return <MyVideosEmptyState canUpload={hasPermissions(PermissionName.UploadVideo)} />;\n\n return (\n <>\n <VideoList\n videos={omittedVideos}\n getVideoAppLink={(v, opts) => VideoAppLinkHelper.getAppLink(v, {\n ...opts,\n context: RelatedVideosContext.CategoryTree,\n contextId: workspace.data?.categoryTree.id,\n includeContext: currentUser.data?.isAuthenticated\n })}\n presentationAudiences={audiences.data}\n canRemovePrivateVideos\n allowBulkAction\n getVideosBulkAction={getVideosAction}\n typeFilter={props.typeFilter}\n checkboxHelper={CheckboxHelper}\n hasPermissions={hasPermissions}\n drag\n getPreviewQuestionsAppLink={interactive =>\n InteractiveHelpers.getPreviewQuestionsAppLink(interactive)}\n commonVideoProps={commonVideoProps}\n />\n {!!videos.data?.pagination?.cursors && (\n <Pagination\n appLink={getMyVideosAppLink()}\n cursors={getCursors()}\n buttonVariant='outline-dark'\n className='py-2 float-end'\n prevHack\n />\n )}\n </>\n );\n })()}\n </div>\n </DragDropMoveContext>\n </div>\n </VideoActionsContext.Provider>\n );\n}\n","import { Flight } from 'libs/common/react/index';\n\nimport { VideoRequests } from 'libs/shared/flight-requests/VideoRequests';\nimport { useGrowingBatchFetch, useGrowingBatchFetchFunc } from 'libs/shared/hooks/UseBatchFetch';\nimport { Clip, ClipCollection, Video, VideoCollection } from 'libs/shared/interfaces';\nimport { VideoHelper } from 'libs/shared/utils/VideoHelper';\n\ntype Types = Video[] | VideoCollection | Clip[] | ClipCollection;\n\nfunction getValidObjects(objects: Types): (Video | Clip)[] {\n if (!objects)\n return [];\n\n if (Array.isArray(objects))\n return objects.filter(o => !!o && (VideoHelper.isVideo(o) || VideoHelper.isClip(o)));\n\n if ('data' in objects)\n return objects.data.filter(o => !!o && (VideoHelper.isVideo(o) || VideoHelper.isClip(o)));\n\n return [];\n}\n\ninterface VideoMixinOptions {\n /**\n * If the videos that are having new data mixed into are sitting on an explicit Flight namespace,\n * providing that namespace here is required\n */\n flightNamespace?: string;\n}\n\nexport function useVideoMixin(objects: Types, options: VideoMixinOptions = {}) {\n const videoIds = getValidObjects(objects).map(v => v.id);\n\n useGrowingBatchFetch(\n videoIds,\n ids => VideoRequests.videoMixinAssocs(ids, options.flightNamespace),\n null\n );\n}\n\nexport function useVideoMixinFunc(options: VideoMixinOptions = {}) {\n function getRequest(ids: string[]): Flight.Request {\n return VideoRequests.videoMixinAssocs(ids, options.flightNamespace);\n }\n \n function fetchObjects(items: Types) {\n return fetchItems(getValidObjects(items).map(v => v.id));\n }\n\n const { fetchItems } = useGrowingBatchFetchFunc({ getRequest });\n\n return { fetchObjects };\n}"],"names":["CHUNK_SIZE","useBatchFetch","itemIds","getRequest","requests","map","chunk","responses","itemsArr","data","items","length","reduce","acc","item","id","isFetching","useGrowingBatchFetch","objs","_getKey","useGrowingBatchFetchFunc","fetchItems","options","getKey","obj","fetchedItems","Set","setRequests","hasFirstRequestCompleted","hasCompleted","unfetchedItems","forEach","key","current","has","push","add","r","namespace","MyVideosView","props","useSetPageMetadata","title","LanguageService","dispatch","commonVideoProps","useCommonVideoProps","locationContext","usePermissions","hasPermissions","hasLocalPermissions","handleDragEnd","useDragDropMove","focusSearchBar","currentUser","UserRequests","workspace","isAuthenticated","folderId","categoryTree","folders","videoActions","getVideosAction","audiences","usePresentationAudiences","getMyVideosRequest","cursor","typeFilter","MyVideosRequests","shouldFetch","videos","useUploadItems","onRemove","uploadingVideos","onClickAlternate","onClickDelete","processingIds","omittedVideos","filter","v","useVideoMixin","CheckboxHelper","useBulkCheckboxManager","getMyVideosAppLink","action","application","params","previous","type","VideoActionsContext","value","className","Text","phrase","UploadFileSelect","canUpload","PermissionName","IconButton","svgName","appLink","source","onClick","analyticsData","analyticsOptions","entity","location","actionType","descriptor","args","DragDropMoveContext","dragOverlayComponent","DragDropOverlay","PartialFolderList","FolderList","getAppLink","f","TextHelper","name","expandFolders","getFolderActions","drag","drop","VideoListActions","allowBulkAction","allowFilter","checkboxHelper","getVideosBulkAction","uploadingVideo","UploadingItem","VideoList","getVideoAppLink","opts","VideoAppLinkHelper","context","RelatedVideosContext","contextId","includeContext","presentationAudiences","canRemovePrivateVideos","getPreviewQuestionsAppLink","interactive","InteractiveHelper","pagination","cursors","Pagination","next","buttonVariant","prevHack","MyVideosEmptyState","PartialVideoList","allowBulkActions","getValidObjects","objects","Array","isArray","o","videoIds","ids","flightNamespace","useVideoMixinFunc","fetchObjects"],"sourceRoot":""}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";(self.webpackChunk_clickview_lite=self.webpackChunk_clickview_lite||[]).push([[8451],{39902:(e,t,n)=>{n.d(t,{FN:()=>m,SW:()=>v,fh:()=>p});var r=n(32735),a=n(20354),i=n(75896);function o(e){return function(e){if(Array.isArray(e))return u(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||l(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function l(e,t){if(e){if("string"==typeof e)return u(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?u(e,t):void 0}}function u(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function c(e){return c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},c(e)}function s(e,t,n){return(t=function(e){var t=function(e){if("object"!=c(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=c(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==c(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var d=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(r=Object.getOwnPropertySymbols(e);a<r.length;a++)t.indexOf(r[a])<0&&Object.prototype.propertyIsEnumerable.call(e,r[a])&&(n[r[a]]=e[r[a]])}return n},f=50;function p(e,t){var n=i.m.chunk(e,f).map((function(e){return t(i.m.uniq(e))})),r=a.a.useBasicFetchAll(n),o=i.m.flatten(r.data),l=r.data.length?o.reduce((function(e,t){return Object.assign(Object.assign({},e),s({},t.id,t))}),{}):null;return{itemsArr:o,items:l,isFetching:r.isFetching}}function m(e,t,n){var a=v({getRequest:t,_getKey:n}),i=a.fetchItems,o=d(a,["fetchItems"]);return r.useEffect((function(){(null==e?void 0:e.length)&&i(e)}),[null==e?void 0:e.length]),o}function v(e){var t,n,u,d,p,m=null!==(t=e._getKey)&&void 0!==t?t:function(e){return"object"===c(e)?e.id:e},v=r.useRef(new Set),h=(d=r.useState([]),p=2,function(e){if(Array.isArray(e))return e}(d)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,i,o,l=[],u=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=i.call(n)).done)&&(l.push(r.value),l.length!==t);u=!0);}catch(e){c=!0,a=e}finally{try{if(!u&&null!=n.return&&(o=n.return(),Object(o)!==o))return}finally{if(c)throw a}}return l}}(d,p)||l(d,p)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),y=h[0],b=h[1],g=a.a.useBasicFetchAll(y),w=i.m.flatten(g.data),A=g.data.length?w.reduce((function(e,t){return Object.assign(Object.assign({},e),s({},m(t),t))}),{}):null;return{hasFirstRequestCompleted:!!(null===(u=null===(n=g.responses)||void 0===n?void 0:n[0])||void 0===u?void 0:u.hasCompleted),itemsArr:w,items:A,isFetching:g.isFetching,fetchItems:function(t){if(null==t?void 0:t.length){var n=[];t.forEach((function(e){var t=m(e);v.current.has(t)||(n.push(e),v.current.add(t))})),n.length&&b((function(t){return[].concat(o(t),o(i.m.chunk(n,f).map(e.getRequest)))}))}}}}},63719:(e,t,n)=>{n.d(t,{h:()=>l});var r=n(32735),a=n(77316);function i(e,t){if(e){if("string"==typeof e)return o(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?o(e,t):void 0}}function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function l(e){var t,n,l=(t=r.useMemo((function(){return a.p.getBuilder()}),[]),n=2,function(e){if(Array.isArray(e))return e}(t)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,i,o,l=[],u=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=i.call(n)).done)&&(l.push(r.value),l.length!==t);u=!0);}catch(e){c=!0,a=e}finally{try{if(!u&&null!=n.return&&(o=n.return(),Object(o)!==o))return}finally{if(c)throw a}}return l}}(t,n)||i(t,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),u=l[0],c=(0,l[1])(u);return c&&e?[].concat(function(e){return function(e){if(Array.isArray(e))return o(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||i(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(c),[Object.assign(Object.assign({},e),{active:!0})]):c}},30709:(e,t,n)=>{n.d(t,{a:()=>v});var r=n(32735),a=n(15611),i=n(83345),o=n(80247),l=n(57900),u=n(2948),c=n(91693),s=n(38143),d=n(35223);const f={banner:"B7jhq"};function p(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var m="contentUpdates.classificationBanner";function v(e){var t,n,v=e.classification,h=e.backgroundUrl,y=e.followed,b=e.follow,g=e.showFollowSpinner,w=(t=(0,u.D)(s.g.AUDIENCE_FILTER,void 0,{storage:l.Z1.SessionStorage}),n=1,function(e){if(Array.isArray(e))return e}(t)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,i,o,l=[],u=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=i.call(n)).done)&&(l.push(r.value),l.length!==t);u=!0);}catch(e){c=!0,a=e}finally{try{if(!u&&null!=n.return&&(o=n.return(),Object(o)!==o))return}finally{if(c)throw a}}return l}}(t,n)||function(e,t){if(e){if("string"==typeof e)return p(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?p(e,t):void 0}}(t,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())[0];return r.createElement("div",{className:"banner mb-2 d-flex justify-content-between align-items-center rounded ".concat(f.banner),style:{backgroundImage:"url('".concat(h,"')")}},r.createElement(a.F,{className:"text-white text-shadow",appLink:e.getClassificationAppLink(v,w)},r.createElement("h2",{className:"h3 mb-0"},v.name)),e.canFollow&&r.createElement(c.h,{className:"btn follow-btn ".concat(y?"btn-outline-dark":"btn-dark"),svgName:y?d.vn.BellFilled:d.vn.Bell,onClick:function(){return b(v.id,v.name,!y)}},g?r.createElement(o.Z,{as:"span",animation:"border",role:"status",size:"sm"}):r.createElement(i.x,{namespace:m,phrase:y?"following":"follow"})))}},98451:(e,t,n)=>{n.r(t),n.d(t,{ClassificationUpdateView:()=>B});var r=n(32735),a=n(70680),i=n(23481),o=n(20354),l=n(110),u=n(65858),c=n(54644),s=n(49935),d=n(75100),f=n(51365),p=n(16714),m=n(61699),v=n(31949),h=n(69883),y=n(63719),b=n(22902),g=n(79612),w=n(76753),A=n(10671),S=n(58321),k=n(44110),j=n(97816),O=n(10741),C=n(33192),F=n(30709),E=n(1860);const I={partialBanner:"DKukI"};function L(){return r.createElement("div",{className:"bg-white px-3"},r.createElement("div",{className:"partial-loading-background mb-2 ".concat(I.partialBanner," rounded")}),r.createElement("div",{className:"mb-1"},r.createElement(s.b2,null)),r.createElement(E.S,null))}var P=n(49985),U="contentUpdates.classificationUpdate",x=i.T.encloseNamespace(U);function T(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var N=i.T.encloseNamespace("contentUpdates.classificationUpdate");function B(e){var t,n,E,I,B,M,V,D,G,R,Y,_=e.classificationId,q=(0,a.I0)(),W=(0,h.Z)(),Z=(0,S.U)({locationContext:u.LZ.VideoThumbnail}).commonVideoProps,$=o.a.useBasicFetch(v.N.currentUser()),K=(R=r.useState(!1),Y=2,function(e){if(Array.isArray(e))return e}(R)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,i,o,l=[],u=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=i.call(n)).done)&&(l.push(r.value),l.length!==t);u=!0);}catch(e){c=!0,a=e}finally{try{if(!u&&null!=n.return&&(o=n.return(),Object(o)!==o))return}finally{if(c)throw a}}return l}}(R,Y)||function(e,t){if(e){if("string"==typeof e)return T(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?T(e,t):void 0}}(R,Y)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),Q=K[0],z=function(e){var t=e.dispatch,n=e.alerts,r=e.setShowFollowSpinner;return{onFollow:function(e,a,l){r(!0);var c=function(){r(!1),P.k.logUserAction({id:e,name:a},{location:u.LZ.ContentUpdatesClassificationBanner,workflowPhase:u.eu.Complete,descriptor:l?u.DL.On:u.DL.Off,actionType:u.Vw.Follow,entity:u.py.Classification}),n.success(x(l?"followed":"unfollowed",{name:a,escapeText:!0}))},s=function(){r(!1),n.error(i.T.getPhrase(U,"error"))},d=l?m.o.followSubjects([e],c,s):m.o.unfollowSubjects([e],c,s);o.a.fetch(t,d)}}}({dispatch:q,alerts:W,setShowFollowSpinner:K[1],currentUser:null==$?void 0:$.data}),H=new Date,J=l.O.format(l.O.endOf(l.O.subtract(H,1,"year"),"day"),"YYYY-MM-DD"),X=l.O.format(l.O.endOf(H,"day"),"YYYY-MM-DD"),ee=(0,b.T)().hasPermissions,te=ee(p.C.FollowSubjects),ne=o.a.useBasicFetch(c.v.getClassification(_)),re=o.a.useBasicFetch($.data&&c.v.getClassificationUpdates(_,J,X)),ae=o.a.useBasicFetch(te&&m.o.mySubjectPreferences()),ie=(0,k.i)(),oe=(0,y.h)({name:null===(t=ne.data)||void 0===t?void 0:t.name});(0,g.M)(w.CG.getDefaultMetadata({title:null===(n=ne.data)||void 0===n?void 0:n.name,phraseContext:{phraseHandler:N,titlePhrase:"pageTitle",descriptionPhrase:"pageDescription"},canonicalLink:C.f.getCanonicalLink({customAppLink:null===(E=e.appLinks)||void 0===E?void 0:E.getClassificationUpdateAppLink(ne.data)}),allowIndexing:C.f.allowIndexing()}));var le=(0,A._)({location:A.i.VideoItem});(0,j.V)(null!==(B=null===(I=re.data)||void 0===I?void 0:I.videos)&&void 0!==B?B:[]);var ue=ae.hasCompleted||!te;if(!(re.data&&ne.data&&ue&&$.data))return r.createElement(L,null);var ce=null!==(V=null===(M=ae.data)||void 0===M?void 0:M.map((function(e){return e.id})))&&void 0!==V?V:[];return r.createElement(f.M.Provider,{value:le},r.createElement("div",{className:"bg-white px-3"},r.createElement(F.a,{classification:ne.data,backgroundUrl:null!==(G=null===(D=ne.data.banner)||void 0===D?void 0:D.url)&&void 0!==G?G:"",getClassificationAppLink:e.appLinks.getClassificationAppLink,followed:!!ce.find((function(e){return e.toString()===ne.data.id.toString()})),follow:z.onFollow,showFollowSpinner:Q,canFollow:te}),r.createElement(s.Oo,{breadcrumbs:oe}),r.createElement(d.E4,{videos:re.data.videos,getVideoAppLink:e.appLinks.getVideoAppLink,hasPermissions:ee,presentationAudiences:ie.data,getPreviewQuestionsAppLink:function(e){return O.j.getPreviewQuestionsAppLink(e)},commonVideoProps:Z})))}},58321:(e,t,n)=>{n.d(t,{U:()=>m});var r=n(20354),a=n(16714),i=n(39151),o=n(1666),l=n(31949),u=n(22902),c=n(37802),s=n(22490),d=n(82431),f=n(46390),p=n(27638);function m(e){var t,n,m,v=e||{},h=v.locationContext,y=v.mtv,b=v.flightNamespace,g=v.sharedPlaylist,w=(0,f.G)(),A=w.isPlugin,S=w.params,k=(0,p.u)(h,b),j=k.setFavourite,O=k.canFavourite,C=(0,c.r)(null),F=C.hasTopicDirectories,E=C.isLoadingSettings,I=(0,u.T)(),L=I.hasPermissions,P=I.isLoaded,U=L(a.C.StudentExperience),x=r.a.useBasicFetch(i.L.config()),T=r.a.useBasicFetch(l.N.currentUser()),N=r.a.useBasicFetch((null===(t=T.data)||void 0===t?void 0:t.isAuthenticated)&&o.h.yearGroups(T.data.customerId));return{hasCommonVideoPropsCompleted:!E&&P&&x.hasCompleted&&T.hasCompleted&&(!(null===(n=T.data)||void 0===n?void 0:n.isAuthenticated)||N.hasCompleted),commonVideoProps:{subTextType:"series",getSubTextAppLink:function(e){var t;return"series"in e?g&&!(null===(t=T.data)||void 0===t?void 0:t.isAuthenticated)?null:d.j.getSeriesAppLink(e.series,{mtv:y}):null},isPlugin:A,isPluginPopup:!!(null==S?void 0:S.popup),canFavourite:O,setFavourite:j,imageCdnUrl:null===(m=x.data)||void 0===m?void 0:m.imageCdnUrl,yearGroups:N.data,getClassroomGuideAppLink:s.W.getClassroomGuideAppLink,getInteractiveGuidanceAppLink:s.W.getInteractiveGuidanceAppLink,getResourceGuidanceAppLink:s.W.getResourceGuidanceAppLink,showNewVideoIndicator:F,companyLogoFallbackUrl:null,hasStudentExperience:U}}}},44110:(e,t,n)=>{n.d(t,{i:()=>o});var r=n(20354),a=n(89454),i=n(86698),o=function(){var e=(0,i.y)({redirectOnError:!0}),t=e.activePresentation,n=e.getFallbackPresentation,o=t||n();return r.a.useBasicFetch(!!o&&a.O.presentationAudiences(o.id))}},97816:(e,t,n)=>{n.d(t,{V:()=>l,l:()=>u});var r=n(1575),a=n(39902),i=n(31908);function o(e){return e?Array.isArray(e)?e.filter((function(e){return!!e&&(i.M.isVideo(e)||i.M.isClip(e))})):"data"in e?e.data.filter((function(e){return!!e&&(i.M.isVideo(e)||i.M.isClip(e))})):[]:[]}function l(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=o(e).map((function(e){return e.id}));(0,a.FN)(n,(function(e){return r.R.videoMixinAssocs(e,t.flightNamespace)}),null)}function u(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=(0,a.SW)({getRequest:function(t){return r.R.videoMixinAssocs(t,e.flightNamespace)}}).fetchItems;return{fetchObjects:function(e){return t(o(e).map((function(e){return e.id})))}}}}}]);
|
|
2
|
+
//# sourceMappingURL=8451-2ef1dfce61-lite.chunk.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version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C,GAASnL,KAAI,SAAAyL,GAAC,OAAIA,EAAE/K,EAAE,KAEvD,QACE8K,GACA,SAAAE,GAAG,OAAI,qBAA+BA,EAAKzK,EAAQgI,gBAAgB,GACnE,KAEJ,CAEM,SAAU0C,IAAiD,IAA/B1K,EAAA,uDAA6B,CAAC,EAStDD,GAAe,QAAyB,CAAElB,WARlD,SAAoB4L,GAClB,OAAO,qBAA+BA,EAAKzK,EAAQgI,gBACrD,IAMQjI,WAER,MAAO,CAAE4K,aANT,SAAsBvL,GACpB,OAAOW,EAAWkK,EAAgB7K,GAAOL,KAAI,SAAAyL,GAAC,OAAIA,EAAE/K,EAAE,IACxD,EAKF,C","sources":["file:///app/packages/libs/shared/src/hooks/UseBatchFetch.ts","file:///app/packages/libs/shared/src/hooks/useBreadcrumbs.ts","file:///app/packages/projects/lite/src/apps/content-updates/components/classification-banner/classification-banner.scss","file:///app/packages/projects/lite/src/apps/content-updates/components/classification-banner/ClassificationBanner.tsx","file:///app/packages/projects/lite/src/apps/content-updates/views/classification-update/partial-loading/partial-classification-update.scss","file:///app/packages/projects/lite/src/apps/content-updates/views/classification-update/partial-loading/PartialClassificationUpdate.tsx","file:///app/packages/projects/lite/src/apps/content-updates/views/classification-update/ClassificationUpdateViewCallbacks.tsx","file:///app/packages/projects/lite/src/apps/content-updates/views/classification-update/ClassificationUpdateView.tsx","file:///app/packages/projects/lite/src/shared/hooks/useCommonVideoProps.ts","file:///app/packages/projects/lite/src/shared/hooks/usePresentationAudiences.ts","file:///app/packages/projects/lite/src/shared/hooks/useVideoMixin.ts"],"sourcesContent":["import React from 'react';\n\nimport { Flight } from 'libs/common/flight';\nimport { ArrayHelper } from 'libs/common/react/utils/ArrayHelper';\n\nimport { BaseObject } from 'libs/shared/interfaces';\n\nconst CHUNK_SIZE = 50;\n\nexport interface UseBatchFetchResult<T extends BaseObject> {\n itemsArr: T[];\n items: { [key: string]: T} | null;\n isFetching: boolean;\n}\n\n/**\n * Used to fetch multiple items by id with Flight. Will fetch 25 items at a time firing off multiple\n * requests if there are more than 25 items.\n * This will return items as null until we have all our items. Items will be returned as an object with\n * their ids as they key for easy mapping\n * \n * @param itemIds \n * @param getRequest \n */\nexport function useBatchFetch<T extends BaseObject>(\n itemIds: string[],\n getRequest: (ids: string[]) => Flight.Request\n): UseBatchFetchResult<T> {\n const chunks = ArrayHelper.chunk<string>(itemIds, CHUNK_SIZE);\n\n const requests = chunks.map(chunk => getRequest(ArrayHelper.uniq(chunk)));\n\n const responses = Flight.useBasicFetchAll<T[]>(requests);\n\n const itemsArr = ArrayHelper.flatten(responses.data);\n const items = responses.data.length\n ? itemsArr.reduce((acc, item) => ({ ...acc, [item.id]: item }), {})\n : null;\n\n return {\n itemsArr,\n items,\n isFetching: responses.isFetching\n };\n}\n\n/**\n * When you need the useBatchFetch() behavior, but your list of objects to hydrate\n * will grow, such as on a scrolling page. useGrowingBatchFetch() will use local state\n * to determine what we've already built a request for and what items are new\n * as to not re-fetch items - Sha\n */\nexport function useGrowingBatchFetch<T>(\n objs: T[],\n getRequest: (items: T[]) => Flight.Request,\n _getKey?: (obj: T) => string\n) {\n const { fetchItems, ...data } = useGrowingBatchFetchFunc({ getRequest, _getKey });\n\n React.useEffect(() => {\n if (!objs?.length)\n return;\n\n fetchItems(objs);\n }, [objs?.length]);\n\n return data;\n}\n\ninterface UseGrowingBatchFetchFuncOptions<T> {\n getRequest: (items: T[]) => Flight.Request;\n _getKey?: (obj: T) => string;\n}\n\n/**\n * When you need the useGrowingBatchFetch() behaviour, but need to trigger the\n * fetch manually and update the objects - Nish \n */\nexport function useGrowingBatchFetchFunc<T>(options: UseGrowingBatchFetchFuncOptions<T>) {\n const getKey = options._getKey ?? ((obj: any) => {\n if (typeof obj === 'object')\n return obj.id;\n\n return obj;\n });\n\n const fetchedItems = React.useRef<Set<string>>(new Set<string>());\n const [ requests, setRequests ] = React.useState<Flight.Request[]>([]);\n\n function fetchItems(objs: T[]) {\n if (!objs?.length)\n return;\n\n const unfetchedItems: T[] = [];\n \n objs.forEach(obj => {\n const key = getKey(obj);\n\n if (fetchedItems.current.has(key))\n return;\n\n unfetchedItems.push(obj);\n fetchedItems.current.add(key);\n });\n \n if (!unfetchedItems.length)\n return;\n \n setRequests(r => ([ ...r, ...ArrayHelper.chunk<T>(unfetchedItems, CHUNK_SIZE).map(options.getRequest) ]));\n }\n\n const responses = Flight.useBasicFetchAll<T[]>(requests);\n const itemsArr = ArrayHelper.flatten(responses.data);\n const items = responses.data.length\n ? itemsArr.reduce((acc, item) => ({ ...acc, [getKey(item)]: item }), {})\n : null;\n\n return {\n hasFirstRequestCompleted: !!responses.responses?.[0]?.hasCompleted,\n itemsArr,\n items,\n isFetching: responses.isFetching,\n fetchItems\n };\n}","import React from 'react';\n\nimport { Breadcrumb } from 'libs/shared/components/breadcrumbs/Breadcrumbs';\nimport { BreadcrumbService } from 'libs/shared/services/BreadcrumbService';\n\nexport function useBreadcrumbs(current: Breadcrumb): Breadcrumb[] {\n const [ match, useBuilder ] = React.useMemo(() => BreadcrumbService.getBuilder(), []);\n\n const breadcrumbs = useBuilder(match);\n\n if (!breadcrumbs || !current)\n return breadcrumbs;\n\n return [ ...breadcrumbs, { ...current, active: true }];\n}\n\n","// extracted by mini-css-extract-plugin\nexport default {\"banner\":\"B7jhq\"};","import * as React from 'react';\nimport { Spinner } from 'react-bootstrap';\n\nimport { StorageType } from 'libs/common/backbone/utils/LocalStorageHelper';\nimport { Core } from 'libs/common/core';\nimport { useViewModel } from 'libs/common/react/hooks/UseViewModel';\n\nimport { AppLink } from 'libs/shared/components/app-link/AppLink';\nimport { IconButton } from 'libs/shared/components/icon-button/IconButton';\nimport { Text } from 'libs/shared/components/text/Text';\nimport { SharedViewModelKeys } from 'libs/shared/constants/SharedViewModelKeys';\nimport { Classification, PresentationAudience } from 'libs/shared/interfaces';\nimport { cvSvgLibrary } from 'libs/shared/utils/SvgHelper';\n\nimport styles from './classification-banner.scss';\n\nconst namespace = 'contentUpdates.classificationBanner';\n\ninterface ClassificationBannerProps {\n classification: Classification;\n backgroundUrl: string;\n getClassificationAppLink: (classification: Classification, activeAudiences: PresentationAudience[]) => Core.AppLink;\n followed: boolean;\n follow: (classificationId: string, classificationName: string, follow: boolean) => void;\n showFollowSpinner: boolean;\n canFollow: boolean;\n}\n\nexport function ClassificationBanner(props: ClassificationBannerProps): JSX.Element {\n const { classification, backgroundUrl, followed, follow, showFollowSpinner } = props;\n\n const [activeAudiences] = useViewModel<PresentationAudience[]>(\n SharedViewModelKeys.AUDIENCE_FILTER,\n undefined,\n { storage: StorageType.SessionStorage }\n );\n\n return (\n <div\n className={`banner mb-2 d-flex justify-content-between align-items-center rounded ${styles.banner}`}\n style={{ backgroundImage: `url('${backgroundUrl}')` }}\n >\n <AppLink className='text-white text-shadow' appLink={props.getClassificationAppLink(classification, activeAudiences)}>\n <h2 className='h3 mb-0'>{classification.name}</h2>\n </AppLink>\n\n {props.canFollow && (\n <IconButton\n className={`btn follow-btn ${followed ? 'btn-outline-dark' : 'btn-dark'}`}\n svgName={followed ? cvSvgLibrary.BellFilled : cvSvgLibrary.Bell}\n onClick={() => follow(classification.id, classification.name, !followed)}\n >\n {showFollowSpinner\n ? <Spinner as='span' animation='border' role='status' size='sm' />\n : <Text namespace={namespace} phrase={followed ? 'following' : 'follow'} />\n }\n </IconButton>\n )}\n </div>\n );\n}\n","// extracted by mini-css-extract-plugin\nexport default {\"partialBanner\":\"DKukI\"};","import React from 'react';\n\nimport { PartialBreadcrumbs } from 'libs/shared/components/breadcrumbs/Breadcrumbs';\nimport { PartialVideoList } from 'libs/shared/components/video-list/partial-loading/PartialVideoList';\n\nimport styles from './partial-classification-update.scss';\n\nexport function PartialClassificationUpdate(): JSX.Element {\n return (\n <div className='bg-white px-3'>\n <div className={`partial-loading-background mb-2 ${styles.partialBanner} rounded`} />\n\n <div className='mb-1'>\n <PartialBreadcrumbs />\n </div>\n\n <PartialVideoList />\n </div>\n );\n}","\nimport { LanguageService } from 'libs/common/backbone/services/LanguageService';\nimport { Flight } from 'libs/common/flight';\n\nimport { AnalyticsHelper } from 'libs/analytics/AnalyticsHelper';\nimport { EntityType, LocationContext, ToggleDescriptor, UserAction, WorkflowPhase } from 'libs/analytics/interfaces';\n\nimport { PreferenceRequests } from 'libs/shared/flight-requests/PreferenceRequests';\nimport { Alerts } from 'libs/shared/hooks/UseAlerts';\nimport { CurrentUser } from 'libs/shared/interfaces';\n\nconst namespace = 'contentUpdates.classificationUpdate';\nconst getPhrase = LanguageService.encloseNamespace(namespace);\n\ninterface ClassificationViewCallbackManager {\n dispatch: React.Dispatch<Flight.RequestAction>;\n alerts: Alerts;\n setShowFollowSpinner: React.Dispatch<React.SetStateAction<boolean>>;\n currentUser: CurrentUser;\n}\n\nexport function getClassificationCallbacks(\n options: ClassificationViewCallbackManager\n) {\n const { dispatch, alerts, setShowFollowSpinner } = options;\n\n function onFollow(classificationId: string, classificationName: string, follow: boolean): void {\n setShowFollowSpinner(true);\n\n const onSuccess = () => {\n setShowFollowSpinner(false);\n\n AnalyticsHelper.logUserAction({\n id: classificationId,\n name: classificationName\n }, {\n location: LocationContext.ContentUpdatesClassificationBanner,\n workflowPhase: WorkflowPhase.Complete,\n descriptor: follow ? ToggleDescriptor.On : ToggleDescriptor.Off,\n actionType: UserAction.Follow,\n entity: EntityType.Classification\n });\n\n alerts.success(getPhrase(follow ? 'followed' : 'unfollowed', { name: classificationName, escapeText: true }));\n };\n\n const onError = () => {\n setShowFollowSpinner(false);\n alerts.error(LanguageService.getPhrase(namespace, 'error'));\n };\n\n const request = follow ?\n PreferenceRequests.followSubjects([classificationId], onSuccess, onError) :\n PreferenceRequests.unfollowSubjects([classificationId], onSuccess, onError);\n\n Flight.fetch(dispatch, request);\n }\n\n return {\n onFollow\n };\n}\n","import * as React from 'react';\nimport { useDispatch } from 'react-redux';\n\nimport { LanguageService } from 'libs/common/backbone/services/LanguageService';\nimport { Flight } from 'libs/common/flight';\nimport { DateHelper } from 'libs/common/react/utils/DateHelper';\n\nimport { LocationContext } from 'libs/analytics/interfaces';\n\nimport { ContentUpdateRequests } from 'libs/shared/apps/content-updates/flight-requests/ContentUpdateRequests';\nimport { ClassificationVideosGrouping, ContentUpdateAppLinks } from 'libs/shared/apps/content-updates/interfaces';\nimport { Breadcrumbs } from 'libs/shared/components/breadcrumbs/Breadcrumbs';\nimport { VideoList } from 'libs/shared/components/video-list/VideoList';\nimport { VideoActionsContext } from 'libs/shared/context/VideoActionsContext';\nimport { PermissionName } from 'libs/shared/enums/PermissionName';\nimport { PreferenceRequests } from 'libs/shared/flight-requests/PreferenceRequests';\nimport { UserRequests } from 'libs/shared/flight-requests/UserRequests';\nimport { useAlerts } from 'libs/shared/hooks/UseAlerts';\nimport { useBreadcrumbs } from 'libs/shared/hooks/useBreadcrumbs';\nimport { usePermissions } from 'libs/shared/hooks/usePermissions';\nimport { useSetPageMetadata } from 'libs/shared/hooks/useSetPageMetadata';\nimport { Classification, CurrentUser } from 'libs/shared/interfaces';\nimport { PageMetadataHelper } from 'libs/shared/utils/PageMetadataHelper';\n\nimport { useVideoActions, VideoActionsLocation } from 'shared/hooks/use-video-actions/useVideoActions';\nimport { useCommonVideoProps } from 'shared/hooks/useCommonVideoProps';\nimport { usePresentationAudiences } from 'shared/hooks/usePresentationAudiences';\nimport { useVideoMixin } from 'shared/hooks/useVideoMixin';\nimport { InteractiveHelpers } from 'shared/utils/InteractiveHelper';\nimport { SeoHelper } from 'shared/utils/SeoHelper';\n\nimport { ClassificationBanner } from 'apps/content-updates/components';\n\nimport { PartialClassificationUpdate } from './partial-loading/PartialClassificationUpdate';\nimport { getClassificationCallbacks } from './ClassificationUpdateViewCallbacks';\n\nconst namespace = 'contentUpdates.classificationUpdate';\nconst getPhrase = LanguageService.encloseNamespace(namespace);\n\ninterface ClassificationUpdateViewProps {\n classificationId: string;\n appLinks: ContentUpdateAppLinks;\n presentationSlug?: string;\n}\n\nexport function ClassificationUpdateView(props: ClassificationUpdateViewProps): JSX.Element {\n const { classificationId } = props;\n\n const dispatch = useDispatch();\n const alerts = useAlerts();\n \n const { commonVideoProps } = useCommonVideoProps({ locationContext: LocationContext.VideoThumbnail });\n\n const currentUser = Flight.useBasicFetch<CurrentUser>(UserRequests.currentUser());\n\n const [ showFollowSpinner, setShowFollowSpinner ] = React.useState(false);\n\n const callbacks = getClassificationCallbacks({\n dispatch,\n alerts,\n setShowFollowSpinner,\n currentUser: currentUser?.data\n });\n\n const date = new Date();\n // Retrieve the past 1 year from today\n const from = DateHelper.format(DateHelper.endOf(DateHelper.subtract(date, 1, 'year'), 'day'), 'YYYY-MM-DD');\n const to = DateHelper.format(DateHelper.endOf(date, 'day'), 'YYYY-MM-DD');\n\n const { hasPermissions } = usePermissions();\n const canFollowSubjects = hasPermissions(PermissionName.FollowSubjects);\n\n const classification = Flight.useBasicFetch<Classification>(\n ContentUpdateRequests.getClassification(classificationId)\n );\n\n const contentUpdates = Flight.useBasicFetch<ClassificationVideosGrouping>(currentUser.data &&\n ContentUpdateRequests.getClassificationUpdates(classificationId, from, to));\n\n const subjectPreferences = Flight.useBasicFetch<Classification[]>(canFollowSubjects &&\n PreferenceRequests.mySubjectPreferences());\n\n const audiences = usePresentationAudiences();\n\n const breadcrumbs = useBreadcrumbs({ name: classification.data?.name });\n\n useSetPageMetadata(PageMetadataHelper.getDefaultMetadata({\n title: classification.data?.name,\n phraseContext: {\n phraseHandler: getPhrase,\n titlePhrase: 'pageTitle',\n descriptionPhrase: 'pageDescription'\n },\n canonicalLink: SeoHelper.getCanonicalLink({\n customAppLink: props.appLinks?.getClassificationUpdateAppLink(classification.data)\n }),\n allowIndexing: SeoHelper.allowIndexing()\n }));\n\n const videoActions = useVideoActions({ location: VideoActionsLocation.VideoItem });\n\n useVideoMixin(contentUpdates.data?.videos ?? []);\n\n const hasLoadedPreferences = subjectPreferences.hasCompleted || !canFollowSubjects;\n\n const dataLoaded = (\n contentUpdates.data && classification.data &&\n hasLoadedPreferences && currentUser.data\n );\n\n if (!dataLoaded)\n return <PartialClassificationUpdate />;\n\n const preferredSubjectIds = subjectPreferences.data?.map(subject => subject.id) ?? [];\n\n return (\n <VideoActionsContext.Provider value={videoActions}>\n <div className='bg-white px-3'>\n <ClassificationBanner\n classification={classification.data}\n backgroundUrl={classification.data.banner?.url ?? ''}\n getClassificationAppLink={props.appLinks.getClassificationAppLink}\n followed={!!preferredSubjectIds.find(id => id.toString() === classification.data.id.toString())}\n follow={callbacks.onFollow}\n showFollowSpinner={showFollowSpinner}\n canFollow={canFollowSubjects}\n />\n <Breadcrumbs breadcrumbs={breadcrumbs} />\n\n\n <VideoList\n videos={contentUpdates.data.videos}\n getVideoAppLink={props.appLinks.getVideoAppLink}\n hasPermissions={hasPermissions}\n presentationAudiences={audiences.data}\n getPreviewQuestionsAppLink={interactive => InteractiveHelpers.getPreviewQuestionsAppLink(interactive)}\n commonVideoProps={commonVideoProps}\n />\n </div>\n </VideoActionsContext.Provider>\n );\n}","import { Core } from 'libs/common/backbone/index';\nimport { Flight } from 'libs/common/react/index';\n\nimport { LocationContext } from 'libs/analytics/interfaces';\n\nimport { PermissionName } from 'libs/shared/enums/PermissionName';\nimport { ConfigRequests } from 'libs/shared/flight-requests/ConfigRequests';\nimport { CustomerRequests } from 'libs/shared/flight-requests/CustomerRequests';\nimport { UserRequests } from 'libs/shared/flight-requests/UserRequests';\nimport { usePermissions } from 'libs/shared/hooks/usePermissions';\nimport { useSettings } from 'libs/shared/hooks/useSettings';\nimport { Config, CurrentUser, VideoTypes, YearGroup } from 'libs/shared/interfaces';\nimport { CommonVideoProps } from 'libs/shared/interfaces/CommonVideoProps';\n\nimport { VideoAppLinkHelper } from 'shared/utils/VideoAppLinkHelper';\n\nimport { SeriesAppLinkHelper } from 'apps/series/SeriesAppLinkHelper';\n\nimport { usePluginHelper } from './use-plugin-helper/usePluginHelper';\nimport { useLiteFavourites } from './useLiteFavourites';\n\ninterface UseCommonVideoPropsResult {\n hasCommonVideoPropsCompleted: boolean;\n commonVideoProps: CommonVideoProps;\n}\n\ninterface UseCommonVideoPropsOptions {\n locationContext: LocationContext,\n mtv?: boolean;\n flightNamespace?: string;\n sharedPlaylist?: boolean;\n}\n\nexport function useCommonVideoProps(options: UseCommonVideoPropsOptions): UseCommonVideoPropsResult {\n const { locationContext, mtv, flightNamespace, sharedPlaylist } = options || {};\n\n const { isPlugin, params } = usePluginHelper();\n const { setFavourite, canFavourite } = useLiteFavourites(locationContext, flightNamespace);\n const { hasTopicDirectories, isLoadingSettings } = useSettings(null);\n const { hasPermissions, isLoaded: hasLoadedPermissions } = usePermissions();\n const hasStudentExperience = hasPermissions(PermissionName.StudentExperience);\n\n const config = Flight.useBasicFetch<Config>(ConfigRequests.config());\n const currentUser = Flight.useBasicFetch<CurrentUser>(UserRequests.currentUser());\n const yearGroups = Flight.useBasicFetch<YearGroup[]>(\n currentUser.data?.isAuthenticated && CustomerRequests.yearGroups(currentUser.data.customerId)\n );\n\n function getSubTextAppLink(video: VideoTypes): Core.AppLink {\n if (!('series' in video))\n return null;\n\n /**\n * We do not allow navigating to series on shared playlists when the user is not signed in\n * because most series are customer created and will be empty for public users\n * \n * We do not have to do this for shared series, because all the series links are self referencing\n * - Sha\n */\n if (sharedPlaylist && !currentUser.data?.isAuthenticated)\n return null;\n \n return SeriesAppLinkHelper.getSeriesAppLink(video.series, { mtv });\n }\n\n const hasCommonVideoPropsCompleted = (\n !isLoadingSettings &&\n hasLoadedPermissions &&\n config.hasCompleted &&\n currentUser.hasCompleted &&\n (!currentUser.data?.isAuthenticated || yearGroups.hasCompleted)\n );\n\n return {\n hasCommonVideoPropsCompleted,\n commonVideoProps: {\n subTextType: 'series',\n getSubTextAppLink,\n isPlugin,\n isPluginPopup: !!params?.popup,\n canFavourite,\n setFavourite,\n imageCdnUrl: config.data?.imageCdnUrl,\n yearGroups: yearGroups.data,\n getClassroomGuideAppLink: VideoAppLinkHelper.getClassroomGuideAppLink,\n getInteractiveGuidanceAppLink: VideoAppLinkHelper.getInteractiveGuidanceAppLink,\n getResourceGuidanceAppLink: VideoAppLinkHelper.getResourceGuidanceAppLink,\n showNewVideoIndicator: hasTopicDirectories,\n companyLogoFallbackUrl: null,\n hasStudentExperience\n }\n };\n}","import { Flight } from 'libs/common/react/index';\n\nimport { AudienceRequests } from 'libs/shared/flight-requests/AudienceRequests';\nimport { PresentationAudience } from 'libs/shared/interfaces';\n\nimport { usePresentation } from 'shared/hooks/usePresentation';\n\nexport const usePresentationAudiences = () => {\n const { activePresentation, getFallbackPresentation } = usePresentation({ redirectOnError: true });\n\n const presentation = activePresentation || getFallbackPresentation();\n\n const audiences = Flight.useBasicFetch<PresentationAudience[]>(\n !!presentation &&\n AudienceRequests.presentationAudiences(presentation.id)\n );\n\n return audiences;\n};","import { Flight } from 'libs/common/react/index';\n\nimport { VideoRequests } from 'libs/shared/flight-requests/VideoRequests';\nimport { useGrowingBatchFetch, useGrowingBatchFetchFunc } from 'libs/shared/hooks/UseBatchFetch';\nimport { Clip, ClipCollection, Video, VideoCollection } from 'libs/shared/interfaces';\nimport { VideoHelper } from 'libs/shared/utils/VideoHelper';\n\ntype Types = Video[] | VideoCollection | Clip[] | ClipCollection;\n\nfunction getValidObjects(objects: Types): (Video | Clip)[] {\n if (!objects)\n return [];\n\n if (Array.isArray(objects))\n return objects.filter(o => !!o && (VideoHelper.isVideo(o) || VideoHelper.isClip(o)));\n\n if ('data' in objects)\n return objects.data.filter(o => !!o && (VideoHelper.isVideo(o) || VideoHelper.isClip(o)));\n\n return [];\n}\n\ninterface VideoMixinOptions {\n /**\n * If the videos that are having new data mixed into are sitting on an explicit Flight namespace,\n * providing that namespace here is required\n */\n flightNamespace?: string;\n}\n\nexport function useVideoMixin(objects: Types, options: VideoMixinOptions = {}) {\n const videoIds = getValidObjects(objects).map(v => v.id);\n\n useGrowingBatchFetch(\n videoIds,\n ids => VideoRequests.videoMixinAssocs(ids, options.flightNamespace),\n null\n );\n}\n\nexport function useVideoMixinFunc(options: VideoMixinOptions = {}) {\n function getRequest(ids: string[]): Flight.Request {\n return VideoRequests.videoMixinAssocs(ids, options.flightNamespace);\n }\n \n function fetchObjects(items: Types) {\n return fetchItems(getValidObjects(items).map(v => v.id));\n }\n\n const { fetchItems } = useGrowingBatchFetchFunc({ getRequest });\n\n return { fetchObjects };\n}"],"names":["CHUNK_SIZE","useBatchFetch","itemIds","getRequest","requests","map","chunk","responses","itemsArr","data","items","length","reduce","acc","item","id","isFetching","useGrowingBatchFetch","objs","_getKey","useGrowingBatchFetchFunc","fetchItems","options","getKey","obj","fetchedItems","Set","setRequests","hasFirstRequestCompleted","hasCompleted","unfetchedItems","forEach","key","current","has","push","add","r","useBreadcrumbs","match","breadcrumbs","useBuilder","active","ClassificationBanner","props","classification","backgroundUrl","followed","follow","showFollowSpinner","activeAudiences","SharedViewModelKeys","undefined","storage","className","style","backgroundImage","appLink","getClassificationAppLink","name","canFollow","IconButton","svgName","onClick","Spinner","as","animation","role","size","namespace","phrase","PartialClassificationUpdate","PartialVideoList","getPhrase","LanguageService","ClassificationUpdateView","classificationId","dispatch","alerts","commonVideoProps","useCommonVideoProps","locationContext","currentUser","UserRequests","callbacks","setShowFollowSpinner","onFollow","classificationName","onSuccess","AnalyticsHelper","location","workflowPhase","descriptor","actionType","entity","success","escapeText","onError","error","request","PreferenceRequests","getClassificationCallbacks","date","Date","from","DateHelper","to","hasPermissions","usePermissions","canFollowSubjects","PermissionName","ContentUpdateRequests","contentUpdates","subjectPreferences","audiences","usePresentationAudiences","useSetPageMetadata","PageMetadataHelper","title","phraseContext","phraseHandler","titlePhrase","descriptionPhrase","canonicalLink","SeoHelper","customAppLink","appLinks","getClassificationUpdateAppLink","allowIndexing","videoActions","useVideoActions","useVideoMixin","videos","hasLoadedPreferences","preferredSubjectIds","subject","VideoActionsContext","value","banner","url","find","toString","Breadcrumbs","VideoList","getVideoAppLink","presentationAudiences","getPreviewQuestionsAppLink","interactive","InteractiveHelper","mtv","flightNamespace","sharedPlaylist","isPlugin","params","u","setFavourite","canFavourite","hasTopicDirectories","isLoadingSettings","hasLoadedPermissions","isLoaded","hasStudentExperience","config","yearGroups","isAuthenticated","customerId","hasCommonVideoPropsCompleted","subTextType","getSubTextAppLink","video","series","isPluginPopup","popup","imageCdnUrl","getClassroomGuideAppLink","getInteractiveGuidanceAppLink","getResourceGuidanceAppLink","showNewVideoIndicator","companyLogoFallbackUrl","redirectOnError","activePresentation","getFallbackPresentation","presentation","getValidObjects","objects","Array","isArray","filter","o","videoIds","v","ids","useVideoMixinFunc","fetchObjects"],"sourceRoot":""}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";(self.webpackChunk_clickview_lite=self.webpackChunk_clickview_lite||[]).push([[9241],{45781:(e,t,n)=>{n.d(t,{z:()=>p});var a=n(32735),r=n(39202),i=n(23481),o=n(65858),l=n(38502),c=n(83345),s=n(38129);const u={pillTab:"bMJM0"};var f="discover.header";function p(e){var t,n,p,d,m,v;if(!e.type)return a.createElement(a.Fragment,null);if(e.type===s.Yv.Learner||e.hasStudentExperience)return a.createElement("div",{className:"py-3"},a.createElement("h1",{className:"h2 mb-0"},a.createElement(c.x,{namespace:f,phrase:"heading"})));var y=[{name:i.T.getPhrase(f,"forYou"),appLink:null===(t=e.appLinks)||void 0===t?void 0:t.forYou,active:"forYou"===e.active,analyticsData:{name:i.T.getPhrase(f,"forYou"),url:r.C$.getHref(null===(n=e.appLinks)||void 0===n?void 0:n.forYou)},analyticsOptions:{actionType:o.Vw.Click,entity:o.py.Url,location:o.LZ.MagicTabs}},{name:i.T.getPhrase(f,"whatsNew"),appLink:null===(p=e.appLinks)||void 0===p?void 0:p.whatsNew,active:"whatsNew"===e.active,analyticsData:{name:i.T.getPhrase(f,"whatsNew"),url:r.C$.getHref(null===(d=e.appLinks)||void 0===d?void 0:d.whatsNew)},analyticsOptions:{actionType:o.Vw.Click,entity:o.py.Url,location:o.LZ.MagicTabs}}];return e.showCalendar&&y.push({name:i.T.getPhrase(f,"calendar"),appLink:null===(m=e.appLinks)||void 0===m?void 0:m.calendar,active:"calendar"===e.active,analyticsData:{name:i.T.getPhrase(f,"calendar"),url:r.C$.getHref(null===(v=e.appLinks)||void 0===v?void 0:v.calendar)},analyticsOptions:{actionType:o.Vw.Click,entity:o.py.Url,location:o.LZ.MagicTabs}}),a.createElement("div",{className:"py-3 text-center mx-n3"},a.createElement(l.r,{tabs:y,className:u.pillTab}))}},38502:(e,t,n)=>{n.d(t,{r:()=>f});var a=n(32735),r=n(49985),i=n(15611),o=n(18559),l=n(11607),c=n(83914),s=n(22771);function u(e){return a.createElement(a.Fragment,null,!!e.tab.svgName&&a.createElement("div",{className:e.tab.name?"pe-1":""},a.createElement(c.x,{svgName:e.tab.svgName})),e.tab.name,"number"==typeof e.tab.count&&a.createElement("div",{className:"ps-2"},a.createElement(o.C,{type:o.g.Count,data:e.tab.count})))}function f(e){var t;return a.createElement("nav",{className:null!==(t=e.className)&&void 0!==t?t:"",ref:e.containerRef},a.createElement("ul",{className:"\n list-unstyled d-inline-block m-0 ".concat(s.Z.pillTabSelector,"\n ").concat(e.borderRadius?s.Z.radiusSmall:"","\n ").concat(e.listClassName,"\n ")},e.tabs.map((function(e,t){return a.createElement("li",{className:"\n p-0 ".concat(s.Z.tab," ").concat(e.active?"btn btn-dark":"btn btn-outline-dark","\n ").concat(e.name?s.Z.minWidth:""," ").concat(e.className,"\n "),key:t},e.appLink?a.createElement(i.F,{appLink:e.appLink,analyticsData:e.analyticsData,analyticsOptions:e.analyticsOptions,className:"\n cursor-pointer d-flex align-items-center justify-content-center\n text-decoration-none text-reset px-2 text-nowrap ".concat(s.Z.tabLink,"\n ")},a.createElement(u,{tab:e})):a.createElement(l.L,{className:"\n cursor-pointer d-flex align-items-center justify-content-center\n text-decoration-none text-reset px-2 text-nowrap ".concat(s.Z.tabLink,"\n "),onClick:function(){return function(e){!e.active&&e.onSelect&&(e.onSelect(),e.analyticsData&&e.analyticsOptions&&r.k.logUserAction(e.analyticsData,e.analyticsOptions))}(e)}},a.createElement(u,{tab:e})))}))))}f.defaultProps={borderRadius:"lg"}},39902:(e,t,n)=>{n.d(t,{FN:()=>m,SW:()=>v,fh:()=>d});var a=n(32735),r=n(20354),i=n(75896);function o(e){return function(e){if(Array.isArray(e))return c(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||l(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function l(e,t){if(e){if("string"==typeof e)return c(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?c(e,t):void 0}}function c(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,a=Array(t);n<t;n++)a[n]=e[n];return a}function s(e){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s(e)}function u(e,t,n){return(t=function(e){var t=function(e){if("object"!=s(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=s(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==s(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var f=function(e,t){var n={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.indexOf(a)<0&&(n[a]=e[a]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(a=Object.getOwnPropertySymbols(e);r<a.length;r++)t.indexOf(a[r])<0&&Object.prototype.propertyIsEnumerable.call(e,a[r])&&(n[a[r]]=e[a[r]])}return n},p=50;function d(e,t){var n=i.m.chunk(e,p).map((function(e){return t(i.m.uniq(e))})),a=r.a.useBasicFetchAll(n),o=i.m.flatten(a.data),l=a.data.length?o.reduce((function(e,t){return Object.assign(Object.assign({},e),u({},t.id,t))}),{}):null;return{itemsArr:o,items:l,isFetching:a.isFetching}}function m(e,t,n){var r=v({getRequest:t,_getKey:n}),i=r.fetchItems,o=f(r,["fetchItems"]);return a.useEffect((function(){(null==e?void 0:e.length)&&i(e)}),[null==e?void 0:e.length]),o}function v(e){var t,n,c,f,d,m=null!==(t=e._getKey)&&void 0!==t?t:function(e){return"object"===s(e)?e.id:e},v=a.useRef(new Set),y=(f=a.useState([]),d=2,function(e){if(Array.isArray(e))return e}(f)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var a,r,i,o,l=[],c=!0,s=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(a=i.call(n)).done)&&(l.push(a.value),l.length!==t);c=!0);}catch(e){s=!0,r=e}finally{try{if(!c&&null!=n.return&&(o=n.return(),Object(o)!==o))return}finally{if(s)throw r}}return l}}(f,d)||l(f,d)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),b=y[0],h=y[1],g=r.a.useBasicFetchAll(b),w=i.m.flatten(g.data),S=g.data.length?w.reduce((function(e,t){return Object.assign(Object.assign({},e),u({},m(t),t))}),{}):null;return{hasFirstRequestCompleted:!!(null===(c=null===(n=g.responses)||void 0===n?void 0:n[0])||void 0===c?void 0:c.hasCompleted),itemsArr:w,items:S,isFetching:g.isFetching,fetchItems:function(t){if(null==t?void 0:t.length){var n=[];t.forEach((function(e){var t=m(e);v.current.has(t)||(n.push(e),v.current.add(t))})),n.length&&h((function(t){return[].concat(o(t),o(i.m.chunk(n,p).map(e.getRequest)))}))}}}}},30709:(e,t,n)=>{n.d(t,{a:()=>v});var a=n(32735),r=n(15611),i=n(83345),o=n(80247),l=n(57900),c=n(2948),s=n(91693),u=n(38143),f=n(35223);const p={banner:"B7jhq"};function d(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,a=Array(t);n<t;n++)a[n]=e[n];return a}var m="contentUpdates.classificationBanner";function v(e){var t,n,v=e.classification,y=e.backgroundUrl,b=e.followed,h=e.follow,g=e.showFollowSpinner,w=(t=(0,c.D)(u.g.AUDIENCE_FILTER,void 0,{storage:l.Z1.SessionStorage}),n=1,function(e){if(Array.isArray(e))return e}(t)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var a,r,i,o,l=[],c=!0,s=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(a=i.call(n)).done)&&(l.push(a.value),l.length!==t);c=!0);}catch(e){s=!0,r=e}finally{try{if(!c&&null!=n.return&&(o=n.return(),Object(o)!==o))return}finally{if(s)throw r}}return l}}(t,n)||function(e,t){if(e){if("string"==typeof e)return d(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?d(e,t):void 0}}(t,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())[0];return a.createElement("div",{className:"banner mb-2 d-flex justify-content-between align-items-center rounded ".concat(p.banner),style:{backgroundImage:"url('".concat(y,"')")}},a.createElement(r.F,{className:"text-white text-shadow",appLink:e.getClassificationAppLink(v,w)},a.createElement("h2",{className:"h3 mb-0"},v.name)),e.canFollow&&a.createElement(s.h,{className:"btn follow-btn ".concat(b?"btn-outline-dark":"btn-dark"),svgName:b?f.vn.BellFilled:f.vn.Bell,onClick:function(){return h(v.id,v.name,!b)}},g?a.createElement(o.Z,{as:"span",animation:"border",role:"status",size:"sm"}):a.createElement(i.x,{namespace:m,phrase:b?"following":"follow"})))}},79241:(e,t,n)=>{n.r(t),n.d(t,{ContentUpdatesView:()=>H});var a=n(32735),r=n(70680),i=n(23481),o=n(20354),l=n(110),c=n(49985),s=n(65858),u=n(54644),f=n(45781),p=n(15611),d=n(83345),m=n(51365),v=n(16714),y=n(61699),b=n(69883),h=n(39902),g=n(22902),w=n(79612),S=n(38129),E=n(76753),k=n(14070),L=n(97291),C=n(10671),A=n(58321),N=n(86698),O=n(44110),j=n(85369),P=n(97816),T=n(33192),F=n(75100),x=n(54610),U=n(67453),I=n(10741),M=n(30709),V="contentUpdates.contentUpdatesView";function D(e){var t=e.classification,n=e.videos,r=e.showMore,i=e.followed,o=(0,g.T)().hasPermissions;if(!t)return a.createElement(a.Fragment,null);var l=U.j.createBannerUrl(t.banner,{fallbackBaseUrl:e.commonVideoProps.imageCdnUrl,fallbackCategoryName:t.name,type:x.__.Banners},{size:x.h2.Medium,resizeType:x.Nq.Cover});return a.createElement("div",{className:"mb-3"},a.createElement(M.a,{classification:t,backgroundUrl:l,getClassificationAppLink:e.appLinks.getClassificationAppLink,followed:i,follow:e.follow,canFollow:e.canFollow,showFollowSpinner:e.showFollowSpinner}),a.createElement(F.E4,{videos:n,getVideoAppLink:e.appLinks.getVideoAppLink,presentationAudiences:e.audiences,hasPermissions:o,getPreviewQuestionsAppLink:function(e){return I.j.getPreviewQuestionsAppLink(e)},commonVideoProps:e.commonVideoProps}),r&&a.createElement("div",{className:"show-more"},a.createElement(p.F,{className:"info-link",appLink:e.appLinks.getClassificationUpdateAppLink(t)},a.createElement(d.x,{namespace:V,phrase:"showMore",options:{classificationName:t.name}}))))}var R=n(1860);const B={partialBanner:"bxaA6"};function _(){return a.createElement(a.Fragment,null,Array(4).fill(null).map((function(e,t){return a.createElement("div",{key:t,className:"mb-3"},a.createElement("div",{className:"partial-loading-background mb-2 ".concat(B.partialBanner)}),a.createElement(R.S,null))})))}function Y(e){return Y="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Y(e)}function Z(e,t,n){return(t=function(e){var t=function(e){if("object"!=Y(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=Y(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Y(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function G(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,a=Array(t);n<t;n++)a[n]=e[n];return a}var W=5,z="contentUpdates.contentUpdatesView",q=i.T.encloseNamespace(z);function H(e){var t,n,i,F,x,U,I=(x=a.useState({}),U=2,function(e){if(Array.isArray(e))return e}(x)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var a,r,i,o,l=[],c=!0,s=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(a=i.call(n)).done)&&(l.push(a.value),l.length!==t);c=!0);}catch(e){s=!0,r=e}finally{try{if(!c&&null!=n.return&&(o=n.return(),Object(o)!==o))return}finally{if(s)throw r}}return l}}(x,U)||function(e,t){if(e){if("string"==typeof e)return G(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?G(e,t):void 0}}(x,U)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),M=I[0],V=I[1],R=(0,r.I0)(),B=(0,b.Z)(),Y=(0,g.T)().hasPermissions,H=Y(v.C.FollowSubjects),$=new Date,J=l.O.format(l.O.endOf(l.O.subtract($,1,"year"),"day"),"YYYY-MM-DD"),K=l.O.format(l.O.endOf($,"day"),"YYYY-MM-DD"),Q=(0,N.y)({redirectOnError:!0}).activePresentation;(0,w.M)(E.CG.getDefaultMetadata({title:null==Q?void 0:Q.name,phraseContext:{phraseHandler:q,titlePhrase:"pageTitle",descriptionPhrase:"pageDescription"},canonicalLink:T.f.getCanonicalLink(),allowIndexing:T.f.allowIndexing(),hrefLang:T.f.getStaticRouteHrefLang(null==Q?void 0:Q.learningLevel,(function(){return{application:L.O.CONTENT_UPDATES,action:k.e.ContentUpdates.CONTENT_UPDATES}}))}));var X=u.v.getContentUpdates(null==Q?void 0:Q.id,J,K),ee=o.a.useBasicFetch(Q&&X),te=o.a.useBasicFetch(H&&y.o.mySubjectPreferences()),ne=(0,O.i)(),ae=[],re=[];ee.data&&ee.data.forEach((function(e){ae.push(e.id),re=re.concat(e.videos)}));var ie=(0,h.fh)(ae,(function(e){return u.v.getClassifications(e)})).items,oe=(0,C._)({location:C.i.VideoItem});(0,P.V)(re,{flightNamespace:null===(t=X.normalizeOptions)||void 0===t?void 0:t.namespace});var le=(0,A.U)({locationContext:s.LZ.VideoThumbnail,flightNamespace:null===(n=X.normalizeOptions)||void 0===n?void 0:n.namespace}),ce=le.commonVideoProps,se=le.hasCommonVideoPropsCompleted;function ue(e,t,n){V((function(t){return Object.assign(Object.assign({},t),Z({},e,!0))}));var a=function(){var a;V((function(t){return Object.assign(Object.assign({},t),Z({},e,!1))})),c.k.logUserAction({id:e,name:t},{location:s.LZ.ContentUpdatesClassificationBanner,workflowPhase:s.eu.Complete,descriptor:n?s.DL.On:s.DL.Off,actionType:s.Vw.Follow,entity:s.py.Classification}),B.success(q(n?"followed":"unfollowed",{classification:null===(a=ie[e])||void 0===a?void 0:a.name,escapeText:!0}))},r=function(){V((function(t){return Object.assign(Object.assign({},t),Z({},e,!1))})),B.error(q("error"))},i=n?y.o.followSubjects([e],a,r):y.o.unfollowSubjects([e],a,r);o.a.fetch(R,i)}var fe=(0,j.N)(),pe=fe.showCalendar,de=fe.isLoading,me=!(!ee.hasCompleted||!ne.hasCompleted||H&&!te.hasCompleted||!ie||de||!se),ve=function(e,t){return e&&t?e.map((function(e){return{showMore:e.videos.length>W,classification:t[e.id],videos:e.videos.slice(0,W).map((function(e){return e.classification=t[e.id],e})).filter((function(e){return e}))}})).filter((function(e){return e.classification})):null}(ee.data,ie),ye=null!==(F=null===(i=te.data)||void 0===i?void 0:i.map((function(e){return e.id})))&&void 0!==F?F:[],be=Y(v.C.ManageSubjectPreferences),he=Y(v.C.ManageVideoAccess);return a.createElement(m.M.Provider,{value:oe},a.createElement("div",{className:"bg-white px-3"},!de&&a.createElement(f.z,{type:S.Yv.Staff,appLinks:{forYou:e.appLinks.dashboardAppLink,whatsNew:e.appLinks.whatsNewAppLink,calendar:e.appLinks.calendarAppLink},showCalendar:pe,active:"whatsNew"}),a.createElement("h1",null,a.createElement(d.x,{namespace:z,phrase:"heading"})),(be||he)&&a.createElement("p",null,be&&a.createElement(a.Fragment,null,a.createElement(d.x,{namespace:z,phrase:"onlyRelevant"})," ",a.createElement(p.F,{className:"info-link",appLink:{application:L.O.SETTINGS,action:k.e.Settings.TOPIC_PREFERENCES}},a.createElement(d.x,{namespace:z,phrase:"updatePreferences"}))),he&&a.createElement("span",{className:"d-block"},a.createElement(p.F,{className:"info-link",appLink:{application:L.O.SETTINGS,action:k.e.Settings.CONTENT_REVIEW}},a.createElement(d.x,{namespace:z,phrase:"contentReview"})))),me?a.createElement(a.Fragment,null,ve.map((function(t,n){var r,i;return a.createElement(D,{key:n,classification:t.classification,videos:t.videos,showMore:t.showMore,appLinks:e.appLinks,followed:ye.includes(null===(r=t.classification)||void 0===r?void 0:r.id),follow:ue,showFollowSpinner:M[null===(i=t.classification)||void 0===i?void 0:i.id],canFollow:H,audiences:ne.data,commonVideoProps:ce})}))):a.createElement(_,null)))}},58321:(e,t,n)=>{n.d(t,{U:()=>m});var a=n(20354),r=n(16714),i=n(39151),o=n(1666),l=n(31949),c=n(22902),s=n(37802),u=n(22490),f=n(82431),p=n(46390),d=n(27638);function m(e){var t,n,m,v=e||{},y=v.locationContext,b=v.mtv,h=v.flightNamespace,g=v.sharedPlaylist,w=(0,p.G)(),S=w.isPlugin,E=w.params,k=(0,d.u)(y,h),L=k.setFavourite,C=k.canFavourite,A=(0,s.r)(null),N=A.hasTopicDirectories,O=A.isLoadingSettings,j=(0,c.T)(),P=j.hasPermissions,T=j.isLoaded,F=P(r.C.StudentExperience),x=a.a.useBasicFetch(i.L.config()),U=a.a.useBasicFetch(l.N.currentUser()),I=a.a.useBasicFetch((null===(t=U.data)||void 0===t?void 0:t.isAuthenticated)&&o.h.yearGroups(U.data.customerId));return{hasCommonVideoPropsCompleted:!O&&T&&x.hasCompleted&&U.hasCompleted&&(!(null===(n=U.data)||void 0===n?void 0:n.isAuthenticated)||I.hasCompleted),commonVideoProps:{subTextType:"series",getSubTextAppLink:function(e){var t;return"series"in e?g&&!(null===(t=U.data)||void 0===t?void 0:t.isAuthenticated)?null:f.j.getSeriesAppLink(e.series,{mtv:b}):null},isPlugin:S,isPluginPopup:!!(null==E?void 0:E.popup),canFavourite:C,setFavourite:L,imageCdnUrl:null===(m=x.data)||void 0===m?void 0:m.imageCdnUrl,yearGroups:I.data,getClassroomGuideAppLink:u.W.getClassroomGuideAppLink,getInteractiveGuidanceAppLink:u.W.getInteractiveGuidanceAppLink,getResourceGuidanceAppLink:u.W.getResourceGuidanceAppLink,showNewVideoIndicator:N,companyLogoFallbackUrl:null,hasStudentExperience:F}}}},44110:(e,t,n)=>{n.d(t,{i:()=>o});var a=n(20354),r=n(89454),i=n(86698),o=function(){var e=(0,i.y)({redirectOnError:!0}),t=e.activePresentation,n=e.getFallbackPresentation,o=t||n();return a.a.useBasicFetch(!!o&&r.O.presentationAudiences(o.id))}},85369:(e,t,n)=>{n.d(t,{N:()=>b});var a=n(32735),r=n(35242),i=n(20354),o=n(27022),l=n(72639),c=n(31949),s=n(37802),u=n(87114),f=n(86698);function p(e){return p="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},p(e)}function d(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var a,r,i,o,l=[],c=!0,s=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(a=i.call(n)).done)&&(l.push(a.value),l.length!==t);c=!0);}catch(e){s=!0,r=e}finally{try{if(!c&&null!=n.return&&(o=n.return(),Object(o)!==o))return}finally{if(s)throw r}}return l}}(e,t)||function(e,t){if(e){if("string"==typeof e)return m(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?m(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function m(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,a=Array(t);n<t;n++)a[n]=e[n];return a}function v(e,t,n){return(t=function(e){var t=function(e){if("object"!=p(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=p(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==p(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var y=v(v(v(v(v(v({},o.t.AU,[l.p.Level_1]),o.t.US,[l.p.Level_1]),o.t.UK,[l.p.Level_1]),o.t.SCOT,[l.p.Level_1]),o.t.NZ,[]),o.t.GLOBAL,[]);function b(){var e,t=(0,s.r)(null),n=t.hasSpecialEventCalendar,o=t.isLoadingSettings,l=(0,f.y)({redirectOnError:!0}).activePresentation,p=i.a.useBasicFetch(c.N.currentUser()),m=y[null===(e=p.data)||void 0===e?void 0:e.contentRegion],v=u.i.getMappedPresentationLevel(null==l?void 0:l.learningLevel),b=!(null==m?void 0:m.find((function(e){return e.toString()===(null==v?void 0:v.toString())}))),h=!o&&!n,g=d(a.useState(!h&&!b),2),w=g[0],S=g[1],E=d(a.useState(o||!(null==l?void 0:l.id)),2),k=E[0],L=E[1];return a.useEffect((function(){h||b?S(!1):k||S(!0),L(o||!(null==l?void 0:l.id))}),[n,null==l?void 0:l.id,k]),r.h.isDevelopment?{showCalendar:!0,isLoading:!1}:{showCalendar:w,isLoading:k}}},97816:(e,t,n)=>{n.d(t,{V:()=>l,l:()=>c});var a=n(1575),r=n(39902),i=n(31908);function o(e){return e?Array.isArray(e)?e.filter((function(e){return!!e&&(i.M.isVideo(e)||i.M.isClip(e))})):"data"in e?e.data.filter((function(e){return!!e&&(i.M.isVideo(e)||i.M.isClip(e))})):[]:[]}function l(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=o(e).map((function(e){return e.id}));(0,r.FN)(n,(function(e){return a.R.videoMixinAssocs(e,t.flightNamespace)}),null)}function c(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=(0,r.SW)({getRequest:function(t){return a.R.videoMixinAssocs(t,e.flightNamespace)}}).fetchItems;return{fetchObjects:function(e){return t(o(e).map((function(e){return e.id})))}}}},22771:(e,t,n)=>{n.d(t,{Z:()=>a});const a={pillTabSelector:"Hdi6o",tab:"RvNxr",minWidth:"GHSz9",radiusSmall:"VhJJa",tabLink:"WFyvo"}}}]);
|
|
2
|
+
//# sourceMappingURL=9241-238326bcb2-lite.chunk.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scripts/9241-238326bcb2-lite.chunk.js","mappings":"qNACA,SAAgB,QAAU,SCa1B,IAAMA,EAAY,kBAgBZ,SAAUC,EAAeC,G,gBAC7B,IAAKA,EAAMC,KACT,OAAO,iCAET,GAAID,EAAMC,OAAS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AEmL,EAAyBhG,aAAkB,EAAlBA,EAAoBnF,GAAIoI,IAElD,kBACK,CAAErK,cAAc,EAAMqK,WAAW,GAEnC,CAAErK,aAAAA,EAAcqK,UAAAA,EACzB,C,+EC5DA,SAASyD,EAAgBC,GACvB,OAAKA,EAGD9H,MAAM+H,QAAQD,GACTA,EAAQrD,QAAO,SAAAuD,GAAC,QAAMA,IAAM,YAAoBA,IAAM,WAAmBA,GAAG,IAEjF,SAAUF,EACLA,EAAQvN,KAAKkK,QAAO,SAAAuD,GAAC,QAAMA,IAAM,YAAoBA,IAAM,WAAmBA,GAAG,IAEnF,GARE,EASX,CAUM,SAAU/E,EAAc6E,GAA+C,IAA/BvL,EAAA,uDAA6B,CAAC,EACpE0L,EAAWJ,EAAgBC,GAASlN,KAAI,SAAA8J,GAAC,OAAIA,EAAE1I,EAAE,KAEvD,QACEiM,GACA,SAAAnF,GAAG,OAAI,qBAA+BA,EAAKvG,EAAQ2G,gBAAgB,GACnE,KAEJ,CAEM,SAAUgF,IAAiD,IAA/B3L,EAAA,uDAA6B,CAAC,EAStDD,GAAe,QAAyB,CAAEhB,WARlD,SAAoBwH,GAClB,OAAO,qBAA+BA,EAAKvG,EAAQ2G,gBACrD,IAMQ5G,WAER,MAAO,CAAE6L,aANT,SAAsBxM,GACpB,OAAOW,EAAWuL,EAAgBlM,GAAOf,KAAI,SAAA8J,GAAC,OAAIA,EAAE1I,EAAE,IACxD,EAKF,C,mCCnDA,SAAgB,gBAAkB,QAAQ,IAAM,QAAQ,SAAW,QAAQ,YAAc,QAAQ,QAAU,Q","sources":["file:///app/packages/libs/shared/src/apps/discover/components/header/discover-header.scss","file:///app/packages/libs/shared/src/apps/discover/components/header/DiscoverHeader.tsx","file:///app/packages/libs/shared/src/components/pill-tab-selector/PillTabSelector.tsx","file:///app/packages/libs/shared/src/hooks/UseBatchFetch.ts","file:///app/packages/projects/lite/src/apps/content-updates/components/classification-banner/classification-banner.scss","file:///app/packages/projects/lite/src/apps/content-updates/components/classification-banner/ClassificationBanner.tsx","file:///app/packages/projects/lite/src/apps/content-updates/views/content-updates/components/ContentUpdateClassification.tsx","file:///app/packages/projects/lite/src/apps/content-updates/views/content-updates/partial-loading/partial-content-updates.scss","file:///app/packages/projects/lite/src/apps/content-updates/views/content-updates/partial-loading/PartialContentUpdates.tsx","file:///app/packages/projects/lite/src/apps/content-updates/views/content-updates/ContentUpdatesView.tsx","file:///app/packages/projects/lite/src/shared/hooks/useCommonVideoProps.ts","file:///app/packages/projects/lite/src/shared/hooks/usePresentationAudiences.ts","file:///app/packages/projects/lite/src/shared/hooks/useShowCalendar.ts","file:///app/packages/projects/lite/src/shared/hooks/useVideoMixin.ts","file:///app/packages/libs/shared/src/components/pill-tab-selector/pill-tab-selector.scss"],"sourcesContent":["// extracted by mini-css-extract-plugin\nexport default {\"pillTab\":\"bMJM0\"};","import React from 'react';\n\nimport { AppLinkHelper } from 'libs/common/backbone/core';\nimport { Core } from 'libs/common/backbone/index';\nimport { LanguageService } from 'libs/common/backbone/services/LanguageService';\n\nimport { EntityType, LocationContext, UserAction } from 'libs/analytics/interfaces';\n\nimport { PillTabSelector } from 'libs/shared/components/pill-tab-selector/PillTabSelector';\nimport { Text } from 'libs/shared/components/text/Text';\nimport { DashboardUserType } from 'libs/shared/interfaces';\n\nimport styles from './discover-header.scss';\n\nconst namespace = 'discover.header';\n\nexport interface DiscoverHeaderAppLinks {\n forYou: Core.AppLink;\n whatsNew: Core.AppLink;\n calendar: Core.AppLink;\n}\n\ninterface DiscoverHeaderProps {\n type: DashboardUserType;\n hasStudentExperience?: boolean;\n appLinks?: DiscoverHeaderAppLinks;\n showCalendar: boolean;\n active: keyof DiscoverHeaderAppLinks;\n}\n\nexport function DiscoverHeader(props: DiscoverHeaderProps): JSX.Element {\n if (!props.type)\n return <></>;\n\n if (props.type === DashboardUserType.Learner || props.hasStudentExperience) {\n return (\n <div className='py-3'>\n <h1 className='h2 mb-0'>\n <Text namespace={namespace} phrase='heading' />\n </h1>\n </div>\n );\n }\n\n const tabs = [{\n name: LanguageService.getPhrase(namespace, 'forYou'),\n appLink: props.appLinks?.forYou,\n active: props.active === 'forYou',\n analyticsData: {\n name: LanguageService.getPhrase(namespace, 'forYou'),\n url: AppLinkHelper.getHref(props.appLinks?.forYou)\n },\n analyticsOptions: {\n actionType: UserAction.Click,\n entity: EntityType.Url,\n location: LocationContext.MagicTabs\n }\n }, {\n name: LanguageService.getPhrase(namespace, 'whatsNew'),\n appLink: props.appLinks?.whatsNew,\n active: props.active === 'whatsNew',\n analyticsData: {\n name: LanguageService.getPhrase(namespace, 'whatsNew'),\n url: AppLinkHelper.getHref(props.appLinks?.whatsNew)\n },\n analyticsOptions: {\n actionType: UserAction.Click,\n entity: EntityType.Url,\n location: LocationContext.MagicTabs\n }\n }];\n\n if (props.showCalendar) {\n tabs.push({\n name: LanguageService.getPhrase(namespace, 'calendar'),\n appLink: props.appLinks?.calendar,\n active: props.active === 'calendar',\n analyticsData: {\n name: LanguageService.getPhrase(namespace, 'calendar'),\n url: AppLinkHelper.getHref(props.appLinks?.calendar)\n },\n analyticsOptions: {\n actionType: UserAction.Click,\n entity: EntityType.Url,\n location: LocationContext.MagicTabs\n }\n });\n }\n\n return (\n <div className='py-3 text-center mx-n3'>\n <PillTabSelector\n tabs={tabs}\n className={styles.pillTab}\n />\n </div>\n );\n}","import React from 'react';\n\nimport { Core } from 'libs/common/core';\nimport { HashObject } from 'libs/common/react/interfaces';\n\nimport { AnalyticsHelper } from 'libs/analytics/AnalyticsHelper';\nimport { AnalyticsOptions } from 'libs/analytics/interfaces';\n\nimport { AppLink } from 'libs/shared/components/app-link/AppLink';\nimport { Badge, BadgeType } from 'libs/shared/components/badges/Badge';\nimport { DivButton } from 'libs/shared/components/div-button/DivButton';\n\nimport { SvgContainer } from '../svg-container/SvgContainer';\n\nimport styles from './pill-tab-selector.scss';\n\ninterface TabContentsProps {\n tab: PillTab;\n}\n\nfunction TabContents(props: TabContentsProps): JSX.Element {\n return (\n <>\n {!!props.tab.svgName && (\n <div className={props.tab.name ? 'pe-1' : ''}>\n <SvgContainer svgName={props.tab.svgName} />\n </div>\n )}\n\n {props.tab.name}\n\n {typeof (props.tab.count) === 'number' && (\n <div className='ps-2'>\n <Badge type={BadgeType.Count} data={props.tab.count} />\n </div>\n )}\n </>\n );\n}\n\nexport interface PillTab {\n name: string;\n active: boolean;\n svgName?: string;\n\n className?: string;\n\n appLink?: Core.AppLink;\n onSelect?: () => void;\n\n analyticsData?: HashObject;\n analyticsOptions?: AnalyticsOptions;\n\n count?: number;\n}\n\ninterface PillTabSelectorProps {\n tabs: PillTab[];\n containerRef?: (el: HTMLElement) => void;\n listClassName?: string;\n className?: string;\n borderRadius?: 'sm' | 'lg'\n}\n\nPillTabSelector.defaultProps = {\n borderRadius: 'lg'\n};\n\nexport function PillTabSelector(props: PillTabSelectorProps): JSX.Element {\n function onSelectTab(tab: PillTab): void {\n if (tab.active || !tab.onSelect)\n return;\n\n tab.onSelect();\n\n if (tab.analyticsData && tab.analyticsOptions)\n AnalyticsHelper.logUserAction(tab.analyticsData, tab.analyticsOptions);\n }\n\n return (\n <nav className={props.className ?? ''} ref={props.containerRef}>\n <ul className={`\n list-unstyled d-inline-block m-0 ${styles.pillTabSelector}\n ${props.borderRadius ? styles.radiusSmall : ''}\n ${props.listClassName}\n `}>\n {props.tabs.map((tab, index) => {\n return (\n <li\n className={`\n p-0 ${styles.tab} ${tab.active ? 'btn btn-dark' : 'btn btn-outline-dark'}\n ${tab.name ? styles.minWidth : ''} ${tab.className}\n `}\n key={index}\n >\n {tab.appLink ? (\n <AppLink\n appLink={tab.appLink}\n analyticsData={tab.analyticsData}\n analyticsOptions={tab.analyticsOptions}\n className={`\n cursor-pointer d-flex align-items-center justify-content-center\n text-decoration-none text-reset px-2 text-nowrap ${styles.tabLink}\n `}\n >\n <TabContents tab={tab} />\n </AppLink>\n ) : (\n <DivButton\n className={`\n cursor-pointer d-flex align-items-center justify-content-center\n text-decoration-none text-reset px-2 text-nowrap ${styles.tabLink}\n `}\n onClick={() => onSelectTab(tab)}\n >\n <TabContents tab={tab} />\n </DivButton>\n )}\n </li>\n );\n })}\n </ul>\n </nav>\n );\n}\n","import React from 'react';\n\nimport { Flight } from 'libs/common/flight';\nimport { ArrayHelper } from 'libs/common/react/utils/ArrayHelper';\n\nimport { BaseObject } from 'libs/shared/interfaces';\n\nconst CHUNK_SIZE = 50;\n\nexport interface UseBatchFetchResult<T extends BaseObject> {\n itemsArr: T[];\n items: { [key: string]: T} | null;\n isFetching: boolean;\n}\n\n/**\n * Used to fetch multiple items by id with Flight. Will fetch 25 items at a time firing off multiple\n * requests if there are more than 25 items.\n * This will return items as null until we have all our items. Items will be returned as an object with\n * their ids as they key for easy mapping\n * \n * @param itemIds \n * @param getRequest \n */\nexport function useBatchFetch<T extends BaseObject>(\n itemIds: string[],\n getRequest: (ids: string[]) => Flight.Request\n): UseBatchFetchResult<T> {\n const chunks = ArrayHelper.chunk<string>(itemIds, CHUNK_SIZE);\n\n const requests = chunks.map(chunk => getRequest(ArrayHelper.uniq(chunk)));\n\n const responses = Flight.useBasicFetchAll<T[]>(requests);\n\n const itemsArr = ArrayHelper.flatten(responses.data);\n const items = responses.data.length\n ? itemsArr.reduce((acc, item) => ({ ...acc, [item.id]: item }), {})\n : null;\n\n return {\n itemsArr,\n items,\n isFetching: responses.isFetching\n };\n}\n\n/**\n * When you need the useBatchFetch() behavior, but your list of objects to hydrate\n * will grow, such as on a scrolling page. useGrowingBatchFetch() will use local state\n * to determine what we've already built a request for and what items are new\n * as to not re-fetch items - Sha\n */\nexport function useGrowingBatchFetch<T>(\n objs: T[],\n getRequest: (items: T[]) => Flight.Request,\n _getKey?: (obj: T) => string\n) {\n const { fetchItems, ...data } = useGrowingBatchFetchFunc({ getRequest, _getKey });\n\n React.useEffect(() => {\n if (!objs?.length)\n return;\n\n fetchItems(objs);\n }, [objs?.length]);\n\n return data;\n}\n\ninterface UseGrowingBatchFetchFuncOptions<T> {\n getRequest: (items: T[]) => Flight.Request;\n _getKey?: (obj: T) => string;\n}\n\n/**\n * When you need the useGrowingBatchFetch() behaviour, but need to trigger the\n * fetch manually and update the objects - Nish \n */\nexport function useGrowingBatchFetchFunc<T>(options: UseGrowingBatchFetchFuncOptions<T>) {\n const getKey = options._getKey ?? ((obj: any) => {\n if (typeof obj === 'object')\n return obj.id;\n\n return obj;\n });\n\n const fetchedItems = React.useRef<Set<string>>(new Set<string>());\n const [ requests, setRequests ] = React.useState<Flight.Request[]>([]);\n\n function fetchItems(objs: T[]) {\n if (!objs?.length)\n return;\n\n const unfetchedItems: T[] = [];\n \n objs.forEach(obj => {\n const key = getKey(obj);\n\n if (fetchedItems.current.has(key))\n return;\n\n unfetchedItems.push(obj);\n fetchedItems.current.add(key);\n });\n \n if (!unfetchedItems.length)\n return;\n \n setRequests(r => ([ ...r, ...ArrayHelper.chunk<T>(unfetchedItems, CHUNK_SIZE).map(options.getRequest) ]));\n }\n\n const responses = Flight.useBasicFetchAll<T[]>(requests);\n const itemsArr = ArrayHelper.flatten(responses.data);\n const items = responses.data.length\n ? itemsArr.reduce((acc, item) => ({ ...acc, [getKey(item)]: item }), {})\n : null;\n\n return {\n hasFirstRequestCompleted: !!responses.responses?.[0]?.hasCompleted,\n itemsArr,\n items,\n isFetching: responses.isFetching,\n fetchItems\n };\n}","// extracted by mini-css-extract-plugin\nexport default {\"banner\":\"B7jhq\"};","import * as React from 'react';\nimport { Spinner } from 'react-bootstrap';\n\nimport { StorageType } from 'libs/common/backbone/utils/LocalStorageHelper';\nimport { Core } from 'libs/common/core';\nimport { useViewModel } from 'libs/common/react/hooks/UseViewModel';\n\nimport { AppLink } from 'libs/shared/components/app-link/AppLink';\nimport { IconButton } from 'libs/shared/components/icon-button/IconButton';\nimport { Text } from 'libs/shared/components/text/Text';\nimport { SharedViewModelKeys } from 'libs/shared/constants/SharedViewModelKeys';\nimport { Classification, PresentationAudience } from 'libs/shared/interfaces';\nimport { cvSvgLibrary } from 'libs/shared/utils/SvgHelper';\n\nimport styles from './classification-banner.scss';\n\nconst namespace = 'contentUpdates.classificationBanner';\n\ninterface ClassificationBannerProps {\n classification: Classification;\n backgroundUrl: string;\n getClassificationAppLink: (classification: Classification, activeAudiences: PresentationAudience[]) => Core.AppLink;\n followed: boolean;\n follow: (classificationId: string, classificationName: string, follow: boolean) => void;\n showFollowSpinner: boolean;\n canFollow: boolean;\n}\n\nexport function ClassificationBanner(props: ClassificationBannerProps): JSX.Element {\n const { classification, backgroundUrl, followed, follow, showFollowSpinner } = props;\n\n const [activeAudiences] = useViewModel<PresentationAudience[]>(\n SharedViewModelKeys.AUDIENCE_FILTER,\n undefined,\n { storage: StorageType.SessionStorage }\n );\n\n return (\n <div\n className={`banner mb-2 d-flex justify-content-between align-items-center rounded ${styles.banner}`}\n style={{ backgroundImage: `url('${backgroundUrl}')` }}\n >\n <AppLink className='text-white text-shadow' appLink={props.getClassificationAppLink(classification, activeAudiences)}>\n <h2 className='h3 mb-0'>{classification.name}</h2>\n </AppLink>\n\n {props.canFollow && (\n <IconButton\n className={`btn follow-btn ${followed ? 'btn-outline-dark' : 'btn-dark'}`}\n svgName={followed ? cvSvgLibrary.BellFilled : cvSvgLibrary.Bell}\n onClick={() => follow(classification.id, classification.name, !followed)}\n >\n {showFollowSpinner\n ? <Spinner as='span' animation='border' role='status' size='sm' />\n : <Text namespace={namespace} phrase={followed ? 'following' : 'follow'} />\n }\n </IconButton>\n )}\n </div>\n );\n}\n","import * as React from 'react';\n\nimport { ContentUpdateAppLinks, VideoWithClassification } from 'libs/shared/apps/content-updates/interfaces';\nimport { AppLink } from 'libs/shared/components/app-link/AppLink';\nimport { Text } from 'libs/shared/components/text/Text';\nimport { VideoList } from 'libs/shared/components/video-list/VideoList';\nimport { ImageSize, ImageType, ResizeType } from 'libs/shared/enums/Images';\nimport { usePermissions } from 'libs/shared/hooks/usePermissions';\nimport { Classification, PresentationAudience } from 'libs/shared/interfaces';\nimport { CommonVideoProps } from 'libs/shared/interfaces/CommonVideoProps';\nimport { ImageHelper } from 'libs/shared/utils/ImageHelper';\n\nimport { InteractiveHelpers } from 'shared/utils/InteractiveHelper';\n\nimport { ClassificationBanner } from 'apps/content-updates/components';\n\nconst namespace = 'contentUpdates.contentUpdatesView';\n\ninterface ClassificationProps {\n classification: Classification;\n videos: VideoWithClassification[];\n showMore: boolean;\n appLinks: ContentUpdateAppLinks;\n followed: boolean;\n follow: (classificationId: string, classificationName: string, follow: boolean) => void;\n showFollowSpinner: boolean;\n canFollow: boolean;\n audiences: PresentationAudience[];\n commonVideoProps: CommonVideoProps;\n}\n\nexport function ContentUpdateClassification(props: ClassificationProps): JSX.Element {\n const { classification, videos, showMore, followed } = props;\n\n const { hasPermissions } = usePermissions();\n\n if (!classification)\n return <></>;\n \n const url = ImageHelper.createBannerUrl(classification.banner, {\n fallbackBaseUrl: props.commonVideoProps.imageCdnUrl,\n fallbackCategoryName: classification.name,\n type: ImageType.Banners\n }, { size: ImageSize.Medium, resizeType: ResizeType.Cover });\n\n return (\n <div className='mb-3'>\n <ClassificationBanner\n classification={classification}\n backgroundUrl={url}\n getClassificationAppLink={props.appLinks.getClassificationAppLink}\n followed={followed}\n follow={props.follow}\n canFollow={props.canFollow}\n showFollowSpinner={props.showFollowSpinner}\n />\n <VideoList\n videos={videos}\n getVideoAppLink={props.appLinks.getVideoAppLink}\n presentationAudiences={props.audiences}\n hasPermissions={hasPermissions}\n getPreviewQuestionsAppLink={interactive => InteractiveHelpers.getPreviewQuestionsAppLink(interactive)}\n commonVideoProps={props.commonVideoProps}\n />\n {showMore &&\n <div className={'show-more'}>\n <AppLink className='info-link' appLink={props.appLinks.getClassificationUpdateAppLink(classification)}>\n <Text namespace={namespace} phrase='showMore' options={{\n classificationName: classification.name\n }} />\n </AppLink>\n </div>\n }\n </div>\n );\n}","// extracted by mini-css-extract-plugin\nexport default {\"partialBanner\":\"bxaA6\"};","import React from 'react';\n\nimport { PartialVideoList } from 'libs/shared/components/video-list/partial-loading/PartialVideoList';\n\nimport styles from './partial-content-updates.scss';\n\nexport function PartialContentUpdates(): JSX.Element {\n return (\n <>\n {Array(4).fill(null).map((s, i) => (\n <div key={i} className='mb-3'>\n <div className={`partial-loading-background mb-2 ${styles.partialBanner}`} />\n <PartialVideoList />\n </div>\n ))}\n </>\n );\n}","import * as React from 'react';\nimport { useDispatch } from 'react-redux';\n\nimport { LanguageService } from 'libs/common/backbone/services/LanguageService';\nimport { Flight } from 'libs/common/flight';\nimport { DateHelper } from 'libs/common/react/utils/DateHelper';\n\nimport { AnalyticsHelper } from 'libs/analytics/AnalyticsHelper';\nimport { EntityType, LocationContext, ToggleDescriptor, UserAction, WorkflowPhase } from 'libs/analytics/interfaces';\n\nimport { ContentUpdateRequests } from 'libs/shared/apps/content-updates/flight-requests/ContentUpdateRequests';\nimport { ClassificationVideosGrouping, ContentUpdate, ContentUpdateAppLinks } from 'libs/shared/apps/content-updates/interfaces';\nimport { DiscoverHeader } from 'libs/shared/apps/discover/components/header/DiscoverHeader';\nimport { AppLink } from 'libs/shared/components/app-link/AppLink';\nimport { Text } from 'libs/shared/components/text/Text';\nimport { VideoActionsContext } from 'libs/shared/context/VideoActionsContext';\nimport { PermissionName } from 'libs/shared/enums/PermissionName';\nimport { PreferenceRequests } from 'libs/shared/flight-requests/PreferenceRequests';\nimport { useAlerts } from 'libs/shared/hooks/UseAlerts';\nimport { useBatchFetch } from 'libs/shared/hooks/UseBatchFetch';\nimport { usePermissions } from 'libs/shared/hooks/usePermissions';\nimport { useSetPageMetadata } from 'libs/shared/hooks/useSetPageMetadata';\nimport { Classification, DashboardUserType, Video } from 'libs/shared/interfaces';\nimport { PageMetadataHelper } from 'libs/shared/utils/PageMetadataHelper';\n\nimport { Actions } from 'shared/constants/LiteActions';\nimport { AppChannels } from 'shared/constants/LiteRadioChannels';\nimport { useVideoActions, VideoActionsLocation } from 'shared/hooks/use-video-actions/useVideoActions';\nimport { useCommonVideoProps } from 'shared/hooks/useCommonVideoProps';\nimport { usePresentation } from 'shared/hooks/usePresentation';\nimport { usePresentationAudiences } from 'shared/hooks/usePresentationAudiences';\nimport { useShowCalendar } from 'shared/hooks/useShowCalendar';\nimport { useVideoMixin } from 'shared/hooks/useVideoMixin';\nimport { SeoHelper } from 'shared/utils/SeoHelper';\n\nimport { ContentUpdateClassification } from './components/ContentUpdateClassification';\nimport { PartialContentUpdates } from './partial-loading/PartialContentUpdates';\n\nconst INITIAL_VIDEO_COUNT = 5;\nconst namespace = 'contentUpdates.contentUpdatesView';\nconst getPhrase = LanguageService.encloseNamespace(namespace);\n\nfunction map(\n contentUpdates: ClassificationVideosGrouping[],\n classifications: {[key: string]: Classification}\n): ContentUpdate[] {\n if (!contentUpdates || !classifications)\n return null;\n\n return contentUpdates.map((c): ContentUpdate => {\n return {\n showMore: c.videos.length > INITIAL_VIDEO_COUNT,\n classification: classifications[c.id],\n videos: c.videos.slice(0, INITIAL_VIDEO_COUNT).map((m: any) => {\n m.classification = classifications[m.id];\n return m;\n }).filter(v => v)\n };\n }).filter(v => v.classification);\n}\n\ninterface FollowSpinnersMap {\n [classificationId: string]: boolean;\n}\n\ninterface ContentUpdatesViewProps {\n appLinks: ContentUpdateAppLinks;\n presentationSlug?: string;\n}\n\nexport function ContentUpdatesView(props: ContentUpdatesViewProps): JSX.Element {\n const [ followSpinners, setFollowSpinners ] = React.useState<FollowSpinnersMap>({});\n\n const dispatch = useDispatch();\n const alerts = useAlerts();\n\n const { hasPermissions } = usePermissions();\n const canFollowSubjects = hasPermissions(PermissionName.FollowSubjects);\n\n const date = new Date();\n const from = DateHelper.format(DateHelper.endOf(DateHelper.subtract(date, 1, 'year'), 'day'), 'YYYY-MM-DD');\n const to = DateHelper.format(DateHelper.endOf(date, 'day'), 'YYYY-MM-DD');\n\n const { activePresentation } = usePresentation({ redirectOnError: true });\n\n useSetPageMetadata(PageMetadataHelper.getDefaultMetadata({\n title: activePresentation?.name,\n phraseContext: {\n phraseHandler: getPhrase,\n titlePhrase: 'pageTitle',\n descriptionPhrase: 'pageDescription'\n },\n canonicalLink: SeoHelper.getCanonicalLink(),\n allowIndexing: SeoHelper.allowIndexing(),\n hrefLang: SeoHelper.getStaticRouteHrefLang(\n activePresentation?.learningLevel,\n () => ({ application: AppChannels.CONTENT_UPDATES, action: Actions.ContentUpdates.CONTENT_UPDATES })\n )\n }));\n\n const contentUpdatesRequest = ContentUpdateRequests.getContentUpdates(activePresentation?.id, from, to);\n const contentUpdates = Flight.useBasicFetch<ClassificationVideosGrouping[]>(\n activePresentation && contentUpdatesRequest\n );\n const subjectPreferences = Flight.useBasicFetch<Classification[]>(canFollowSubjects &&\n PreferenceRequests.mySubjectPreferences());\n\n const audiences = usePresentationAudiences();\n\n /* Map content update response into list of video ids and classification ids*/\n const classificationIds: string[] = [];\n let videos: Video[] = [];\n contentUpdates.data && contentUpdates.data.forEach(c => {\n classificationIds.push(c.id);\n videos = videos.concat(c.videos);\n });\n\n /* Batch fetch the videos and classifications by id */\n const { items: classifications } = useBatchFetch<Classification>(\n classificationIds,\n (ids: string[]) => ContentUpdateRequests.getClassifications(ids)\n );\n\n const videoActions = useVideoActions({ location: VideoActionsLocation.VideoItem });\n \n useVideoMixin(videos, {\n flightNamespace: contentUpdatesRequest.normalizeOptions?.namespace\n });\n\n const { commonVideoProps, hasCommonVideoPropsCompleted } = useCommonVideoProps({\n locationContext: LocationContext.VideoThumbnail,\n flightNamespace: contentUpdatesRequest.normalizeOptions?.namespace\n });\n\n /** Callbacks */\n function onFollow(classificationId: string, classificationName: string, follow: boolean): void {\n setFollowSpinners(currentState => ({\n ...currentState,\n [classificationId]: true\n }));\n\n const onSuccess = () => {\n setFollowSpinners(currentState => ({\n ...currentState,\n [classificationId]: false\n }));\n\n AnalyticsHelper.logUserAction({\n id: classificationId,\n name: classificationName\n }, {\n location: LocationContext.ContentUpdatesClassificationBanner,\n workflowPhase: WorkflowPhase.Complete,\n descriptor: follow ? ToggleDescriptor.On : ToggleDescriptor.Off,\n actionType: UserAction.Follow,\n entity: EntityType.Classification\n });\n\n alerts.success(getPhrase(\n follow ? 'followed' : 'unfollowed',\n { classification: classifications[classificationId]?.name, escapeText: true }\n ));\n };\n\n const onError = () => {\n setFollowSpinners(currentState => ({\n ...currentState,\n [classificationId]: false\n }));\n\n alerts.error(getPhrase('error'));\n };\n\n const request = follow ?\n PreferenceRequests.followSubjects([classificationId], onSuccess, onError) :\n PreferenceRequests.unfollowSubjects([classificationId], onSuccess, onError);\n\n Flight.fetch(dispatch, request);\n }\n\n const { showCalendar, isLoading } = useShowCalendar();\n\n const dataLoaded = !!(\n contentUpdates.hasCompleted &&\n audiences.hasCompleted &&\n (!canFollowSubjects || subjectPreferences.hasCompleted) &&\n classifications &&\n !isLoading &&\n hasCommonVideoPropsCompleted\n );\n\n /* Build out array of content updates from our lists of videos and classifications */\n const mappedUpdates = map(contentUpdates.data, classifications);\n const preferredSubjectIds = subjectPreferences.data?.map(subject => subject.id) ?? [];\n\n const managePreferences = hasPermissions(PermissionName.ManageSubjectPreferences);\n const manageVideoAccess = hasPermissions(PermissionName.ManageVideoAccess);\n\n return (\n <VideoActionsContext.Provider value={videoActions}>\n <div className='bg-white px-3'>\n {!isLoading && <DiscoverHeader\n type={DashboardUserType.Staff} // Students never see this page\n appLinks={{\n forYou: props.appLinks.dashboardAppLink,\n whatsNew: props.appLinks.whatsNewAppLink,\n calendar: props.appLinks.calendarAppLink\n }}\n showCalendar={showCalendar}\n active='whatsNew'\n />}\n <h1><Text namespace={namespace} phrase='heading' /></h1>\n {(managePreferences || manageVideoAccess) && (\n <p>\n {managePreferences &&\n <>\n <Text namespace={namespace} phrase='onlyRelevant' /> \n <AppLink\n className='info-link'\n appLink={{\n application: AppChannels.SETTINGS,\n action: Actions.Settings.TOPIC_PREFERENCES\n }}\n >\n <Text namespace={namespace} phrase='updatePreferences' />\n </AppLink>\n </>\n }\n {manageVideoAccess &&\n <span className='d-block'>\n <AppLink\n className='info-link'\n appLink={{\n application: AppChannels.SETTINGS,\n action: Actions.Settings.CONTENT_REVIEW\n }}\n >\n <Text namespace={namespace} phrase='contentReview' />\n </AppLink>\n </span>\n }\n </p>\n )}\n\n {dataLoaded ? (\n <>\n {mappedUpdates.map((c: ContentUpdate, key: number) => (\n <ContentUpdateClassification\n key={key}\n classification={c.classification}\n videos={c.videos}\n showMore={c.showMore}\n appLinks={props.appLinks}\n followed={preferredSubjectIds.includes(c.classification?.id)}\n follow={onFollow}\n showFollowSpinner={followSpinners[c.classification?.id]}\n canFollow={canFollowSubjects}\n audiences={audiences.data}\n commonVideoProps={commonVideoProps}\n />\n ))}\n </>\n ) : (\n <PartialContentUpdates />\n )}\n </div>\n </VideoActionsContext.Provider>\n );\n}\n","import { Core } from 'libs/common/backbone/index';\nimport { Flight } from 'libs/common/react/index';\n\nimport { LocationContext } from 'libs/analytics/interfaces';\n\nimport { PermissionName } from 'libs/shared/enums/PermissionName';\nimport { ConfigRequests } from 'libs/shared/flight-requests/ConfigRequests';\nimport { CustomerRequests } from 'libs/shared/flight-requests/CustomerRequests';\nimport { UserRequests } from 'libs/shared/flight-requests/UserRequests';\nimport { usePermissions } from 'libs/shared/hooks/usePermissions';\nimport { useSettings } from 'libs/shared/hooks/useSettings';\nimport { Config, CurrentUser, VideoTypes, YearGroup } from 'libs/shared/interfaces';\nimport { CommonVideoProps } from 'libs/shared/interfaces/CommonVideoProps';\n\nimport { VideoAppLinkHelper } from 'shared/utils/VideoAppLinkHelper';\n\nimport { SeriesAppLinkHelper } from 'apps/series/SeriesAppLinkHelper';\n\nimport { usePluginHelper } from './use-plugin-helper/usePluginHelper';\nimport { useLiteFavourites } from './useLiteFavourites';\n\ninterface UseCommonVideoPropsResult {\n hasCommonVideoPropsCompleted: boolean;\n commonVideoProps: CommonVideoProps;\n}\n\ninterface UseCommonVideoPropsOptions {\n locationContext: LocationContext,\n mtv?: boolean;\n flightNamespace?: string;\n sharedPlaylist?: boolean;\n}\n\nexport function useCommonVideoProps(options: UseCommonVideoPropsOptions): UseCommonVideoPropsResult {\n const { locationContext, mtv, flightNamespace, sharedPlaylist } = options || {};\n\n const { isPlugin, params } = usePluginHelper();\n const { setFavourite, canFavourite } = useLiteFavourites(locationContext, flightNamespace);\n const { hasTopicDirectories, isLoadingSettings } = useSettings(null);\n const { hasPermissions, isLoaded: hasLoadedPermissions } = usePermissions();\n const hasStudentExperience = hasPermissions(PermissionName.StudentExperience);\n\n const config = Flight.useBasicFetch<Config>(ConfigRequests.config());\n const currentUser = Flight.useBasicFetch<CurrentUser>(UserRequests.currentUser());\n const yearGroups = Flight.useBasicFetch<YearGroup[]>(\n currentUser.data?.isAuthenticated && CustomerRequests.yearGroups(currentUser.data.customerId)\n );\n\n function getSubTextAppLink(video: VideoTypes): Core.AppLink {\n if (!('series' in video))\n return null;\n\n /**\n * We do not allow navigating to series on shared playlists when the user is not signed in\n * because most series are customer created and will be empty for public users\n * \n * We do not have to do this for shared series, because all the series links are self referencing\n * - Sha\n */\n if (sharedPlaylist && !currentUser.data?.isAuthenticated)\n return null;\n \n return SeriesAppLinkHelper.getSeriesAppLink(video.series, { mtv });\n }\n\n const hasCommonVideoPropsCompleted = (\n !isLoadingSettings &&\n hasLoadedPermissions &&\n config.hasCompleted &&\n currentUser.hasCompleted &&\n (!currentUser.data?.isAuthenticated || yearGroups.hasCompleted)\n );\n\n return {\n hasCommonVideoPropsCompleted,\n commonVideoProps: {\n subTextType: 'series',\n getSubTextAppLink,\n isPlugin,\n isPluginPopup: !!params?.popup,\n canFavourite,\n setFavourite,\n imageCdnUrl: config.data?.imageCdnUrl,\n yearGroups: yearGroups.data,\n getClassroomGuideAppLink: VideoAppLinkHelper.getClassroomGuideAppLink,\n getInteractiveGuidanceAppLink: VideoAppLinkHelper.getInteractiveGuidanceAppLink,\n getResourceGuidanceAppLink: VideoAppLinkHelper.getResourceGuidanceAppLink,\n showNewVideoIndicator: hasTopicDirectories,\n companyLogoFallbackUrl: null,\n hasStudentExperience\n }\n };\n}","import { Flight } from 'libs/common/react/index';\n\nimport { AudienceRequests } from 'libs/shared/flight-requests/AudienceRequests';\nimport { PresentationAudience } from 'libs/shared/interfaces';\n\nimport { usePresentation } from 'shared/hooks/usePresentation';\n\nexport const usePresentationAudiences = () => {\n const { activePresentation, getFallbackPresentation } = usePresentation({ redirectOnError: true });\n\n const presentation = activePresentation || getFallbackPresentation();\n\n const audiences = Flight.useBasicFetch<PresentationAudience[]>(\n !!presentation &&\n AudienceRequests.presentationAudiences(presentation.id)\n );\n\n return audiences;\n};","import React from 'react';\n\nimport { EnvironmentVariables } from 'libs/common/backbone/services/EnvironmentVariables';\nimport { Flight } from 'libs/common/react/index';\n\nimport { ContentRegion } from 'libs/shared/enums/ContentRegion';\nimport { PresentationLearningLevel } from 'libs/shared/enums/PresentationLearningLevel';\nimport { UserRequests } from 'libs/shared/flight-requests/UserRequests';\nimport { useSettings } from 'libs/shared/hooks/useSettings';\nimport { CurrentUser } from 'libs/shared/interfaces';\nimport { TopicsHelper } from 'libs/shared/utils/topics-helper/TopicsHelper';\n\nimport { usePresentation } from 'shared/hooks/usePresentation';\n\nconst ALLOWED_LEARNING_LEVELS_BY_REGION: Record<ContentRegion, PresentationLearningLevel[]> = {\n [ContentRegion.AU]: [\n // AU Primary Calendar\n PresentationLearningLevel.Level_1\n ],\n [ContentRegion.US]: [\n // US Elementary Calendar\n PresentationLearningLevel.Level_1\n ],\n [ContentRegion.UK]: [\n // UK Primary Calendar\n PresentationLearningLevel.Level_1\n ],\n [ContentRegion.SCOT]: [\n // Scotland Primary Calendar\n PresentationLearningLevel.Level_1\n ],\n [ContentRegion.NZ]: [],\n [ContentRegion.GLOBAL]: []\n};\n\nexport function useShowCalendar() {\n const { hasSpecialEventCalendar, isLoadingSettings } = useSettings(null);\n\n const {\n activePresentation\n } = usePresentation({ redirectOnError: true });\n\n const currentUser = Flight.useBasicFetch<CurrentUser>(UserRequests.currentUser());\n\n const allowedLearningLevels = ALLOWED_LEARNING_LEVELS_BY_REGION[currentUser.data?.contentRegion];\n const learningLevel = TopicsHelper.getMappedPresentationLevel(activePresentation?.learningLevel);\n const learningLevelCantAccess = !allowedLearningLevels?.find(l => {\n return l.toString() === (learningLevel as PresentationLearningLevel)?.toString();\n });\n\n const noSetting = !isLoadingSettings && !hasSpecialEventCalendar;\n\n const [ showCalendar, setShowCalendar ] = React.useState<boolean>(!noSetting && !learningLevelCantAccess);\n\n const [ isLoading, setIsLoading ] = React.useState(isLoadingSettings || !activePresentation?.id);\n\n React.useEffect(() => {\n if (noSetting || learningLevelCantAccess) {\n setShowCalendar(false);\n } else if (!isLoading) {\n setShowCalendar(true);\n }\n setIsLoading(isLoadingSettings || !activePresentation?.id);\n }, [ hasSpecialEventCalendar, activePresentation?.id, isLoading ]);\n\n if (EnvironmentVariables.isDevelopment)\n return { showCalendar: true, isLoading: false };\n\n return { showCalendar, isLoading };\n}","import { Flight } from 'libs/common/react/index';\n\nimport { VideoRequests } from 'libs/shared/flight-requests/VideoRequests';\nimport { useGrowingBatchFetch, useGrowingBatchFetchFunc } from 'libs/shared/hooks/UseBatchFetch';\nimport { Clip, ClipCollection, Video, VideoCollection } from 'libs/shared/interfaces';\nimport { VideoHelper } from 'libs/shared/utils/VideoHelper';\n\ntype Types = Video[] | VideoCollection | Clip[] | ClipCollection;\n\nfunction getValidObjects(objects: Types): (Video | Clip)[] {\n if (!objects)\n return [];\n\n if (Array.isArray(objects))\n return objects.filter(o => !!o && (VideoHelper.isVideo(o) || VideoHelper.isClip(o)));\n\n if ('data' in objects)\n return objects.data.filter(o => !!o && (VideoHelper.isVideo(o) || VideoHelper.isClip(o)));\n\n return [];\n}\n\ninterface VideoMixinOptions {\n /**\n * If the videos that are having new data mixed into are sitting on an explicit Flight namespace,\n * providing that namespace here is required\n */\n flightNamespace?: string;\n}\n\nexport function useVideoMixin(objects: Types, options: VideoMixinOptions = {}) {\n const videoIds = getValidObjects(objects).map(v => v.id);\n\n useGrowingBatchFetch(\n videoIds,\n ids => VideoRequests.videoMixinAssocs(ids, options.flightNamespace),\n null\n );\n}\n\nexport function useVideoMixinFunc(options: VideoMixinOptions = {}) {\n function getRequest(ids: string[]): Flight.Request {\n return VideoRequests.videoMixinAssocs(ids, options.flightNamespace);\n }\n \n function fetchObjects(items: Types) {\n return fetchItems(getValidObjects(items).map(v => v.id));\n }\n\n const { fetchItems } = useGrowingBatchFetchFunc({ getRequest });\n\n return { fetchObjects };\n}","// extracted by mini-css-extract-plugin\nexport default {\"pillTabSelector\":\"Hdi6o\",\"tab\":\"RvNxr\",\"minWidth\":\"GHSz9\",\"radiusSmall\":\"VhJJa\",\"tabLink\":\"WFyvo\"};"],"names":["namespace","DiscoverHeader","props","type","hasStudentExperience","className","Text","phrase","tabs","name","LanguageService","appLink","appLinks","forYou","active","analyticsData","url","analyticsOptions","actionType","entity","location","whatsNew","showCalendar","push","calendar","PillTabSelector","TabContents","tab","svgName","count","data","ref","containerRef","borderRadius","listClassName","map","index","key","onClick","onSelect","onSelectTab","defaultProps","CHUNK_SIZE","useBatchFetch","itemIds","getRequest","requests","chunk","responses","itemsArr","items","length","reduce","acc","item","id","isFetching","useGrowingBatchFetch","objs","_getKey","useGrowingBatchFetchFunc","fetchItems","options","getKey","obj","fetchedItems","Set","setRequests","hasFirstRequestCompleted","hasCompleted","unfetchedItems","forEach","current","has","add","r","ClassificationBanner","classification","backgroundUrl","followed","follow","showFollowSpinner","activeAudiences","SharedViewModelKeys","undefined","storage","style","backgroundImage","getClassificationAppLink","canFollow","IconButton","Spinner","as","animation","role","size","ContentUpdateClassification","videos","showMore","hasPermissions","usePermissions","ImageHelper","banner","fallbackBaseUrl","commonVideoProps","imageCdnUrl","fallbackCategoryName","resizeType","VideoList","getVideoAppLink","presentationAudiences","audiences","getPreviewQuestionsAppLink","interactive","InteractiveHelper","AppLink","getClassificationUpdateAppLink","classificationName","PartialContentUpdates","Array","fill","s","i","PartialVideoList","INITIAL_VIDEO_COUNT","getPhrase","ContentUpdatesView","followSpinners","setFollowSpinners","dispatch","alerts","canFollowSubjects","PermissionName","date","Date","from","DateHelper","to","activePresentation","usePresentation","redirectOnError","useSetPageMetadata","PageMetadataHelper","title","phraseContext","phraseHandler","titlePhrase","descriptionPhrase","canonicalLink","SeoHelper","allowIndexing","hrefLang","learningLevel","application","action","contentUpdatesRequest","ContentUpdateRequests","contentUpdates","subjectPreferences","PreferenceRequests","usePresentationAudiences","classificationIds","c","concat","classifications","ids","videoActions","useVideoActions","useVideoMixin","flightNamespace","normalizeOptions","useCommonVideoProps","locationContext","hasCommonVideoPropsCompleted","onFollow","classificationId","currentState","onSuccess","AnalyticsHelper","workflowPhase","descriptor","success","escapeText","onError","error","request","useShowCalendar","isLoading","dataLoaded","mappedUpdates","slice","m","filter","v","preferredSubjectIds","subject","managePreferences","manageVideoAccess","VideoActionsContext","value","dashboardAppLink","whatsNewAppLink","calendarAppLink","includes","mtv","sharedPlaylist","isPlugin","params","u","setFavourite","canFavourite","hasTopicDirectories","isLoadingSettings","hasLoadedPermissions","isLoaded","config","currentUser","yearGroups","isAuthenticated","customerId","subTextType","getSubTextAppLink","video","series","isPluginPopup","popup","getClassroomGuideAppLink","getInteractiveGuidanceAppLink","getResourceGuidanceAppLink","showNewVideoIndicator","companyLogoFallbackUrl","getFallbackPresentation","presentation","ALLOWED_LEARNING_LEVELS_BY_REGION","hasSpecialEventCalendar","allowedLearningLevels","contentRegion","learningLevelCantAccess","find","l","toString","noSetting","setShowCalendar","setIsLoading","getValidObjects","objects","isArray","o","videoIds","useVideoMixinFunc","fetchObjects"],"sourceRoot":""}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
/*! For license information please see 9345-a373f08fe5-lite.chunk.js.LICENSE.txt */
|
|
2
|
+
"use strict";(self.webpackChunk_clickview_lite=self.webpackChunk_clickview_lite||[]).push([[9345],{94644:(t,e,r)=>{r.d(e,{r:()=>l});var n=r(50242),o=r(81886),i=r(67058),a=r(14553),c=r(49267),u=r(49075),s={notFound:i.d,forbidden:{rating:a.q,yearLevel:a.q,region:c.a,privacy:a.q},badRequest:u._,internalServerError:u._};function l(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(t){var i;i="number"==typeof t?t:t.status;var a=Object.assign(Object.assign({},s),e);i&&o.Q.Ry.isStatusCodeError(i)&&(i!==n.o.InternalServer?i!==n.o.NotFound?i!==n.o.Forbidden?r.badRequest||o.Q.Ry.throw(new a.badRequest):r.forbidden||o.Q.Ry.throw(new a.forbidden.privacy):r.notFound||o.Q.Ry.throw(new a.notFound):r.internalServerError||o.Q.Ry.throw(new u._))}}},39902:(t,e,r)=>{r.d(e,{FN:()=>m,SW:()=>v,fh:()=>h});var n=r(32735),o=r(20354),i=r(75896);function a(t){return function(t){if(Array.isArray(t))return u(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||c(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function c(t,e){if(t){if("string"==typeof t)return u(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?u(t,e):void 0}}function u(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function s(t){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},s(t)}function l(t,e,r){return(e=function(t){var e=function(t){if("object"!=s(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=s(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==s(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var f=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},d=50;function h(t,e){var r=i.m.chunk(t,d).map((function(t){return e(i.m.uniq(t))})),n=o.a.useBasicFetchAll(r),a=i.m.flatten(n.data),c=n.data.length?a.reduce((function(t,e){return Object.assign(Object.assign({},t),l({},e.id,e))}),{}):null;return{itemsArr:a,items:c,isFetching:n.isFetching}}function m(t,e,r){var o=v({getRequest:e,_getKey:r}),i=o.fetchItems,a=f(o,["fetchItems"]);return n.useEffect((function(){(null==t?void 0:t.length)&&i(t)}),[null==t?void 0:t.length]),a}function v(t){var e,r,u,f,h,m=null!==(e=t._getKey)&&void 0!==e?e:function(t){return"object"===s(t)?t.id:t},v=n.useRef(new Set),p=(f=n.useState([]),h=2,function(t){if(Array.isArray(t))return t}(f)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,c=[],u=!0,s=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(c.push(n.value),c.length!==e);u=!0);}catch(t){s=!0,o=t}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(s)throw o}}return c}}(f,h)||c(f,h)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),y=p[0],g=p[1],b=o.a.useBasicFetchAll(y),w=i.m.flatten(b.data),E=b.data.length?w.reduce((function(t,e){return Object.assign(Object.assign({},t),l({},m(e),e))}),{}):null;return{hasFirstRequestCompleted:!!(null===(u=null===(r=b.responses)||void 0===r?void 0:r[0])||void 0===u?void 0:u.hasCompleted),itemsArr:w,items:E,isFetching:b.isFetching,fetchItems:function(e){if(null==e?void 0:e.length){var r=[];e.forEach((function(t){var e=m(t);v.current.has(e)||(r.push(t),v.current.add(e))})),r.length&&g((function(e){return[].concat(a(e),a(i.m.chunk(r,d).map(t.getRequest)))}))}}}}},60115:(t,e,r)=>{r.d(e,{K:()=>s});var n=r(32735),o=r(50242),i=r(91967),a=400,c=r(45719);function u(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function s(t,e,r,s,l,f){var d,h,m,v,p=(d=(0,n.useState)(0),h=2,function(t){if(Array.isArray(t))return t}(d)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,c=[],u=!0,s=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(c.push(n.value),c.length!==e);u=!0);}catch(t){s=!0,o=t}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(s)throw o}}return c}}(d,h)||function(t,e){if(t){if("string"==typeof t)return u(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?u(t,e):void 0}}(d,h)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),y=p[0],g=p[1],b=e,w=(0,c.P)((function(e){if(!t)return null;var r=t(e);return r?r.key:null}),s,l);return m={fetchNextPage:function(){if(e&&t&&w)return g((function(t){return t+1})),b(w.nextCursor)},hasMore:!!(null==w?void 0:w.nextCursor),isFetching:null==w?void 0:w.isFetching,scrollContainer:f},v=function(){if(!m.isFetching){if(m.scrollContainer){var t=m.scrollContainer;if(t.getBoundingClientRect().height+t.scrollTop<t.scrollHeight-a)return}else if(window.innerHeight+document.documentElement.scrollTop<document.documentElement.scrollHeight-a)return;m.fetchNextPage()}},(0,n.useEffect)((function(){var t=i.q.throttle(v,200),e=m.scrollContainer||window;return m.hasMore&&e.addEventListener("scroll",t),function(){return e.removeEventListener("scroll",t)}}),[m.hasMore,m.fetchNextPage,m.scrollContainer]),(0,n.useEffect)((function(){w&&w.shouldInitialFetch&&e&&(b(),g((function(t){return t+1})))}),[null==w?void 0:w.shouldInitialFetch,e]),(0,n.useEffect)((function(){var t,e;if((null==w?void 0:w.statusCode)&&i.q.isFunction(r)){var n=+(null===(e=null===(t=w.statusCode)||void 0===t?void 0:t.toString())||void 0===e?void 0:e.substr(0,1));n!==o.k.ClientError&&n!==o.k.ServerError||r(y,w.statusCode)}}),[null==w?void 0:w.statusCode]),{items:null==w?void 0:w.items,hasMore:!!(null==w?void 0:w.nextCursor),nextCursor:null==w?void 0:w.nextCursor,isFetching:null==w?void 0:w.isFetching,totalItems:null==w?void 0:w.totalItems,hasFirstPageCompleted:null==w?void 0:w.hasFirstPageCompleted}}},87821:(t,e,r)=>{r.d(e,{p:()=>a});var n=r(99940),o=r(110);function i(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}var a={userVideoHistory:function(t,e,r,n){var i="video:history",a="{gateway}/v1/users/me/watch-history";return t&&(i+=":".concat(t),a+="?cursor=".concat(t)),{key:i,url:a,formatData:function(t){return{data:t.data.map((function(t){var e=o.O.format(t.lastTimeWatched),r=o.O.format(e,"YYYY-MM-DD");return Object.assign(Object.assign({},t),{lastTimeWatched:e,lastDateWatched:r})})),pagination:t.pagination}},success:e,error:r,always:n}},videoHistory:function(t,e,r,n,o){var i=t.sort().map((function(t){return"videoId=".concat(t)}));return{key:"video:history:videos:".concat(i.join("&")),url:"{gateway}/v1/videos/history?".concat(i.join("&")),normalizeOptions:{namespace:e},formatData:function(t){return(null==t?void 0:t.length)?t.map((function(t){return{id:t.videoId,lastProgressPoint:t.lastProgressPoint}})):t},success:r,error:n,always:o}},removeFromHistory:function(t){var e,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return{url:"{gateway}/v1/users/me/videos/".concat(t,"/watch-history"),key:"remove:video:history:".concat(t),type:n.k.DELETE,invalidationKeys:["video:history"].concat((e=r,function(t){if(Array.isArray(t))return i(t)}(e)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(e)||function(t,e){if(t){if("string"==typeof t)return i(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?i(t,e):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()))}}}},79345:(t,e,r)=>{r.r(e),r.d(e,{WatchHistoryView:()=>z});var n=r(32735),o=r(23481),i=r(20354),a=r(49985),c=r(65858),u=r(87801),s=r(83345),l=r(51365),f=r(16714),d=r(69883),h=r(22902),m=r(79612),v=r(58321),p=r(44110),y=r(75896),g=r(110),b=r(75100),w=r(10741),E=r(22490);function S(t){return S="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},S(t)}var P="watchHistory.watchHistoryVideoList";function A(t){var e=(0,h.T)().hasPermissions,r=y.m.groupBy(t.videoHistory,"lastDateWatched"),i={},a=Object.keys(r).sort().reverse();a.forEach((function(e){i[e]=r[e].map((function(e){var r=t.videos.find((function(t){return t.id.toString()===e.videoId.toString()}));return r?Object.assign(Object.assign({},r),{lastProgressPoint:e.lastProgressPoint}):null})).filter(Boolean)}));var c=a.reduce((function(t,e){var r,n,o,a,c=i[e].length,u=c+(null!==(r=t.runningTotal)&&void 0!==r?r:0);return Object.assign(Object.assign({},t),(n={runningTotal:u},a=u-c,(o=function(t){var e=function(t){if("object"!=S(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=S(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==S(e)?e:e+""}(o=e))in n?Object.defineProperty(n,o,{value:a,enumerable:!0,configurable:!0,writable:!0}):n[o]=a,n))}),{});return n.createElement(n.Fragment,null,a.map((function(r){return i[r].length?n.createElement("div",{key:r,className:"pb-3"},n.createElement("h2",{className:"h4"},function(t){var e=g.O.timeSince(new Date(t),"day");return 0===e?o.T.getPhrase(P,"today"):1===e?o.T.getPhrase(P,"yesterday"):g.O.format(t,"Do MMMM")}(r)),n.createElement(b.E4,{videos:i[r],getVideoAppLink:E.W.getAppLink,hasPermissions:e,startingPositionIndex:c[r],presentationAudiences:t.presentationAudiences,getPreviewQuestionsAppLink:function(t){return w.j.getPreviewQuestionsAppLink(t)},commonVideoProps:t.commonVideoProps})):n.createElement(n.Fragment,{key:r})})))}var x=r(87821),O=r(94644),L=r(31949),F=r(1575),j=r(39902),k=r(60115),C=r(97816),I="watchHistory.hooks",T=r(35223),N=r(10671);function H(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}var V="watchHistory.hooks",_=r(97958),D=r(99742),M=r(14070),R=r(97291),G="watchHistory.watchHistoryEmptyState",W=o.T.encloseNamespace(G);function U(t){var e=t.hasDiscover;return n.createElement(s.D.Provider,{value:G},n.createElement(_.u,null,n.createElement(_.u.Image,{src:D.W.EmptyStates.WATCH_HISTORY,altText:W("info")}),n.createElement(_.u.Heading,null,n.createElement(s.x,{phrase:"heading"})),n.createElement(_.u.Info,null,n.createElement(s.x,{phrase:"info"})),e&&n.createElement(_.u.Cta,{text:o.T.getPhrase(G,"cta"),appLink:{application:R.O.DASHBOARD,action:M.e.Dashboard.HOME}})))}function q(){return n.createElement(s.D.Provider,{value:G},n.createElement(_.u,null,n.createElement(_.u.Image,{src:D.W.EmptyStates.WATCH_HISTORY_PUBLIC,altText:W("publicInfo")}),n.createElement(_.u.Heading,null,n.createElement(s.x,{phrase:"publicHeading"})),n.createElement(_.u.Info,null,n.createElement(s.x,{phrase:"publicInfo"})),n.createElement(_.u.Cta,{text:o.T.getPhrase(G,"publicCta"),appLink:{application:R.O.SIGN_UP,action:M.e.SignUp.SIGN_UP},analyticsData:{},analyticsOptions:{actionType:c.Vw.Click,location:c.LZ.WatchHistoryLanding,entity:c.py.AppLink,workflowPhase:c.eu.Start,descriptor:c.Yu.SignUp}})))}var B=r(1860);const Y={partialDate:"vq4eE"};function Q(){return n.createElement(n.Fragment,null,n.createElement("div",{className:"mb-3"},n.createElement("div",{className:"".concat(Y.partialDate," mb-2 partial-loading-background")}),n.createElement(B.S,{numVideos:2})),n.createElement("div",{className:"mb-3"},n.createElement("div",{className:"".concat(Y.partialDate," mb-2 partial-loading-background")}),n.createElement(B.S,{numVideos:3})),n.createElement("div",{className:"mb-3"},n.createElement("div",{className:"".concat(Y.partialDate," mb-2 partial-loading-background")}),n.createElement(B.S,{numVideos:2})),n.createElement("div",{className:"mb-3"},n.createElement("div",{className:"".concat(Y.partialDate," mb-2 partial-loading-background")}),n.createElement(B.S,{numVideos:5})))}function K(t){return K="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},K(t)}function Z(){Z=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function s(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{s({},"")}catch(t){s=function(t,e,r){return t[e]=r}}function l(t,e,r,n){var i=e&&e.prototype instanceof y?e:y,a=Object.create(i.prototype),c=new k(n||[]);return o(a,"_invoke",{value:O(t,r,c)}),a}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=l;var d="suspendedStart",h="suspendedYield",m="executing",v="completed",p={};function y(){}function g(){}function b(){}var w={};s(w,a,(function(){return this}));var E=Object.getPrototypeOf,S=E&&E(E(C([])));S&&S!==r&&n.call(S,a)&&(w=S);var P=b.prototype=y.prototype=Object.create(w);function A(t){["next","throw","return"].forEach((function(e){s(t,e,(function(t){return this._invoke(e,t)}))}))}function x(t,e){function r(o,i,a,c){var u=f(t[o],t,i);if("throw"!==u.type){var s=u.arg,l=s.value;return l&&"object"==K(l)&&n.call(l,"__await")?e.resolve(l.__await).then((function(t){r("next",t,a,c)}),(function(t){r("throw",t,a,c)})):e.resolve(l).then((function(t){s.value=t,a(s)}),(function(t){return r("throw",t,a,c)}))}c(u.arg)}var i;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return i=i?i.then(o,o):o()}})}function O(e,r,n){var o=d;return function(i,a){if(o===m)throw Error("Generator is already running");if(o===v){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=L(c,n);if(u){if(u===p)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===d)throw o=v,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=m;var s=f(e,r,n);if("normal"===s.type){if(o=n.done?v:h,s.arg===p)continue;return{value:s.arg,done:n.done}}"throw"===s.type&&(o=v,n.method="throw",n.arg=s.arg)}}}function L(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,L(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),p;var i=f(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,p;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,p):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,p)}function F(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function j(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function k(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(F,this),this.reset(!0)}function C(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o<e.length;)if(n.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return i.next=i}}throw new TypeError(K(e)+" is not iterable")}return g.prototype=b,o(P,"constructor",{value:b,configurable:!0}),o(b,"constructor",{value:g,configurable:!0}),g.displayName=s(b,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,b):(t.__proto__=b,s(t,u,"GeneratorFunction")),t.prototype=Object.create(P),t},e.awrap=function(t){return{__await:t}},A(x.prototype),s(x.prototype,c,(function(){return this})),e.AsyncIterator=x,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new x(l(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},A(P),s(P,u,"Generator"),s(P,a,(function(){return this})),s(P,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=C,k.prototype={constructor:k,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(j),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function o(n,o){return c.type="throw",c.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),s=n.call(a,"finallyLoc");if(u&&s){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!s)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,p):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),p},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),j(r),p}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;j(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:C(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),p}},e}var $=function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{u(n.next(t))}catch(t){i(t)}}function c(t){try{u(n.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,c)}u((n=n.apply(t,e||[])).next())}))},X="watchHistory.watchHistory";function z(){(0,m.M)({title:o.T.getPhrase(X,"pageTitle")});var t=i.a.useGetFetchAsync(),e=(0,h.T)(),r=e.hasPermissions,y=e.hasLocalPermissions,g=(0,d.Z)(),b=(0,v.U)({locationContext:c.LZ.VideoThumbnail}).commonVideoProps,w=function(){var e=(0,N._)({location:N.i.VideoItem});return Object.assign(Object.assign({},e),{getVideoActions:function(r,n){var i,u={label:o.T.getPhrase(V,"removeFromWatchHistory"),button:!1,svgName:T.vn.Delete,className:"text-danger",onClick:function(){!function(e){$(this,void 0,void 0,Z().mark((function r(){return Z().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.prev=0,r.next=3,t(x.p.removeFromHistory(e.id));case 3:g.success(o.T.getPhrase(X,"removeFromHistorySuccess")),a.k.logUserAction({id:e.id,name:e.name},{entity:c.py.Video,actionType:c.Vw.Click,descriptor:c.XX.RemoveFromWatchHistory,location:c.LZ.VideoListItem}),r.next=10;break;case 7:r.prev=7,r.t0=r.catch(0),g.error(o.T.getPhrase(X,"removeFromHistoryError",{name:e.name}));case 10:case"end":return r.stop()}}),r,null,[[0,7]])})))}(r)},group:"delete"};return[].concat(function(t){if(Array.isArray(t))return H(t)}(i=e.getVideoActions(r,n))||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(i)||function(t,e){if(t){if("string"==typeof t)return H(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?H(t,e):void 0}}(i)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),[u])}})}(),E=function(){var t,e=i.a.useGetFetch(),r=(0,d.Z)(),n=(0,h.T)().hasLocalPermissions,a=i.a.useBasicFetch(L.N.currentUser());function c(t){return x.p.userVideoHistory(t)}function u(t){return e(c(t))}var s=!n(f.E.ViewWatchHistoryLanding)&&a.hasCompleted,l=(0,k.K)(!!s&&c,u,(function(t,e){if(1===t)return(0,O.r)(e);r.error(o.T.getPhrase(I,"error"))})),m=l.items,v=l.hasMore,p=l.isFetching,y=null!==(t=null==m?void 0:m.map((function(t){return t.object})))&&void 0!==t?t:[],g=(0,j.FN)(y.map((function(t){return t.id})),F.R.watchHistoryVideos);return(0,C.V)(y),{videoHistory:m,videos:y,fetchNext:u,isFetching:p,hasMore:v,hasFetchedFirstPage:g.hasFirstRequestCompleted}}(),S=E.videoHistory,P=E.videos,_=E.fetchNext,D=E.hasMore,M=E.hasFetchedFirstPage,R=E.isFetching,G=(0,p.i)();return y(f.E.ViewWatchHistoryLanding)?n.createElement(q,null):n.createElement(s.D.Provider,{value:X},n.createElement("div",{className:"px-3"},n.createElement("h1",{className:"h2"},n.createElement(s.x,{phrase:"heading"})),M?P.length?n.createElement(l.M.Provider,{value:w},n.createElement(A,{videoHistory:S,videos:P,presentationAudiences:G.data,commonVideoProps:b}),(D||R)&&n.createElement(u._,{isFetching:R,fetchNext:_})):n.createElement(U,{hasDiscover:r(f.C.ViewDiscover)}):n.createElement(Q,null)))}},58321:(t,e,r)=>{r.d(e,{U:()=>m});var n=r(20354),o=r(16714),i=r(39151),a=r(1666),c=r(31949),u=r(22902),s=r(37802),l=r(22490),f=r(82431),d=r(46390),h=r(27638);function m(t){var e,r,m,v=t||{},p=v.locationContext,y=v.mtv,g=v.flightNamespace,b=v.sharedPlaylist,w=(0,d.G)(),E=w.isPlugin,S=w.params,P=(0,h.u)(p,g),A=P.setFavourite,x=P.canFavourite,O=(0,s.r)(null),L=O.hasTopicDirectories,F=O.isLoadingSettings,j=(0,u.T)(),k=j.hasPermissions,C=j.isLoaded,I=k(o.C.StudentExperience),T=n.a.useBasicFetch(i.L.config()),N=n.a.useBasicFetch(c.N.currentUser()),H=n.a.useBasicFetch((null===(e=N.data)||void 0===e?void 0:e.isAuthenticated)&&a.h.yearGroups(N.data.customerId));return{hasCommonVideoPropsCompleted:!F&&C&&T.hasCompleted&&N.hasCompleted&&(!(null===(r=N.data)||void 0===r?void 0:r.isAuthenticated)||H.hasCompleted),commonVideoProps:{subTextType:"series",getSubTextAppLink:function(t){var e;return"series"in t?b&&!(null===(e=N.data)||void 0===e?void 0:e.isAuthenticated)?null:f.j.getSeriesAppLink(t.series,{mtv:y}):null},isPlugin:E,isPluginPopup:!!(null==S?void 0:S.popup),canFavourite:x,setFavourite:A,imageCdnUrl:null===(m=T.data)||void 0===m?void 0:m.imageCdnUrl,yearGroups:H.data,getClassroomGuideAppLink:l.W.getClassroomGuideAppLink,getInteractiveGuidanceAppLink:l.W.getInteractiveGuidanceAppLink,getResourceGuidanceAppLink:l.W.getResourceGuidanceAppLink,showNewVideoIndicator:L,companyLogoFallbackUrl:null,hasStudentExperience:I}}}},44110:(t,e,r)=>{r.d(e,{i:()=>a});var n=r(20354),o=r(89454),i=r(86698),a=function(){var t=(0,i.y)({redirectOnError:!0}),e=t.activePresentation,r=t.getFallbackPresentation,a=e||r();return n.a.useBasicFetch(!!a&&o.O.presentationAudiences(a.id))}},97816:(t,e,r)=>{r.d(e,{V:()=>c,l:()=>u});var n=r(1575),o=r(39902),i=r(31908);function a(t){return t?Array.isArray(t)?t.filter((function(t){return!!t&&(i.M.isVideo(t)||i.M.isClip(t))})):"data"in t?t.data.filter((function(t){return!!t&&(i.M.isVideo(t)||i.M.isClip(t))})):[]:[]}function c(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=a(t).map((function(t){return t.id}));(0,o.FN)(r,(function(t){return n.R.videoMixinAssocs(t,e.flightNamespace)}),null)}function u(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=(0,o.SW)({getRequest:function(e){return n.R.videoMixinAssocs(e,t.flightNamespace)}}).fetchItems;return{fetchObjects:function(t){return e(a(t).map((function(t){return t.id})))}}}}}]);
|
|
3
|
+
//# sourceMappingURL=9345-a373f08fe5-lite.chunk.js.map
|