import{bS as h,bT as r,bv as _,cy as C,ao as a,dV as u,ap as m,au as k,av as b,bl as v,cw as j,cx as N,b_ as L,aq as g,ba as S}from"./app-k0jcl5PQ.js";const w="_appLink_1diix_1",I="_name_1diix_4",f="_selectedMask_1diix_7",y="_widgetItem_1diix_15",P="_hasThemeColor_1diix_19",$="_text_1diix_26",F="_imagePanel_1diix_29",H="_partialLargeImage_1diix_29",M="_selected_1diix_7",O="_image_1diix_29",T="_dragHandle_1diix_55",V="_large_1diix_59",B="_comingSoonPanel_1diix_69",A="_newVideos_1diix_75",U="_draggingItem_1diix_94",z="_partialLargeFallback_1diix_102",R="_partialIcon_1diix_106",t={appLink:w,name:I,selectedMask:f,widgetItem:y,hasThemeColor:P,text:$,imagePanel:F,partialLargeImage:H,selected:M,image:O,dragHandle:T,large:V,comingSoonPanel:B,newVideos:A,draggingItem:U,partialLargeFallback:z,partialIcon:R},x="shared.subjectWidgetItem",W=({name:e,multiline:i,noUnderLine:l})=>{let s=`${t.comingSoonPanel} 
    d-flex flex-column align-items-center justify-content-center px-3 text-center`,n="";return i?n+=` ${t.clamped} clamp-2`:(s+=" text-nowrap",n+=" text-truncate"),a.jsxs("div",{className:s,children:[a.jsx("small",{className:"text-secondary",children:a.jsx(g,{namespace:x,phrase:"comingSoon"})}),a.jsx("p",{className:`${l?"":t.name} h6`,children:a.jsx("span",{className:n,children:e})})]})},D=({name:e,multiline:i,subtitle:l,noUnderLine:s,newVideosCount:n})=>{let d="px-3 d-flex flex-column justify-content-center",c=`${s?"":t.name} h6`;return i?c+=` ${n?"clamp-2":"clamp-3"} text-start`:(d+=" text-nowrap text-truncate",c+=" text-truncate mb-0"),a.jsxs("div",{className:d,children:[l&&a.jsx("div",{className:`text-secondary clamp-1 ${t.text}`,children:l}),a.jsx("div",{className:c,title:e,children:e}),!!n&&a.jsx("div",{className:`fw-semibold d-inline-block rounded-pill px-2 mt-1 bg-light-green w-fit h-fit text-green ${t.newVideos}`,children:a.jsx(g,{namespace:x,phrase:"newVideos",options:{smartCount:n}})})]})};o.defaultProps={showFallbackBackgroundColour:!0};function o(e){var c;const i=h.createUrl(e.coverUrl,{size:e.isLarge?r.Medium:r.Small});let l;_.isClassification(e.data)&&(l=e.data);const s={name:e.data.name,multiline:e.isLarge||e.multiline,subtitle:e.subtitle,noUnderLine:e.highlightOnHover,newVideosCount:e.showNewVideosCount?(c=l==null?void 0:l.externalMetadata)==null?void 0:c.childDashboardNewVideoCount:0},n={backgroundImage:i?`url('${i}')`:null,backgroundColor:e.coverBgColor},d=C(e.data.name,L);return a.jsxs("div",{className:m(e.themeColor?t.hasThemeColor:"border","d-flex position-relative",e.className,t.widgetItem,e.isSelected?"border-success border-2":"",e.highlightOnHover&&!e.themeColor?"bg-light-blue-hover":""),style:e.themeColor?{"--themeColor":e.themeColor}:{},id:`${e.data.id}-${u.getRandomInt()}`,onClick:e.onClick,children:[e.isSelected&&a.jsx("div",{className:`${t.selectedMask} border-2`}),a.jsxs("div",{className:`${t.imagePanel} ${e.isLarge?t.large:""}`,children:[e.isSelected&&!e.hideCheckmark&&a.jsx("div",{className:t.selected,children:a.jsx(k,{svg:v,svgSize:b.Large,textVariant:"white",variant:"green"})}),i&&a.jsx("div",{className:m(t.image,e.imageClassName,!e.coverBgColor&&e.showFallbackBackgroundColour&&d),style:n}),!e.hideFallback&&a.jsx(j,{type:N.Subject,extraClasses:e.isLarge?t.large:""})]}),e.isComingSoon?a.jsx(W,{...s}):a.jsx(D,{...s})]})}function q(e){var l;const i=e.getChildAppLink?e.getChildAppLink(e.data):null;return a.jsx(a.Fragment,{children:i?a.jsx(S,{className:t.appLink,appLink:i,analyticsData:e.analyticsData,analyticsOptions:e.analyticsOptions,appLinkOptions:(l=e.getChildAppLinkOptions)==null?void 0:l.call(e),children:a.jsx(o,{...e})}):a.jsx(o,{...e})})}export{q as C,o as a,t as s};
//# sourceMappingURL=BcYgJJPz.chunk.js.map
