(window.webpackJsonp=window.webpackJsonp||[]).push([["7FEo"],{Dpzn:function(t,e,n){"use strict";var i=n("TqRt");Object.defineProperty(e,"__esModule",{value:!0}),e._ConcatenatedContentTitle=void 0,e._tokenizedWordSet=f,e.generateContentTitleTag=a,e.getTranslatedContentTitle=function(t){const e=function(t){let e=null;"Video"===t?e=s._("video"):"Article"===t?e=s._("article"):"Exercise"===t&&(e=s._("practice"));if(!e)return null;return` (${e})`}(t.contentKind);if(!e)return null;const n=t.tutorialPageData.contentModel.translatedCustomTitleTag;if(n)return`${n}${e}`;const i=t.tutorialPageData.topicModel.translatedTitle;let r=null;if(t.ancestorTopics){const e=t.ancestorTopics[t.ancestorTopics.length-2];e&&(r=e.title)}return a(t.tutorialPageData.contentModel.translatedTitle,e,i,r)},e.getTranslatedCurationNodeTitle=function(t,e,n){if(n)return n;const i=[t];let r=f(t),o=t.length;if(e){const t=e.slice().reverse();for(const e of t){const t=e.title;if(o+u.length+t.length>60)break;const n=f(t);h(r,n)||(i.push(t),r=r.concat(n),o+=t.length+u.length)}}return i.join(u)};var r=i(n("pVnL")),o=n("sExA"),s=function(t,e){if(!e&&t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var n=l(e);if(n&&n.has(t))return n.get(t);var i={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in t)if("default"!==o&&Object.prototype.hasOwnProperty.call(t,o)){var s=r?Object.getOwnPropertyDescriptor(t,o):null;s&&(s.get||s.set)?Object.defineProperty(i,o,s):i[o]=t[o]}i.default=t,n&&n.set(t,i);return i}(n("8jAt"));function l(t){if("function"!=typeof WeakMap)return null;var e=new WeakMap,n=new WeakMap;return(l=function(t){return t?n:e})(t)}const u=" | ";function a(t,e,n,i){let r=null;t&&(r=`${t}${e}`);const o=new c(t,e,n),s=new c(t,e,i);if(o.isPastLimit()&&s.isPastLimit())return r;if(o.isWithinLimit()&&s.isWithinLimit()){const t=o.numberCommonWords(),e=s.numberCommonWords();return t<e?o.title:e<t?s.title:o.numberUncommonWords()>0?o.title:s.numberUncommonWords()>0?s.title:r}return o.isWithinLimit()&&o.numberUncommonWords()>0?o.title:s.isWithinLimit()&&s.numberUncommonWords()>0?s.title:r}class c{constructor(t,e,n){this.CONTENT_TITLE_LIMIT=45,this.contentTitle=null,this.parentTitle=null,this.hasBothTitles=!1,this.title=null,this.titleLength=null,this.contentTitle=t,this.parentTitle=n,this.contentTitle&&this.parentTitle?(this.hasBothTitles=!0,this.title=[this.contentTitle+e,this.parentTitle].join(u),this.titleLength=this.title.length):(this.hasBothTitles=!1,this.title=null,this.titleLength=null)}isPastLimit(){return this.hasBothTitles&&null!==this.titleLength&&this.titleLength>this.CONTENT_TITLE_LIMIT}isWithinLimit(){return this.hasBothTitles&&null!==this.titleLength&&this.titleLength<this.CONTENT_TITLE_LIMIT}numberCommonWords(){if(!this.hasBothTitles)return 0;const t=this.parentTitle,e=this.contentTitle;if(!e||!t)return 0;const n=f(e),i=f(t),r={};return n.forEach((t=>{i.indexOf(t)>-1&&!r[t]&&(r[t]=!0)})),(0,o.keys)(r).length}numberUncommonWords(){if(!this.hasBothTitles)return 0;const t=this.parentTitle,e=this.contentTitle;if(!e||!t)return 0;const n=f(e),i=f(t),r={};n.forEach((t=>{r[t]=!0})),i.forEach((t=>{r[t]=!0}));const o={};n.forEach((t=>{i.indexOf(t)>-1&&!o[t]&&(o[t]=!0)}));const s=[];for(const t in r)o[t]||s.push(t);return s.length}}function h(t,e){for(const n of e)if(-1===t.indexOf(n))return!1;return!0}function f(t){let e={};return e=t.toLocaleLowerCase().split(/\s/).reduce(((t,e)=>(0,r.default)({},t,{[e]:!0})),e),(0,o.keys)(e)}e._ConcatenatedContentTitle=c},xjI7:function(t,e,n){"use strict";var i=n("TqRt");Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r=i(n("pVnL")),o=n("q1tI"),s=i(n("V7qd"));var l=t=>{const{state:e}=(0,s.default)(),{courseId:n}=t,i=n?e.courseById[n]:null,l=n?e.unlistedUnitIdsByCourseId[n]:null;return(0,o.useMemo)((()=>i?(0,r.default)({},i,{unitChildren:i.unitChildren.filter((e=>e.id===t.unitId||!(null!=l&&l.has(e.id))))}):null),[i,t.unitId,l])};e.default=l}}]);
//# sourceMappingURL=../../sourcemaps/en/7FEo.72b566a3a6bca04b33a0.js.map