@clickview/lite 0.103.1 → 0.103.2
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/.vite/manifest.json +271 -271
- package/dist/bundles.json +1 -1
- package/dist/en.json +1 -1
- package/dist/scripts/{igSDXA6g.chunk.js → 1WHinyQW.chunk.js} +2 -2
- package/dist/scripts/{igSDXA6g.chunk.js.map → 1WHinyQW.chunk.js.map} +1 -1
- package/dist/scripts/{kMWvzbRv2.chunk.js → B1ag1ah72.chunk.js} +2 -2
- package/dist/scripts/{kMWvzbRv2.chunk.js.map → B1ag1ah72.chunk.js.map} +1 -1
- package/dist/scripts/{D2_GYzlb.chunk.js → B6Pc3q-u.chunk.js} +2 -2
- package/dist/scripts/{D2_GYzlb.chunk.js.map → B6Pc3q-u.chunk.js.map} +1 -1
- package/dist/scripts/{sCuSDiER2.chunk.js → BPbjSFkC2.chunk.js} +2 -2
- package/dist/scripts/{sCuSDiER2.chunk.js.map → BPbjSFkC2.chunk.js.map} +1 -1
- package/dist/scripts/{CNm_4jj62.chunk.js → BZFomoIH2.chunk.js} +2 -2
- package/dist/scripts/BZFomoIH2.chunk.js.map +1 -0
- package/dist/scripts/{CW_rYB-i2.chunk.js → BazdM9Ah2.chunk.js} +2 -2
- package/dist/scripts/{CW_rYB-i2.chunk.js.map → BazdM9Ah2.chunk.js.map} +1 -1
- package/dist/scripts/{BcPrUEuC2.chunk.js → CNPnPJMp2.chunk.js} +2 -2
- package/dist/scripts/{BcPrUEuC2.chunk.js.map → CNPnPJMp2.chunk.js.map} +1 -1
- package/dist/scripts/{Dd23z1_x2.chunk.js → CUp7_5gE2.chunk.js} +2 -2
- package/dist/scripts/{Dd23z1_x2.chunk.js.map → CUp7_5gE2.chunk.js.map} +1 -1
- package/dist/scripts/{C-zUHAyD.chunk.js → CajcIz6S.chunk.js} +2 -2
- package/dist/scripts/{C-zUHAyD.chunk.js.map → CajcIz6S.chunk.js.map} +1 -1
- package/dist/scripts/{Drx3PvJj.chunk.js → Cc9f2ux0.chunk.js} +2 -2
- package/dist/scripts/{Drx3PvJj.chunk.js.map → Cc9f2ux0.chunk.js.map} +1 -1
- package/dist/scripts/Cj_F4Lv92.chunk.js +2 -0
- package/dist/scripts/{C8l37H7t2.chunk.js.map → Cj_F4Lv92.chunk.js.map} +1 -1
- package/dist/scripts/{DFrz_upP2.chunk.js → CtBGtgb32.chunk.js} +2 -2
- package/dist/scripts/{DFrz_upP2.chunk.js.map → CtBGtgb32.chunk.js.map} +1 -1
- package/dist/scripts/{BpiZZWnJ2.chunk.js → CtWAorP42.chunk.js} +2 -2
- package/dist/scripts/{BpiZZWnJ2.chunk.js.map → CtWAorP42.chunk.js.map} +1 -1
- package/dist/scripts/{C3Qd_bbV2.chunk.js → D8mi6CVp2.chunk.js} +2 -2
- package/dist/scripts/{C3Qd_bbV2.chunk.js.map → D8mi6CVp2.chunk.js.map} +1 -1
- package/dist/scripts/{3K2h5K5-.chunk.js → DJfIirut.chunk.js} +2 -2
- package/dist/scripts/{3K2h5K5-.chunk.js.map → DJfIirut.chunk.js.map} +1 -1
- package/dist/scripts/{Cc63s6rS2.chunk.js → DaaQ5htA2.chunk.js} +2 -2
- package/dist/scripts/{Cc63s6rS2.chunk.js.map → DaaQ5htA2.chunk.js.map} +1 -1
- package/dist/scripts/{CHwPLUZK.chunk.js → DkFP4cXM.chunk.js} +2 -2
- package/dist/scripts/{CHwPLUZK.chunk.js.map → DkFP4cXM.chunk.js.map} +1 -1
- package/dist/scripts/{izXlxhJf.chunk.js → Dzy1nQk7.chunk.js} +2 -2
- package/dist/scripts/{izXlxhJf.chunk.js.map → Dzy1nQk7.chunk.js.map} +1 -1
- package/dist/scripts/{DGy8Ldlr.chunk.js → FIUOppmy.chunk.js} +2 -2
- package/dist/scripts/{DGy8Ldlr.chunk.js.map → FIUOppmy.chunk.js.map} +1 -1
- package/dist/scripts/{CPBvCqVK.chunk.js → H511PXuG.chunk.js} +2 -2
- package/dist/scripts/{CPBvCqVK.chunk.js.map → H511PXuG.chunk.js.map} +1 -1
- package/dist/scripts/{D8Op6EUa2.chunk.js → IYIY9hIU2.chunk.js} +2 -2
- package/dist/scripts/{D8Op6EUa2.chunk.js.map → IYIY9hIU2.chunk.js.map} +1 -1
- package/dist/scripts/{app-BHlllGhO.js → app-DvYKGw_S.js} +3 -3
- package/dist/scripts/{app-BHlllGhO.js.map → app-DvYKGw_S.js.map} +1 -1
- package/dist/scripts/{2HZlmQRs2.chunk.js → lJ6ZVpyv2.chunk.js} +2 -2
- package/dist/scripts/{2HZlmQRs2.chunk.js.map → lJ6ZVpyv2.chunk.js.map} +1 -1
- package/package.json +1 -1
- package/dist/scripts/C8l37H7t2.chunk.js +0 -2
- package/dist/scripts/CNm_4jj62.chunk.js.map +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{o as e}from"./DAXXjFlN.chunk.js";import{t}from"./D8uRDrkd.chunk.js";import{t as n}from"./CQyJ7YGa.chunk.js";import{t as r}from"./e57H3T-k.chunk.js";import{t as i}from"./C2w0pmFW.chunk.js";import{t as a}from"./wrLrTezN.chunk.js";import{t as o}from"./CjA4Q5pm.chunk.js";import{l as s,y as c,z as l}from"./NlCAcBdo.chunk.js";import{t as u}from"./CYEpX3hx.chunk.js";import{t as d}from"./Bbp2U9GK2.chunk.js";import{t as f}from"./Ci5E3nqm2.chunk.js";import{n as p}from"./BJUbYu222.chunk.js";import{t as m}from"./C-THHyTP.chunk.js";import{n as h}from"./DSuhq1Rt2.chunk.js";import{t as g}from"./DBHDBu1Y.chunk.js";import{t as _}from"./BHxNnPzi2.chunk.js";import{t as v}from"./Dg1mFtY2.chunk.js";import{t as y}from"./
|
|
2
|
-
//# sourceMappingURL=
|
|
1
|
+
import{o as e}from"./DAXXjFlN.chunk.js";import{t}from"./D8uRDrkd.chunk.js";import{t as n}from"./CQyJ7YGa.chunk.js";import{t as r}from"./e57H3T-k.chunk.js";import{t as i}from"./C2w0pmFW.chunk.js";import{t as a}from"./wrLrTezN.chunk.js";import{t as o}from"./CjA4Q5pm.chunk.js";import{l as s,y as c,z as l}from"./NlCAcBdo.chunk.js";import{t as u}from"./CYEpX3hx.chunk.js";import{t as d}from"./Bbp2U9GK2.chunk.js";import{t as f}from"./Ci5E3nqm2.chunk.js";import{n as p}from"./BJUbYu222.chunk.js";import{t as m}from"./C-THHyTP.chunk.js";import{n as h}from"./DSuhq1Rt2.chunk.js";import{t as g}from"./DBHDBu1Y.chunk.js";import{t as _}from"./BHxNnPzi2.chunk.js";import{t as v}from"./Dg1mFtY2.chunk.js";import{t as y}from"./BZFomoIH2.chunk.js";import{t as b}from"./DyzFu8SA2.chunk.js";import{t as x}from"./nNE51iyg2.chunk.js";var S=e(i()),C={cellDate:`_cellDate_vp37w_1`,label:`_label_vp37w_13`,isHovering:`_isHovering_vp37w_16`,numberWrapper:`_numberWrapper_vp37w_19`},w=a(),T=n.encloseNamespace(`specialEventCalendar.calendarCellDate`);function E(e){let t=o.isSame(y.convertUTCToTimezoneDate(new Date().toISOString(),e.timezone||null),e.date,`day`),n=`${C.cellDate} d-flex flex-nowrap`;t&&(n+=` bg-dark text-white`),e.hasEvent?n+=` text-white`:e.notCurrentMonth&&!e.isHovering&&(n+=` text-secondary`),e.className&&(n+=` ${e.className}`);let[r,i]=p({delay:250});return(0,w.jsxs)(`div`,{className:`${n} ${i?C.isHovering:``}`,ref:r,children:[(0,w.jsx)(`div`,{className:`${C.numberWrapper} d-flex text-center justify-content-center align-items-center flex-shrink-0`,children:o.format(e.date,`D`)}),t&&(0,w.jsx)(`div`,{className:`${C.label} justify-content-start align-items-center`,children:T(`today`)})]})}var D=50;function O(e){return e*50}function k(e){return O(e)+200+D}var A={hardcodedCover:`_hardcodedCover_chonb_1`,tag:`_tag_chonb_1`,date:`_date_chonb_1`,backgroundImage:`_backgroundImage_chonb_1`,eventCard:`_eventCard_chonb_1`,wrapper:`_wrapper_chonb_5`,left:`_left_chonb_5`,right:`_right_chonb_8`,noAnimation:`_noAnimation_chonb_22`,cover:`_cover_chonb_25`,tagWrap:`_tagWrap_chonb_35`,appear:`_appear_chonb_46`,displayDate:`_displayDate_chonb_49`,title:`_title_chonb_53`,titleText:`_titleText_chonb_56`,circle:`_circle_chonb_71`,active:`_active_chonb_78`,arrow:`_arrow_chonb_90`,bottomBar:`_bottomBar_chonb_108`,bottomPlaceholder:`_bottomPlaceholder_chonb_112`,multiEventFilter:`_multiEventFilter_chonb_126`};j.defaultProps={responsiveText:!0};function j(e){let{sliderStep:n,setSliderStep:i}=e,a=e.fadePastEvents?H(e.eventsOnDay):e.eventsOnDay,p=e.eventsOnDay.length>1,y=a.find((e,t)=>t===n)||a[0],C=!!y.endDate,T=e.getBackgroundColor?.(y.content),D=e.getHardCodedEvent?.(y.content),k=e.getIconUrl?.(y.content),j=e.getCoverUrl?.(y.content),M=y.content.status===g.ComingSoon,[N,P]=S.useState(e.hasInitialized?A.appear:``);S.useEffect(()=>{if(!e.hasInitialized){let t=O(e.rowIndex??0),n=window.setTimeout(()=>{P(A.appear)},t);return()=>window.clearTimeout(n)}},[e.hasInitialized]),S.useEffect(()=>{e.isHovering&&e.setHoveredEvent(y)},[e.isHovering,y]),S.useEffect(()=>()=>{e.isHovering&&e.hoveredEvent?.specialEventId===y.specialEventId&&e.setHoveredEvent(null)},[e.isHovering,e.hoveredEvent,y]);function F(){return p?e.getEventsListAppLink?.():M?null:e.getTopicAppLink?.(y.content,r.slugify(y.name))}function I(){let t={date:o.format(e.date,`YYYY-MM-DD`),presentationId:e.presentationId,eventCount:e.eventsOnDay.length};return p?(t.eventId=e.eventsOnDay.map(e=>e.specialEventId).join(`,`),t.topicId=e.eventsOnDay.map(e=>e.content.id).join(`,`)):(t.eventId=y.specialEventId,t.topicId=y.content.id,t.eventStatus=y.content.status),t}let L=I(),R={actionType:l.Click,entity:s.SpecialEvent,location:c.CalendarDay};function z(e){return o.format(e,`YYYY-MM-DD`)}function B(){return`${e.className} ${N} `+[D?`${A.hardcodedCover} position-absolute`:A.backgroundImage,k?`my-auto`:A.cover,M?A.comingSoon:``,e.hasInitialized?A.noAnimation:``,e.isHovering?`rounded-3`:``,e.isMultiEventDate?A.multiEventFilter:``,`company`in y.content?`rounded-circle`:``].join(` `)}function V(e){return`startDateTime`in e.content&&o.isBefore(e.content.startDateTime,new Date)}function H(e){return e.sort((e,t)=>!V(e)&&V(t)?1:V(e)&&!V(t)?-1:0)}return(0,w.jsx)(`div`,{style:{"--calendar-fade-duration":`200ms`},onClick:()=>{M&&u.logUserAction(L,R)},children:(0,w.jsxs)(f,{appLink:F(),analyticsOptions:R,analyticsData:L,className:`position-absolute top-0 start-0 h-100 w-100 text-shadow ${A.wrapper}`,labelledBy:`calendarEvent`,children:[(0,w.jsx)(`div`,{className:`${A.tagWrap} p-1`,children:M&&(0,w.jsx)(b,{className:`justify-content-center p-0 rounded-circle ${A.tag} ${N}`,onlyIcon:!0})}),!e.hideDay&&(0,w.jsx)(E,{date:e.date,notCurrentMonth:e.notCurrentMonth,className:`${A.date} ${N}`,isHovering:e.isHovering,timezone:e.timezone,hasEvent:!0}),(0,w.jsxs)(`div`,{style:{backgroundColor:T},className:`position-absolute d-flex flex-column justify-content-end align-items-center text-white px-1 pt-2 pb-1 ${A.eventCard} ${N} ${e.isHovering?`rounded-3`:``} ${e.isMultiEventDate?A.multiEventFilter:``} ${e.className} ${!e.isHovering&&V(y)?`opacity-50`:``}`,children:[k&&(0,w.jsx)(h,{src:k,alt:y.content.name,className:B()}),j&&!k&&(0,w.jsx)(`div`,{style:{backgroundImage:`url('${j}')`},className:B()}),C&&(0,w.jsx)(`div`,{className:`${A.displayDate}`,children:x.getDisplayDate(y.startDate,y.endDate)}),(0,w.jsx)(`div`,{className:`text-center ${A.title} ${p?`mb-1`:`mb-2`}`,children:(0,w.jsx)(`p`,{id:`calendarEvent`,className:`${e.responsiveText?A.titleText:``} ${e.isHovering?`mb-0`:`clamp-2`} h6`,title:y.name,children:y.name})}),p&&n!==0&&(0,w.jsx)(`div`,{className:`position-absolute bg-white rounded-circle ${A.left}`,children:(0,w.jsx)(d,{onClick:t=>{t.stopPropagation(),t.preventDefault(),i(e=>e-1),u.logUserAction({date:z(e.date),action:`previous`,eventCount:e.eventsOnDay.length},R)},children:(0,w.jsx)(t,{svg:m,className:`d-inline-block svg-container text-dark ${A.arrow}`})})}),p&&n!==e.eventsOnDay.length-1&&(0,w.jsx)(`div`,{className:`position-absolute bg-white rounded-circle ${A.right}`,children:(0,w.jsx)(d,{onClick:t=>{t.stopPropagation(),t.preventDefault(),i(e=>e+1),u.logUserAction({date:z(e.date),action:`next`,eventCount:e.eventsOnDay.length},R)},children:(0,w.jsx)(t,{svg:v,className:`d-inline-block svg-container text-dark ${A.arrow}`})})}),p&&(0,w.jsx)(`div`,{className:`d-flex ${A.bottomBar} ${p?``:A.bottomPlaceholder}`,children:(0,w.jsx)(_,{sliderStep:n,sliderLength:e.eventsOnDay.length,size:`sm`,className:`${e.isHovering?`mb-2`:`mb-1`}`,onSliderDotClick:t=>{i(t),u.logUserAction({date:z(e.date),action:`jump`,eventCount:e.eventsOnDay.length},R)}})})]})]})})}var M={cell:`_cell_34fbn_1`,multiEventCell:`_multiEventCell_34fbn_4`,fadeIn:`_fadeIn_34fbn_1`};function N(e){let t=S.useMemo(()=>e.hoveredEvent?.endDate&&!o.isSame(e.date,e.hoveredEvent?.startDate)&&o.isBetween(o.format(e.date,`YYYY-MM-DD`),e.hoveredEvent?.startDate,e.hoveredEvent?.endDate),[e.hoveredEvent]),n=e.hoveredEvent?e.getBackgroundColor?.(e.hoveredEvent.content):null;return(0,w.jsxs)(`div`,{className:`${M.cell} fw-semibold`,children:[!e.hideDay&&(0,w.jsx)(E,{date:e.date,notCurrentMonth:e.notCurrentMonth,timezone:e.timezone}),t&&!e.isHovering&&(0,w.jsx)(`div`,{style:{backgroundColor:n},className:M.multiEventCell}),e.eventsOnDay?.length>0&&(0,w.jsx)(j,{...e,isMultiEventDate:t&&!e.isHovering})]})}export{k as n,N as t};
|
|
2
|
+
//# sourceMappingURL=BPbjSFkC2.chunk.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sCuSDiER2.chunk.js","names":[],"sources":["../../../../libs/shared/src/apps/calendar/components/calendar-cell-date/calendar-cell-date.module.scss","../../../../libs/shared/src/apps/calendar/components/calendar-cell-date/CalendarCellDate.tsx","../../../../libs/shared/src/apps/calendar/constants/CalendarAnimation.ts","../../../../libs/shared/src/apps/calendar/components/calendar-events/calendar-events.module.scss","../../../../libs/shared/src/apps/calendar/components/calendar-events/CalendarEvents.tsx","../../../../libs/shared/src/apps/calendar/components/calendar-day/calendar-day.module.scss","../../../../libs/shared/src/apps/calendar/components/calendar-day/CalendarDay.tsx"],"sourcesContent":[":local {\n .cellDate {\n z-index: 100;\n position: absolute;\n top: map-get($spacers, 1);\n left: map-get($spacers, 1);\n width: 2rem;\n height: 2rem;\n border-radius: 2rem;\n line-height: 0;\n transition: width 150ms ease-in !important;\n overflow: hidden;\n .label{\n display: flex;\n }\n &.isHovering {\n width: 5.18rem;\n }\n }\n\n .numberWrapper {\n width: 2rem;\n height: 2rem;\n border-radius: 2rem;\n }\n}","import React from 'react';\n\nimport { LanguageService } from 'libs/common/backbone/services/LanguageService';\nimport { DateHelper } from 'libs/common/react/utils/DateHelper';\n\nimport { Timezone } from 'libs/shared/apps/streamable-learning/constants/Timezones';\nimport { TimezoneHelper } from 'libs/shared/apps/streamable-learning/utils/TimezoneHelper';\nimport { useHoverIntent } from 'libs/shared/hooks/UseHover';\n\nimport styles from './calendar-cell-date.module.scss';\n\nconst namespace = 'specialEventCalendar.calendarCellDate';\nconst getPhrase = LanguageService.encloseNamespace(namespace);\n\ninterface CalendarCellDateProps {\n date: Date;\n notCurrentMonth: boolean;\n hasEvent?: boolean;\n className?: string;\n isHovering?: boolean;\n timezone?: Timezone;\n}\n\nexport function CalendarCellDate(props: CalendarCellDateProps): JSX.Element {\n const isToday = DateHelper.isSame(\n TimezoneHelper.convertUTCToTimezoneDate(new Date().toISOString(), props.timezone || null),\n props.date,\n 'day'\n );\n\n let dateClassName = `${styles.cellDate} d-flex flex-nowrap`;\n if (isToday)\n dateClassName += ' bg-dark text-white';\n if (props.hasEvent)\n dateClassName += ' text-white';\n else if (props.notCurrentMonth && !props.isHovering)\n dateClassName += ' text-secondary';\n if (props.className)\n dateClassName += ` ${props.className}`;\n \n const numberClassName = 'd-flex text-center justify-content-center align-items-center flex-shrink-0';\n const [ ref, isHovering ] = useHoverIntent<HTMLDivElement>({ delay: 250 });\n\n return (\n <div className={`${dateClassName} ${isHovering ? styles.isHovering : ''}`} ref={ref}>\n <div className={`${styles.numberWrapper} ${numberClassName}`}>\n {DateHelper.format(props.date, 'D')}\n </div>\n {isToday && (\n <div className={`${styles.label} justify-content-start align-items-center`}>\n {getPhrase('today')}\n </div>\n )}\n </div>\n );\n}\n","export const CALENDAR_STAGGER_INTERVAL_MS = 50;\nexport const CALENDAR_FADE_TRANSITION_MS = 200;\n\n// Extra buffer after the last row's fade completes, so the \"disable transitions\" flip\n// can never race ahead of the fade it's timed against.\nconst CALENDAR_ANIMATION_SAFETY_MARGIN_MS = 50;\n\nexport function getCalendarRowDelayMs(rowIndex: number): number {\n return rowIndex * CALENDAR_STAGGER_INTERVAL_MS;\n}\n\nexport function getCalendarAnimationDurationMs(maxRowIndex: number): number {\n return getCalendarRowDelayMs(maxRowIndex) + CALENDAR_FADE_TRANSITION_MS + CALENDAR_ANIMATION_SAFETY_MARGIN_MS;\n}\n","@import '~styles/utils/mixins';\n@import '~styles/utils/include-media';\n:local {\n $button-bottom: 2.15rem;\n $circle-size: map-get($spacers, 1);\n \n %fade-in {\n opacity: 0;\n transition: opacity var(--calendar-fade-duration, 200ms) ease-in-out;\n }\n\n %slider-on-hover {\n display: none;\n &:hover{\n display: block;\n }\n }\n\n .wrapper {\n &:hover{\n .left {\n display: block;\n }\n .right {\n display: block;\n }\n }\n }\n\n .eventCard {\n top: 0;\n left: 0;\n height: 100%;\n width: 100%;\n @extend %fade-in;\n //fall-back color\n background-color: $gray-900;\n\n }\n .backgroundImage {\n height: 4.5rem;\n width: 4.5rem;\n \n @extend %fade-in;\n &.noAnimation {\n transition: none;\n }\n &.cover{\n top:0;\n left:0;\n width: 100%;\n height: 100%;\n z-index: 1;\n background-repeat: no-repeat;\n background-position: 0 0 !important;\n background-size: cover;\n }\n }\n \n .date {\n @extend %fade-in;\n }\n\n .tagWrap {\n z-index: 4;\n position: absolute;\n right: 0;\n }\n\n .tag {\n @extend %fade-in;\n width: 2rem;\n height: 2rem;\n top: map-get($spacers, 1);\n right: map-get($spacers, 1);\n }\n\n .appear {\n opacity: 1;\n }\n\n .displayDate {\n font-size: 0.625rem;\n z-index: 2;\n }\n\n .title {\n z-index: 2;\n }\n\n $title-font-size: clamp(0.75rem, 1.25vw, 1rem);\n .titleText {\n font-size: $title-font-size;\n padding-bottom: calc($title-font-size * 0.05) !important;\n\n @include media('<=sm') {\n @include clamp(1);\n }\n }\n\n .circle {\n width: $circle-size;\n height: $circle-size;\n border-radius: 50%;\n background-color: $gray-400;\n z-index: 2;\n\n &.active {\n background-color: $blue;\n }\n\n &:not(:last-child) {\n margin-right: map-get($spacers, 2);\n }\n }\n\n .left {\n left: map-get($spacers, 1);\n bottom: 50%;\n transform: translateY(50%);\n z-index: 2;\n .arrow {\n padding-right: 0.1rem;\n }\n display: none;\n\n }\n .right {\n right: map-get($spacers, 1);\n bottom: 50%;\n transform: translateY(50%);\n z-index: 2;\n .arrow {\n padding-left: 0.1rem;\n }\n display: none;\n\n }\n .bottomBar {\n z-index: 3;\n margin-top: 0.125rem;\n }\n .bottomPlaceholder {\n visibility: hidden;\n }\n\n .hardcodedCover {\n top:0;\n left:0;\n width: 100%;\n height: 100%;\n z-index: 1;\n background-size: 100%;\n @extend %fade-in;\n &.noAnimation {\n transition: none;\n }\n }\n\n .multiEventFilter {\n &::before {\n content: '';\n position: absolute;\n height: 100%;\n width: 100%;\n top: 0;\n left: 0;\n background: rgba(255, 255, 255, 0.4);\n }\n }\n}","import React from 'react';\n\nimport { Core } from 'libs/common/backbone/index';\nimport { DateHelper } from 'libs/common/react/utils/DateHelper';\nimport { TextHelper } from 'libs/common/react/utils/TextHelper';\n\nimport { AnalyticsHelper } from 'libs/analytics/AnalyticsHelper';\nimport { AnalyticsOptions, EntityType, HashObject, LocationContext, UserAction } from 'libs/analytics/interfaces';\n\nimport { CalendarCellDate } from 'libs/shared/apps/calendar/components/calendar-cell-date/CalendarCellDate';\nimport { ComingSoonTag } from 'libs/shared/apps/calendar/components/coming-soon-tag/ComingSoonTag';\nimport { CALENDAR_FADE_TRANSITION_MS, getCalendarRowDelayMs } from 'libs/shared/apps/calendar/constants/CalendarAnimation';\nimport { CalendarCellProps } from 'libs/shared/apps/calendar/interfaces/CalendarCellProps';\nimport { SpecialEventHelper } from 'libs/shared/apps/calendar/utils/SpecialEventHelper';\nimport { AppLink } from 'libs/shared/components/app-link/AppLink';\nimport { DivButton } from 'libs/shared/components/div-button/DivButton';\nimport { HoverableProps } from 'libs/shared/components/hover-to-portal-container/HoverToPortalContainer';\nimport { LazyImage } from 'libs/shared/components/lazy-image/LazyImage';\nimport { SliderDots } from 'libs/shared/components/slider-dots/SliderDots';\nimport { SvgContainer } from 'libs/shared/components/svg-container/SvgContainer';\nimport { ClassificationStatus } from 'libs/shared/enums/ClassificationStatus';\nimport { ChevronLeftSvg } from 'libs/shared/images/svg/arrows/ChevronLeftSvg';\nimport { ChevronRightSvg } from 'libs/shared/images/svg/arrows/ChevronRightSvg';\nimport { CalendarEvent, CalendarEventContent } from 'libs/shared/interfaces';\n\nimport styles from './calendar-events.module.scss';\n\ntype CalendarEventsProps = HoverableProps & CalendarCellProps;\n\nCalendarEvents.defaultProps = {\n responsiveText: true\n};\n\nexport function CalendarEvents(props: CalendarEventsProps): JSX.Element {\n const { sliderStep, setSliderStep } = props;\n\n const sortedEventsOnDay = props.fadePastEvents ? sortPastEvents(props.eventsOnDay) : props.eventsOnDay;\n const multiEvents = props.eventsOnDay.length > 1;\n const displayedEvent = sortedEventsOnDay.find((e, idx) => idx === sliderStep) || sortedEventsOnDay[0];\n const multiDayEvent = !!displayedEvent.endDate;\n\n const backgroundColor = props.getBackgroundColor?.(displayedEvent.content);\n\n const hardCodedEvent = props.getHardCodedEvent?.(displayedEvent.content);\n\n const iconUrl = props.getIconUrl?.(displayedEvent.content);\n const coverUrl = props.getCoverUrl?.(displayedEvent.content);\n\n const isComingSoon = displayedEvent.content.status === ClassificationStatus.ComingSoon;\n\n const [ className, setClassName ] = React.useState(!props.hasInitialized ? '' : styles.appear);\n\n React.useEffect(() => {\n if (!props.hasInitialized) {\n const delay = getCalendarRowDelayMs(props.rowIndex ?? 0);\n const timeoutId = window.setTimeout(() => {\n setClassName(styles.appear);\n }, delay);\n return () => window.clearTimeout(timeoutId);\n }\n }, [props.hasInitialized]);\n\n React.useEffect(() => {\n if (props.isHovering) {\n props.setHoveredEvent(displayedEvent);\n }\n }, [ props.isHovering, displayedEvent ]);\n\n React.useEffect(() => {\n return () => {\n if (props.isHovering && props.hoveredEvent?.specialEventId === displayedEvent.specialEventId) {\n props.setHoveredEvent(null);\n }\n };\n }, [ props.isHovering, props.hoveredEvent, displayedEvent ]);\n\n function getAppLink(): Core.AppLink {\n if (multiEvents)\n return props.getEventsListAppLink?.();\n\n if (isComingSoon)\n return null;\n\n return props.getTopicAppLink?.(displayedEvent.content, TextHelper.slugify(displayedEvent.name));\n }\n\n function getAnalyticsData() {\n const analyticsData: HashObject = {\n date: DateHelper.format(props.date, 'YYYY-MM-DD'),\n presentationId: props.presentationId,\n eventCount: props.eventsOnDay.length\n };\n\n if (multiEvents) {\n analyticsData.eventId = props.eventsOnDay.map(e => e.specialEventId).join(',');\n analyticsData.topicId = props.eventsOnDay.map(e => e.content.id).join(',');\n } else {\n analyticsData.eventId = displayedEvent.specialEventId;\n analyticsData.topicId = displayedEvent.content.id;\n analyticsData.eventStatus = displayedEvent.content.status;\n }\n return analyticsData;\n }\n\n const analyticsData = getAnalyticsData();\n\n const analyticsOptions: AnalyticsOptions = {\n actionType: UserAction.Click,\n entity: EntityType.SpecialEvent,\n location: LocationContext.CalendarDay\n };\n\n function formatAnalyticDataDate(date: Date): string {\n return DateHelper.format(date, 'YYYY-MM-DD');\n }\n\n function getBgImageClassName(): string {\n const defaultClassName = `${props.className} ${className} `;\n\n const classes = [\n hardCodedEvent ? `${styles.hardcodedCover} position-absolute` : styles.backgroundImage,\n iconUrl ? 'my-auto' : styles.cover,\n isComingSoon ? styles.comingSoon : '',\n props.hasInitialized ? styles.noAnimation : '',\n props.isHovering ? `rounded-3` : '',\n props.isMultiEventDate ? styles.multiEventFilter : '',\n 'company' in displayedEvent.content ? 'rounded-circle' : ''\n ];\n\n return defaultClassName + classes.join(' ');\n }\n\n function isPastEvent(event: CalendarEvent<CalendarEventContent>) {\n if ('startDateTime' in event.content) {\n return DateHelper.isBefore(event.content.startDateTime, new Date());\n }\n return false;\n }\n\n function sortPastEvents(events: CalendarEvent<CalendarEventContent>[]) {\n return events.sort((a, b) => {\n if (!isPastEvent(a) && isPastEvent(b)) {\n return 1;\n }\n\n if (isPastEvent(a) && !isPastEvent(b)) {\n return -1;\n }\n\n return 0;\n });\n }\n\n const fadeTransitionStyle = { '--calendar-fade-duration': `${CALENDAR_FADE_TRANSITION_MS}ms` } as React.CSSProperties;\n\n return (\n <div\n style={fadeTransitionStyle}\n onClick={() => {\n if (isComingSoon)\n AnalyticsHelper.logUserAction(analyticsData, analyticsOptions);\n }}\n >\n <AppLink\n appLink={getAppLink()}\n analyticsOptions={analyticsOptions}\n analyticsData={analyticsData}\n className={`position-absolute top-0 start-0 h-100 w-100 text-shadow ${styles.wrapper}`}\n labelledBy='calendarEvent'\n >\n <div className={`${styles.tagWrap} p-1`}>\n {isComingSoon && (\n <ComingSoonTag className={`justify-content-center p-0 rounded-circle ${styles.tag} ${className}`} onlyIcon />\n )}\n </div>\n {!props.hideDay && (\n <CalendarCellDate\n date={props.date}\n notCurrentMonth={props.notCurrentMonth}\n className={`${styles.date} ${className}`}\n isHovering={props.isHovering}\n timezone={props.timezone}\n hasEvent\n />\n )}\n\n <div\n style={{ backgroundColor } }\n className={`position-absolute d-flex flex-column justify-content-end align-items-center text-white px-1 pt-2 pb-1 ${styles.eventCard} ${className} ${props.isHovering ? 'rounded-3' : ''} ${props.isMultiEventDate ? styles.multiEventFilter : ''} ${props.className} ${!props.isHovering && isPastEvent(displayedEvent) ? 'opacity-50' : ''}`}\n >\n {iconUrl && <LazyImage src={iconUrl} alt={displayedEvent.content.name} className={getBgImageClassName()} />}\n\n {coverUrl && !iconUrl && (\n <div\n style={{ backgroundImage: `url('${coverUrl}')` }}\n className={getBgImageClassName()}\n />\n )}\n\n {multiDayEvent && (\n <div className={`${styles.displayDate}`}>\n {SpecialEventHelper.getDisplayDate(displayedEvent.startDate, displayedEvent.endDate)}\n </div>\n )}\n <div className={`text-center ${styles.title} ${multiEvents ? 'mb-1' : 'mb-2'}`}>\n <p id='calendarEvent' className={`${props.responsiveText ? styles.titleText : ''} ${props.isHovering ? 'mb-0' : 'clamp-2'} h6`} title={displayedEvent.name}>{displayedEvent.name}</p>\n </div>\n\n {(multiEvents && sliderStep !== 0) && (\n <div className={`position-absolute bg-white rounded-circle ${styles.left}`}>\n <DivButton\n onClick={e => {\n e.stopPropagation();\n e.preventDefault();\n setSliderStep(s => s - 1);\n AnalyticsHelper.logUserAction({ date: formatAnalyticDataDate(props.date), action: 'previous', eventCount: props.eventsOnDay.length }, analyticsOptions);\n }}>\n <SvgContainer\n svg={ChevronLeftSvg}\n className={`d-inline-block svg-container text-dark ${styles.arrow}`}\n />\n </DivButton>\n </div>\n )}\n\n {multiEvents && sliderStep !== props.eventsOnDay.length - 1 && (\n <div className={`position-absolute bg-white rounded-circle ${styles.right}`}>\n <DivButton\n onClick={e => {\n e.stopPropagation();\n e.preventDefault();\n setSliderStep(s => s + 1);\n AnalyticsHelper.logUserAction({ date: formatAnalyticDataDate(props.date), action: 'next', eventCount: props.eventsOnDay.length }, analyticsOptions);\n }}>\n <SvgContainer\n svg={ChevronRightSvg}\n className={`d-inline-block svg-container text-dark ${styles.arrow}`}\n />\n </DivButton>\n </div>\n )}\n\n {multiEvents && (\n <div className={`d-flex ${styles.bottomBar} ${multiEvents ? '' : styles.bottomPlaceholder}`}>\n <SliderDots\n sliderStep={sliderStep}\n sliderLength={props.eventsOnDay.length}\n size='sm'\n className={`${props.isHovering ? 'mb-2' : 'mb-1'}`}\n onSliderDotClick={i => {\n setSliderStep(i);\n AnalyticsHelper.logUserAction({ date: formatAnalyticDataDate(props.date), action: 'jump', eventCount: props.eventsOnDay.length }, analyticsOptions);\n }}\n />\n </div>\n )}\n </div>\n </AppLink>\n </div>\n );\n}\n",":local {\n .cell {\n padding-bottom: 100%;\n }\n\n .multiEventCell {\n height: 100%;\n width: 100%;\n position: absolute;\n top: 0;\n left: 0;\n opacity: 0.25;\n z-index: 100;\n animation: fadeIn 0.8s ease-in;\n }\n @keyframes :local(fadeIn) {\n 0% {\n opacity: 0.1;\n }\n 20% {\n opacity: 0.25;\n }\n }\n}","import React from 'react';\n\nimport { DateHelper } from 'libs/common/react/utils/DateHelper';\n\nimport { CalendarCellDate } from 'libs/shared/apps/calendar/components/calendar-cell-date/CalendarCellDate';\nimport { CalendarEvents } from 'libs/shared/apps/calendar/components/calendar-events/CalendarEvents';\nimport { CalendarCellProps } from 'libs/shared/apps/calendar/interfaces/CalendarCellProps';\nimport { HoverableProps } from 'libs/shared/components/hover-to-portal-container/HoverToPortalContainer';\n\nimport styles from './calendar-day.module.scss';\n\ntype CalendarDayProps = HoverableProps & CalendarCellProps;\n\nexport function CalendarDay(props: CalendarDayProps) {\n const isMultiEventDate = React.useMemo(\n () =>\n props.hoveredEvent?.endDate &&\n !DateHelper.isSame(props.date, props.hoveredEvent?.startDate) &&\n DateHelper.isBetween(\n DateHelper.format(props.date, 'YYYY-MM-DD'),\n props.hoveredEvent?.startDate,\n props.hoveredEvent?.endDate\n ),\n [props.hoveredEvent]\n );\n const backgroundColor = props.hoveredEvent ? props.getBackgroundColor?.(props.hoveredEvent.content) : null;\n\n return (\n <div className={`${styles.cell} fw-semibold`}>\n {!props.hideDay && (\n <CalendarCellDate\n date={props.date}\n notCurrentMonth={props.notCurrentMonth}\n timezone={props.timezone}\n />\n )}\n {isMultiEventDate && !props.isHovering && (\n <div style={{ backgroundColor }} className={styles.multiEventCell}></div>\n )}\n {props.eventsOnDay?.length > 0 && (\n <CalendarEvents {...props}\n isMultiEventDate={isMultiEventDate && !props.isHovering}\n />\n )}\n </div>\n );\n}\n"],"mappings":"u8BCYM,EAAY,EAAgB,iBAAiB,uCAAS,EAW5D,SAAgB,EAAiB,EAA2C,CAC1E,IAAM,EAAU,EAAW,OACzB,EAAe,yBAAyB,IAAI,KAAK,CAAA,CAAE,YAAY,EAAG,EAAM,UAAY,IAAI,EACxF,EAAM,KACN,KACF,EAEI,EAAgB,GAAG,EAAO,SAAS,qBACnC,IACF,GAAiB,uBACf,EAAM,SACR,GAAiB,cACV,EAAM,iBAAmB,CAAC,EAAM,aACvC,GAAiB,mBACf,EAAM,YACR,GAAiB,IAAI,EAAM,aAE7B,GACM,CAAE,EAAK,GAAe,EAA+B,CAAE,MAAO,GAAI,CAAC,EAEzE,OACE,EAAA,EAAA,KAAA,CAAC,MAAD,CAAK,UAAW,GAAG,EAAc,GAAG,EAAa,EAAO,WAAa,KAAW,eAAhF,EACE,EAAA,EAAA,IAAA,CAAC,MAAD,CAAK,UAAW,GAAG,EAAO,cAAc,sFACrC,EAAW,OAAO,EAAM,KAAM,GAAG,CAC/B,CAAA,EACJ,IACC,EAAA,EAAA,IAAA,CAAC,MAAD,CAAK,UAAW,GAAG,EAAO,MAAM,oDAC7B,EAAU,OAAO,CACf,CAAA,CAEJ,GAET,CClDA,IAAM,EAAsC,GAE5C,SAAgB,EAAsB,EAA0B,CAC9D,OAAO,EAAA,EACT,CAEA,SAAgB,EAA+B,EAA6B,CAC1E,OAAO,E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ACL,UAAW,GAAG,EAAM,WAAa,OAAS,SAC1C,iBAAkB,GAAK,CACrB,EAAc,CAAC,EACf,EAAgB,cAAc,CAAE,KAAM,EAAuB,EAAM,IAAI,EAAG,OAAQ,OAAQ,WAAY,EAAM,YAAY,MAAO,EAAG,CAAgB,CACpJ,CACD,CAAA,CACE,CAAA,CAEJ,GACE,GACN,CAAA,CAET,gGEvPA,SAAgB,EAAY,EAAyB,CACnD,IAAM,EAAA,EAAyB,YAE3B,EAAM,cAAc,SACpB,CAAC,EAAW,OAAO,EAAM,KAAM,EAAM,cAAc,SAAS,GAC5D,EAAW,UACT,EAAW,OAAO,EAAM,KAAM,YAAY,EAC1C,EAAM,cAAc,UACpB,EAAM,cAAc,OACtB,EACF,CAAC,EAAM,YAAY,CACrB,EACM,EAAkB,EAAM,aAAe,EAAM,qBAAqB,EAAM,aAAa,OAAO,EAAI,KAEtG,OACE,EAAA,EAAA,KAAA,CAAC,MAAD,CAAK,UAAW,GAAG,EAAO,KAAK,uBAA/B,CACG,CAAC,EAAM,UACN,EAAA,EAAA,IAAA,CAAC,EAAD,CACE,KAAM,EAAM,KACZ,gBAAiB,EAAM,gBACvB,SAAU,EAAM,QACjB,CAAA,EAEF,GAAoB,CAAC,EAAM,aAC1B,EAAA,EAAA,IAAA,CAAC,MAAD,CAAK,MAAO,CAAE,iBAAgB,EAAG,UAAW,EAAO,cAAqB,CAAA,EAEzE,EAAM,aAAa,OAAS,IAC3B,EAAA,EAAA,IAAA,CAAC,EAAD,CAAgB,GAAI,EAClB,iBAAkB,GAAoB,CAAC,EAAM,UAC9C,CAAA,CAEA,GAET"}
|
|
1
|
+
{"version":3,"file":"BPbjSFkC2.chunk.js","names":[],"sources":["../../../../libs/shared/src/apps/calendar/components/calendar-cell-date/calendar-cell-date.module.scss","../../../../libs/shared/src/apps/calendar/components/calendar-cell-date/CalendarCellDate.tsx","../../../../libs/shared/src/apps/calendar/constants/CalendarAnimation.ts","../../../../libs/shared/src/apps/calendar/components/calendar-events/calendar-events.module.scss","../../../../libs/shared/src/apps/calendar/components/calendar-events/CalendarEvents.tsx","../../../../libs/shared/src/apps/calendar/components/calendar-day/calendar-day.module.scss","../../../../libs/shared/src/apps/calendar/components/calendar-day/CalendarDay.tsx"],"sourcesContent":[":local {\n .cellDate {\n z-index: 100;\n position: absolute;\n top: map-get($spacers, 1);\n left: map-get($spacers, 1);\n width: 2rem;\n height: 2rem;\n border-radius: 2rem;\n line-height: 0;\n transition: width 150ms ease-in !important;\n overflow: hidden;\n .label{\n display: flex;\n }\n &.isHovering {\n width: 5.18rem;\n }\n }\n\n .numberWrapper {\n width: 2rem;\n height: 2rem;\n border-radius: 2rem;\n }\n}","import React from 'react';\n\nimport { LanguageService } from 'libs/common/backbone/services/LanguageService';\nimport { DateHelper } from 'libs/common/react/utils/DateHelper';\n\nimport { Timezone } from 'libs/shared/apps/streamable-learning/constants/Timezones';\nimport { TimezoneHelper } from 'libs/shared/apps/streamable-learning/utils/TimezoneHelper';\nimport { useHoverIntent } from 'libs/shared/hooks/UseHover';\n\nimport styles from './calendar-cell-date.module.scss';\n\nconst namespace = 'specialEventCalendar.calendarCellDate';\nconst getPhrase = LanguageService.encloseNamespace(namespace);\n\ninterface CalendarCellDateProps {\n date: Date;\n notCurrentMonth: boolean;\n hasEvent?: boolean;\n className?: string;\n isHovering?: boolean;\n timezone?: Timezone;\n}\n\nexport function CalendarCellDate(props: CalendarCellDateProps): JSX.Element {\n const isToday = DateHelper.isSame(\n TimezoneHelper.convertUTCToTimezoneDate(new Date().toISOString(), props.timezone || null),\n props.date,\n 'day'\n );\n\n let dateClassName = `${styles.cellDate} d-flex flex-nowrap`;\n if (isToday)\n dateClassName += ' bg-dark text-white';\n if (props.hasEvent)\n dateClassName += ' text-white';\n else if (props.notCurrentMonth && !props.isHovering)\n dateClassName += ' text-secondary';\n if (props.className)\n dateClassName += ` ${props.className}`;\n \n const numberClassName = 'd-flex text-center justify-content-center align-items-center flex-shrink-0';\n const [ ref, isHovering ] = useHoverIntent<HTMLDivElement>({ delay: 250 });\n\n return (\n <div className={`${dateClassName} ${isHovering ? styles.isHovering : ''}`} ref={ref}>\n <div className={`${styles.numberWrapper} ${numberClassName}`}>\n {DateHelper.format(props.date, 'D')}\n </div>\n {isToday && (\n <div className={`${styles.label} justify-content-start align-items-center`}>\n {getPhrase('today')}\n </div>\n )}\n </div>\n );\n}\n","export const CALENDAR_STAGGER_INTERVAL_MS = 50;\nexport const CALENDAR_FADE_TRANSITION_MS = 200;\n\n// Extra buffer after the last row's fade completes, so the \"disable transitions\" flip\n// can never race ahead of the fade it's timed against.\nconst CALENDAR_ANIMATION_SAFETY_MARGIN_MS = 50;\n\nexport function getCalendarRowDelayMs(rowIndex: number): number {\n return rowIndex * CALENDAR_STAGGER_INTERVAL_MS;\n}\n\nexport function getCalendarAnimationDurationMs(maxRowIndex: number): number {\n return getCalendarRowDelayMs(maxRowIndex) + CALENDAR_FADE_TRANSITION_MS + CALENDAR_ANIMATION_SAFETY_MARGIN_MS;\n}\n","@import '~styles/utils/mixins';\n@import '~styles/utils/include-media';\n:local {\n $button-bottom: 2.15rem;\n $circle-size: map-get($spacers, 1);\n \n %fade-in {\n opacity: 0;\n transition: opacity var(--calendar-fade-duration, 200ms) ease-in-out;\n }\n\n %slider-on-hover {\n display: none;\n &:hover{\n display: block;\n }\n }\n\n .wrapper {\n &:hover{\n .left {\n display: block;\n }\n .right {\n display: block;\n }\n }\n }\n\n .eventCard {\n top: 0;\n left: 0;\n height: 100%;\n width: 100%;\n @extend %fade-in;\n //fall-back color\n background-color: $gray-900;\n\n }\n .backgroundImage {\n height: 4.5rem;\n width: 4.5rem;\n \n @extend %fade-in;\n &.noAnimation {\n transition: none;\n }\n &.cover{\n top:0;\n left:0;\n width: 100%;\n height: 100%;\n z-index: 1;\n background-repeat: no-repeat;\n background-position: 0 0 !important;\n background-size: cover;\n }\n }\n \n .date {\n @extend %fade-in;\n }\n\n .tagWrap {\n z-index: 4;\n position: absolute;\n right: 0;\n }\n\n .tag {\n @extend %fade-in;\n width: 2rem;\n height: 2rem;\n top: map-get($spacers, 1);\n right: map-get($spacers, 1);\n }\n\n .appear {\n opacity: 1;\n }\n\n .displayDate {\n font-size: 0.625rem;\n z-index: 2;\n }\n\n .title {\n z-index: 2;\n }\n\n $title-font-size: clamp(0.75rem, 1.25vw, 1rem);\n .titleText {\n font-size: $title-font-size;\n padding-bottom: calc($title-font-size * 0.05) !important;\n\n @include media('<=sm') {\n @include clamp(1);\n }\n }\n\n .circle {\n width: $circle-size;\n height: $circle-size;\n border-radius: 50%;\n background-color: $gray-400;\n z-index: 2;\n\n &.active {\n background-color: $blue;\n }\n\n &:not(:last-child) {\n margin-right: map-get($spacers, 2);\n }\n }\n\n .left {\n left: map-get($spacers, 1);\n bottom: 50%;\n transform: translateY(50%);\n z-index: 2;\n .arrow {\n padding-right: 0.1rem;\n }\n display: none;\n\n }\n .right {\n right: map-get($spacers, 1);\n bottom: 50%;\n transform: translateY(50%);\n z-index: 2;\n .arrow {\n padding-left: 0.1rem;\n }\n display: none;\n\n }\n .bottomBar {\n z-index: 3;\n margin-top: 0.125rem;\n }\n .bottomPlaceholder {\n visibility: hidden;\n }\n\n .hardcodedCover {\n top:0;\n left:0;\n width: 100%;\n height: 100%;\n z-index: 1;\n background-size: 100%;\n @extend %fade-in;\n &.noAnimation {\n transition: none;\n }\n }\n\n .multiEventFilter {\n &::before {\n content: '';\n position: absolute;\n height: 100%;\n width: 100%;\n top: 0;\n left: 0;\n background: rgba(255, 255, 255, 0.4);\n }\n }\n}","import React from 'react';\n\nimport { Core } from 'libs/common/backbone/index';\nimport { DateHelper } from 'libs/common/react/utils/DateHelper';\nimport { TextHelper } from 'libs/common/react/utils/TextHelper';\n\nimport { AnalyticsHelper } from 'libs/analytics/AnalyticsHelper';\nimport { AnalyticsOptions, EntityType, HashObject, LocationContext, UserAction } from 'libs/analytics/interfaces';\n\nimport { CalendarCellDate } from 'libs/shared/apps/calendar/components/calendar-cell-date/CalendarCellDate';\nimport { ComingSoonTag } from 'libs/shared/apps/calendar/components/coming-soon-tag/ComingSoonTag';\nimport { CALENDAR_FADE_TRANSITION_MS, getCalendarRowDelayMs } from 'libs/shared/apps/calendar/constants/CalendarAnimation';\nimport { CalendarCellProps } from 'libs/shared/apps/calendar/interfaces/CalendarCellProps';\nimport { SpecialEventHelper } from 'libs/shared/apps/calendar/utils/SpecialEventHelper';\nimport { AppLink } from 'libs/shared/components/app-link/AppLink';\nimport { DivButton } from 'libs/shared/components/div-button/DivButton';\nimport { HoverableProps } from 'libs/shared/components/hover-to-portal-container/HoverToPortalContainer';\nimport { LazyImage } from 'libs/shared/components/lazy-image/LazyImage';\nimport { SliderDots } from 'libs/shared/components/slider-dots/SliderDots';\nimport { SvgContainer } from 'libs/shared/components/svg-container/SvgContainer';\nimport { ClassificationStatus } from 'libs/shared/enums/ClassificationStatus';\nimport { ChevronLeftSvg } from 'libs/shared/images/svg/arrows/ChevronLeftSvg';\nimport { ChevronRightSvg } from 'libs/shared/images/svg/arrows/ChevronRightSvg';\nimport { CalendarEvent, CalendarEventContent } from 'libs/shared/interfaces';\n\nimport styles from './calendar-events.module.scss';\n\ntype CalendarEventsProps = HoverableProps & CalendarCellProps;\n\nCalendarEvents.defaultProps = {\n responsiveText: true\n};\n\nexport function CalendarEvents(props: CalendarEventsProps): JSX.Element {\n const { sliderStep, setSliderStep } = props;\n\n const sortedEventsOnDay = props.fadePastEvents ? sortPastEvents(props.eventsOnDay) : props.eventsOnDay;\n const multiEvents = props.eventsOnDay.length > 1;\n const displayedEvent = sortedEventsOnDay.find((e, idx) => idx === sliderStep) || sortedEventsOnDay[0];\n const multiDayEvent = !!displayedEvent.endDate;\n\n const backgroundColor = props.getBackgroundColor?.(displayedEvent.content);\n\n const hardCodedEvent = props.getHardCodedEvent?.(displayedEvent.content);\n\n const iconUrl = props.getIconUrl?.(displayedEvent.content);\n const coverUrl = props.getCoverUrl?.(displayedEvent.content);\n\n const isComingSoon = displayedEvent.content.status === ClassificationStatus.ComingSoon;\n\n const [ className, setClassName ] = React.useState(!props.hasInitialized ? '' : styles.appear);\n\n React.useEffect(() => {\n if (!props.hasInitialized) {\n const delay = getCalendarRowDelayMs(props.rowIndex ?? 0);\n const timeoutId = window.setTimeout(() => {\n setClassName(styles.appear);\n }, delay);\n return () => window.clearTimeout(timeoutId);\n }\n }, [props.hasInitialized]);\n\n React.useEffect(() => {\n if (props.isHovering) {\n props.setHoveredEvent(displayedEvent);\n }\n }, [ props.isHovering, displayedEvent ]);\n\n React.useEffect(() => {\n return () => {\n if (props.isHovering && props.hoveredEvent?.specialEventId === displayedEvent.specialEventId) {\n props.setHoveredEvent(null);\n }\n };\n }, [ props.isHovering, props.hoveredEvent, displayedEvent ]);\n\n function getAppLink(): Core.AppLink {\n if (multiEvents)\n return props.getEventsListAppLink?.();\n\n if (isComingSoon)\n return null;\n\n return props.getTopicAppLink?.(displayedEvent.content, TextHelper.slugify(displayedEvent.name));\n }\n\n function getAnalyticsData() {\n const analyticsData: HashObject = {\n date: DateHelper.format(props.date, 'YYYY-MM-DD'),\n presentationId: props.presentationId,\n eventCount: props.eventsOnDay.length\n };\n\n if (multiEvents) {\n analyticsData.eventId = props.eventsOnDay.map(e => e.specialEventId).join(',');\n analyticsData.topicId = props.eventsOnDay.map(e => e.content.id).join(',');\n } else {\n analyticsData.eventId = displayedEvent.specialEventId;\n analyticsData.topicId = displayedEvent.content.id;\n analyticsData.eventStatus = displayedEvent.content.status;\n }\n return analyticsData;\n }\n\n const analyticsData = getAnalyticsData();\n\n const analyticsOptions: AnalyticsOptions = {\n actionType: UserAction.Click,\n entity: EntityType.SpecialEvent,\n location: LocationContext.CalendarDay\n };\n\n function formatAnalyticDataDate(date: Date): string {\n return DateHelper.format(date, 'YYYY-MM-DD');\n }\n\n function getBgImageClassName(): string {\n const defaultClassName = `${props.className} ${className} `;\n\n const classes = [\n hardCodedEvent ? `${styles.hardcodedCover} position-absolute` : styles.backgroundImage,\n iconUrl ? 'my-auto' : styles.cover,\n isComingSoon ? styles.comingSoon : '',\n props.hasInitialized ? styles.noAnimation : '',\n props.isHovering ? `rounded-3` : '',\n props.isMultiEventDate ? styles.multiEventFilter : '',\n 'company' in displayedEvent.content ? 'rounded-circle' : ''\n ];\n\n return defaultClassName + classes.join(' ');\n }\n\n function isPastEvent(event: CalendarEvent<CalendarEventContent>) {\n if ('startDateTime' in event.content) {\n return DateHelper.isBefore(event.content.startDateTime, new Date());\n }\n return false;\n }\n\n function sortPastEvents(events: CalendarEvent<CalendarEventContent>[]) {\n return events.sort((a, b) => {\n if (!isPastEvent(a) && isPastEvent(b)) {\n return 1;\n }\n\n if (isPastEvent(a) && !isPastEvent(b)) {\n return -1;\n }\n\n return 0;\n });\n }\n\n const fadeTransitionStyle = { '--calendar-fade-duration': `${CALENDAR_FADE_TRANSITION_MS}ms` } as React.CSSProperties;\n\n return (\n <div\n style={fadeTransitionStyle}\n onClick={() => {\n if (isComingSoon)\n AnalyticsHelper.logUserAction(analyticsData, analyticsOptions);\n }}\n >\n <AppLink\n appLink={getAppLink()}\n analyticsOptions={analyticsOptions}\n analyticsData={analyticsData}\n className={`position-absolute top-0 start-0 h-100 w-100 text-shadow ${styles.wrapper}`}\n labelledBy='calendarEvent'\n >\n <div className={`${styles.tagWrap} p-1`}>\n {isComingSoon && (\n <ComingSoonTag className={`justify-content-center p-0 rounded-circle ${styles.tag} ${className}`} onlyIcon />\n )}\n </div>\n {!props.hideDay && (\n <CalendarCellDate\n date={props.date}\n notCurrentMonth={props.notCurrentMonth}\n className={`${styles.date} ${className}`}\n isHovering={props.isHovering}\n timezone={props.timezone}\n hasEvent\n />\n )}\n\n <div\n style={{ backgroundColor } }\n className={`position-absolute d-flex flex-column justify-content-end align-items-center text-white px-1 pt-2 pb-1 ${styles.eventCard} ${className} ${props.isHovering ? 'rounded-3' : ''} ${props.isMultiEventDate ? styles.multiEventFilter : ''} ${props.className} ${!props.isHovering && isPastEvent(displayedEvent) ? 'opacity-50' : ''}`}\n >\n {iconUrl && <LazyImage src={iconUrl} alt={displayedEvent.content.name} className={getBgImageClassName()} />}\n\n {coverUrl && !iconUrl && (\n <div\n style={{ backgroundImage: `url('${coverUrl}')` }}\n className={getBgImageClassName()}\n />\n )}\n\n {multiDayEvent && (\n <div className={`${styles.displayDate}`}>\n {SpecialEventHelper.getDisplayDate(displayedEvent.startDate, displayedEvent.endDate)}\n </div>\n )}\n <div className={`text-center ${styles.title} ${multiEvents ? 'mb-1' : 'mb-2'}`}>\n <p id='calendarEvent' className={`${props.responsiveText ? styles.titleText : ''} ${props.isHovering ? 'mb-0' : 'clamp-2'} h6`} title={displayedEvent.name}>{displayedEvent.name}</p>\n </div>\n\n {(multiEvents && sliderStep !== 0) && (\n <div className={`position-absolute bg-white rounded-circle ${styles.left}`}>\n <DivButton\n onClick={e => {\n e.stopPropagation();\n e.preventDefault();\n setSliderStep(s => s - 1);\n AnalyticsHelper.logUserAction({ date: formatAnalyticDataDate(props.date), action: 'previous', eventCount: props.eventsOnDay.length }, analyticsOptions);\n }}>\n <SvgContainer\n svg={ChevronLeftSvg}\n className={`d-inline-block svg-container text-dark ${styles.arrow}`}\n />\n </DivButton>\n </div>\n )}\n\n {multiEvents && sliderStep !== props.eventsOnDay.length - 1 && (\n <div className={`position-absolute bg-white rounded-circle ${styles.right}`}>\n <DivButton\n onClick={e => {\n e.stopPropagation();\n e.preventDefault();\n setSliderStep(s => s + 1);\n AnalyticsHelper.logUserAction({ date: formatAnalyticDataDate(props.date), action: 'next', eventCount: props.eventsOnDay.length }, analyticsOptions);\n }}>\n <SvgContainer\n svg={ChevronRightSvg}\n className={`d-inline-block svg-container text-dark ${styles.arrow}`}\n />\n </DivButton>\n </div>\n )}\n\n {multiEvents && (\n <div className={`d-flex ${styles.bottomBar} ${multiEvents ? '' : styles.bottomPlaceholder}`}>\n <SliderDots\n sliderStep={sliderStep}\n sliderLength={props.eventsOnDay.length}\n size='sm'\n className={`${props.isHovering ? 'mb-2' : 'mb-1'}`}\n onSliderDotClick={i => {\n setSliderStep(i);\n AnalyticsHelper.logUserAction({ date: formatAnalyticDataDate(props.date), action: 'jump', eventCount: props.eventsOnDay.length }, analyticsOptions);\n }}\n />\n </div>\n )}\n </div>\n </AppLink>\n </div>\n );\n}\n",":local {\n .cell {\n padding-bottom: 100%;\n }\n\n .multiEventCell {\n height: 100%;\n width: 100%;\n position: absolute;\n top: 0;\n left: 0;\n opacity: 0.25;\n z-index: 100;\n animation: fadeIn 0.8s ease-in;\n }\n @keyframes :local(fadeIn) {\n 0% {\n opacity: 0.1;\n }\n 20% {\n opacity: 0.25;\n }\n }\n}","import React from 'react';\n\nimport { DateHelper } from 'libs/common/react/utils/DateHelper';\n\nimport { CalendarCellDate } from 'libs/shared/apps/calendar/components/calendar-cell-date/CalendarCellDate';\nimport { CalendarEvents } from 'libs/shared/apps/calendar/components/calendar-events/CalendarEvents';\nimport { CalendarCellProps } from 'libs/shared/apps/calendar/interfaces/CalendarCellProps';\nimport { HoverableProps } from 'libs/shared/components/hover-to-portal-container/HoverToPortalContainer';\n\nimport styles from './calendar-day.module.scss';\n\ntype CalendarDayProps = HoverableProps & CalendarCellProps;\n\nexport function CalendarDay(props: CalendarDayProps) {\n const isMultiEventDate = React.useMemo(\n () =>\n props.hoveredEvent?.endDate &&\n !DateHelper.isSame(props.date, props.hoveredEvent?.startDate) &&\n DateHelper.isBetween(\n DateHelper.format(props.date, 'YYYY-MM-DD'),\n props.hoveredEvent?.startDate,\n props.hoveredEvent?.endDate\n ),\n [props.hoveredEvent]\n );\n const backgroundColor = props.hoveredEvent ? props.getBackgroundColor?.(props.hoveredEvent.content) : null;\n\n return (\n <div className={`${styles.cell} fw-semibold`}>\n {!props.hideDay && (\n <CalendarCellDate\n date={props.date}\n notCurrentMonth={props.notCurrentMonth}\n timezone={props.timezone}\n />\n )}\n {isMultiEventDate && !props.isHovering && (\n <div style={{ backgroundColor }} className={styles.multiEventCell}></div>\n )}\n {props.eventsOnDay?.length > 0 && (\n <Calend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,cAAc,SACpB,CAAC,EAAW,OAAO,EAAM,KAAM,EAAM,cAAc,SAAS,GAC5D,EAAW,UACT,EAAW,OAAO,EAAM,KAAM,YAAY,EAC1C,EAAM,cAAc,UACpB,EAAM,cAAc,OACtB,EACF,CAAC,EAAM,YAAY,CACrB,EACM,EAAkB,EAAM,aAAe,EAAM,qBAAqB,EAAM,aAAa,OAAO,EAAI,KAEtG,OACE,EAAA,EAAA,KAAA,CAAC,MAAD,CAAK,UAAW,GAAG,EAAO,KAAK,uBAA/B,CACG,CAAC,EAAM,UACN,EAAA,EAAA,IAAA,CAAC,EAAD,CACE,KAAM,EAAM,KACZ,gBAAiB,EAAM,gBACvB,SAAU,EAAM,QACjB,CAAA,EAEF,GAAoB,CAAC,EAAM,aAC1B,EAAA,EAAA,IAAA,CAAC,MAAD,CAAK,MAAO,CAAE,iBAAgB,EAAG,UAAW,EAAO,cAAqB,CAAA,EAEzE,EAAM,aAAa,OAAS,IAC3B,EAAA,EAAA,IAAA,CAAC,EAAD,CAAgB,GAAI,EAClB,iBAAkB,GAAoB,CAAC,EAAM,UAC9C,CAAA,CAEA,GAET"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{o as e}from"./DAXXjFlN.chunk.js";import{r as t,t as n}from"./CjA4Q5pm.chunk.js";var r=e(t()),i=function(e){return e.ET=`Eastern Standard Time`,e}({}),a={"Eastern Standard Time":{name:`Eastern Time`,timezone:`America/New_York`,code:`ET`}},o=[`long`,`longGeneric`,`shortGeneric`,`short`,`shortOffset`,`longOffset`];function s(e){try{return Intl.DateTimeFormat.supportedLocalesOf(e).length>0}catch{return!1}}function c(e){try{return Intl.DateTimeFormat(void 0,{timeZone:e}),!0}catch{return!1}}var l={convertToUTCString(e,t=i.ET){return e?n.getUtcStringByTimezone(e,a[t].timezone):``},convertUTCToTimezoneDate(e,t){if(!e)return new Date;let n=new Date(e),r=new Intl.DateTimeFormat(`en-US`,{timeZone:t?a[t].timezone:l.guessTimezone(),year:`numeric`,month:`2-digit`,day:`2-digit`,hour:`2-digit`,minute:`2-digit`}).format(n);return new Date(r)},guessTimezone(){
|
|
2
|
-
//# sourceMappingURL=
|
|
1
|
+
import{o as e}from"./DAXXjFlN.chunk.js";import{r as t,t as n}from"./CjA4Q5pm.chunk.js";var r=e(t()),i=function(e){return e.ET=`Eastern Standard Time`,e}({}),a={"Eastern Standard Time":{name:`Eastern Time`,timezone:`America/New_York`,code:`ET`}},o=[`long`,`longGeneric`,`shortGeneric`,`short`,`shortOffset`,`longOffset`];function s(e){try{return Intl.DateTimeFormat.supportedLocalesOf(e).length>0}catch{return!1}}function c(e){try{return Intl.DateTimeFormat(void 0,{timeZone:e}),!0}catch{return!1}}var l={convertToUTCString(e,t=i.ET){return e?n.getUtcStringByTimezone(e,a[t].timezone):``},convertUTCToTimezoneDate(e,t){if(!e)return new Date;let n=new Date(e),r=new Intl.DateTimeFormat(`en-US`,{timeZone:t?a[t].timezone:l.guessTimezone(),year:`numeric`,month:`2-digit`,day:`2-digit`,hour:`2-digit`,minute:`2-digit`}).format(n);return new Date(r)},guessTimezone(){let e=Intl.DateTimeFormat().resolvedOptions().timeZone;return e===`Etc/Unknown`?a[`Eastern Standard Time`].timezone:e},getTimezoneInfo(e){(!e||!c(e))&&(e=l.guessTimezone());let t=s(r.default.locale())?r.default.locale():void 0;return o.reduce((n,r)=>({...n,[r]:new Intl.DateTimeFormat(t,{timeZone:e,timeZoneName:r}).formatToParts(new Date).find(e=>e.type===`timeZoneName`)?.value}),{})},getTimezones(){return Intl.supportedValuesOf?.(`timeZone`)??[]}};export{i as n,l as t};
|
|
2
|
+
//# sourceMappingURL=BZFomoIH2.chunk.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BZFomoIH2.chunk.js","names":[],"sources":["../../../../libs/shared/src/apps/streamable-learning/constants/Timezones.ts","../../../../libs/shared/src/apps/streamable-learning/utils/TimezoneHelper.ts"],"sourcesContent":["interface TimezoneInfo {\n name: string;\n timezone: string;\n code: string;\n}\n\nexport enum Timezone {\n // This is the timezone ID for .NET which represents the generic 'Eastern Time'\n ET = 'Eastern Standard Time'\n}\n\nexport type Timezones = {\n [key in Timezone]: TimezoneInfo;\n};\n\nexport const TIMEZONES_US: Timezones = {\n [Timezone.ET]: {\n name: 'Eastern Time',\n timezone: 'America/New_York',\n code: 'ET'\n }\n};\n","import dayjs from 'dayjs';\n\nimport { DateHelper } from 'libs/common/react/utils/DateHelper';\n\nimport { Timezone, TIMEZONES_US } from 'libs/shared/apps/streamable-learning/constants/Timezones';\n\n// `Intl.DateTimeFormatOptions['timeZoneName']` is an inline union type, so it has to be pulled out by indexed access\ntype TimeZoneName = NonNullable<Intl.DateTimeFormatOptions['timeZoneName']>;\n\nconst TIMEZONE_OPTIONS = [ 'long', 'longGeneric', 'shortGeneric', 'short', 'shortOffset', 'longOffset' ] as const satisfies readonly TimeZoneName[];\n\n/**\n * Example of the format:\n * long: 'Australian Eastern Standard Time'\n * longGeneric: 'Australian Eastern Time'\n * short: 'GMT+10'\n * shortGeneric: 'Sydney Time',\n * shortOffset: 'GMT+10'\n * longOffset: 'GMT+10:00'\n */\ntype TimeZoneData = Partial<Record<(typeof TIMEZONE_OPTIONS)[number], string>>;\n\nfunction isSupportedLocale(locale: string): boolean {\n try {\n return Intl.DateTimeFormat.supportedLocalesOf(locale).length > 0;\n } catch {\n return false;\n }\n}\n\nfunction isSupportedTimezone(timezone: string): boolean {\n try {\n Intl.DateTimeFormat(undefined, { timeZone: timezone });\n return true;\n } catch {\n return false;\n }\n}\n\nexport const TimezoneHelper = {\n convertToUTCString(datetime: string, timezone: Timezone = Timezone.ET) {\n if (!datetime) return '';\n\n return DateHelper.getUtcStringByTimezone(datetime, TIMEZONES_US[timezone].timezone);\n },\n convertUTCToTimezoneDate(datetime: string, timezone?: Timezone) {\n if (!datetime) return new Date();\n \n const utcDate = new Date(datetime);\n \n const timezoneDateTime = new Intl.DateTimeFormat('en-US', {\n timeZone: timezone ? TIMEZONES_US[timezone].timezone : TimezoneHelper.guessTimezone(),\n year: 'numeric',\n month: '2-digit',\n day: '2-digit',\n hour: '2-digit',\n minute: '2-digit'\n }).format(utcDate);\n\n return new Date(timezoneDateTime);\n },\n\n /** Attempts to infer the user's local IANA timezone from their browser (e.g. \"Australia/Perth\"). */\n guessTimezone(): string {\n const timezone = Intl.DateTimeFormat().resolvedOptions().timeZone;\n\n // Intl.DateTimeFormat().resolvedOptions().timeZone can return 'Etc/Unknown'\n // if the system cannot infer the user's timezone information\n // We are handling by setting a default timezone for them\n return timezone === 'Etc/Unknown' ? TIMEZONES_US['Eastern Standard Time'].timezone : timezone;\n },\n\n /** \n * @param {string} timezone Accepts a value in the format of <Country/City>, e.g. 'America/New_York'\n * @returns {TimeZoneData} Contains the long and short versions of the timezone, which is also split into generic and specific versions. Generic versions do not capture the daylight saving/standard split\n */\n getTimezoneInfo(timezone?: string): TimeZoneData {\n if (!timezone || !isSupportedTimezone(timezone)) {\n timezone = TimezoneHelper.guessTimezone();\n }\n \n const locale = isSupportedLocale(dayjs.locale()) ? dayjs.locale() : undefined;\n\n return TIMEZONE_OPTIONS.reduce<TimeZoneData>(\n (prev, curr) => {\n return {\n ...prev,\n [curr]: (new Intl.DateTimeFormat(locale, { // this handles daylight saving/standard conversion automatically\n timeZone: timezone,\n timeZoneName: curr\n }).formatToParts(new Date())).find(val => val.type === 'timeZoneName')?.value\n };\n },\n {}\n );\n },\n\n getTimezones(): string[] {\n return (Intl as any).supportedValuesOf?.('timeZone') as string[] ?? [];\n }\n\n};\n"],"mappings":"oGAMY,EAAL,SAAA,EAAA,OAEL,GAAA,GAAA,yBACF,EAAA,CAAA,CAAA,EAMa,EAA0B,CAAA,wBACtB,CACb,KAAM,eACN,SAAU,mBACV,KAAM,IACR,CACF,ECZM,EAAmB,CAAE,OAAQ,cAAe,eAAgB,QAAS,cAAe,YAAa,EAavG,SAAS,EAAkB,EAAyB,CAClD,GAAI,CACF,OAAO,KAAK,eAAe,mBAAmB,C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a,oBAAoB,UAAU,GAAiB,CAAC,CACvE,CAEF"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{o as e}from"./DAXXjFlN.chunk.js";import{_ as t,y as n}from"./BftnFbcr.chunk.js";import{n as r}from"./B785hxeE.chunk.js";import{t as i}from"./C2w0pmFW.chunk.js";import{t as a}from"./wrLrTezN.chunk.js";import{t as o}from"./BXTI9cmX.chunk.js";import{u as s}from"./BX0wDJmp.chunk.js";import{t as c}from"./C1SLt-ar.chunk.js";import{y as l}from"./NlCAcBdo.chunk.js";import{r as u}from"./Cr6TXzQQ2.chunk.js";import{t as d}from"./oPIkfKWW2.chunk.js";import{n as f}from"./CmcCVXi32.chunk.js";import{t as p}from"./CcDvlSWl2.chunk.js";import{t as m}from"./DdsRCMkN.chunk.js";import{t as h}from"./BWaKdG0l.chunk.js";import{t as g}from"./PgzMrOyM.chunk.js";import{n as _,t as v}from"./A8xLZrSw.chunk.js";import{t as y}from"./BQKcAczf.chunk.js";import{t as b}from"./DR9DEoQL.chunk.js";import{t as x}from"./GhOuBMgg.chunk.js";import{t as S}from"./DewCxv4i.chunk.js";import{t as C}from"./NVkf8UeY.chunk.js";import{t as w}from"./C2pEjcxD.chunk.js";import{t as T}from"./BmR4qY-v2.chunk.js";import{t as E}from"./DDiorDZl.chunk.js";import{t as D}from"./y3q_PHh_.chunk.js";import{t as O}from"./
|
|
2
|
-
//# sourceMappingURL=
|
|
1
|
+
import{o as e}from"./DAXXjFlN.chunk.js";import{_ as t,y as n}from"./BftnFbcr.chunk.js";import{n as r}from"./B785hxeE.chunk.js";import{t as i}from"./C2w0pmFW.chunk.js";import{t as a}from"./wrLrTezN.chunk.js";import{t as o}from"./BXTI9cmX.chunk.js";import{u as s}from"./BX0wDJmp.chunk.js";import{t as c}from"./C1SLt-ar.chunk.js";import{y as l}from"./NlCAcBdo.chunk.js";import{r as u}from"./Cr6TXzQQ2.chunk.js";import{t as d}from"./oPIkfKWW2.chunk.js";import{n as f}from"./CmcCVXi32.chunk.js";import{t as p}from"./CcDvlSWl2.chunk.js";import{t as m}from"./DdsRCMkN.chunk.js";import{t as h}from"./BWaKdG0l.chunk.js";import{t as g}from"./PgzMrOyM.chunk.js";import{n as _,t as v}from"./A8xLZrSw.chunk.js";import{t as y}from"./BQKcAczf.chunk.js";import{t as b}from"./DR9DEoQL.chunk.js";import{t as x}from"./GhOuBMgg.chunk.js";import{t as S}from"./DewCxv4i.chunk.js";import{t as C}from"./NVkf8UeY.chunk.js";import{t as w}from"./C2pEjcxD.chunk.js";import{t as T}from"./BmR4qY-v2.chunk.js";import{t as E}from"./DDiorDZl.chunk.js";import{t as D}from"./y3q_PHh_.chunk.js";import{t as O}from"./CajcIz6S.chunk.js";import{o as k}from"./YcLj4o6h.chunk.js";import{n as A,t as j}from"./Bp_pLLKM.chunk.js";import{t as M}from"./cX5MHowe.chunk.js";import{r as N}from"./CHQUozwb.chunk.js";import{n as P,t as F}from"./DWeyYfUG.chunk.js";var I=e(i()),L=a();function R(e){let t=c.sortBy(e.dashboard?.widgets,`index`),{setEmptyWidget:n}=A(t);function i(t,n,r){let i=u.getWidgetParams(n,r,u.getDashboardTargetType(e.dashboard),void 0,void 0,{params:{objectId:e.objectData.id}});return e.getWidgetContentRequest(t,i,r)}let a=I.useCallback((e,t)=>{n(e,t)},[n]),o=E.getObjectBannerInfo(e.objectData);return(0,L.jsx)(L.Fragment,{children:!!t.length&&(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(D,{type:`partner-profile`,heading:o.heading,blockColourClass:o.blockColourClass,logo:o.logo,logoBgColour:o.logoBgColour,banner:o.banner,imageCdnUrl:e.commonVideoProps.imageCdnUrl,actions:e.getBannerActions?.(),onClickSignUp:e.onClickSignUp,isAuthenticated:e.isAuthenticated,isStudent:e.hasPermissions(r.StudentExperience)}),(0,L.jsx)(`div`,{className:`py-3 mb-3 border-bottom`,children:(0,L.jsx)(w,{breadcrumbs:e.breadcrumbs})}),(0,L.jsx)(`div`,{className:`mt-3`,children:t.map(t=>(0,L.jsx)(O,{widgetCollection:f.PartnerProfile,dashboardTarget:f.PartnerProfile,id:t.id,getContentRequest:i,name:t.name,description:t.description,templateId:t.templateId,metadata:t.metadata,appLinks:e.widgetAppLinks,widgetTypeId:t.widgetId,hasPermissions:e.hasPermissions,hasLocalPermissions:e.hasLocalPermissions,isPreviewing:e.isReadonly,settings:{hasTopicDirectories:e.settings?.hasTopicDirectories},commonVideoProps:e.commonVideoProps,audiences:e.audiences,setIsEmpty:a,lazyLoad:e.lazyLoad,settingsHash:e.settings,classification:null,hasTableOfContents:!1,seeMoreLink:null,onClickRemoveItem:null,badgeComponent:null},t.id))})]})})}function z(e){let r=P({location:F.VideoItem,presentationSlug:null}),{openInCurationStudioLabel:i,isUserCurator:a,getOpenInCurationStudioLink:c}=N(),{hasPermissions:u,hasLocalPermissions:w}=y(),E=p(null),{commonVideoProps:D}=T({locationContext:l.VideoThumbnail}),O=s(d.currentUser()),A=s(e.objectId&&x.objectDataById(e.objectId)),z=M({name:A.data?.name});v(_.getDefaultMetadata({title:`${A.data?.name}'s Hub`,allowIndexing:!0}));let{dashboard:B}=C({targetType:f.PartnerProfileHub,queryParams:{}});function V(){return a?[{label:i,href:c(B.data?.typeId,B.data?.id),openInNewTab:!0}]:[]}function H(e){n.trigger({application:o.SIGN_UP,action:m.SignUp.SIGN_UP,params:{email:e}})}let U=b.isBot(),W=A.hasCompleted&&B.hasCompleted;return I.useEffect(()=>{!B.hasCompleted||B.data||t.throw(new h)},[B.data,B.hasCompleted]),W?(0,L.jsx)(`div`,{className:`bg-white px-3 position-relative`,children:(0,L.jsx)(k.Provider,{value:r,children:(0,L.jsx)(R,{dashboard:B.data,objectData:A.data,getWidgetContentRequest:S.dashboardWidgetContent,breadcrumbs:z,commonVideoProps:D,getBannerActions:V,hasPermissions:u,hasLocalPermissions:w,settings:E,widgetAppLinks:j(O.data),emptyImageUrl:g.EmptyStates.WATCH_HISTORY,isBot:U,lazyLoad:!U,isAuthenticated:O.data?.isAuthenticated,onClickSignUp:H})})}):(0,L.jsx)(L.Fragment,{})}export{z as ContentPartnersDashboardHubView};
|
|
2
|
+
//# sourceMappingURL=BazdM9Ah2.chunk.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CW_rYB-i2.chunk.js","names":[],"sources":["../../../../libs/shared/src/apps/content-partners/components/content-partner-dashboard-hub/ContentPartnerDashboardHub.tsx","../../src/apps/content-partners/views/content-partners-dashboard-hub/ContentPartnersDashboardHubView.tsx"],"sourcesContent":["import React from 'react';\n\nimport { Flight } from 'libs/common/react/index';\nimport { ArrayHelper } from 'libs/common/react/utils/ArrayHelper';\n\nimport { ContentPartnersHelper } from 'libs/shared/apps/content-partners/utils/ContentPartnersHelper';\nimport { ActionOptions } from 'libs/shared/components/actions/Actions';\nimport { BannerHeader } from 'libs/shared/components/banner-header/BannerHeader';\nimport { Breadcrumb, Breadcrumbs } from 'libs/shared/components/breadcrumbs/Breadcrumbs';\nimport { WidgetContainerView } from 'libs/shared/components/widgets/curated-widgets/WidgetContainerView';\nimport { AllPartnerProfileWidgetTemplates } from 'libs/shared/components/widgets/curated-widgets/WidgetProps';\nimport { PermissionName } from 'libs/shared/enums/PermissionName';\nimport { WidgetTemplate } from 'libs/shared/enums/WidgetTemplate';\nimport { WidgetTypeId } from 'libs/shared/enums/WidgetTypeId';\nimport { useEmptyWidgets } from 'libs/shared/hooks/useEmptyWidgets';\nimport { HasLocalPermissionsFunc, HasPermissionsFunc } from 'libs/shared/hooks/usePermissions';\nimport { Company, CuratedDashboard, CuratedWidgetQueryParams, DashboardTargetType, Person, PresentationAudience } from 'libs/shared/interfaces';\nimport { CommonVideoProps } from 'libs/shared/interfaces/CommonVideoProps';\nimport { CuratedDashboardHelper } from 'libs/shared/utils/DashboardHelper';\n\ntype SupportedContentParterObject = Company | Person;\n\nexport interface ContentPartnerDashboardHubProps {\n dashboard: CuratedDashboard;\n objectData: SupportedContentParterObject;\n getWidgetContentRequest: (\n id: string,\n params: CuratedWidgetQueryParams,\n widgetTemplate: WidgetTemplate\n ) => Flight.Request;\n commonVideoProps: CommonVideoProps;\n getBannerActions?: () => ActionOptions[];\n breadcrumbs?: Breadcrumb[];\n isReadonly?: boolean;\n widgetAppLinks?: AllPartnerProfileWidgetTemplates['appLinks'];\n scrollToWidgetId?: string;\n hasPermissions: HasPermissionsFunc;\n hasLocalPermissions: HasLocalPermissionsFunc;\n settings?: AllPartnerProfileWidgetTemplates['settings'];\n audiences?: PresentationAudience[];\n emptyImageUrl?: string;\n lazyLoad?: boolean;\n isBot?: boolean;\n isComingSoon?: boolean;\n isPreviewing?: boolean;\n isAuthenticated?: boolean;\n onClickSignUp: (email: string) => void;\n}\n\nexport function ContentPartnerDashboardHub(props: ContentPartnerDashboardHubProps): JSX.Element {\n const widgets = ArrayHelper.sortBy(props.dashboard?.widgets, 'index');\n\n const { setEmptyWidget } = useEmptyWidgets(widgets);\n \n function getWidgetContentRequest(id: string, widgetTypeId: WidgetTypeId, template: WidgetTemplate): Flight.Request {\n const params = CuratedDashboardHelper.getWidgetParams(\n widgetTypeId,\n template,\n CuratedDashboardHelper.getDashboardTargetType(props.dashboard),\n undefined,\n undefined,\n {\n params: {\n objectId: props.objectData.id\n }\n }\n );\n\n return props.getWidgetContentRequest(id, params, template);\n }\n\n const onSetIsEmpty = React.useCallback((widgetId: string, isEmpty: boolean) => {\n setEmptyWidget(widgetId, isEmpty);\n }, [setEmptyWidget]);\n\n const bannerInfo = ContentPartnersHelper.getObjectBannerInfo(props.objectData);\n \n return (\n <>\n {!!widgets.length &&\n <>\n <BannerHeader\n type='partner-profile'\n heading={bannerInfo.heading}\n blockColourClass={bannerInfo.blockColourClass}\n logo={bannerInfo.logo}\n logoBgColour={bannerInfo.logoBgColour}\n banner={bannerInfo.banner}\n imageCdnUrl={props.commonVideoProps.imageCdnUrl}\n actions={props.getBannerActions?.()}\n onClickSignUp={props.onClickSignUp}\n isAuthenticated={props.isAuthenticated}\n isStudent={props.hasPermissions(PermissionName.StudentExperience)}\n />\n \n <div className='py-3 mb-3 border-bottom'>\n <Breadcrumbs breadcrumbs={props.breadcrumbs} />\n </div>\n\n <div className='mt-3'>\n {widgets.map(widget => (\n <WidgetContainerView\n widgetCollection={DashboardTargetType.PartnerProfile}\n dashboardTarget={DashboardTargetType.PartnerProfile}\n key={widget.id}\n id={widget.id}\n getContentRequest={getWidgetContentRequest}\n name={widget.name}\n description={widget.description}\n templateId={widget.templateId}\n metadata={widget.metadata}\n appLinks={props.widgetAppLinks}\n widgetTypeId={widget.widgetId}\n hasPermissions={props.hasPermissions}\n hasLocalPermissions={props.hasLocalPermissions}\n isPreviewing={props.isReadonly}\n settings={{\n hasTopicDirectories: props.settings?.hasTopicDirectories\n }}\n commonVideoProps={props.commonVideoProps}\n audiences={props.audiences}\n setIsEmpty={onSetIsEmpty}\n lazyLoad={props.lazyLoad}\n settingsHash={props.settings}\n\n classification={null}\n hasTableOfContents={false}\n seeMoreLink={null}\n onClickRemoveItem={null}\n badgeComponent={null}\n />\n ))}\n </div>\n </>\n }\n </>\n );\n}\n","import React from 'react';\n\nimport { Core } from 'libs/common/backbone/index';\nimport { Flight } from 'libs/common/react/index';\n\nimport { LocationContext } from 'libs/analytics/interfaces';\n\nimport { ContentPartnerDashboardHub } from 'libs/shared/apps/content-partners/components/content-partner-dashboard-hub/ContentPartnerDashboardHub';\nimport { ActionOptions } from 'libs/shared/components/actions/Actions';\nimport { VideoActionsContext } from 'libs/shared/context/VideoActionsContext';\nimport { NotFoundError } from 'libs/shared/errors/general/not-found/NotFoundError';\nimport { DashboardRequests } from 'libs/shared/flight-requests/DashboardRequests';\nimport { UserRequests } from 'libs/shared/flight-requests/UserRequests';\nimport { useBreadcrumbs } from 'libs/shared/hooks/useBreadcrumbs';\nimport { useCurationStudio } from 'libs/shared/hooks/useCurationStudio';\nimport { usePermissions } from 'libs/shared/hooks/usePermissions';\nimport { useSetPageMetadata } from 'libs/shared/hooks/useSetPageMetadata';\nimport { useSettings } from 'libs/shared/hooks/useSettings';\nimport { Company, CurrentUser, DashboardTargetType, Person } from 'libs/shared/interfaces';\nimport { PageMetadataHelper } from 'libs/shared/utils/PageMetadataHelper';\n\nimport { ImageUrls } from 'shared/constants/ImageUrls';\nimport { Actions } from 'shared/constants/LiteActions';\nimport { AppChannels } from 'shared/constants/LiteRadioChannels';\nimport { ContentPartnersRequests } from 'shared/flight-requests/ContentPartnersRequests';\nimport { useVideoActions, VideoActionsLocation } from 'shared/hooks/use-video-actions/useVideoActions';\nimport { useCommonVideoProps } from 'shared/hooks/useCommonVideoProps';\nimport { useFetchCuratedDashboard } from 'shared/utils/DashboardHelper';\nimport { SeoHelper } from 'shared/utils/SeoHelper';\n\nimport { getContentPartnerWidgetAppLinks } from 'apps/content-partners/utils/getContentPartnerWidgetAppLinks';\n\ninterface ContentPartnersDashboardHubViewProps {\n objectId: string;\n}\n\nexport function ContentPartnersDashboardHubView(props: ContentPartnersDashboardHubViewProps): JSX.Element {\n const videoActions = useVideoActions({ location: VideoActionsLocation.VideoItem, presentationSlug: null });\n const { openInCurationStudioLabel, isUserCurator, getOpenInCurationStudioLink } = useCurationStudio();\n const { hasPermissions, hasLocalPermissions } = usePermissions();\n const settings = useSettings(null);\n const { commonVideoProps } = useCommonVideoProps({\n locationContext: LocationContext.VideoThumbnail\n });\n\n const currentUser = Flight.useBasicFetch<CurrentUser>(UserRequests.currentUser());\n const objectData = Flight.useBasicFetch<Company | Person>(\n props.objectId && ContentPartnersRequests.objectDataById(props.objectId)\n );\n\n const breadcrumbs = useBreadcrumbs({ name: objectData.data?.name });\n\n useSetPageMetadata(\n PageMetadataHelper.getDefaultMetadata({\n title: `${objectData.data?.name}'s Hub`,\n allowIndexing: true\n })\n );\n \n const { dashboard } = useFetchCuratedDashboard({\n targetType: DashboardTargetType.PartnerProfileHub,\n queryParams: {}\n });\n\n function getBannerActions(): ActionOptions[] {\n if (!isUserCurator)\n return [];\n\n return [{\n label: openInCurationStudioLabel,\n href: getOpenInCurationStudioLink(dashboard.data?.typeId, dashboard.data?.id),\n openInNewTab: true\n }];\n }\n\n function onClickSignUp(email: string): void {\n Core.AppLinkHelper.trigger({\n application: AppChannels.SIGN_UP,\n action: Actions.SignUp.SIGN_UP,\n params: { email }\n });\n }\n\n const isBot = SeoHelper.isBot();\n\n const loaded = objectData.hasCompleted && dashboard.hasCompleted;\n \n React.useEffect(() => {\n if (!dashboard.hasCompleted || dashboard.data) return;\n\n Core.ErrorHelper.throw(new NotFoundError());\n }, [ dashboard.data, dashboard.hasCompleted ]);\n\n if (!loaded)\n return <></>;\n\n return (\n <div className='bg-white px-3 position-relative'>\n <VideoActionsContext.Provider value={videoActions}>\n <ContentPartnerDashboardHub\n dashboard={dashboard.data}\n objectData={objectData.data}\n getWidgetContentRequest={DashboardRequests.dashboardWidgetContent}\n breadcrumbs={breadcrumbs}\n commonVideoProps={commonVideoProps}\n getBannerActions={getBannerActions}\n hasPermissions={hasPermissions}\n hasLocalPermissions={hasLocalPermissions}\n settings={settings}\n widgetAppLinks={getContentPartnerWidgetAppLinks(currentUser.data)}\n emptyImageUrl={ImageUrls.EmptyStates.WATCH_HISTORY}\n isBot={isBot}\n // Only lazy load if its an actual user\n lazyLoad={!isBot}\n isAuthenticated={currentUser.data?.isAuthenticated}\n onClickSignUp={onClickSignUp}\n />\n </VideoActionsContext.Provider>\n </div>\n );\n}\n"],"mappings":"ozCAiDA,SAAgB,EAA2B,EAAqD,CAC9F,IAAM,EAAU,EAAY,OAAO,EAAM,WAAW,QAAS,OAAO,EAE9D,CAAE,kBAAmB,EAAgB,CAAO,EAElD,SAAS,EAAwB,EAAY,EAA4B,EAA0C,CACjH,IAAM,EAAS,EAAuB,gBACpC,EACA,EACA,EAAuB,uBAAuB,EAAM,SAAS,EAC7D,IAAA,GACA,IAAA,GACA,CACE,OAAQ,CACN,SAAU,EAAM,WAAW,EAC7B,CACF,CACF,EAEA,OAAO,EAAM,wBAAwB,EAAI,EAAQ,CAAQ,CAC3D,C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A,CAAC,EAAoB,SAArB,CAA8B,MAAO,YACnC,EAAA,EAAA,IAAA,CAAC,EAAD,CACE,UAAW,EAAU,KACrB,WAAY,EAAW,KACvB,wBAAyB,EAAkB,uBAC9B,cACK,mBACA,mBACF,iBACK,sBACX,WACV,eAAgB,EAAgC,EAAY,IAAI,EAChE,cAAe,EAAU,YAAY,cAC9B,QAEP,SAAU,CAAC,EACX,gBAAiB,EAAY,MAAM,gBACpB,eAChB,CAAA,CAC2B,CAAA,CAC3B,CAAA,GAxBE,EAAA,EAAA,IAAA,CAAA,EAAA,SAAA,CAAI,CAAA,CA0Bf"}
|
|
1
|
+
{"version":3,"file":"BazdM9Ah2.chunk.js","names":[],"sources":["../../../../libs/shared/src/apps/content-partners/components/content-partner-dashboard-hub/ContentPartnerDashboardHub.tsx","../../src/apps/content-partners/views/content-partners-dashboard-hub/ContentPartnersDashboardHubView.tsx"],"sourcesContent":["import React from 'react';\n\nimport { Flight } from 'libs/common/react/index';\nimport { ArrayHelper } from 'libs/common/react/utils/ArrayHelper';\n\nimport { ContentPartnersHelper } from 'libs/shared/apps/content-partners/utils/ContentPartnersHelper';\nimport { ActionOptions } from 'libs/shared/components/actions/Actions';\nimport { BannerHeader } from 'libs/shared/components/banner-header/BannerHeader';\nimport { Breadcrumb, Breadcrumbs } from 'libs/shared/components/breadcrumbs/Breadcrumbs';\nimport { WidgetContainerView } from 'libs/shared/components/widgets/curated-widgets/WidgetContainerView';\nimport { AllPartnerProfileWidgetTemplates } from 'libs/shared/components/widgets/curated-widgets/WidgetProps';\nimport { PermissionName } from 'libs/shared/enums/PermissionName';\nimport { WidgetTemplate } from 'libs/shared/enums/WidgetTemplate';\nimport { WidgetTypeId } from 'libs/shared/enums/WidgetTypeId';\nimport { useEmptyWidgets } from 'libs/shared/hooks/useEmptyWidgets';\nimport { HasLocalPermissionsFunc, HasPermissionsFunc } from 'libs/shared/hooks/usePermissions';\nimport { Company, CuratedDashboard, CuratedWidgetQueryParams, DashboardTargetType, Person, PresentationAudience } from 'libs/shared/interfaces';\nimport { CommonVideoProps } from 'libs/shared/interfaces/CommonVideoProps';\nimport { CuratedDashboardHelper } from 'libs/shared/utils/DashboardHelper';\n\ntype SupportedContentParterObject = Company | Person;\n\nexport interface ContentPartnerDashboardHubProps {\n dashboard: CuratedDashboard;\n objectData: SupportedContentParterObject;\n getWidgetContentRequest: (\n id: string,\n params: CuratedWidgetQueryParams,\n widgetTemplate: WidgetTemplate\n ) => Flight.Request;\n commonVideoProps: CommonVideoProps;\n getBannerActions?: () => ActionOptions[];\n breadcrumbs?: Breadcrumb[];\n isReadonly?: boolean;\n widgetAppLinks?: AllPartnerProfileWidgetTemplates['appLinks'];\n scrollToWidgetId?: string;\n hasPermissions: HasPermissionsFunc;\n hasLocalPermissions: HasLocalPermissionsFunc;\n settings?: AllPartnerProfileWidgetTemplates['settings'];\n audiences?: PresentationAudience[];\n emptyImageUrl?: string;\n lazyLoad?: boolean;\n isBot?: boolean;\n isComingSoon?: boolean;\n isPreviewing?: boolean;\n isAuthenticated?: boolean;\n onClickSignUp: (email: string) => void;\n}\n\nexport function ContentPartnerDashboardHub(props: ContentPartnerDashboardHubProps): JSX.Element {\n const widgets = ArrayHelper.sortBy(props.dashboard?.widgets, 'index');\n\n const { setEmptyWidget } = useEmptyWidgets(widgets);\n \n function getWidgetContentRequest(id: string, widgetTypeId: WidgetTypeId, template: WidgetTemplate): Flight.Request {\n const params = CuratedDashboardHelper.getWidgetParams(\n widgetTypeId,\n template,\n CuratedDashboardHelper.getDashboardTargetType(props.dashboard),\n undefined,\n undefined,\n {\n params: {\n objectId: props.objectData.id\n }\n }\n );\n\n return props.getWidgetContentRequest(id, params, template);\n }\n\n const onSetIsEmpty = React.useCallback((widgetId: string, isEmpty: boolean) => {\n setEmptyWidget(widgetId, isEmpty);\n }, [setEmptyWidget]);\n\n const bannerInfo = ContentPartnersHelper.getObjectBannerInfo(props.objectData);\n \n return (\n <>\n {!!widgets.length &&\n <>\n <BannerHeader\n type='partner-profile'\n heading={bannerInfo.heading}\n blockColourClass={bannerInfo.blockColourClass}\n logo={bannerInfo.logo}\n logoBgColour={bannerInfo.logoBgColour}\n banner={bannerInfo.banner}\n imageCdnUrl={props.commonVideoProps.imageCdnUrl}\n actions={props.getBannerActions?.()}\n onClickSignUp={props.onClickSignUp}\n isAuthenticated={props.isAuthenticated}\n isStudent={props.hasPermissions(PermissionName.StudentExperience)}\n />\n \n <div className='py-3 mb-3 border-bottom'>\n <Breadcrumbs breadcrumbs={props.breadcrumbs} />\n </div>\n\n <div className='mt-3'>\n {widgets.map(widget => (\n <WidgetContainerView\n widgetCollection={DashboardTargetType.PartnerProfile}\n dashboardTarget={DashboardTargetType.PartnerProfile}\n key={widget.id}\n id={widget.id}\n getContentRequest={getWidgetContentRequest}\n name={widget.name}\n description={widget.description}\n templateId={widget.templateId}\n metadata={widget.metadata}\n appLinks={props.widgetAppLinks}\n widgetTypeId={widget.widgetId}\n hasPermissions={props.hasPermissions}\n hasLocalPermissions={props.hasLocalPermissions}\n isPreviewing={props.isReadonly}\n settings={{\n hasTopicDirectories: props.settings?.hasTopicDirectories\n }}\n commonVideoProps={props.commonVideoProps}\n audiences={props.audiences}\n setIsEmpty={onSetIsEmpty}\n lazyLoad={props.lazyLoad}\n settingsHash={props.settings}\n\n classification={null}\n hasTableOfContents={false}\n seeMoreLink={null}\n onClickRemoveItem={null}\n badgeComponent={null}\n />\n ))}\n </div>\n </>\n }\n </>\n );\n}\n","import React from 'react';\n\nimport { Core } from 'libs/common/backbone/index';\nimport { Flight } from 'libs/common/react/index';\n\nimport { LocationContext } from 'libs/analytics/interfaces';\n\nimport { ContentPartnerDashboardHub } from 'libs/shared/apps/content-partners/components/content-partner-dashboard-hub/ContentPartnerDashboardHub';\nimport { ActionOptions } from 'libs/shared/components/actions/Actions';\nimport { VideoActionsContext } from 'libs/shared/context/VideoActionsContext';\nimport { NotFoundError } from 'libs/shared/errors/general/not-found/NotFoundError';\nimport { DashboardRequests } from 'libs/shared/flight-requests/DashboardRequests';\nimport { UserRequests } from 'libs/shared/flight-requests/UserRequests';\nimport { useBreadcrumbs } from 'libs/shared/hooks/useBreadcrumbs';\nimport { useCurationStudio } from 'libs/shared/hooks/useCurationStudio';\nimport { usePermissions } from 'libs/shared/hooks/usePermissions';\nimport { useSetPageMetadata } from 'libs/shared/hooks/useSetPageMetadata';\nimport { useSettings } from 'libs/shared/hooks/useSettings';\nimport { Company, CurrentUser, DashboardTargetType, Person } from 'libs/shared/interfaces';\nimport { PageMetadataHelper } from 'libs/shared/utils/PageMetadataHelper';\n\nimport { ImageUrls } from 'shared/constants/ImageUrls';\nimport { Actions } from 'shared/constants/LiteActions';\nimport { AppChannels } from 'shared/constants/LiteRadioChannels';\nimport { ContentPartnersRequests } from 'shared/flight-requests/ContentPartnersRequests';\nimport { useVideoActions, VideoActionsLocation } from 'shared/hooks/use-video-actions/useVideoActions';\nimport { useCommonVideoProps } from 'shared/hooks/useCommonVideoProps';\nimport { useFetchCuratedDashboard } from 'shared/utils/DashboardHelper';\nimport { SeoHelper } from 'shared/utils/SeoHelper';\n\nimport { getContentPartnerWidgetAppLinks } from 'apps/content-partners/utils/getContentPartnerWidgetAppLinks';\n\ninterface ContentPartnersDashboardHubViewProps {\n objectId: string;\n}\n\nexport function ContentPartnersDashboardHubView(props: ContentPartnersDashboardHubViewProps): JSX.Element {\n const videoActions = useVideoActions({ location: VideoActionsLocation.VideoItem, presentationSlug: null });\n const { openInCurationStudioLabel, isUserCurator, getOpenInCurationStudioLink } = useCurationStudio();\n const { hasPermissions, hasLocalPermissions } = usePermissions();\n const settings = useSettings(null);\n const { commonVideoProps } = useCommonVideoProps({\n locationContext: LocationContext.VideoThumbnail\n });\n\n const currentUser = Flight.useBasicFetch<CurrentUser>(UserRequests.currentUser());\n const objectData = Flight.useBasicFetch<Company | Person>(\n props.objectId && ContentPartnersRequests.objectDataById(props.objectId)\n );\n\n const breadcrumbs = useBreadcrumbs({ name: objectData.data?.name });\n\n useSetPageMetadata(\n PageMetadataHelper.getDefaultMetadata({\n title: `${objectData.data?.name}'s Hub`,\n allowIndexing: true\n })\n );\n \n const { dashboard } = useFetchCuratedDashboard({\n targetType: DashboardTargetType.PartnerProfileHub,\n queryParams: {}\n });\n\n function getBannerActions(): ActionOptions[] {\n if (!isUserCurator)\n return [];\n\n return [{\n label: openInCurationStudioLabel,\n href: getOpenInCurationStudioLink(dashboard.data?.typeId, dashboard.data?.id),\n openInNewTab: true\n }];\n }\n\n function onClickSignUp(email: string): void {\n Core.AppLinkHelper.trigger({\n application: AppChannels.SIGN_UP,\n action: Actions.SignUp.SIGN_UP,\n params: { email }\n });\n }\n\n const isBot = SeoHelper.isBot();\n\n const loaded = objectData.hasCompleted && dashboard.hasCompleted;\n \n React.useEffect(() => {\n if (!dashboard.hasCompleted || dashboard.data) return;\n\n Core.ErrorHelper.throw(new NotFoundError());\n }, [ dashboard.data, dashboard.hasCompleted ]);\n\n if (!loaded)\n return <></>;\n\n return (\n <div className='bg-white px-3 position-relative'>\n <VideoActionsContext.Provider value={videoActions}>\n <ContentPartnerDashboardHub\n dashboard={dashboard.data}\n objectData={objectData.data}\n getWidgetContentRequest={DashboardRequests.dashboardWidgetContent}\n breadcrumbs={breadcrumbs}\n commonVideoProps={commonVideoProps}\n getBannerActions={getBannerActions}\n hasPermissions={hasPermissions}\n hasLocalPermissions={hasLocalPermissions}\n settings={settings}\n widgetAppLinks={getContentPartnerWidgetAppLinks(currentUser.data)}\n emptyImageUrl={ImageUrls.EmptyStates.WATCH_HISTORY}\n isBot={isBot}\n // Only lazy load if its an actual user\n lazyLoad={!isBot}\n isAuthenticated={currentUser.data?.isAuthenticated}\n onClickSignUp={onClickSignUp}\n />\n </VideoActionsContext.Provider>\n </div>\n );\n}\n"],"mappings":"ozCAiDA,SAAgB,EAA2B,EAAqD,CAC9F,IAAM,EAAU,EAAY,OAAO,EAAM,WAAW,QAAS,OAAO,EAE9D,CAAE,kBAAmB,EAAgB,CAAO,EAElD,SAAS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,EAAW,cAAgB,EAAU,aAWpD,OATA,EAAM,cAAgB,CAChB,CAAC,EAAU,cAAgB,EAAU,MAEzC,EAAiB,MAAM,IAAI,CAAe,CAC5C,EAAG,CAAE,EAAU,KAAM,EAAU,YAAa,CAAC,EAExC,GAIH,EAAA,EAAA,IAAA,CAAC,MAAD,CAAK,UAAU,4CACb,EAAA,EAAA,IAAA,CAAC,EAAoB,SAArB,CAA8B,MAAO,YACnC,EAAA,EAAA,IAAA,CAAC,EAAD,CACE,UAAW,EAAU,KACrB,WAAY,EAAW,KACvB,wBAAyB,EAAkB,uBAC9B,cACK,mBACA,mBACF,iBACK,sBACX,WACV,eAAgB,EAAgC,EAAY,IAAI,EAChE,cAAe,EAAU,YAAY,cAC9B,QAEP,SAAU,CAAC,EACX,gBAAiB,EAAY,MAAM,gBACpB,eAChB,CAAA,CAC2B,CAAA,CAC3B,CAAA,GAxBE,EAAA,EAAA,IAAA,CAAA,EAAA,SAAA,CAAI,CAAA,CA0Bf"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import"./DAXXjFlN.chunk.js";import{t as e}from"./D8uRDrkd.chunk.js";import{t}from"./e57H3T-k.chunk.js";import{t as n}from"./C2w0pmFW.chunk.js";import{t as r}from"./wrLrTezN.chunk.js";import{t as i}from"./BXTI9cmX.chunk.js";import{t as a}from"./CjA4Q5pm.chunk.js";import{l as o,y as s,z as c}from"./NlCAcBdo.chunk.js";import{t as l}from"./RjGIOTdP.chunk.js";import{t as u}from"./DdsRCMkN.chunk.js";import{t as d}from"./CYEpX3hx.chunk.js";import{t as f}from"./PgzMrOyM.chunk.js";import{t as p}from"./Ci5E3nqm2.chunk.js";import{n as m}from"./CpFtf-tI2.chunk.js";import{t as h}from"./Delmxf6C.chunk.js";import{t as g}from"./Bv4_l1OV.chunk.js";import{t as _}from"./CuVGnzB82.chunk.js";import{t as v}from"./DSuhq1Rt2.chunk.js";import{t as y}from"./DBHDBu1Y.chunk.js";import{t as b}from"./CdYjo8_g.chunk.js";import{t as x}from"./
|
|
2
|
-
//# sourceMappingURL=
|
|
1
|
+
import"./DAXXjFlN.chunk.js";import{t as e}from"./D8uRDrkd.chunk.js";import{t}from"./e57H3T-k.chunk.js";import{t as n}from"./C2w0pmFW.chunk.js";import{t as r}from"./wrLrTezN.chunk.js";import{t as i}from"./BXTI9cmX.chunk.js";import{t as a}from"./CjA4Q5pm.chunk.js";import{l as o,y as s,z as c}from"./NlCAcBdo.chunk.js";import{t as l}from"./RjGIOTdP.chunk.js";import{t as u}from"./DdsRCMkN.chunk.js";import{t as d}from"./CYEpX3hx.chunk.js";import{t as f}from"./PgzMrOyM.chunk.js";import{t as p}from"./Ci5E3nqm2.chunk.js";import{n as m}from"./CpFtf-tI2.chunk.js";import{t as h}from"./Delmxf6C.chunk.js";import{t as g}from"./Bv4_l1OV.chunk.js";import{t as _}from"./CuVGnzB82.chunk.js";import{t as v}from"./DSuhq1Rt2.chunk.js";import{t as y}from"./DBHDBu1Y.chunk.js";import{t as b}from"./CdYjo8_g.chunk.js";import{t as x}from"./BZFomoIH2.chunk.js";import{t as S}from"./DyzFu8SA2.chunk.js";import{t as C}from"./nNE51iyg2.chunk.js";import{t as w}from"./tnBD84bg2.chunk.js";import{n as T}from"./CtBGtgb32.chunk.js";n();var E={modalWidth:`_modalWidth_1p617_1`,banner:`_banner_1p617_5`,pill:`_pill_1p617_10`,logo:`_logo_1p617_13`},D=r(),O=`shared.specialEventListItem`;function k(e){return`audiences`in e&&`endDateTime`in e&&`startDateTime`in e}function A(n){let r=n.getAppLink(n.event.content,t.slugify(n.event.name)),i=n.getBackgroundColor?.(n.event.content),u=n.getIconUrl?.(n.event.content),f=n.getBannerUrl?.(n.event.content),h=!!n.event.endDate,g=n.event.content.status===y.ComingSoon,b=n.getStartTime?.(n.event.content),x=n.getActionLabel?.(),A=n.isPastEvent?.(n.event.content),j={actionType:c.Click,entity:o.SpecialEvent,location:n.inPopup?s.CalendarPopup:s.CalendarDay},M={topicId:n.event.content.id,eventId:n.event.specialEventId,presentationId:n.presentationId,date:a.format(new Date(n.event.startDate),`YYYY-MM-DD`),status:n.event.content.status};return(0,D.jsxs)(`div`,{children:[b&&(0,D.jsx)(`h6`,{children:b}),(0,D.jsxs)(`div`,{onClick:()=>{g&&d.logUserAction(M,j)},children:[(0,D.jsx)(p,{appLink:!g&&r,className:`${g?``:`cursor-pointer`} text-decoration-none mb-2`,onClick:n.onClick,analyticsOptions:j,analyticsData:M,children:(0,D.jsxs)(`div`,{className:`banner rounded-3 position-relative position-relative ${E.banner}`,style:{backgroundColor:i,backgroundImage:`url('${f}')`},children:[A&&(0,D.jsx)(`div`,{className:`bg-white w-100 h-100 opacity-50 position-absolute top-0 left-0 z-0`}),(0,D.jsxs)(`div`,{className:`d-flex justify-content-between align-items-center w-100 h-100 px-3`,children:[(0,D.jsxs)(`div`,{className:`d-flex align-items-center z-1`,children:[u&&(0,D.jsx)(`div`,{className:`${E.logo} rounded-circle flex-shrink-0 overflow-hidden me-2`,children:(0,D.jsx)(v,{data:u})}),(0,D.jsxs)(`div`,{children:[g&&(0,D.jsx)(S,{className:`pe-2 fw-semibold mb-1 rounded-pill justify-content-start ${E.pill}`}),A&&(0,D.jsxs)(`div`,{className:`d-inline-block rounded-pill bg-light-green mb-1`,children:[(0,D.jsx)(e,{svg:T}),(0,D.jsx)(`p`,{className:`d-inline ms-1 mb-0`,children:(0,D.jsx)(m,{namespace:O,phrase:`pastEvent`})})]}),h&&(0,D.jsx)(`p`,{className:`text-white text-shadow mb-1`,children:C.getDisplayDate(n.event.startDate,n.event.endDate)}),(0,D.jsx)(`h2`,{className:`h4 text-white text-shadow ${n.event.description?`clamp-2`:`clamp-1`}`,title:n.event.name,children:n.event.name})]})]}),(0,D.jsx)(`div`,{className:`d-none d-sm-block flex-shrink-0 z-1`,children:!g&&(0,D.jsx)(_,{className:`btn ${A?`btn-outline-dark`:`btn-dark`} fw-semibold`,children:x})})]})]})}),(0,D.jsx)(`div`,{className:`pre-wrap text-break mb-3`,dangerouslySetInnerHTML:{__html:t.sanitize(w.linkifyText(n.event.description||n.event.content.description))}}),k(n.event.content)&&(0,D.jsxs)(`div`,{className:`d-flex mb-3`,children:[(0,D.jsx)(`div`,{className:`rounded-pill border border-dark px-2 bg-white d-inline-block me-2`,children:l.getMergedPresentationAudienceString(n.event.content.audiences)?.name}),(0,D.jsx)(`div`,{className:`rounded-pill fw-semibold bg-dark text-white d-inline-block px-2`,children:`${a.diffBetween(n.event.content.endDateTime,n.event.content.startDateTime,`minutes`)}m`})]})]})]})}function j(e){switch(e?.toLocaleLowerCase()){case g.AU:return{emptyState:f.EmptyStates.CALENDAR.NO_EVENTS_AU,errorState:f.EmptyStates.CALENDAR.INVALID_DATE};case g.US:return{emptyState:f.EmptyStates.CALENDAR.NO_EVENTS_US,errorState:f.EmptyStates.CALENDAR.INVALID_DATE};case g.UK:return{emptyState:f.EmptyStates.CALENDAR.NO_EVENTS_UK,errorState:f.EmptyStates.CALENDAR.INVALID_DATE};default:return{emptyState:f.EmptyStates.CALENDAR.NO_EVENTS,errorState:f.EmptyStates.CALENDAR.INVALID_DATE}}}function M(e,t){return{calendar:()=>({application:i.CALENDAR,action:u.Calendar.CALENDAR,args:[e]}),month:t=>({application:i.CALENDAR,action:u.Calendar.CALENDAR_MONTH,args:[e,t]}),event:(e,n)=>h.getAppLink({...e,name:n||e.name},void 0,t),eventList:(t,n,r)=>({application:i.CALENDAR,action:u.Calendar.SPECIAL_EVENT_LIST,args:[e],params:{...t,date:n.toString(),presentationId:r}}),emptyStateRedirect:()=>({application:i.CONTENT_UPDATES,action:u.ContentUpdates.CONTENT_UPDATES,args:[e]})}}function N(){return{emptyState:f.Live.EmptyStates.CALENDAR.NO_EVENTS,errorState:f.Live.EmptyStates.CALENDAR.INVALID_DATE}}function P(e){return{calendar:()=>({application:i.CALENDAR,action:u.Calendar.CALENDAR,args:[e]}),month:t=>({application:i.CALENDAR,action:u.Calendar.CALENDAR_MONTH,args:[e,t]}),event:(t,n)=>({application:i.LIVESTREAMS,action:u.Livestreams.LIVESTREAM,args:[e,t.id,n]}),eventList:(t,n,r)=>({application:i.CALENDAR,action:u.Calendar.SPECIAL_EVENT_LIST,args:[e],params:{...t,date:n.toString(),presentationId:r}})}}function F(){return(0,D.jsxs)(`div`,{children:[(0,D.jsx)(e,{svg:b}),(0,D.jsx)(`span`,{className:`ms-1`,children:x.getTimezoneInfo().longGeneric})]})}var I={getStartTime(e){return a.format(x.convertUTCToTimezoneDate(e.startDateTime),`h:mm a`)},isSameTime(e,t){return t!==0&&a.isSame(e[t].content.startDateTime,e[t-1].content.startDateTime)},isPastEvent(e){return a.isBefore(e.endDateTime,new Date)}};export{P as a,j as i,F as n,N as o,M as r,A as s,I as t};
|
|
2
|
+
//# sourceMappingURL=CNPnPJMp2.chunk.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BcPrUEuC2.chunk.js","names":[],"sources":["../../../../libs/shared/src/apps/calendar/components/special-event-list-item/special-event-list-item.module.scss","../../../../libs/shared/src/apps/calendar/components/special-event-list-item/SpecialEventListItem.tsx","../../src/apps/calendar/views/calendar-view/CalendarViewUtils.ts","../../../../libs/shared/src/apps/streamable-learning/components/timezone-indicator/TimezoneIndicator.tsx","../../src/apps/calendar/utils/LiveCalendarUtils.ts"],"sourcesContent":[":local {\n .modalWidth {\n width: 40rem;\n max-width: 40rem;\n }\n\n .banner {\n background-position: center;\n background-size: cover; \n height: 6.25rem;\n }\n\n .pill {\n width:fit-content\n }\n\n .logo {\n height: 3.75rem;\n width: 3.75rem;\n }\n}","import React from 'react';\n\nimport { Core } from 'libs/common/backbone/index';\nimport { DateHelper } from 'libs/common/react/utils/DateHelper';\nimport { LinkifyHelper } from 'libs/common/react/utils/LinkifyHelper';\nimport { TextHelper } from 'libs/common/react/utils/TextHelper';\n\nimport { AnalyticsHelper } from 'libs/analytics/AnalyticsHelper';\nimport { AnalyticsOptions, EntityType, LocationContext, UserAction } from 'libs/analytics/interfaces';\n\nimport { ComingSoonTag } from 'libs/shared/apps/calendar/components/coming-soon-tag/ComingSoonTag';\nimport { SpecialEventHelper } from 'libs/shared/apps/calendar/utils/SpecialEventHelper';\nimport { ActionButton } from 'libs/shared/components/actions/ActionButton';\nimport { AppLink } from 'libs/shared/components/app-link/AppLink';\nimport { BaseImage } from 'libs/shared/components/image/BaseImage';\nimport { SvgContainer } from 'libs/shared/components/svg-container/SvgContainer';\nimport { Text } from 'libs/shared/components/text/Text';\nimport { ClassificationStatus } from 'libs/shared/enums/ClassificationStatus';\nimport { CalendarCheckSvg } from 'libs/shared/images/svg/objects/CalendarCheckSvg';\nimport { CalendarEvent, CalendarEventContent, Livestream, PresentationAudience } from 'libs/shared/interfaces';\nimport { AudienceHelper } from 'libs/shared/utils/audience-helper/AudienceHelper';\n\nimport styles from './special-event-list-item.module.scss';\n\nconst namespace = 'shared.specialEventListItem';\n\nfunction isLiveStream(obj: CalendarEventContent): obj is Livestream {\n return 'audiences' in obj &&\n 'endDateTime' in obj &&\n 'startDateTime' in obj;\n}\n\ninterface SpecialEventListItemProps {\n getAppLink: (content: CalendarEventContent, name: string) => Core.AppLink;\n event: CalendarEvent<CalendarEventContent>;\n onClick?: () => void;\n inPopup?: boolean;\n presentationId: string;\n headingClassName?: string;\n getIconUrl?: (content: CalendarEventContent) => string;\n getBackgroundColor?: (content: CalendarEventContent) => string;\n getBannerUrl?: (content: CalendarEventContent) => string;\n getActionLabel?: () => string;\n getStartTime?: (content: CalendarEventContent) => string;\n isPastEvent?: (content: CalendarEventContent) => boolean;\n}\n\nexport function SpecialEventListItem(props: SpecialEventListItemProps): JSX.Element {\n const appLink = props.getAppLink(props.event.content, TextHelper.slugify(props.event.name));\n\n const backgroundColor = props.getBackgroundColor?.(props.event.content);\n const iconUrl = props.getIconUrl?.(props.event.content);\n const bannerUrl = props.getBannerUrl?.(props.event.content);\n const multiDayEvent = !!props.event.endDate;\n const isComingSoon = props.event.content.status === ClassificationStatus.ComingSoon;\n const startTime = props.getStartTime?.(props.event.content);\n const actionLabel = props.getActionLabel?.();\n const isPastEvent = props.isPastEvent?.(props.event.content);\n\n const analyticsOptions: AnalyticsOptions = {\n actionType: UserAction.Click,\n entity: EntityType.SpecialEvent,\n location: props.inPopup ? LocationContext.CalendarPopup : LocationContext.CalendarDay\n };\n const analyticsData = {\n topicId: props.event.content.id,\n eventId: props.event.specialEventId,\n presentationId: props.presentationId,\n date: DateHelper.format(new Date(props.event.startDate), 'YYYY-MM-DD'),\n status: props.event.content.status\n };\n\n return (\n <div>\n {startTime && (\n <h6>{startTime}</h6>\n )}\n\n <div onClick={() => {\n if (isComingSoon)\n AnalyticsHelper.logUserAction(analyticsData, analyticsOptions);\n }}>\n <AppLink\n appLink={!isComingSoon && appLink}\n className={`${!isComingSoon ? 'cursor-pointer' : ''} text-decoration-none mb-2`}\n onClick={props.onClick}\n analyticsOptions={analyticsOptions}\n analyticsData={analyticsData}\n >\n <div\n className={`banner rounded-3 position-relative position-relative ${styles.banner}`}\n style={{ backgroundColor, backgroundImage: `url('${bannerUrl}')` }}\n >\n {isPastEvent && (\n <div className='bg-white w-100 h-100 opacity-50 position-absolute top-0 left-0 z-0' />\n )}\n <div className='d-flex justify-content-between align-items-center w-100 h-100 px-3'>\n <div className='d-flex align-items-center z-1'>\n {iconUrl && (\n <div className={`${styles.logo} rounded-circle flex-shrink-0 overflow-hidden me-2`}>\n <BaseImage data={iconUrl} />\n </div>\n )}\n <div>\n {isComingSoon && <ComingSoonTag className={`pe-2 fw-semibold mb-1 rounded-pill justify-content-start ${styles.pill}`}/>}\n\n {isPastEvent &&\n <div className='d-inline-block rounded-pill bg-light-green mb-1'>\n <SvgContainer svg={CalendarCheckSvg} />\n <p className='d-inline ms-1 mb-0'><Text namespace={namespace} phrase='pastEvent' /></p>\n </div>}\n \n {multiDayEvent && (\n <p className='text-white text-shadow mb-1'>{SpecialEventHelper.getDisplayDate(props.event.startDate, props.event.endDate)}</p>\n )}\n <h2 className={`h4 text-white text-shadow ${props.event.description ? 'clamp-2' : 'clamp-1'}`} title={props.event.name}>{props.event.name}</h2>\n \n </div>\n </div>\n\n <div className='d-none d-sm-block flex-shrink-0 z-1'>\n {!isComingSoon && (\n <ActionButton className={`btn ${isPastEvent ? 'btn-outline-dark' : 'btn-dark'} fw-semibold`}>\n {actionLabel}\n </ActionButton>\n )}\n </div>\n </div>\n </div>\n </AppLink>\n <div className='pre-wrap text-break mb-3' dangerouslySetInnerHTML={{ __html: TextHelper.sanitize(LinkifyHelper.linkifyText(props.event.description || props.event.content.description)) }}/>\n {(isLiveStream(props.event.content) &&\n <div className='d-flex mb-3'>\n <div className='rounded-pill border border-dark px-2 bg-white d-inline-block me-2'>\n {AudienceHelper.getMergedPresentationAudienceString(\n props.event.content.audiences as PresentationAudience[]\n )?.name}\n </div>\n <div className='rounded-pill fw-semibold bg-dark text-white d-inline-block px-2'>\n {`${DateHelper.diffBetween(props.event.content.endDateTime, props.event.content.startDateTime, 'minutes')}m`}\n </div>\n </div>\n )}\n </div>\n </div>\n );\n}\n","import { CalendarAppLinks } from 'libs/shared/apps/calendar/interfaces/CalendarAppLinks';\nimport { CalendarImageUrls } from 'libs/shared/apps/calendar/interfaces/CalendarImageUrls';\nimport { MonthQuery } from 'libs/shared/apps/calendar/interfaces/MonthQuery';\nimport { PatchedDate } from 'libs/shared/apps/calendar/utils/CalendarHelper';\nimport { CountryCode } from 'libs/shared/enums/CountryCode';\nimport { Classification, Livestream, Presentation } from 'libs/shared/interfaces';\n\nimport { ImageUrls } from 'shared/constants/ImageUrls';\nimport { Actions } from 'shared/constants/LiteActions';\nimport { AppChannels } from 'shared/constants/LiteRadioChannels';\nimport { ClassificationAppLinkHelper } from 'shared/utils/ClassificationAppLinkHelper';\n\nexport function getCalendarImageUrls(countryCode?: CountryCode): CalendarImageUrls {\n switch (countryCode?.toLocaleLowerCase()) {\n case CountryCode.AU:\n return {\n emptyState: ImageUrls.EmptyStates.CALENDAR.NO_EVENTS_AU,\n errorState: ImageUrls.EmptyStates.CALENDAR.INVALID_DATE\n };\n\n case CountryCode.US:\n return {\n emptyState: ImageUrls.EmptyStates.CALENDAR.NO_EVENTS_US,\n errorState: ImageUrls.EmptyStates.CALENDAR.INVALID_DATE\n };\n\n case CountryCode.UK:\n return {\n emptyState: ImageUrls.EmptyStates.CALENDAR.NO_EVENTS_UK,\n errorState: ImageUrls.EmptyStates.CALENDAR.INVALID_DATE\n };\n\n default:\n return {\n emptyState: ImageUrls.EmptyStates.CALENDAR.NO_EVENTS,\n errorState: ImageUrls.EmptyStates.CALENDAR.INVALID_DATE\n };\n }\n}\n\n/**\n * Build the calendar applinks. The `presentationSlug` arg is threaded into args[0]\n * for the slug-aware calendar/calendarMonth actions so URL generation produces\n * `/<region>/<slug>/calendar(/<month>)` URLs and the handler receives the slug.\n *\n * Pass the slug from the consuming view (it's typically on `props.presentationSlug`\n * or readable from `usePresentation()`).\n */\nexport function getCalendarAppLinks(\n presentationSlug: string | null,\n availablePresentations: Presentation[]\n): CalendarAppLinks {\n return {\n calendar: () => ({\n application: AppChannels.CALENDAR,\n action: Actions.Calendar.CALENDAR,\n args: [presentationSlug]\n }),\n month: (month: string) => ({\n application: AppChannels.CALENDAR,\n action: Actions.Calendar.CALENDAR_MONTH,\n args: [ presentationSlug, month ]\n }),\n event: (classification: Classification, slug: string) => {\n return ClassificationAppLinkHelper.getAppLink(\n { ...classification, name: slug || classification.name },\n undefined,\n availablePresentations\n );\n },\n eventList: (monthQuery: MonthQuery, date: PatchedDate, presentationId: string) => ({\n application: AppChannels.CALENDAR,\n action: Actions.Calendar.SPECIAL_EVENT_LIST,\n args: [presentationSlug],\n params: {\n ...monthQuery,\n date: date.toString(),\n presentationId: presentationId\n }\n }),\n emptyStateRedirect: () => ({\n application: AppChannels.CONTENT_UPDATES,\n action: Actions.ContentUpdates.CONTENT_UPDATES,\n args: [presentationSlug]\n })\n };\n}\n\nexport function getLiveCalendarImageUrls(): CalendarImageUrls {\n return {\n emptyState: ImageUrls.Live.EmptyStates.CALENDAR.NO_EVENTS,\n errorState: ImageUrls.Live.EmptyStates.CALENDAR.INVALID_DATE\n };\n}\n\nexport function getLiveCalendarAppLinks(presentationSlug: string | null): CalendarAppLinks {\n return {\n calendar: () => ({\n application: AppChannels.CALENDAR,\n action: Actions.Calendar.CALENDAR,\n args: [presentationSlug]\n }),\n month: (month: string) => ({\n application: AppChannels.CALENDAR,\n action: Actions.Calendar.CALENDAR_MONTH,\n args: [ presentationSlug, month ]\n }),\n event: (livestream: Livestream, slug?: string) => ({\n application: AppChannels.LIVESTREAMS,\n action: Actions.Livestreams.LIVESTREAM,\n args: [ presentationSlug, livestream.id, slug ]\n }),\n eventList: (monthQuery: MonthQuery, date: PatchedDate, presentationId: string) => ({\n application: AppChannels.CALENDAR,\n action: Actions.Calendar.SPECIAL_EVENT_LIST,\n args: [presentationSlug],\n params: {\n ...monthQuery,\n date: date.toString(),\n presentationId: presentationId\n }\n })\n };\n}\n","import React from 'react';\n\nimport { TimezoneHelper } from 'libs/shared/apps/streamable-learning/utils/TimezoneHelper';\nimport { SvgContainer } from 'libs/shared/components/svg-container/SvgContainer';\nimport { GlobeSvg } from 'libs/shared/images/svg/objects/GlobeSvg';\n\nexport function TimezoneIndicator() {\n return (\n <div>\n <SvgContainer svg={GlobeSvg} />\n <span className='ms-1'>{TimezoneHelper.getTimezoneInfo().longGeneric}</span>\n </div>\n );\n}\n","import { DateHelper } from 'libs/common/react/utils/DateHelper';\n\nimport { TimezoneHelper } from 'libs/shared/apps/streamable-learning/utils/TimezoneHelper';\nimport { CalendarEvent, Livestream } from 'libs/shared/interfaces';\n\nexport const LiveCalendarUtils = {\n getStartTime(livestream: Livestream): string {\n return DateHelper.format(\n TimezoneHelper.convertUTCToTimezoneDate(livestream.startDateTime),\n 'h:mm a'\n );\n },\n isSameTime(events: CalendarEvent<Livestream>[], index: number): boolean {\n if (index === 0) return false;\n\n return DateHelper.isSame(\n events[index].content.startDateTime,\n events[index - 1].content.startDateTime\n );\n },\n isPastE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A,GAC9B,EAAA,EAAA,IAAA,CAAC,OAAD,CAAM,UAAU,gBAAQ,EAAe,gBAAgB,CAAC,CAAC,WAAkB,CAAA,CACxE,CAAA,CAAA,CAET,CCRA,IAAa,EAAoB,CAC/B,aAAa,EAAgC,CAC3C,OAAO,EAAW,OAChB,EAAe,yBAAyB,EAAW,aAAa,EAChE,QACF,CACF,EACA,WAAW,EAAqC,EAAwB,CAGtE,OAFI,IAAU,GAEP,EAAW,OAChB,EAAO,EAAM,CAAC,QAAQ,cACtB,EAAO,EAAQ,EAAE,CAAC,QAAQ,aAC5B,CACF,EACA,YAAY,EAAiC,CAC3C,OAAO,EAAW,SAAS,EAAW,YAAa,IAAI,IAAM,CAC/D,CACF"}
|
|
1
|
+
{"version":3,"file":"CNPnPJMp2.chunk.js","names":[],"sources":["../../../../libs/shared/src/apps/calendar/components/special-event-list-item/special-event-list-item.module.scss","../../../../libs/shared/src/apps/calendar/components/special-event-list-item/SpecialEventListItem.tsx","../../src/apps/calendar/views/calendar-view/CalendarViewUtils.ts","../../../../libs/shared/src/apps/streamable-learning/components/timezone-indicator/TimezoneIndicator.tsx","../../src/apps/calendar/utils/LiveCalendarUtils.ts"],"sourcesContent":[":local {\n .modalWidth {\n width: 40rem;\n max-width: 40rem;\n }\n\n .banner {\n background-position: center;\n background-size: cover; \n height: 6.25rem;\n }\n\n .pill {\n width:fit-content\n }\n\n .logo {\n height: 3.75rem;\n width: 3.75rem;\n }\n}","import React from 'react';\n\nimport { Core } from 'libs/common/backbone/index';\nimport { DateHelper } from 'libs/common/react/utils/DateHelper';\nimport { LinkifyHelper } from 'libs/common/react/utils/LinkifyHelper';\nimport { TextHelper } from 'libs/common/react/utils/TextHelper';\n\nimport { AnalyticsHelper } from 'libs/analytics/AnalyticsHelper';\nimport { AnalyticsOptions, EntityType, LocationContext, UserAction } from 'libs/analytics/interfaces';\n\nimport { ComingSoonTag } from 'libs/shared/apps/calendar/components/coming-soon-tag/ComingSoonTag';\nimport { SpecialEventHelper } from 'libs/shared/apps/calendar/utils/SpecialEventHelper';\nimport { ActionButton } from 'libs/shared/components/actions/ActionButton';\nimport { AppLink } from 'libs/shared/components/app-link/AppLink';\nimport { BaseImage } from 'libs/shared/components/image/BaseImage';\nimport { SvgContainer } from 'libs/shared/components/svg-container/SvgContainer';\nimport { Text } from 'libs/shared/components/text/Text';\nimport { ClassificationStatus } from 'libs/shared/enums/ClassificationStatus';\nimport { CalendarCheckSvg } from 'libs/shared/images/svg/objects/CalendarCheckSvg';\nimport { CalendarEvent, CalendarEventContent, Livestream, PresentationAudience } from 'libs/shared/interfaces';\nimport { AudienceHelper } from 'libs/shared/utils/audience-helper/AudienceHelper';\n\nimport styles from './special-event-list-item.module.scss';\n\nconst namespace = 'shared.specialEventListItem';\n\nfunction isLiveStream(obj: CalendarEventContent): obj is Livestream {\n return 'audiences' in obj &&\n 'endDateTime' in obj &&\n 'startDateTime' in obj;\n}\n\ninterface SpecialEventListItemProps {\n getAppLink: (content: CalendarEventContent, name: string) => Core.AppLink;\n event: CalendarEvent<CalendarEventContent>;\n onClick?: () => void;\n inPopup?: boolean;\n presentationId: string;\n headingClassName?: string;\n getIconUrl?: (content: CalendarEventContent) => string;\n getBackgroundColor?: (content: CalendarEventContent) => string;\n getBannerUrl?: (content: CalendarEventContent) => string;\n getActionLabel?: () => string;\n getStartTime?: (content: CalendarEventContent) => string;\n isPastEvent?: (content: CalendarEventContent) => boolean;\n}\n\nexport function SpecialEventListItem(props: SpecialEventListItemProps): JSX.Element {\n const appLink = props.getAppLink(props.event.content, TextHelper.slugify(props.event.name));\n\n const backgroundColor = props.getBackgroundColor?.(props.event.content);\n const iconUrl = props.getIconUrl?.(props.event.content);\n const bannerUrl = props.getBannerUrl?.(props.event.content);\n const multiDayEvent = !!props.event.endDate;\n const isComingSoon = props.event.content.status === ClassificationStatus.ComingSoon;\n const startTime = props.getStartTime?.(props.event.content);\n const actionLabel = props.getActionLabel?.();\n const isPastEvent = props.isPastEvent?.(props.event.content);\n\n const analyticsOptions: AnalyticsOptions = {\n actionType: UserAction.Click,\n entity: EntityType.SpecialEvent,\n location: props.inPopup ? LocationContext.CalendarPopup : LocationContext.CalendarDay\n };\n const analyticsData = {\n topicId: props.event.content.id,\n eventId: props.event.specialEventId,\n presentationId: props.presentationId,\n date: DateHelper.format(new Date(props.event.startDate), 'YYYY-MM-DD'),\n status: props.event.content.status\n };\n\n return (\n <div>\n {startTime && (\n <h6>{startTime}</h6>\n )}\n\n <div onClick={() => {\n if (isComingSoon)\n AnalyticsHelper.logUserAction(analyticsData, analyticsOptions);\n }}>\n <AppLink\n appLink={!isComingSoon && appLink}\n className={`${!isComingSoon ? 'cursor-pointer' : ''} text-decoration-none mb-2`}\n onClick={props.onClick}\n analyticsOptions={analyticsOptions}\n analyticsData={analyticsData}\n >\n <div\n className={`banner rounded-3 position-relative position-relative ${styles.banner}`}\n style={{ backgroundColor, backgroundImage: `url('${bannerUrl}')` }}\n >\n {isPastEvent && (\n <div className='bg-white w-100 h-100 opacity-50 position-absolute top-0 left-0 z-0' />\n )}\n <div className='d-flex justify-content-between align-items-center w-100 h-100 px-3'>\n <div className='d-flex align-items-center z-1'>\n {iconUrl && (\n <div className={`${styles.logo} rounded-circle flex-shrink-0 overflow-hidden me-2`}>\n <BaseImage data={iconUrl} />\n </div>\n )}\n <div>\n {isComingSoon && <ComingSoonTag className={`pe-2 fw-semibold mb-1 rounded-pill justify-content-start ${styles.pill}`}/>}\n\n {isPastEvent &&\n <div className='d-inline-block rounded-pill bg-light-green mb-1'>\n <SvgContainer svg={CalendarCheckSvg} />\n <p className='d-inline ms-1 mb-0'><Text namespace={namespace} phrase='pastEvent' /></p>\n </div>}\n \n {multiDayEvent && (\n <p className='text-white text-shadow mb-1'>{SpecialEventHelper.getDisplayDate(props.event.startDate, props.event.endDate)}</p>\n )}\n <h2 className={`h4 text-white text-shadow ${props.event.description ? 'clamp-2' : 'clamp-1'}`} title={props.event.name}>{props.event.name}</h2>\n \n </div>\n </div>\n\n <div className='d-none d-sm-block flex-shrink-0 z-1'>\n {!isComingSoon && (\n <ActionButton className={`btn ${isPastEvent ? 'btn-outline-dark' : 'btn-dark'} fw-semibold`}>\n {actionLabel}\n </ActionButton>\n )}\n </div>\n </div>\n </div>\n </AppLink>\n <div className='pre-wrap text-break mb-3' dangerouslySetInnerHTML={{ __html: TextHelper.sanitize(LinkifyHelper.linkifyText(props.event.description || props.event.content.description)) }}/>\n {(isLiveStream(props.event.content) &&\n <div className='d-flex mb-3'>\n <div className='rounded-pill border border-dark px-2 bg-white d-inline-block me-2'>\n {AudienceHelper.getMergedPresentationAudienceString(\n props.event.content.audiences as PresentationAudience[]\n )?.name}\n </div>\n <div className='rounded-pill fw-semibold bg-dark text-white d-inline-block px-2'>\n {`${DateHelper.diffBetween(props.event.content.endDateTime, props.event.content.startDateTime, 'minutes')}m`}\n </div>\n </div>\n )}\n </div>\n </div>\n );\n}\n","import { CalendarAppLinks } from 'libs/shared/apps/calendar/interfaces/CalendarAppLinks';\nimport { CalendarImageUrls } from 'libs/shared/apps/calendar/interfaces/CalendarImageUrls';\nimport { MonthQuery } from 'libs/shared/apps/calendar/interfaces/MonthQuery';\nimport { PatchedDate } from 'libs/shared/apps/calendar/utils/CalendarHelper';\nimport { CountryCode } from 'libs/shared/enums/CountryCode';\nimport { Classification, Livestream, Presentation } from 'libs/shared/interfaces';\n\nimport { ImageUrls } from 'shared/constants/ImageUrls';\nimport { Actions } from 'shared/constants/LiteActions';\nimport { AppChannels } from 'shared/constants/LiteRadioChannels';\nimport { ClassificationAppLinkHelper } from 'shared/utils/ClassificationAppLinkHelper';\n\nexport function getCalendarImageUrls(countryCode?: CountryCode): CalendarImageUrls {\n switch (countryCode?.toLocaleLowerCase()) {\n case CountryCode.AU:\n return {\n emptyState: ImageUrls.EmptyStates.CALENDAR.NO_EVENTS_AU,\n errorState: ImageUrls.EmptyStates.CALENDAR.INVALID_DATE\n };\n\n case CountryCode.US:\n return {\n emptyState: ImageUrls.EmptyStates.CALENDAR.NO_EVENTS_US,\n errorState: ImageUrls.EmptyStates.CALENDAR.INVALID_DATE\n };\n\n case CountryCode.UK:\n return {\n emptyState: ImageUrls.EmptyStates.CALENDAR.NO_EVENTS_UK,\n errorState: ImageUrls.EmptyStates.CALENDAR.INVALID_DATE\n };\n\n default:\n return {\n emptyState: ImageUrls.EmptyStates.CALENDAR.NO_EVENTS,\n errorState: ImageUrls.EmptyStates.CALENDAR.INVALID_DATE\n };\n }\n}\n\n/**\n * Build the calendar applinks. The `presentationSlug` arg is threaded into args[0]\n * for the slug-aware calendar/calendarMonth actions so URL generation produces\n * `/<region>/<slug>/calendar(/<month>)` URLs and the handler receives the slug.\n *\n * Pass the slug from the consuming view (it's typically on `props.presentationSlug`\n * or readable from `usePresentation()`).\n */\nexport function getCalendarAppLinks(\n presentationSlug: string | null,\n availablePresentations: Presentation[]\n): CalendarAppLinks {\n return {\n calendar: () => ({\n application: AppChannels.CALENDAR,\n action: Actions.Calendar.CALENDAR,\n args: [presentationSlug]\n }),\n month: (month: string) => ({\n application: AppChannels.CALENDAR,\n action: Actions.Calendar.CALENDAR_MONTH,\n args: [ presentationSlug, month ]\n }),\n event: (classification: Classification, slug: string) => {\n return ClassificationAppLinkHelper.getAppLink(\n { ...classification, name: slug || classification.name },\n undefined,\n availablePresentations\n );\n },\n eventList: (monthQuery: MonthQuery, date: PatchedDate, presentationId: string) => ({\n application: AppChannels.CALENDAR,\n action: Actions.Calendar.SPECIAL_EVENT_LIST,\n args: [presentationSlug],\n params: {\n ...monthQuery,\n date: date.toString(),\n presentationId: presentationId\n }\n }),\n emptyStateRedirect: () => ({\n application: AppChannels.CONTENT_UPDATES,\n action: Actions.ContentUpdates.CONTENT_UPDATES,\n args: [presentationSlug]\n })\n };\n}\n\nexport function getLiveCalendarImageUrls(): CalendarImageUrls {\n return {\n emptyState: ImageUrls.Live.EmptyStates.CALENDAR.NO_EVENTS,\n errorState: ImageUrls.Live.EmptyStates.CALENDAR.INVALID_DATE\n };\n}\n\nexport function getLiveCalendarAppLinks(presentationSlug: string | null): CalendarAppLinks {\n return {\n calendar: () => ({\n application: AppChannels.CALENDAR,\n action: Actions.Calendar.CALENDAR,\n args: [presentationSlug]\n }),\n month: (month: string) => ({\n application: AppChannels.CALENDAR,\n action: Actions.Calendar.CALENDAR_MONTH,\n args: [ presentationSlug, month ]\n }),\n event: (livestream: Livestream, slug?: string) => ({\n application: AppChannels.LIVESTREAMS,\n action: Actions.Livestreams.LIVESTREAM,\n args: [ presentationSlug, livestream.id, slug ]\n }),\n eventList: (monthQuery: MonthQuery, date: PatchedDate, presentationId: string) => ({\n application: AppChannels.CALENDAR,\n action: Actions.Calendar.SPECIAL_EVENT_LIST,\n args: [presentationSlug],\n params: {\n ...monthQuery,\n date: date.toString(),\n presentationId: presentationId\n }\n })\n };\n}\n","import React from 'react';\n\nimport { TimezoneHelper } from 'libs/shared/apps/streamable-learning/utils/TimezoneHelper';\nimport { SvgContainer } from 'libs/shared/components/svg-container/SvgContainer';\nimport { GlobeSvg } from 'libs/shared/images/svg/objects/GlobeSvg';\n\nexport function TimezoneIndicator() {\n return (\n <div>\n <SvgContainer svg={GlobeSvg} />\n <span className='ms-1'>{TimezoneHelper.getTimezoneInfo().longGeneric}</span>\n </div>\n );\n}\n","import { DateHelper } from 'libs/common/react/utils/DateHelper';\n\nimport { TimezoneHelper } from 'libs/shared/apps/streamable-learning/utils/TimezoneHelper';\nimport { CalendarEvent, Livestream } from 'libs/shared/interfaces';\n\nexport const LiveCalendarUtils = {\n getStartTime(livestream: Livestream): string {\n return DateHelper.format(\n TimezoneHelper.convertUTCToTimezoneDate(livestream.startDateTime),\n 'h:mm a'\n );\n },\n isSameTime(events: CalendarEvent<Livestream>[], index: number): boolean {\n if (index === 0) return false;\n\n return DateHelper.isSame(\n events[index].content.startDateTime,\n events[index - 1].content.startDateTime\n );\n },\n isPastEvent(livestream: Livestream): boolean {\n return DateHelper.isBefore(livestream.endDateTime, new Date());\n }\n};\n"],"mappings":"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B,CAAC,CAAC,WAAkB,CAAA,CACxE,CAAA,CAAA,CAET,CCRA,IAAa,EAAoB,CAC/B,aAAa,EAAgC,CAC3C,OAAO,EAAW,OAChB,EAAe,yBAAyB,EAAW,aAAa,EAChE,QACF,CACF,EACA,WAAW,EAAqC,EAAwB,CAGtE,OAFI,IAAU,GAEP,EAAW,OAChB,EAAO,EAAM,CAAC,QAAQ,cACtB,EAAO,EAAQ,EAAE,CAAC,QAAQ,aAC5B,CACF,EACA,YAAY,EAAiC,CAC3C,OAAO,EAAW,SAAS,EAAW,YAAa,IAAI,IAAM,CAC/D,CACF"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{o as e}from"./DAXXjFlN.chunk.js";import{t}from"./D8uRDrkd.chunk.js";import{_ as n,y as r}from"./BftnFbcr.chunk.js";import{n as i}from"./B785hxeE.chunk.js";import{t as a}from"./CQyJ7YGa.chunk.js";import{t as o}from"./C2w0pmFW.chunk.js";import{t as s}from"./wrLrTezN.chunk.js";import{t as c}from"./BXTI9cmX.chunk.js";import{u as l}from"./BX0wDJmp.chunk.js";import{t as u}from"./C1SLt-ar.chunk.js";import{U as d,l as f,o as p,y as m,z as h}from"./NlCAcBdo.chunk.js";import{i as g,n as _,r as v,t as y}from"./Cr6TXzQQ2.chunk.js";import{t as b}from"./oPIkfKWW2.chunk.js";import{n as x,t as S}from"./CmcCVXi32.chunk.js";import{t as ee}from"./CcDvlSWl2.chunk.js";import{t as C}from"./DZX1tZ-D2.chunk.js";import{t as w}from"./DdsRCMkN.chunk.js";import{t as T}from"./BWaKdG0l.chunk.js";import{t as te}from"./PgzMrOyM.chunk.js";import{t as E}from"./Vp01-r6R.chunk.js";import{n as D,t as O}from"./A8xLZrSw.chunk.js";import{t as k}from"./BQKcAczf.chunk.js";import{t as A}from"./DR9DEoQL.chunk.js";import{n as j}from"./CpFtf-tI2.chunk.js";import{t as ne}from"./D0bhWkNM.chunk.js";import{t as M}from"./De16zmhB.chunk.js";import{t as re}from"./DewCxv4i.chunk.js";import{t as ie}from"./NVkf8UeY.chunk.js";import{t as ae}from"./BXU-68zb2.chunk.js";import{t as N}from"./B97Lnms-.chunk.js";import{t as P}from"./C2pEjcxD.chunk.js";import{t as F}from"./BmR4qY-v2.chunk.js";import{t as I}from"./DDiorDZl.chunk.js";import{t as L}from"./y3q_PHh_.chunk.js";import{o as R}from"./YcLj4o6h.chunk.js";import{n as z,t as B}from"./Bp_pLLKM.chunk.js";import{t as V}from"./cX5MHowe.chunk.js";import{r as H}from"./CHQUozwb.chunk.js";import{n as U,t as W}from"./DWeyYfUG.chunk.js";import{t as G}from"./
|
|
2
|
-
//# sourceMappingURL=
|
|
1
|
+
import{o as e}from"./DAXXjFlN.chunk.js";import{t}from"./D8uRDrkd.chunk.js";import{_ as n,y as r}from"./BftnFbcr.chunk.js";import{n as i}from"./B785hxeE.chunk.js";import{t as a}from"./CQyJ7YGa.chunk.js";import{t as o}from"./C2w0pmFW.chunk.js";import{t as s}from"./wrLrTezN.chunk.js";import{t as c}from"./BXTI9cmX.chunk.js";import{u as l}from"./BX0wDJmp.chunk.js";import{t as u}from"./C1SLt-ar.chunk.js";import{U as d,l as f,o as p,y as m,z as h}from"./NlCAcBdo.chunk.js";import{i as g,n as _,r as v,t as y}from"./Cr6TXzQQ2.chunk.js";import{t as b}from"./oPIkfKWW2.chunk.js";import{n as x,t as S}from"./CmcCVXi32.chunk.js";import{t as ee}from"./CcDvlSWl2.chunk.js";import{t as C}from"./DZX1tZ-D2.chunk.js";import{t as w}from"./DdsRCMkN.chunk.js";import{t as T}from"./BWaKdG0l.chunk.js";import{t as te}from"./PgzMrOyM.chunk.js";import{t as E}from"./Vp01-r6R.chunk.js";import{n as D,t as O}from"./A8xLZrSw.chunk.js";import{t as k}from"./BQKcAczf.chunk.js";import{t as A}from"./DR9DEoQL.chunk.js";import{n as j}from"./CpFtf-tI2.chunk.js";import{t as ne}from"./D0bhWkNM.chunk.js";import{t as M}from"./De16zmhB.chunk.js";import{t as re}from"./DewCxv4i.chunk.js";import{t as ie}from"./NVkf8UeY.chunk.js";import{t as ae}from"./BXU-68zb2.chunk.js";import{t as N}from"./B97Lnms-.chunk.js";import{t as P}from"./C2pEjcxD.chunk.js";import{t as F}from"./BmR4qY-v2.chunk.js";import{t as I}from"./DDiorDZl.chunk.js";import{t as L}from"./y3q_PHh_.chunk.js";import{o as R}from"./YcLj4o6h.chunk.js";import{n as z,t as B}from"./Bp_pLLKM.chunk.js";import{t as V}from"./cX5MHowe.chunk.js";import{r as H}from"./CHQUozwb.chunk.js";import{n as U,t as W}from"./DWeyYfUG.chunk.js";import{t as G}from"./B1ag1ah72.chunk.js";import{t as K}from"./DFrZwydG2.chunk.js";import{t as q}from"./CtWAorP42.chunk.js";import{t as oe}from"./Cj_F4Lv92.chunk.js";var se=e(o()),J=s();function ce(e){let n=I.getPartnerLinkByType(e.partnerProfile?.links,`website`,I.makeUTMs({slug:e.partnerProfile._slug.value})),r=C.getHostname(n)??n;return(0,J.jsx)(`div`,{className:`mt-3`,children:(0,J.jsx)(K,{children:()=>(0,J.jsxs)(`p`,{className:`mb-0`,children:[n&&(0,J.jsxs)(J.Fragment,{children:[(0,J.jsxs)(`a`,{href:n,target:`_blank`,rel:`noopener noreferrer`,className:`position-relative d-inline-block ps-4 mb-2 me-2`,children:[(0,J.jsx)(t,{svg:M,className:`svg-container position-absolute top-50 start-0 translate-middle-y`}),(0,J.jsx)(`span`,{className:`ps-1`,children:r})]}),(0,J.jsx)(`span`,{className:`mb-2 me-2`,children:`•`})]}),e.partnerProfile.description]})})})}var Y=`contentPartners.contentPartnerDashboardComingSoon`,le=a.encloseNamespace(Y);function ue(e){return(0,J.jsxs)(E,{children:[(0,J.jsx)(E.Image,{src:e.comingSoonImageUrl,altText:le(`description`,{partnerName:e.partnerName})}),(0,J.jsx)(E.Heading,{children:(0,J.jsx)(j,{namespace:Y,phrase:`heading`})}),(0,J.jsx)(E.Info,{children:(0,J.jsx)(j,{namespace:Y,phrase:`description`,options:{partnerName:e.partnerName}})})]})}var X=`contentPartners.contentPartnerDashboardContentRegion`,Z=a.encloseNamespace(X);function de(e){return(0,J.jsxs)(E,{children:[(0,J.jsx)(E.Image,{src:e.contentRegionImageUrl,altText:Z(`imageAlt`)}),(0,J.jsx)(E.Heading,{children:(0,J.jsx)(j,{namespace:X,phrase:`heading`})}),(0,J.jsx)(E.Cta,{text:Z(`cta`),appLink:e.contentRegionButtonLink,className:`btn btn-dark`})]})}var Q=`contentPartners.contentPartnerDashboardNoContent`,fe=a.encloseNamespace(Q);function $(e){return(0,J.jsxs)(E,{children:[(0,J.jsx)(E.Image,{src:e.noContentImageUrl,altText:fe(`description`)}),(0,J.jsx)(E.Heading,{children:(0,J.jsx)(j,{namespace:Q,phrase:`heading`})}),(0,J.jsx)(E.Info,{children:(0,J.jsx)(j,{namespace:Q,phrase:`description`})})]})}var pe={"coming-soon":ue,"content-region":de,"no-content":$};function me(e){let t=pe[e.type];return(0,J.jsx)(t,{...e})}var he=[g.ContentPartnerVideos];function ge(e,t){let n=e[t];return n?he.includes(n.widgetId)&&t===e.length-1:!1}function _e(e){let t=u.sortBy(e.dashboard?.widgets,`index`),{emptyWidgets:n,setEmptyWidget:r}=z(t);function a(t,n,r,i){let a=v.getWidgetParams(n,r,v.getDashboardTargetType(e.dashboard));return e.getWidgetContentRequest(t,a,r,void 0,i)}function o(){if(!e.isInContentRegion)return`content-region`;if(e.isComingSoon||e.dashboard.status===S.Archived&&!e.isReadonly)return`coming-soon`;if(e.dashboard.status===S.Draft&&!e.isPreviewing)return!1;if(!t?.length)return`no-content`;let r=Object.values(n);return r.length>0&&r.every(e=>!!e)?`no-content`:!1}let s=I.getPartnerBannerInfo(e.partnerProfile),c=o(),l=(!c||c===`content-region`)&&e.partnerProfile.description;return(0,J.jsxs)(J.Fragment,{children:[!!t.length&&(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(L,{type:`partner-profile`,partnerBannerType:I.getPartnerBannerType(e.partnerProfile),heading:s.heading,blockColourClass:s.blockColourClass,logo:s.logo,logoBgColour:s.logoBgColour,banner:s.banner,imageCdnUrl:e.commonVideoProps.imageCdnUrl,actions:e.getBannerActions?.(),onClickSignUp:e.onClickSignUp,isAuthenticated:e.isAuthenticated,videoUrl:e.partnerProfile._videobanner?.value?.url,websiteUrl:I.getPartnerLinkByType(e.partnerProfile?.links,`website`,I.makeUTMs({slug:e.partnerProfile._slug.value})),isStudent:e.hasPermissions(i.StudentExperience),log:e.log}),(0,J.jsxs)(`div`,{className:`py-3 mb-3 border-bottom`,children:[(0,J.jsx)(P,{breadcrumbs:e.breadcrumbs}),l&&(0,J.jsx)(ce,{partnerProfile:e.partnerProfile})]}),(0,J.jsx)(`div`,{className:`mt-3`,children:!c&&t.map((n,i)=>(0,J.jsx)(G,{dashboardTarget:x.PartnerProfile,index:i,item:n,infiniteFetch:ge(t,i),getName:e=>e.name,getWidgetMetadata:e=>e.metadata,appLinks:e.widgetAppLinks,hasPermissions:e.hasPermissions,commonVideoProps:e.commonVideoProps,audiences:e.audiences,setIsEmpty:e=>r(n.id,e),getCursor:e=>e.cursor,getRequest:e=>a(n.id,n.widgetId,n.templateId,e),hasLocalPermissions:e.hasLocalPermissions,settingsHash:e.settings,getContent:e=>e.content,resultsTransformers:y.getWidgetResultsTransformers(),onClickSearchAllVideos:e.onClickSearchAllVideos,getSeeMoreAppLink:e.getSeeMoreAppLink,isEmptyPredicate:e=>Array.isArray(e)&&Array.isArray(e[0]?.content)&&!e[0]?.content?.length,getSelectedItems:null,appLinkOptions:null},n.id))})]}),c&&(0,J.jsx)(me,{type:c,partnerName:e.partnerProfile.name,comingSoonImageUrl:e.emptyImageUrl,contentRegionImageUrl:e.emptyImageUrl,contentRegionButtonLink:e.widgetAppLinks?.partnerHome?.(),noContentImageUrl:e.emptyImageUrl})]})}function ve(){return{"click-video-banner-controls":{isValid:()=>!0,analyticsOptions:{actionType:h.Click,entity:f.PartnerProfile,descriptor:p.VideoBannerControls,location:m.ContentPartnerDashboardVideoBanner}},"click-video-banner-sign-up":{isValid:()=>!0,analyticsOptions:{actionType:h.Click,entity:f.PartnerProfile,workflowPhase:d.Start,descriptor:p.VideoBannerSignUp,location:m.ContentPartnerDashboardVideoBanner}}}}function ye(e){let{getData:t,log:n}=N({analyticsOptions:e.analyticsOptions,baseData:e.data,config:ve(),shouldLog:e.shouldLog??!0});return{log:n,getData:t}}var be=a.encloseNamespace(`contentPartners.dashboard`);function xe(e){let t=l(b.currentUser()),i=ae(e.slug),a=U({location:W.VideoItem,presentationSlug:null}),{log:o}=ye({data:{entity:{id:i.data?.id,name:i.data?.name,contentRegion:t.data?.contentRegion}},analyticsOptions:{entity:f.PartnerProfile,location:m.ContentPartnerDashboard}});oe({app:`channels`,id:i.data?.id,metadata:{conversionSuffix:i.data?.name}});let{openInCurationStudioLabel:s,isUserCurator:u,getOpenInCurationStudioLink:d}=H(),{commonVideoProps:p}=F({locationContext:m.VideoThumbnail}),{hasPermissions:h,hasLocalPermissions:g}=k(),v=ee(null),{dashboard:y,isPreviewing:S}=ie({targetType:x.PartnerProfile,partnerProfileSlug:e.slug,queryParams:e.queryParams});O(D.getDefaultMetadata({title:i.data?.name,phraseContext:{phraseHandler:be,titlePhrase:`pageTitle`,descriptionPhrase:`pageDescription`},allowIndexing:!0}));let C=V({name:i.data?.name});se.useEffect(()=>{!y.hasCompleted||y.data||n.throw(new T)},[y.data,y.hasCompleted]);let E=B(t.data,{channelId:i.data?.id,presentationSlug:null});function j(){return u?[{label:s,href:d(y.data?.typeId,y.data?.id),openInNewTab:!0}]:[]}function M(e,t,n,r,i){return re.dashboardWidgetContent(e,t,n,r,{cursor:i})}function N(e){return _[e.widgetId]?.getCollectionAppLink?.(E,e.content)??null}function P(e){o?.({type:`click-video-banner-sign-up`,email:e}),r.trigger(ne.getSignUpAppLink({email:e}))}let L=i.hasCompleted&&y.hasCompleted,z=A.isBot(),G=S?!0:I.isInContentRegion(i.data,t.data?.contentRegion,t.data?.isAuthenticated);function K(){r.trigger({application:c.SEARCH,action:w.Search.HOME,params:{scopeId:i.data?.id}})}return L?(0,J.jsx)(`div`,{className:`bg-white px-4 position-relative`,children:(0,J.jsxs)(R.Provider,{value:a,children:[!!(S&&y.data)&&(0,J.jsx)(q,{status:y.data.status,type:`channel`}),(0,J.jsx)(_e,{dashboard:y.data,partnerProfile:i.data,getWidgetContentRequest:M,commonVideoProps:p,breadcrumbs:C,getBannerActions:j,hasPermissions:h,hasLocalPermissions:g,settings:v,widgetAppLinks:E,emptyImageUrl:te.EmptyStates.WATCH_HISTORY,isBot:z,lazyLoad:!z,isAuthenticated:t.data?.isAuthenticated,isInContentRegion:G,onClickSignUp:P,isPreviewing:S,onClickSearchAllVideos:K,getSeeMoreAppLink:N,log:o})]})}):(0,J.jsx)(J.Fragment,{})}export{xe as ContentPartnersDashboardView};
|
|
2
|
+
//# sourceMappingURL=CUp7_5gE2.chunk.js.map
|