@livetiles/reach-components-react 0.4.0-preview.233 → 0.4.0-preview.237
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/NewsGrid.d.ts +2 -2
- package/NewsHero.d.ts +3 -2
- package/NewsList.d.ts +2 -2
- package/common/filter/LibNewsFilterDefinition.d.ts +5 -0
- package/common/utils.d.ts +2 -1
- package/en.async.esm.esm.js +2 -1
- package/index.d.ts +18 -12
- package/index.esm2.js +82 -51
- package/index.umd.js +84 -52
- package/package.json +1 -1
package/index.esm2.js
CHANGED
|
@@ -87469,9 +87469,9 @@ var AuthenticationContextProvider = function AuthenticationContextProvider(_a) {
|
|
|
87469
87469
|
}), void 0);
|
|
87470
87470
|
};
|
|
87471
87471
|
|
|
87472
|
-
var version$1 = "0.4.0-preview.
|
|
87473
|
-
var buildId = "
|
|
87474
|
-
var commitId = "
|
|
87472
|
+
var version$1 = "0.4.0-preview.237";
|
|
87473
|
+
var buildId = "98977";
|
|
87474
|
+
var commitId = "564f4c9f83e894d254c37ee765eb6672fa8ac3b0";
|
|
87475
87475
|
var isCustomerBuild = false;
|
|
87476
87476
|
var buildInfo = {
|
|
87477
87477
|
version: version$1,
|
|
@@ -131658,7 +131658,13 @@ resolve:function resolve(x){return promiseResolve(this,x);}});$$9({target:PROMIS
|
|
|
131658
131658
|
// https://tc39.github.io/ecma262/#sec-promise.all
|
|
131659
131659
|
all:function all(iterable){var C=this;var capability=newPromiseCapability(C);var resolve=capability.resolve;var reject=capability.reject;var result=perform(function(){var $promiseResolve=aFunction$3(C.resolve);var values=[];var counter=0;var remaining=1;iterate(iterable,function(promise){var index=counter++;var alreadyCalled=false;values.push(undefined);remaining++;$promiseResolve.call(C,promise).then(function(value){if(alreadyCalled)return;alreadyCalled=true;values[index]=value;--remaining||resolve(values);},reject);});--remaining||resolve(values);});if(result.error)reject(result.value);return capability.promise;},// `Promise.race` method
|
|
131660
131660
|
// https://tc39.github.io/ecma262/#sec-promise.race
|
|
131661
|
-
race:function race(iterable){var C=this;var capability=newPromiseCapability(C);var reject=capability.reject;var result=perform(function(){var $promiseResolve=aFunction$3(C.resolve);iterate(iterable,function(promise){$promiseResolve.call(C,promise).then(capability.resolve,reject);});});if(result.error)reject(result.value);return capability.promise;}});
|
|
131661
|
+
race:function race(iterable){var C=this;var capability=newPromiseCapability(C);var reject=capability.reject;var result=perform(function(){var $promiseResolve=aFunction$3(C.resolve);iterate(iterable,function(promise){$promiseResolve.call(C,promise).then(capability.resolve,reject);});});if(result.error)reject(result.value);return capability.promise;}});var LogicalOperator;(function(LogicalOperator){LogicalOperator["Or"]="or";LogicalOperator["And"]="and";})(LogicalOperator||(LogicalOperator={}));var fails$2$1=fails$i;var arrayMethodIsStrict$2=function(METHOD_NAME,argument){var method=[][METHOD_NAME];return !!method&&fails$2$1(function(){// eslint-disable-next-line no-useless-call,no-throw-literal
|
|
131662
|
+
method.call(null,argument||function(){throw 1;},1);});};var $$8=_export;var aFunction$2=aFunction$7;var toObject$3=toObject$7;var fails$1$1=fails$i;var arrayMethodIsStrict$1=arrayMethodIsStrict$2;var test$1=[];var nativeSort=test$1.sort;// IE8-
|
|
131663
|
+
var FAILS_ON_UNDEFINED=fails$1$1(function(){test$1.sort(undefined);});// V8 bug
|
|
131664
|
+
var FAILS_ON_NULL=fails$1$1(function(){test$1.sort(null);});// Old WebKit
|
|
131665
|
+
var STRICT_METHOD$1=arrayMethodIsStrict$1('sort');var FORCED$1=FAILS_ON_UNDEFINED||!FAILS_ON_NULL||!STRICT_METHOD$1;// `Array.prototype.sort` method
|
|
131666
|
+
// https://tc39.github.io/ecma262/#sec-array.prototype.sort
|
|
131667
|
+
$$8({target:'Array',proto:true,forced:FORCED$1},{sort:function sort(comparefn){return comparefn===undefined?nativeSort.call(toObject$3(this)):nativeSort.call(toObject$3(this),aFunction$2(comparefn));}});var SortFieldsDefinitionBuilder=/** @class */function(){function SortFieldsDefinitionBuilder(){this.sort=[];}SortFieldsDefinitionBuilder.prototype.addSortField=function(field,direction){this.sort.push(field+":"+SortFieldsDefinitionBuilder.getSortDirectionAsString(direction));return this;};SortFieldsDefinitionBuilder.getSortDirectionAsString=function(direction){return direction===SortDirection.asc?'asc':'desc';};return SortFieldsDefinitionBuilder;}();var EventSortFieldsDefinitionBuilder=/** @class */function(_super){__extends(EventSortFieldsDefinitionBuilder,_super);function EventSortFieldsDefinitionBuilder(){return _super!==null&&_super.apply(this,arguments)||this;}EventSortFieldsDefinitionBuilder.create=function(){return new EventSortFieldsDefinitionBuilder();};return EventSortFieldsDefinitionBuilder;}(SortFieldsDefinitionBuilder);EventSortFieldsDefinitionBuilder.create().addSortField('startDate',SortDirection.desc);EventSortFieldsDefinitionBuilder.create().addSortField('publishingDate',SortDirection.desc);var ItemType;(function(ItemType){ItemType[ItemType["None"]=0]="None";ItemType[ItemType["News"]=1]="News";ItemType[ItemType["Post"]=2]="Post";ItemType[ItemType["Page"]=4]="Page";ItemType[ItemType["Event"]=8]="Event";})(ItemType||(ItemType={}));// `SameValue` abstract operation
|
|
131662
131668
|
// https://tc39.github.io/ecma262/#sec-samevalue
|
|
131663
131669
|
var sameValue$1=Object.is||function is(x,y){// eslint-disable-next-line no-self-compare
|
|
131664
131670
|
return x===y?x!==0||1/x===1/y:x!=x&&y!=y;};var fixRegExpWellKnownSymbolLogic$1=fixRegexpWellKnownSymbolLogic$1;var anObject$1$1=anObject$h;var requireObjectCoercible$3=requireObjectCoercible$c;var sameValue=sameValue$1;var regExpExec$1=regexpExecAbstract$1;// @@search logic
|
|
@@ -131666,10 +131672,22 @@ fixRegExpWellKnownSymbolLogic$1('search',1,function(SEARCH,nativeSearch,maybeCal
|
|
|
131666
131672
|
// https://tc39.github.io/ecma262/#sec-string.prototype.search
|
|
131667
131673
|
function search(regexp){var O=requireObjectCoercible$3(this);var searcher=regexp==undefined?undefined:regexp[SEARCH];return searcher!==undefined?searcher.call(regexp,O):new RegExp(regexp)[SEARCH](String(O));},// `RegExp.prototype[@@search]` method
|
|
131668
131674
|
// https://tc39.github.io/ecma262/#sec-regexp.prototype-@@search
|
|
131669
|
-
function(regexp){var res=maybeCallNative(nativeSearch,regexp,this);if(res.done)return res.value;var rx=anObject$1$1(regexp);var S=String(this);var previousLastIndex=rx.lastIndex;if(!sameValue(previousLastIndex,0))rx.lastIndex=0;var result=regExpExec$1(rx,S);if(!sameValue(rx.lastIndex,previousLastIndex))rx.lastIndex=previousLastIndex;return result===null?-1:result.index;}];});var $$
|
|
131675
|
+
function(regexp){var res=maybeCallNative(nativeSearch,regexp,this);if(res.done)return res.value;var rx=anObject$1$1(regexp);var S=String(this);var previousLastIndex=rx.lastIndex;if(!sameValue(previousLastIndex,0))rx.lastIndex=0;var result=regExpExec$1(rx,S);if(!sameValue(rx.lastIndex,previousLastIndex))rx.lastIndex=previousLastIndex;return result===null?-1:result.index;}];});var $$7=_export;var assign=objectAssign;// `Object.assign` method
|
|
131670
131676
|
// https://tc39.github.io/ecma262/#sec-object.assign
|
|
131671
|
-
$$
|
|
131672
|
-
|
|
131677
|
+
$$7({target:'Object',stat:true,forced:Object.assign!==assign},{assign:assign});var fixRegExpWellKnownSymbolLogic$4=fixRegexpWellKnownSymbolLogic$1;var anObject$i=anObject$h;var toObject$2=toObject$7;var toLength$4=toLength$b;var toInteger$5=toInteger$4;var requireObjectCoercible$2$1=requireObjectCoercible$c;var advanceStringIndex$4=advanceStringIndex$3;var regExpExec$3=regexpExecAbstract$1;var max$1=Math.max;var min$2=Math.min;var floor=Math.floor;var SUBSTITUTION_SYMBOLS=/\$([$&'`]|\d\d?|<[^>]*>)/g;var SUBSTITUTION_SYMBOLS_NO_NAMED=/\$([$&'`]|\d\d?)/g;var maybeToString=function(it){return it===undefined?it:String(it);};// @@replace logic
|
|
131678
|
+
fixRegExpWellKnownSymbolLogic$4('replace',2,function(REPLACE,nativeReplace,maybeCallNative,reason){var REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE=reason.REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE;var REPLACE_KEEPS_$0=reason.REPLACE_KEEPS_$0;var UNSAFE_SUBSTITUTE=REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE?'$':'$0';return [// `String.prototype.replace` method
|
|
131679
|
+
// https://tc39.github.io/ecma262/#sec-string.prototype.replace
|
|
131680
|
+
function replace(searchValue,replaceValue){var O=requireObjectCoercible$2$1(this);var replacer=searchValue==undefined?undefined:searchValue[REPLACE];return replacer!==undefined?replacer.call(searchValue,O,replaceValue):nativeReplace.call(String(O),searchValue,replaceValue);},// `RegExp.prototype[@@replace]` method
|
|
131681
|
+
// https://tc39.github.io/ecma262/#sec-regexp.prototype-@@replace
|
|
131682
|
+
function(regexp,replaceValue){if(!REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE&&REPLACE_KEEPS_$0||typeof replaceValue==='string'&&replaceValue.indexOf(UNSAFE_SUBSTITUTE)===-1){var res=maybeCallNative(nativeReplace,regexp,this,replaceValue);if(res.done)return res.value;}var rx=anObject$i(regexp);var S=String(this);var functionalReplace=typeof replaceValue==='function';if(!functionalReplace)replaceValue=String(replaceValue);var global=rx.global;if(global){var fullUnicode=rx.unicode;rx.lastIndex=0;}var results=[];while(true){var result=regExpExec$3(rx,S);if(result===null)break;results.push(result);if(!global)break;var matchStr=String(result[0]);if(matchStr==='')rx.lastIndex=advanceStringIndex$4(S,toLength$4(rx.lastIndex),fullUnicode);}var accumulatedResult='';var nextSourcePosition=0;for(var i=0;i<results.length;i++){result=results[i];var matched=String(result[0]);var position=max$1(min$2(toInteger$5(result.index),S.length),0);var captures=[];// NOTE: This is equivalent to
|
|
131683
|
+
// captures = result.slice(1).map(maybeToString)
|
|
131684
|
+
// but for some reason `nativeSlice.call(result, 1, result.length)` (called in
|
|
131685
|
+
// the slice polyfill when slicing native arrays) "doesn't work" in safari 9 and
|
|
131686
|
+
// causes a crash (https://pastebin.com/N21QzeQA) when trying to debug it.
|
|
131687
|
+
for(var j=1;j<result.length;j++)captures.push(maybeToString(result[j]));var namedCaptures=result.groups;if(functionalReplace){var replacerArgs=[matched].concat(captures,position,S);if(namedCaptures!==undefined)replacerArgs.push(namedCaptures);var replacement=String(replaceValue.apply(undefined,replacerArgs));}else {replacement=getSubstitution(matched,S,position,captures,namedCaptures,replaceValue);}if(position>=nextSourcePosition){accumulatedResult+=S.slice(nextSourcePosition,position)+replacement;nextSourcePosition=position+matched.length;}}return accumulatedResult+S.slice(nextSourcePosition);}];// https://tc39.github.io/ecma262/#sec-getsubstitution
|
|
131688
|
+
function getSubstitution(matched,str,position,captures,namedCaptures,replacement){var tailPos=position+matched.length;var m=captures.length;var symbols=SUBSTITUTION_SYMBOLS_NO_NAMED;if(namedCaptures!==undefined){namedCaptures=toObject$2(namedCaptures);symbols=SUBSTITUTION_SYMBOLS;}return nativeReplace.call(replacement,symbols,function(match,ch){var capture;switch(ch.charAt(0)){case'$':return '$';case'&':return matched;case'`':return str.slice(0,position);case"'":return str.slice(tailPos);case'<':capture=namedCaptures[ch.slice(1,-1)];break;default:// \d\d?
|
|
131689
|
+
var n=+ch;if(n===0)return match;if(n>m){var f=floor(n/10);if(f===0)return match;if(f<=m)return captures[f-1]===undefined?ch.charAt(1):captures[f-1]+ch.charAt(1);return match;}capture=captures[n-1];}return capture===undefined?'':capture;});}});var BaseFilterDefinitionImpl=/** @class */function(){function BaseFilterDefinitionImpl(){}return BaseFilterDefinitionImpl;}();__spreadArray(__spreadArray([],Object.keys(new BaseFilterDefinitionImpl())),['hideChrome','teams']);function getCommaSeparatedChannelsString(channels){var _a;if(!channels||!((_a=channels.items)===null||_a===void 0?void 0:_a.length)){return {};}return {channels:channels.items.join(',')};}function getCommaSeparatedKeywordsString(keywords){if(!keywords||!keywords.length){return {};}return {keywords:keywords.join(',')};}function converToChannelsFilterWithLogicalOperator(channels){if(!(channels===null||channels===void 0?void 0:channels.length)){return {};}return {items:channels.split(','),operator:LogicalOperator.Or};}function convertToKeywordsArray(keywords){return (keywords||'').split(',').filter(function(k){return k&&k.length>0;});}function useEventsApi(){var api=useApi();return useMemo(function(){return {getEvents:getEvents,getEvent:getEvent,getEventRecurrences:getEventRecurrences};function getEvents(filter,sortFieldBuilder){var queryString$1=queryString.stringify(__assign(__assign({},filter&&__assign(__assign(__assign({},filter),getCommaSeparatedChannelsString(filter===null||filter===void 0?void 0:filter.channels)),getCommaSeparatedKeywordsString(filter===null||filter===void 0?void 0:filter.keywords))),sortFieldBuilder&&__assign({},sortFieldBuilder)));return api.custom("events?"+queryString$1).get().then(function(r){return r.body().data();});}function getEvent(id){return api.all('events').get(id).then(function(response){var eventItem=response.body().data();itemStatisticsCache[eventItem.id]=Promise.resolve(__assign({},eventItem.statistics));return eventItem;});}function getEventRecurrences(eventId,from,to){return api.all("editor/events/"+eventId+"/recurrences?"+queryString.stringify({from:from,to:to})).getAll().then(function(res){return res.body().map(function(e){return e.data();});});}},[api]);}var defaultPageSize$2=10;function fetchNewsItems(path,cacheKey,api,storage,paginationToken,filterDefinition,isArray){var _this=this;var _a,_b,_c;if(isArray===void 0){isArray=false;}var hasSimpleFilters=filterDefinition.beforeDate!=null||filterDefinition.afterDate!=null||((_a=filterDefinition.keywords)===null||_a===void 0?void 0:_a.length)>0||filterDefinition.author!=null||filterDefinition.owner!=null||filterDefinition.bookmarksOnly!=null||filterDefinition.source!=null||filterDefinition.state!=null||filterDefinition.groupId!=null||filterDefinition.includePromoted!=null||filterDefinition.unreadOnly!=null;var isSearchActive=filterDefinition.search&&filterDefinition.search.length>0;var hasChannels=((_c=(_b=filterDefinition===null||filterDefinition===void 0?void 0:filterDefinition.channels)===null||_b===void 0?void 0:_b.items)===null||_c===void 0?void 0:_c.length)>0;var pageSize=filterDefinition.pageSize;var hasAnyFilteringApplied=hasChannels||hasSimpleFilters||isSearchActive;// Note: caching is done only for the first page (paginationToken == null)
|
|
131690
|
+
var canCache=!hasAnyFilteringApplied&&paginationToken==null;if(isSearchActive){filterDefinition.search=filterDefinition.search.trim();}if(!hasAnyFilteringApplied){filterDefinition=null;}var params=Object.assign({},{token:paginationToken,pageSize:pageSize!==null&&pageSize!==void 0?pageSize:defaultPageSize$2},__assign(__assign(__assign({},filterDefinition),getCommaSeparatedChannelsString(filterDefinition===null||filterDefinition===void 0?void 0:filterDefinition.channels)),getCommaSeparatedKeywordsString(filterDefinition===null||filterDefinition===void 0?void 0:filterDefinition.keywords)));var endpoint=api.all(path);var apiLoader=isArray?endpoint.getAll(params).then(function(res){return {items:res.body().map(function(r){return r.data();})};}):endpoint.get('',params).then(function(res){return res.body().data();});if(!canCache){return from(apiLoader);}return new Observable(function(observer){(function(){return __awaiter(_this,void 0,void 0,function(){var cachedPage,apiPage_1,err_1;return __generator(this,function(_a){switch(_a.label){case 0:_a.trys.push([0,3,,4]);return [4/*yield*/,storage.getObject(cacheKey)];case 1:cachedPage=_a.sent();if(cachedPage){validateFileAccessTokens(cachedPage,function(isTokenValid,item){if(!isTokenValid){// prevent executing requests resulting in 401 if we already know the token is not valid anymore
|
|
131673
131691
|
item.fileAccessToken=null;}});observer.next(cachedPage);}return [4/*yield*/,apiLoader];case 2:apiPage_1=_a.sent();// no need to wait for updating the cache
|
|
131674
131692
|
storage.set(cacheKey,apiPage_1).then(function(){return null;});if(!cachedPage){observer.next(apiPage_1);observer.complete();return [2/*return*/];}validateFileAccessTokens(cachedPage,function(isTokenValid,cachedItem){var apiItem=apiPage_1.items.find(function(i){return i.id===cachedItem.id;});if(apiItem&&isTokenValid){// prevent reload of the image if the old token is still valid
|
|
131675
131693
|
apiItem.fileAccessToken=cachedItem.fileAccessToken;}});observer.next(apiPage_1);observer.complete();return [3/*break*/,4];case 3:err_1=_a.sent();observer.error(err_1);return [3/*break*/,4];case 4:return [2/*return*/];}});});})();});}function validateFileAccessTokens(page,modifyFunc){if(!page||!page.items){return;}page.items.forEach(function(item){var isTokenValid=isTokenStillValid(item.fileAccessToken);modifyFunc(isTokenValid,item);});}var NewsApiService=/** @class */function(){function NewsApiService(factory,subscriptionId,storage){var _this=this;this.factory=factory;this.storage=storage;this.trackExternalItem=function(itemId,itemType){return _this.api.custom(itemType+"/"+encodeURIComponent(itemId)+"/external_url/track").get().then(function(result){return result.body().data();});};this.getAllNews=function(filterDefinition,paginationToken){return fetchNewsItems('news',NewsApiService.allNewsCacheKey,_this.api,_this.storage,paginationToken,__assign(__assign({},filterDefinition||{}),{includePromoted:true}));};this.getAllUnreadNews=function(filterDefinition,paginationToken){return fetchNewsItems('news',NewsApiService.allNewsCacheKey,_this.api,_this.storage,paginationToken,__assign(__assign({},filterDefinition||{}),{unreadOnly:true,pageSize:0}));};this.getMyNews=function(filterDefinition,paginationToken){return fetchNewsItems('users/current/news',NewsApiService.newsCacheKey,_this.api,_this.storage,paginationToken,filterDefinition);};this.getMyUnreadNews=function(filterDefinition,paginationToken){return fetchNewsItems('users/current/news/unread',NewsApiService.myUnreadNewsCacheKey,_this.api,_this.storage,paginationToken,filterDefinition,true);};this.getBookmarks=function(filterDefinition){return fetchNewsItems('users/current/bookmarks',NewsApiService.bookmarksCacheKey,_this.api,_this.storage,null,filterDefinition,true);};this.getNewsFromCache=function(){return __awaiter(_this,void 0,void 0,function(){var _a;return __generator(this,function(_b){switch(_b.label){case 0:return [4/*yield*/,this.storage.getObject(NewsApiService.newsItemsCacheKey)];case 1:return [2/*return*/,(_a=_b.sent())!==null&&_a!==void 0?_a:[]];}});});};this.get=function(newsId){var getFromCache=function getFromCache(id){return __awaiter(_this,void 0,void 0,function(){var cache,hits;return __generator(this,function(_a){switch(_a.label){case 0:return [4/*yield*/,this.getNewsFromCache()];case 1:cache=_a.sent();hits=cache.filter(function(i){return i.id===id;});return [2/*return*/,hits.length>0?hits[0]:null];}});});};var getFromApi=function getFromApi(id){return from(_this.api.all('news').get(id)).pipe(mergeMap(function(res){return updateItemCache(res.body().data());}));};var updateItemCache=function updateItemCache(item){return __awaiter(_this,void 0,void 0,function(){var fromCache,index,cacheItem,clonedCachedItem,clonedNewItem;return __generator(this,function(_a){switch(_a.label){case 0:if(item.statistics){itemStatisticsCache[item.id]=Promise.resolve(__assign({},item.statistics));}return [4/*yield*/,this.getNewsFromCache()];case 1:fromCache=_a.sent();index=fromCache.findIndex(function(i){return i.id===item.id;});if(index>-1){cacheItem=fromCache[index];if(isTokenStillValid(cacheItem.fileAccessToken)){clonedCachedItem=__assign({},cacheItem);delete clonedCachedItem.fileAccessToken;clonedNewItem=__assign({},item);delete clonedNewItem.fileAccessToken;if(JSON.stringify(clonedCachedItem)===JSON.stringify(clonedNewItem)){return [2/*return*/,null];}}fromCache.splice(index,1,item);}else {fromCache.push(item);}return [4/*yield*/,this.storage.set(NewsApiService.newsItemsCacheKey,fromCache)];case 2:_a.sent();return [2/*return*/,item];}});});};return concat(getFromCache(newsId),getFromApi(newsId)).pipe(filter(function(i){return i!=null;}),catchError(function(err){if(err.response&&err.response.statusCode===404){return of(null);}else {return throwError(err);}}));};this.getImageUrlWithToken=function(token,itemId,subscriptionId,resourceType,imageIdentifier,width,height){if(imageIdentifier===void 0){imageIdentifier='banner';}return _this.factory.createApiUrl("/"+resourceType+"/"+itemId+"/images/"+imageIdentifier+"/"+width+"/"+(height||''),{access_token:token,subscriptionId:subscriptionId});};this.getStatistics=function(newsId){if(!itemStatisticsCache[newsId]){itemStatisticsCache[newsId]=_this.api.custom("news/"+newsId+"/statistics").get().then(function(result){return result.body().data();}).then(function(result){var feedbackCountsKeys=Object.keys(result.feedbackCounts);return {bookmarkCount:result.bookmarkCount,likeCount:result.feedbackCounts[feedbackCountsKeys.find(function(k){return k==='like';})],commentCount:result.commentCount,confirmationCount:result.feedbackCounts[feedbackCountsKeys.find(function(k){return k==='confirm';})],readCount:result.readCount};});}return itemStatisticsCache[newsId];};this.refreshStatistics=function(itemId,delta){return __awaiter(_this,void 0,void 0,function(){var _this=this;return __generator(this,function(_a){switch(_a.label){case 0:// update statistics cache with new delta
|
|
@@ -131694,27 +131712,14 @@ return this.getVideoElement(getMicrosoftStreamEmbedVideoUrl(this.videoInfo.id,th
|
|
|
131694
131712
|
// ></iframe>;
|
|
131695
131713
|
var _a=this.videoProperties||{},sp=_a.sp,uiconfId=_a.uiconfId,partnerId=_a.partnerId,entryId=_a.entryId;var iframe=document.createElement('iframe');iframe.setAttribute('aria-label',this.iframeAreaLabel);iframe.setAttribute('src',"https://cdnapisec.kaltura.com/p/"+this.videoInfo.id+"/sp/"+sp+"/embedIframeJs/uiconf_id/"+uiconfId+"/partner_id/"+partnerId+"?iframeembed=true&playerId=kaltura_player&entry_id="+entryId);iframe.setAttribute('frameborder','0');iframe.setAttribute('allowfullscreen','');return iframe;};VideoElementGenerator.prototype.getGenericURLVideoElement=function(){var _a;// for generic URL videos, we treat the id as the URL
|
|
131696
131714
|
var video=document.createElement('video');video.setAttribute('controls','');var source=document.createElement('source');source.setAttribute('src',(_a=this.videoInfo.url)!==null&&_a!==void 0?_a:this.videoInfo.id);if(this.autoplay){video.setAttribute('autoplay','');}if(this.width){video.setAttribute('width',this.width);}var noVideo=document.createTextNode('Your browser does not support the video tag');video.appendChild(source);video.appendChild(noVideo);return video;};VideoElementGenerator.prototype.getVideoElement=function(src){var iframe=document.createElement('iframe');iframe.setAttribute('src',src);iframe.setAttribute('frameborder','0');iframe.setAttribute('webkitallowfullscreen','');iframe.setAttribute('mozallowfullscreen','');iframe.setAttribute('allowfullscreen','');iframe.setAttribute('aria-label',this.iframeAreaLabel);return iframe;};VideoElementGenerator.prototype.getNotSupportedElement=function(){var content=document.createElement('div');content.innerText="The selected video cannot be played. The source is not supported.";return content;};VideoElementGenerator.getVideoElement=function(videoInfo,autoplay,width,iframeAreaLabel,videoProperties){var generator=new VideoElementGenerator(videoInfo,iframeAreaLabel||'',autoplay,width,videoProperties);switch(videoInfo.source){case VideoSource.YouTube:return generator.getYouTubeVideoElement();case VideoSource.Vimeo:return videoInfo.isDirectUrl?generator.getExternalVimeoVideoElement():generator.getVimeoVideoElement();case VideoSource.MicrosoftStream:return generator.getMicrosoftStreamVideoElement();case VideoSource.GenericUrl:return generator.getGenericURLVideoElement();case VideoSource.Kaltura:return generator.getKalturaVideoElement();default:return generator.getNotSupportedElement();}};VideoElementGenerator.getVideoType=function(videoInfo){switch(videoInfo.source){case VideoSource.YouTube:return 'YouTube';case VideoSource.Vimeo:return 'Vimeo';case VideoSource.MicrosoftStream:return 'Microsoft Stream';case VideoSource.GenericUrl:return 'Generic';case VideoSource.Kaltura:return 'Kaltura';default:return '';}};return VideoElementGenerator;}();var VideoView=function VideoView(_a){var videoInfo=_a.videoInfo,autoplay=_a.autoplay,width=_a.width,className=_a.className;var formatMessage=useIntl().formatMessage;var container=useRef$1();useEffect$1(function(){renderContents();// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
131697
|
-
},[videoInfo.id,videoInfo.source]);return jsx$1(Host$T,{className:classNames(className,inlineObjectsClassNames.video,videoInfo.source===VideoSource.YouTube?inlineObjectsClassNames.video+"--youtube":null),ref:container,"data-is-direct-url":!!videoInfo.isDirectUrl,applyBackground:videoInfo.source===VideoSource.Vimeo&&!videoInfo.isDirectUrl},void 0);function renderContents(){var _a;if(!container.current){return;}var videoProperties=(_a=new VideoUrlParser(videoInfo.url))===null||_a===void 0?void 0:_a.videoProperties;var iframeAreaLabel=formatMessage({id:'AriaLabel.videoElementGenerator.videoPreview'},{type:VideoElementGenerator.getVideoType(videoInfo)});container.current.innerHTML='';container.current.appendChild(VideoElementGenerator.getVideoElement(videoInfo,autoplay,width,iframeAreaLabel,videoProperties));}};var Host$T=_styled.div.withConfig({displayName:"VideoView__Host",componentId:"sc-1t89fhn-0"})(templateObject_2$1u||(templateObject_2$1u=__makeTemplateObject(["\n ","\n\n &.video-view-container {\n position: relative;\n width: 100%;\n display: block;\n overflow: hidden;\n z-index: 1;\n\n &:after {\n content: '';\n display: block;\n padding-bottom: calc(9 / 16 * 100%);\n font-size: 0; // fix for firefox\n }\n\n > * {\n display: block;\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n }\n\n &[data-is-direct-url='true'] {\n > [data-external-vimeo] {\n display: flex;\n\n > video {\n height: 100%;\n max-width: 100%;\n margin: 0 auto;\n }\n }\n }\n }\n"],["\n ","\n\n &.video-view-container {\n position: relative;\n width: 100%;\n display: block;\n overflow: hidden;\n z-index: 1;\n\n &:after {\n content: '';\n display: block;\n padding-bottom: calc(9 / 16 * 100%);\n font-size: 0; // fix for firefox\n }\n\n > * {\n display: block;\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n }\n\n &[data-is-direct-url='true'] {\n > [data-external-vimeo] {\n display: flex;\n\n > video {\n height: 100%;\n max-width: 100%;\n margin: 0 auto;\n }\n }\n }\n }\n"])),function(p){return p.applyBackground&&css$2(templateObject_1$2h||(templateObject_1$2h=__makeTemplateObject(["\n background-color: ",";\n "],["\n background-color: ",";\n "])),p.theme.palette.black);});var templateObject_1$2h,templateObject_2$1u;var VideoWithThumbnailView=function VideoWithThumbnailView(_a){var videoInfo=_a.videoInfo,videoThumbnailUrl=_a.videoThumbnailUrl,className=_a.className;var _b=useState$2(!videoInfo.isDirectUrl),showPlayer=_b[0],setShowPlayer=_b[1];if(showPlayer){return jsx$1(VideoView,{videoInfo:videoInfo,autoplay:videoInfo.isDirectUrl,className:className},void 0);}if(videoThumbnailUrl){return jsxs(Host$S,__assign({className:className},{children:[jsx$1(StyledImage,{src:videoThumbnailUrl,imageFit:ImageFit.cover,maximizeFrame:true},void 0),jsx$1(PlayButton,{onClick:function(){return setShowPlayer(true);},iconProps:{iconName:'MSNVideosSolid'}},void 0)]}),void 0);}return null;};var Host$S=_styled.div.withConfig({displayName:"VideoWithThumbnailView__Host",componentId:"sc-z8lt34-0"})(templateObject_1$2g||(templateObject_1$2g=__makeTemplateObject(["\n width: 100%;\n display: block;\n position: relative;\n\n &:after {\n content: '';\n display: block;\n padding-bottom: calc(9 / 16 * 100%);\n }\n"],["\n width: 100%;\n display: block;\n position: relative;\n\n &:after {\n content: '';\n display: block;\n padding-bottom: calc(9 / 16 * 100%);\n }\n"])));var StyledImage=_styled(Image$1).withConfig({displayName:"VideoWithThumbnailView__StyledImage",componentId:"sc-z8lt34-1"})(templateObject_2$1t||(templateObject_2$1t=__makeTemplateObject(["\n position: absolute;\n top: 0;\n bottom: 0;\n right: 0;\n left: 0;\n"],["\n position: absolute;\n top: 0;\n bottom: 0;\n right: 0;\n left: 0;\n"])));var PlayButton=_styled(IconButton$1).withConfig({displayName:"VideoWithThumbnailView__PlayButton",componentId:"sc-z8lt34-2"})(templateObject_3$Z||(templateObject_3$Z=__makeTemplateObject(["\n && {\n width: 100%;\n height: 100%;\n margin: 0;\n padding: 0;\n\n // overlay styling\n position: absolute;\n top: 0;\n bottom: 0;\n right: 0;\n left: 0;\n\n background-color: rgba(0, 0, 0, 0.33);\n\n // play icon styling\n i {\n font-size: 50px;\n color: rgba(255, 255, 255, 0.5);\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n }\n\n &&:hover {\n background-color: rgba(0, 0, 0, 0.33);\n\n i {\n color: rgba(255, 255, 255, 0.85);\n }\n }\n }\n"],["\n && {\n width: 100%;\n height: 100%;\n margin: 0;\n padding: 0;\n\n // overlay styling\n position: absolute;\n top: 0;\n bottom: 0;\n right: 0;\n left: 0;\n\n background-color: rgba(0, 0, 0, 0.33);\n\n // play icon styling\n i {\n font-size: 50px;\n color: rgba(255, 255, 255, 0.5);\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n }\n\n &&:hover {\n background-color: rgba(0, 0, 0, 0.33);\n\n i {\n color: rgba(255, 255, 255, 0.85);\n }\n }\n }\n"])));var templateObject_1$2g,templateObject_2$1t,templateObject_3$Z;var VideoList=function VideoList(_a){var attachments=_a.attachments,onDeleteClick=_a.onDeleteClick,className=_a.className;var formatMessage=useIntl().formatMessage;var videos=attachments.filter(function(a){return a.type===AttachmentType.YouTubeVideo||a.type===AttachmentType.VimeoVideo;});if(videos.length===0){return null;}if(onDeleteClick){return jsx$1(Host$R,__assign({className:className,"data-video-attachment-list":true},{children:videos.map(function(video){return jsx$1(AttachmentHost,__assign({domIdentifier:"video",deleteButton:jsx$1(DeleteAttachmentButton,{"data-remove-attachment-button":video.id,iconProps:{iconName:'ChromeClose'},onClick:function(){onDeleteClick(video);},ariaLabel:formatMessage({id:'AriaLabel.removeAttachmentButton'})},void 0)},{children:jsx$1(VideoPreview,{video:video},void 0)}),video.id);})}),void 0);}var video=videos[0];return jsx$1(PreviewHost$1,__assign({className:className,domIdentifier:"video-url-preview-"+video.id},{children:jsx$1(VideoPreview,{video:video},void 0)}),void 0);};var VideoPreview=function VideoPreview(_a){var video=_a.video;var getVideoThumbnailUrl=useVideosApi().getVideoThumbnailUrl;var token=useCurrentToken();var user=useCurrentUser();var parser=new VideoUrlParser(video.url);var source=video.type===AttachmentType.YouTubeVideo?VideoSource.YouTube:VideoSource.Vimeo;var videoThumbnailUrl=parser.isDirectVideoUrl?getVideoThumbnailUrl(token,user.subscription.id,source,video.id):null;return jsx$1(VideoWithThumbnailView,{videoInfo:{id:video.id,source:source,url:video.url,isDirectUrl:parser.isDirectVideoUrl},videoThumbnailUrl:videoThumbnailUrl},void 0);};var Host$R=_styled.div.withConfig({displayName:"VideoList__Host",componentId:"sc-1cep2pw-0"})(templateObject_1$2f||(templateObject_1$2f=__makeTemplateObject(["\n display: flex;\n flex-wrap: wrap;\n width: 100%;\n padding-bottom: ","px;\n"],["\n display: flex;\n flex-wrap: wrap;\n width: 100%;\n padding-bottom: ","px;\n"])),spacingM);var PreviewHost$1=_styled(AttachmentHost).withConfig({displayName:"VideoList__PreviewHost",componentId:"sc-1cep2pw-1"})(templateObject_2$1s||(templateObject_2$1s=__makeTemplateObject(["\n margin: ","px 0 0 0;\n"],["\n margin: ","px 0 0 0;\n"])),spacingM);var templateObject_1$2f,templateObject_2$1s;var aFunction$
|
|
131698
|
-
var createMethod$4=function(IS_RIGHT){return function(that,callbackfn,argumentsLength,memo){aFunction$
|
|
131715
|
+
},[videoInfo.id,videoInfo.source]);return jsx$1(Host$T,{className:classNames(className,inlineObjectsClassNames.video,videoInfo.source===VideoSource.YouTube?inlineObjectsClassNames.video+"--youtube":null),ref:container,"data-is-direct-url":!!videoInfo.isDirectUrl,applyBackground:videoInfo.source===VideoSource.Vimeo&&!videoInfo.isDirectUrl},void 0);function renderContents(){var _a;if(!container.current){return;}var videoProperties=(_a=new VideoUrlParser(videoInfo.url))===null||_a===void 0?void 0:_a.videoProperties;var iframeAreaLabel=formatMessage({id:'AriaLabel.videoElementGenerator.videoPreview'},{type:VideoElementGenerator.getVideoType(videoInfo)});container.current.innerHTML='';container.current.appendChild(VideoElementGenerator.getVideoElement(videoInfo,autoplay,width,iframeAreaLabel,videoProperties));}};var Host$T=_styled.div.withConfig({displayName:"VideoView__Host",componentId:"sc-1t89fhn-0"})(templateObject_2$1u||(templateObject_2$1u=__makeTemplateObject(["\n ","\n\n &.video-view-container {\n position: relative;\n width: 100%;\n display: block;\n overflow: hidden;\n z-index: 1;\n\n &:after {\n content: '';\n display: block;\n padding-bottom: calc(9 / 16 * 100%);\n font-size: 0; // fix for firefox\n }\n\n > * {\n display: block;\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n }\n\n &[data-is-direct-url='true'] {\n > [data-external-vimeo] {\n display: flex;\n\n > video {\n height: 100%;\n max-width: 100%;\n margin: 0 auto;\n }\n }\n }\n }\n"],["\n ","\n\n &.video-view-container {\n position: relative;\n width: 100%;\n display: block;\n overflow: hidden;\n z-index: 1;\n\n &:after {\n content: '';\n display: block;\n padding-bottom: calc(9 / 16 * 100%);\n font-size: 0; // fix for firefox\n }\n\n > * {\n display: block;\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n }\n\n &[data-is-direct-url='true'] {\n > [data-external-vimeo] {\n display: flex;\n\n > video {\n height: 100%;\n max-width: 100%;\n margin: 0 auto;\n }\n }\n }\n }\n"])),function(p){return p.applyBackground&&css$2(templateObject_1$2h||(templateObject_1$2h=__makeTemplateObject(["\n background-color: ",";\n "],["\n background-color: ",";\n "])),p.theme.palette.black);});var templateObject_1$2h,templateObject_2$1u;var VideoWithThumbnailView=function VideoWithThumbnailView(_a){var videoInfo=_a.videoInfo,videoThumbnailUrl=_a.videoThumbnailUrl,className=_a.className;var _b=useState$2(!videoInfo.isDirectUrl),showPlayer=_b[0],setShowPlayer=_b[1];if(showPlayer){return jsx$1(VideoView,{videoInfo:videoInfo,autoplay:videoInfo.isDirectUrl,className:className},void 0);}if(videoThumbnailUrl){return jsxs(Host$S,__assign({className:className},{children:[jsx$1(StyledImage,{src:videoThumbnailUrl,imageFit:ImageFit.cover,maximizeFrame:true},void 0),jsx$1(PlayButton,{onClick:function(){return setShowPlayer(true);},iconProps:{iconName:'MSNVideosSolid'}},void 0)]}),void 0);}return null;};var Host$S=_styled.div.withConfig({displayName:"VideoWithThumbnailView__Host",componentId:"sc-z8lt34-0"})(templateObject_1$2g||(templateObject_1$2g=__makeTemplateObject(["\n width: 100%;\n display: block;\n position: relative;\n\n &:after {\n content: '';\n display: block;\n padding-bottom: calc(9 / 16 * 100%);\n }\n"],["\n width: 100%;\n display: block;\n position: relative;\n\n &:after {\n content: '';\n display: block;\n padding-bottom: calc(9 / 16 * 100%);\n }\n"])));var StyledImage=_styled(Image$1).withConfig({displayName:"VideoWithThumbnailView__StyledImage",componentId:"sc-z8lt34-1"})(templateObject_2$1t||(templateObject_2$1t=__makeTemplateObject(["\n position: absolute;\n top: 0;\n bottom: 0;\n right: 0;\n left: 0;\n"],["\n position: absolute;\n top: 0;\n bottom: 0;\n right: 0;\n left: 0;\n"])));var PlayButton=_styled(IconButton$1).withConfig({displayName:"VideoWithThumbnailView__PlayButton",componentId:"sc-z8lt34-2"})(templateObject_3$Z||(templateObject_3$Z=__makeTemplateObject(["\n && {\n width: 100%;\n height: 100%;\n margin: 0;\n padding: 0;\n\n // overlay styling\n position: absolute;\n top: 0;\n bottom: 0;\n right: 0;\n left: 0;\n\n background-color: rgba(0, 0, 0, 0.33);\n\n // play icon styling\n i {\n font-size: 50px;\n color: rgba(255, 255, 255, 0.5);\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n }\n\n &&:hover {\n background-color: rgba(0, 0, 0, 0.33);\n\n i {\n color: rgba(255, 255, 255, 0.85);\n }\n }\n }\n"],["\n && {\n width: 100%;\n height: 100%;\n margin: 0;\n padding: 0;\n\n // overlay styling\n position: absolute;\n top: 0;\n bottom: 0;\n right: 0;\n left: 0;\n\n background-color: rgba(0, 0, 0, 0.33);\n\n // play icon styling\n i {\n font-size: 50px;\n color: rgba(255, 255, 255, 0.5);\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n }\n\n &&:hover {\n background-color: rgba(0, 0, 0, 0.33);\n\n i {\n color: rgba(255, 255, 255, 0.85);\n }\n }\n }\n"])));var templateObject_1$2g,templateObject_2$1t,templateObject_3$Z;var VideoList=function VideoList(_a){var attachments=_a.attachments,onDeleteClick=_a.onDeleteClick,className=_a.className;var formatMessage=useIntl().formatMessage;var videos=attachments.filter(function(a){return a.type===AttachmentType.YouTubeVideo||a.type===AttachmentType.VimeoVideo;});if(videos.length===0){return null;}if(onDeleteClick){return jsx$1(Host$R,__assign({className:className,"data-video-attachment-list":true},{children:videos.map(function(video){return jsx$1(AttachmentHost,__assign({domIdentifier:"video",deleteButton:jsx$1(DeleteAttachmentButton,{"data-remove-attachment-button":video.id,iconProps:{iconName:'ChromeClose'},onClick:function(){onDeleteClick(video);},ariaLabel:formatMessage({id:'AriaLabel.removeAttachmentButton'})},void 0)},{children:jsx$1(VideoPreview,{video:video},void 0)}),video.id);})}),void 0);}var video=videos[0];return jsx$1(PreviewHost$1,__assign({className:className,domIdentifier:"video-url-preview-"+video.id},{children:jsx$1(VideoPreview,{video:video},void 0)}),void 0);};var VideoPreview=function VideoPreview(_a){var video=_a.video;var getVideoThumbnailUrl=useVideosApi().getVideoThumbnailUrl;var token=useCurrentToken();var user=useCurrentUser();var parser=new VideoUrlParser(video.url);var source=video.type===AttachmentType.YouTubeVideo?VideoSource.YouTube:VideoSource.Vimeo;var videoThumbnailUrl=parser.isDirectVideoUrl?getVideoThumbnailUrl(token,user.subscription.id,source,video.id):null;return jsx$1(VideoWithThumbnailView,{videoInfo:{id:video.id,source:source,url:video.url,isDirectUrl:parser.isDirectVideoUrl},videoThumbnailUrl:videoThumbnailUrl},void 0);};var Host$R=_styled.div.withConfig({displayName:"VideoList__Host",componentId:"sc-1cep2pw-0"})(templateObject_1$2f||(templateObject_1$2f=__makeTemplateObject(["\n display: flex;\n flex-wrap: wrap;\n width: 100%;\n padding-bottom: ","px;\n"],["\n display: flex;\n flex-wrap: wrap;\n width: 100%;\n padding-bottom: ","px;\n"])),spacingM);var PreviewHost$1=_styled(AttachmentHost).withConfig({displayName:"VideoList__PreviewHost",componentId:"sc-1cep2pw-1"})(templateObject_2$1s||(templateObject_2$1s=__makeTemplateObject(["\n margin: ","px 0 0 0;\n"],["\n margin: ","px 0 0 0;\n"])),spacingM);var templateObject_1$2f,templateObject_2$1s;var aFunction$1=aFunction$7;var toObject$1=toObject$7;var IndexedObject=indexedObject;var toLength$3=toLength$b;// `Array.prototype.{ reduce, reduceRight }` methods implementation
|
|
131716
|
+
var createMethod$4=function(IS_RIGHT){return function(that,callbackfn,argumentsLength,memo){aFunction$1(callbackfn);var O=toObject$1(that);var self=IndexedObject(O);var length=toLength$3(O.length);var index=IS_RIGHT?length-1:0;var i=IS_RIGHT?-1:1;if(argumentsLength<2)while(true){if(index in self){memo=self[index];index+=i;break;}index+=i;if(IS_RIGHT?index<0:length<=index){throw TypeError('Reduce of empty array with no initial value');}}for(;IS_RIGHT?index>=0:length>index;index+=i)if(index in self){memo=callbackfn(memo,self[index],index,O);}return memo;};};var arrayReduce={// `Array.prototype.reduce` method
|
|
131699
131717
|
// https://tc39.github.io/ecma262/#sec-array.prototype.reduce
|
|
131700
131718
|
left:createMethod$4(false),// `Array.prototype.reduceRight` method
|
|
131701
131719
|
// https://tc39.github.io/ecma262/#sec-array.prototype.reduceright
|
|
131702
|
-
right:createMethod$4(true)};var
|
|
131703
|
-
method.call(null,argument||function(){throw 1;},1);});};var DESCRIPTORS$1=descriptors;var fails$1$1=fails$i;var has$1=has$c;var defineProperty$1=Object.defineProperty;var cache={};var thrower=function(it){throw it;};var arrayMethodUsesToLength$1=function(METHOD_NAME,options){if(has$1(cache,METHOD_NAME))return cache[METHOD_NAME];if(!options)options={};var method=[][METHOD_NAME];var ACCESSORS=has$1(options,'ACCESSORS')?options.ACCESSORS:false;var argument0=has$1(options,0)?options[0]:thrower;var argument1=has$1(options,1)?options[1]:undefined;return cache[METHOD_NAME]=!!method&&!fails$1$1(function(){if(ACCESSORS&&!DESCRIPTORS$1)return true;var O={length:-1};if(ACCESSORS)defineProperty$1(O,1,{enumerable:true,get:thrower});else O[1]=1;method.call(O,argument0,argument1);});};var $$7=_export;var $reduce=arrayReduce.left;var arrayMethodIsStrict$1=arrayMethodIsStrict$2;var arrayMethodUsesToLength=arrayMethodUsesToLength$1;var STRICT_METHOD$1=arrayMethodIsStrict$1('reduce');var USES_TO_LENGTH=arrayMethodUsesToLength('reduce',{1:0});// `Array.prototype.reduce` method
|
|
131720
|
+
right:createMethod$4(true)};var DESCRIPTORS$1=descriptors;var fails$j=fails$i;var has$1=has$c;var defineProperty$1=Object.defineProperty;var cache={};var thrower=function(it){throw it;};var arrayMethodUsesToLength$1=function(METHOD_NAME,options){if(has$1(cache,METHOD_NAME))return cache[METHOD_NAME];if(!options)options={};var method=[][METHOD_NAME];var ACCESSORS=has$1(options,'ACCESSORS')?options.ACCESSORS:false;var argument0=has$1(options,0)?options[0]:thrower;var argument1=has$1(options,1)?options[1]:undefined;return cache[METHOD_NAME]=!!method&&!fails$j(function(){if(ACCESSORS&&!DESCRIPTORS$1)return true;var O={length:-1};if(ACCESSORS)defineProperty$1(O,1,{enumerable:true,get:thrower});else O[1]=1;method.call(O,argument0,argument1);});};var $$6=_export;var $reduce=arrayReduce.left;var arrayMethodIsStrict=arrayMethodIsStrict$2;var arrayMethodUsesToLength=arrayMethodUsesToLength$1;var STRICT_METHOD=arrayMethodIsStrict('reduce');var USES_TO_LENGTH=arrayMethodUsesToLength('reduce',{1:0});// `Array.prototype.reduce` method
|
|
131704
131721
|
// https://tc39.github.io/ecma262/#sec-array.prototype.reduce
|
|
131705
|
-
$$7({target:'Array',proto:true,forced:!STRICT_METHOD$1||!USES_TO_LENGTH},{reduce:function reduce(callbackfn/* , initialValue */){return $reduce(this,callbackfn,arguments.length,arguments.length>1?arguments[1]:undefined);}});var KeywordsInfo=function KeywordsInfo(_a){var keywords=_a.keywords,language=_a.language,className=_a.className,filterBaseUrl=_a.filterBaseUrl;var selectedKeywordGroups=useContext(LazySubscriptionContext).selectedKeywordGroups;if(selectedKeywordGroups==null){return null;}var availableKeywordGroups=selectedKeywordGroups===null||selectedKeywordGroups===void 0?void 0:selectedKeywordGroups.reduce(function(result,next){var _a;return __assign(__assign({},result),(_a={},_a[next.id]=next,_a));},{});var flatKeywords=getFlatKeywordList(keywords);var hasKeywords=flatKeywords&&flatKeywords.length>0;if(!hasKeywords){return null;}return jsx$1(Host$Q,__assign({"data-keywords":true},{children:renderKeywords()}),void 0);function renderKeywords(){var keywordsGroupsIds=Object.keys(keywords||[]);return keywordsGroupsIds.filter(function(id){return availableKeywordGroups[id];}).map(function(groupId){return keywords[groupId].length>0&&jsx$1(KeywordsGroup,{groupId:groupId,groupName:availableKeywordGroups[groupId].name,language:language,keywords:keywords,className:className,filterBaseUrl:filterBaseUrl},groupId);});}};var KeywordsGroup=function KeywordsGroup(_a){var groupId=_a.groupId,groupName=_a.groupName,keywords=_a.keywords,language=_a.language,className=_a.className,filterBaseUrl=_a.filterBaseUrl;return jsxs(KeywordsList$1,__assign({className:classNames('ms-fontColor-neutralSecondaryAlt',className)},{children:[jsxs(KeywordsListTitle,{children:[jsx$1(KeywordTitle,{groupName:groupName,language:language},void 0),":"]},void 0),keywords[groupId].map(function(k){var Title=jsx$1(KeywordTitle,{groupName:groupName,keywordName:k.name,language:language},void 0);return jsx$1(KeywordsListItem,{children:filterBaseUrl?jsx$1(NavLink,__assign({"data-keyword":true,className:"ms-fontColor-neutralSecondaryAlt",to:filterBaseUrl+"?"+queryString.stringify({keywords:k.id})},{children:Title}),void 0):jsxs(Fragment,{children:[" ",Title," "]},void 0)},groupName+k.name);})]}),void 0);};var Host$Q=_styled.div.withConfig({displayName:"KeywordsInfo__Host",componentId:"sc-woteiy-0"})(templateObject_1$2e||(templateObject_1$2e=__makeTemplateObject(["\n padding-right: ","px;\n flex: 1; /* IE fix */\n @media (min-width: 700px) {\n padding-right: ","px;\n }\n"],["\n padding-right: ","px;\n flex: 1; /* IE fix */\n @media (min-width: 700px) {\n padding-right: ","px;\n }\n"])),spacingM,spacingXl);var KeywordsList$1=_styled.dl.withConfig({displayName:"KeywordsInfo__KeywordsList",componentId:"sc-woteiy-1"})(templateObject_2$1r||(templateObject_2$1r=__makeTemplateObject(["\n width: 100%;\n margin: 0;\n\n + dl {\n margin-top: 5px;\n }\n"],["\n width: 100%;\n margin: 0;\n\n + dl {\n margin-top: 5px;\n }\n"])));var KeywordsListTitle=_styled.dt.withConfig({displayName:"KeywordsInfo__KeywordsListTitle",componentId:"sc-woteiy-2"})(templateObject_3$Y||(templateObject_3$Y=__makeTemplateObject(["\n display: inline-block;\n padding-right: 5px;\n word-break: normal;\n"],["\n display: inline-block;\n padding-right: 5px;\n word-break: normal;\n"])));var KeywordsListItem=_styled.dd.withConfig({displayName:"KeywordsInfo__KeywordsListItem",componentId:"sc-woteiy-3"})(templateObject_4$H||(templateObject_4$H=__makeTemplateObject(["\n display: inline-block;\n margin: 0;\n\n text-decoration: underline;\n\n &:not(:last-child) span::after {\n content: ',';\n padding-right: 5px;\n }\n"],["\n display: inline-block;\n margin: 0;\n\n text-decoration: underline;\n\n &:not(:last-child) span::after {\n content: ',';\n padding-right: 5px;\n }\n"])));var Keywords$3=function Keywords(_a){var keywords=_a.item.keywords,filterBaseUrl=_a.filterBaseUrl,className=_a.className,useGridKeywordTitle=_a.useGridKeywordTitle;var location=useLocation$1();var currentParamsObject=queryString.parse(location.search);var selectedKeywordGroups=useContext(LazySubscriptionContext).selectedKeywordGroups;if(selectedKeywordGroups==null){return null;}var availableKeywordGroups=selectedKeywordGroups===null||selectedKeywordGroups===void 0?void 0:selectedKeywordGroups.reduce(function(result,next){var _a;return __assign(__assign({},result),(_a={},_a[next.id]=next,_a));},{});var keywordsGroupsIds=Object.keys(keywords||[]);return jsx$1("span",__assign({className:className},{children:keywordsGroupsIds.filter(function(id){return availableKeywordGroups[id];}).map(function(groupId){return keywords[groupId].map(function(keyword){currentParamsObject.keywords=keyword.id;if(filterBaseUrl){return jsx$1(NavLink,__assign({"data-keyword":true,to:filterBaseUrl+"?"+queryString.stringify(currentParamsObject)},{children:useGridKeywordTitle?jsx$1(GridKeywordTitle,{keywordName:keyword.name,groupId:groupId},void 0):jsx$1(KeywordTitle,{keywordName:keyword.name,groupId:groupId,underlined:true},void 0)}),groupId+keyword.id);}return useGridKeywordTitle?jsx$1(GridKeywordTitle,{keywordName:keyword.name,groupId:groupId},groupId+keyword.id):jsx$1(KeywordTitle,{keywordName:keyword.name,groupId:groupId},groupId+keyword.id);});}).reduce(function(result,next){return result.concat(next);},[])}),void 0);};var FlatKeywords=_styled(Keywords$3).withConfig({displayName:"KeywordsInfo__FlatKeywords",componentId:"sc-woteiy-4"})(templateObject_5$B||(templateObject_5$B=__makeTemplateObject(["\n > a,\n > a:link,\n > a:visited,\n > span {\n color: ",";\n\n &:not(:last-child) {\n &::after {\n content: ', ';\n }\n }\n }\n\n a {\n position: relative;\n z-index: 1;\n }\n"],["\n > a,\n > a:link,\n > a:visited,\n > span {\n color: ",";\n\n &:not(:last-child) {\n &::after {\n content: ', ';\n }\n }\n }\n\n a {\n position: relative;\n z-index: 1;\n }\n"])),function(p){return p.theme.palette.neutralSecondaryAlt;});var templateObject_1$2e,templateObject_2$1r,templateObject_3$Y,templateObject_4$H,templateObject_5$B;var fixRegExpWellKnownSymbolLogic$4=fixRegexpWellKnownSymbolLogic$1;var anObject$i=anObject$h;var toObject$2=toObject$7;var toLength$3=toLength$b;var toInteger$5=toInteger$4;var requireObjectCoercible$2$1=requireObjectCoercible$c;var advanceStringIndex$4=advanceStringIndex$3;var regExpExec$3=regexpExecAbstract$1;var max$1=Math.max;var min$2=Math.min;var floor=Math.floor;var SUBSTITUTION_SYMBOLS=/\$([$&'`]|\d\d?|<[^>]*>)/g;var SUBSTITUTION_SYMBOLS_NO_NAMED=/\$([$&'`]|\d\d?)/g;var maybeToString=function(it){return it===undefined?it:String(it);};// @@replace logic
|
|
131706
|
-
fixRegExpWellKnownSymbolLogic$4('replace',2,function(REPLACE,nativeReplace,maybeCallNative,reason){var REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE=reason.REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE;var REPLACE_KEEPS_$0=reason.REPLACE_KEEPS_$0;var UNSAFE_SUBSTITUTE=REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE?'$':'$0';return [// `String.prototype.replace` method
|
|
131707
|
-
// https://tc39.github.io/ecma262/#sec-string.prototype.replace
|
|
131708
|
-
function replace(searchValue,replaceValue){var O=requireObjectCoercible$2$1(this);var replacer=searchValue==undefined?undefined:searchValue[REPLACE];return replacer!==undefined?replacer.call(searchValue,O,replaceValue):nativeReplace.call(String(O),searchValue,replaceValue);},// `RegExp.prototype[@@replace]` method
|
|
131709
|
-
// https://tc39.github.io/ecma262/#sec-regexp.prototype-@@replace
|
|
131710
|
-
function(regexp,replaceValue){if(!REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE&&REPLACE_KEEPS_$0||typeof replaceValue==='string'&&replaceValue.indexOf(UNSAFE_SUBSTITUTE)===-1){var res=maybeCallNative(nativeReplace,regexp,this,replaceValue);if(res.done)return res.value;}var rx=anObject$i(regexp);var S=String(this);var functionalReplace=typeof replaceValue==='function';if(!functionalReplace)replaceValue=String(replaceValue);var global=rx.global;if(global){var fullUnicode=rx.unicode;rx.lastIndex=0;}var results=[];while(true){var result=regExpExec$3(rx,S);if(result===null)break;results.push(result);if(!global)break;var matchStr=String(result[0]);if(matchStr==='')rx.lastIndex=advanceStringIndex$4(S,toLength$3(rx.lastIndex),fullUnicode);}var accumulatedResult='';var nextSourcePosition=0;for(var i=0;i<results.length;i++){result=results[i];var matched=String(result[0]);var position=max$1(min$2(toInteger$5(result.index),S.length),0);var captures=[];// NOTE: This is equivalent to
|
|
131711
|
-
// captures = result.slice(1).map(maybeToString)
|
|
131712
|
-
// but for some reason `nativeSlice.call(result, 1, result.length)` (called in
|
|
131713
|
-
// the slice polyfill when slicing native arrays) "doesn't work" in safari 9 and
|
|
131714
|
-
// causes a crash (https://pastebin.com/N21QzeQA) when trying to debug it.
|
|
131715
|
-
for(var j=1;j<result.length;j++)captures.push(maybeToString(result[j]));var namedCaptures=result.groups;if(functionalReplace){var replacerArgs=[matched].concat(captures,position,S);if(namedCaptures!==undefined)replacerArgs.push(namedCaptures);var replacement=String(replaceValue.apply(undefined,replacerArgs));}else {replacement=getSubstitution(matched,S,position,captures,namedCaptures,replaceValue);}if(position>=nextSourcePosition){accumulatedResult+=S.slice(nextSourcePosition,position)+replacement;nextSourcePosition=position+matched.length;}}return accumulatedResult+S.slice(nextSourcePosition);}];// https://tc39.github.io/ecma262/#sec-getsubstitution
|
|
131716
|
-
function getSubstitution(matched,str,position,captures,namedCaptures,replacement){var tailPos=position+matched.length;var m=captures.length;var symbols=SUBSTITUTION_SYMBOLS_NO_NAMED;if(namedCaptures!==undefined){namedCaptures=toObject$2(namedCaptures);symbols=SUBSTITUTION_SYMBOLS;}return nativeReplace.call(replacement,symbols,function(match,ch){var capture;switch(ch.charAt(0)){case'$':return '$';case'&':return matched;case'`':return str.slice(0,position);case"'":return str.slice(tailPos);case'<':capture=namedCaptures[ch.slice(1,-1)];break;default:// \d\d?
|
|
131717
|
-
var n=+ch;if(n===0)return match;if(n>m){var f=floor(n/10);if(f===0)return match;if(f<=m)return captures[f-1]===undefined?ch.charAt(1):captures[f-1]+ch.charAt(1);return match;}capture=captures[n-1];}return capture===undefined?'':capture;});}});var NewsService=/** @class */function(){function NewsService(){}NewsService.getNewsRouteWithRedirect=function(baseRoute,newsId,newsTitle,isExternalContent){var route=!isExternalContent?baseRoute:baseRoute.replace('/news','/redirect/news');return this.getNewsRoute(route,newsId,newsTitle,isExternalContent);};NewsService.getNewsRoute=function(baseRoute,newsId,newsTitle,isExternalContent){var route=baseRoute+"/"+encodeURIComponent(newsId);if(newsTitle){route=route+"/"+slugify(newsTitle,{remove:/[%.#?]/});}return isExternalContent?route+"?"+queryString.stringify({noRedirect:true}):route;};NewsService.getItemContentLanguages=function(item,languages){if(!item){return [];}return NewsService.getContentLanguages(item.contents,languages);};NewsService.getContentLanguages=function(contents,languages,contentValidator){if(!contents){return [];}var allLanguages=Object.keys(contents);if(!allLanguages.length){return [];}var activeLanguages=allLanguages.filter(function(l){return contents[l].active&&languages.find(function(sl){return sl.code===l;})&&(!contentValidator||contentValidator(contents[l]));});if(contentValidator){return activeLanguages;}return activeLanguages.length?activeLanguages:[allLanguages[0]];};NewsService.getLanguageForPublishableItem=function(item,user,contentValidator){if(!user||!item||!item.contents||!user.subscription){return null;}return NewsService.getLanguageForContent(item.contents,user,contentValidator);};NewsService.getLanguageForContent=function(contents,user,contentValidator){if(!contents){return null;}var activeLanguages=NewsService.getContentLanguages(contents,user.subscription.languages,contentValidator);return NewsService.getUserPreferredLanguage(activeLanguages,user);};NewsService.getUserPreferredLanguage=function(languages,user){if(!languages){return null;}var preferredLanguage=getPreferredContentLanguage(user);var subscription=user.subscription;if(languages.find(function(l){return l===preferredLanguage;})){return preferredLanguage;}if(languages.find(function(l){return l===subscription.defaultLanguage;})){return subscription.defaultLanguage;}return languages[0];};return NewsService;}();var ClickableOverlay=function ClickableOverlay(_a){var title=_a.title,itemId=_a.itemId,itemType=_a.itemType,baseRoute=_a.baseRoute,ariaLabelResourceKey=_a.ariaLabelResourceKey,onClick=_a.onClick,openTargetInNewWindow=_a.openTargetInNewWindow,isExternalContent=_a.isExternalContent;var formatMessage=useIntl().formatMessage;var targetRoute=itemType===ItemResourceTypes.Posts||itemType===ItemResourceTypes.Comments?baseRoute:NewsService.getNewsRoute(baseRoute,itemId,title,isExternalContent);if(openTargetInNewWindow){return jsx$1(ExternalLink$1,{href:targetRoute,target:"_blank",rel:"noopener noreferrer",onClick:onClick,"aria-label":ariaLabelResourceKey?formatMessage({id:ariaLabelResourceKey}):formatMessage({id:'AriaLabel.readMoreAbout'},{title:title}),"data-clickable-overlay":true},void 0);}return jsx$1(StyledLink$1,{to:targetRoute,onClick:onClick,"aria-label":ariaLabelResourceKey?formatMessage({id:ariaLabelResourceKey}):formatMessage({id:'AriaLabel.readMoreAbout'},{title:title}),"data-clickable-overlay":true},void 0);};var Style=css$2(templateObject_1$2d||(templateObject_1$2d=__makeTemplateObject(["\n width: 0;\n height: 0;\n\n &::before {\n content: '';\n position: absolute;\n top: 0;\n bottom: 0;\n right: 0;\n left: 0;\n z-index: 1;\n }\n"],["\n width: 0;\n height: 0;\n\n &::before {\n content: '';\n position: absolute;\n top: 0;\n bottom: 0;\n right: 0;\n left: 0;\n z-index: 1;\n }\n"])));var StyledLink$1=_styled(Link$4).withConfig({displayName:"ClickableOverlay__StyledLink",componentId:"sc-yfxl9c-0"})(templateObject_2$1q||(templateObject_2$1q=__makeTemplateObject(["\n ","\n"],["\n ","\n"])),Style);var ExternalLink$1=_styled.a.withConfig({displayName:"ClickableOverlay__ExternalLink",componentId:"sc-yfxl9c-1"})(templateObject_3$X||(templateObject_3$X=__makeTemplateObject(["\n ","\n"],["\n ","\n"])),Style);var templateObject_1$2d,templateObject_2$1q,templateObject_3$X;var PostItemTile=function PostItemTile(_a){var post=_a.post,readOnly=_a.readOnly,backgroundColor=_a.backgroundColor,className=_a.className;var features=useFeatures();var buildPath=useSubscriptionHandlePathBuilder().buildPath;return jsxs(PostHost,__assign({className:className,backgroundColor:backgroundColor},{children:[!readOnly&&jsx$1(ClickableOverlay,{baseRoute:buildPath("/posts/"+post.id),itemId:post.id,itemType:ItemResourceTypes.Posts,ariaLabelResourceKey:"AriaLabel.itemLink"},void 0),jsxs(Header$3,{children:[jsx$1(StyledPersonaCard$3,__assign({upn:post.author.userPrincipalName,domIdentifier:"avatar"},{children:jsx$1(Avatar,{upn:post.author.userPrincipalName,text:post.author.displayName,size:PersonaSize.size40,hidePersonaDetails:true},void 0)}),void 0),jsxs(HeaderMetadata$2,{children:[jsx$1(PostDisplayName$1,__assign({"data-author":true},{children:post.author.displayName}),void 0),jsx$1(PostDateTime$1,{className:"ms-fontColor-neutralTertiary",value:post.publishingDate},void 0),jsx$1(Modified,{modified:post.modified},void 0)]},void 0)]},void 0),jsx$1(Content$8,{children:jsx$1(ContentDisplay,{content:post.content,handlers:[ContentDisplayHandler.LineBreak,ContentDisplayHandler.Link,ContentDisplayHandler.Mention,ContentDisplayHandler.Hashtag]},void 0)},void 0),features.keywords&&features.postKeywords&&post.keywords&&jsx$1(StyledKeywordsInfo$1,{keywords:post.keywords},void 0)]}),void 0);};var PostHost=_styled.div.withConfig({displayName:"PostItemTile__PostHost",componentId:"sc-yu434m-0"})(templateObject_3$W||(templateObject_3$W=__makeTemplateObject(["\n ","\n\n display: flex;\n flex-direction: column;\n\n font-size: ","px;\n padding: ","px;\n\n position: relative;\n"],["\n ","\n\n display: flex;\n flex-direction: column;\n\n font-size: ","px;\n padding: ","px;\n\n position: relative;\n"])),function(p){return p.backgroundColor?css$2(templateObject_1$2c||(templateObject_1$2c=__makeTemplateObject(["\n background-color: ",";\n "],["\n background-color: ",";\n "])),p.backgroundColor):css$2(templateObject_2$1p||(templateObject_2$1p=__makeTemplateObject(["\n background-color: ",";\n "],["\n background-color: ",";\n "])),p.theme.palette.white);},fontSizeSmall,spacingM);var Header$3=_styled.div.withConfig({displayName:"PostItemTile__Header",componentId:"sc-yu434m-1"})(templateObject_4$G||(templateObject_4$G=__makeTemplateObject(["\n display: flex;\n align-items: center;\n"],["\n display: flex;\n align-items: center;\n"])));var StyledPersonaCard$3=_styled(PersonaCard).withConfig({displayName:"PostItemTile__StyledPersonaCard",componentId:"sc-yu434m-2"})(templateObject_5$A||(templateObject_5$A=__makeTemplateObject(["\n a,\n button {\n position: relative;\n z-index: 1;\n }\n"],["\n a,\n button {\n position: relative;\n z-index: 1;\n }\n"])));var HeaderMetadata$2=_styled.div.withConfig({displayName:"PostItemTile__HeaderMetadata",componentId:"sc-yu434m-3"})(templateObject_6$q||(templateObject_6$q=__makeTemplateObject(["\n flex: 1;\n font-size: ","px;\n padding-left: ","px;\n white-space: nowrap;\n"],["\n flex: 1;\n font-size: ","px;\n padding-left: ","px;\n white-space: nowrap;\n"])),fontSizeSmall,spacingS);var PostDisplayName$1=_styled.div.withConfig({displayName:"PostItemTile__PostDisplayName",componentId:"sc-yu434m-4"})(templateObject_7$k||(templateObject_7$k=__makeTemplateObject(["\n font-weight: bold;\n"],["\n font-weight: bold;\n"])));var PostDateTime$1=_styled(DateTime).withConfig({displayName:"PostItemTile__PostDateTime",componentId:"sc-yu434m-5"})(templateObject_8$i||(templateObject_8$i=__makeTemplateObject(["\n font-size: ","px;\n"],["\n font-size: ","px;\n"])),fontSizeSmaller);var Content$8=_styled.div.withConfig({displayName:"PostItemTile__Content",componentId:"sc-yu434m-6"})(templateObject_9$e||(templateObject_9$e=__makeTemplateObject(["\n padding-top: 15px;\n a {\n text-decoration: underline;\n }\n\n a,\n button {\n position: relative;\n z-index: 1;\n }\n"],["\n padding-top: 15px;\n a {\n text-decoration: underline;\n }\n\n a,\n button {\n position: relative;\n z-index: 1;\n }\n"])));var StyledKeywordsInfo$1=_styled(KeywordsInfo).withConfig({displayName:"PostItemTile__StyledKeywordsInfo",componentId:"sc-yu434m-7"})(templateObject_10$c||(templateObject_10$c=__makeTemplateObject(["\n margin-top: ","px;\n\n dd {\n text-decoration: none;\n }\n"],["\n margin-top: ","px;\n\n dd {\n text-decoration: none;\n }\n"])),spacingM);var templateObject_1$2c,templateObject_2$1p,templateObject_3$W,templateObject_4$G,templateObject_5$A,templateObject_6$q,templateObject_7$k,templateObject_8$i,templateObject_9$e,templateObject_10$c;var EventLocationLink=function EventLocationLink(_a){var location=_a.location,alternativeCaption=_a.alternativeCaption,className=_a.className;var locationLink=location.url||getGoogleMapsSearchLink(location.locationOnMap);return jsx$1(Fragment,{children:locationLink?jsx$1(TextLink,__assign({url:locationLink,ariaLabel:alternativeCaption||location.name},{children:alternativeCaption||location.name}),void 0):jsx$1("span",__assign({className:className},{children:alternativeCaption||location.name}),void 0)},void 0);};var EventLocationInfo=function EventLocationInfo(_a){var locations=_a.locations,className=_a.className;if(!locations||locations.length===0){return null;}var isMultiLine=locations.length>1;return jsx$1(Host$P,__assign({className:className},{children:jsxs(ListWrapper,__assign({"data-event-locations":true,isMultiLine:isMultiLine},{children:[jsx$1(Label,{resourceKey:"Events.locationsLabel",count:locations.length},void 0),jsx$1(List$2,__assign({isMultiLine:isMultiLine},{children:locations.map(function(l){return jsx$1("li",{children:jsx$1(EventLocationLink,{location:l},void 0)},l.locationId);})}),void 0)]}),void 0)}),void 0);};var EventPeopleInfo=function EventPeopleInfo(_a){var item=_a.item,className=_a.className,hideAnnouncer=_a.hideAnnouncer;var author=item.owner||item.author;var contactsCount=item.contacts&&item.contacts.length;if(hideAnnouncer&&contactsCount===0){return null;}var isMultiLine=contactsCount>1;return jsxs(Host$P,__assign({className:className},{children:[contactsCount>0&&jsxs(Contacts$1,__assign({"data-event-people":"contacts",isMultiLine:isMultiLine,hideAnnouncer:hideAnnouncer},{children:[jsx$1(Label,{resourceKey:"Events.contactsLabel",count:contactsCount},void 0),jsx$1(List$2,__assign({isMultiLine:isMultiLine},{children:item.contacts.map(function(c){return jsx$1("li",{children:jsx$1(EventUser,{user:c,className:"ms-fontColor-accent"},void 0)},c.userPrincipalName);})}),void 0)]}),void 0),!hideAnnouncer&&author&&jsxs(ListWrapper,__assign({"data-event-people":"author",isMultiLine:false},{children:[jsx$1(Label,{resourceKey:"Events.authorLabel"},void 0),jsx$1(EventUser,{user:author,className:"ms-fontColor-accent"},void 0)]}),void 0)]}),void 0);};var EventUser=function EventUser(_a){var user=_a.user,className=_a.className;return jsx$1("div",__assign({className:className},{children:jsx$1(StyledPersonaCard$2,__assign({upn:user.userPrincipalName},{children:user.displayName}),void 0)}),void 0);};var Label=function Label(_a){var resourceKey=_a.resourceKey,count=_a.count;return jsxs("div",{children:[jsx$1(FormattedMessage$1,{id:resourceKey,values:{count:count||1}},void 0),":\u00A0"]},void 0);};var EventChannelsDisplay=function EventChannelsDisplay(_a){var _b;var item=_a.item,language=_a.language,className=_a.className,allowFilterByChannels=_a.allowFilterByChannels,channelBackgroundColor=_a.channelBackgroundColor;var buildPath=useSubscriptionHandlePathBuilder().buildPath;if(!((_b=item===null||item===void 0?void 0:item.channels)===null||_b===void 0?void 0:_b.length)){return null;}return jsx$1(Channels$2,{channels:item.channels.map(function(c){return c.name;}),language:language,buildChannelFilterUrl:allowFilterByChannels?function(c){return buildPath("/events?"+queryString.stringify({channels:c}));}:null,channelBackgroundColor:channelBackgroundColor,className:className},void 0);};var Host$P=_styled.div.withConfig({displayName:"EventMetaInfo__Host",componentId:"sc-l9y854-0"})(templateObject_1$2b||(templateObject_1$2b=__makeTemplateObject(["\n display: flex;\n flex-wrap: wrap;\n font-size: ","px;\n"],["\n display: flex;\n flex-wrap: wrap;\n font-size: ","px;\n"])),fontSizeSmall);var ListWrapper=_styled.div.withConfig({displayName:"EventMetaInfo__ListWrapper",componentId:"sc-l9y854-1"})(templateObject_2$1o||(templateObject_2$1o=__makeTemplateObject(["\n display: flex;\n flex-wrap: wrap;\n width: 100%;\n text-align: left;\n\n flex-direction: ",";\n\n ","\n"],["\n display: flex;\n flex-wrap: wrap;\n width: 100%;\n text-align: left;\n\n flex-direction: ",";\n\n ","\n"])),function(_a){var isMultiLine=_a.isMultiLine;return isMultiLine?'column':'row';},function(_a){var isMultiLine=_a.isMultiLine;return isMultiLine&&'> div:first-child { padding-bottom: 3px }';});var Contacts$1=_styled(ListWrapper).withConfig({displayName:"EventMetaInfo__Contacts",componentId:"sc-l9y854-2"})(templateObject_3$V||(templateObject_3$V=__makeTemplateObject(["\n margin-bottom: ","px;\n"],["\n margin-bottom: ","px;\n"])),function(p){return !p.hideAnnouncer?spacingXs:0;});var StyledPersonaCard$2=_styled(PersonaCard).withConfig({displayName:"EventMetaInfo__StyledPersonaCard",componentId:"sc-l9y854-3"})(templateObject_4$F||(templateObject_4$F=__makeTemplateObject(["\n text-decoration: underline;\n"],["\n text-decoration: underline;\n"])));var List$2=_styled.ul.withConfig({displayName:"EventMetaInfo__List",componentId:"sc-l9y854-4"})(templateObject_6$p||(templateObject_6$p=__makeTemplateObject(["\n ",";\n\n &&& {\n padding: 0;\n margin: 0;\n list-style: none;\n }\n\n > li {\n margin-top: ","px;\n }\n"],["\n ",";\n\n &&& {\n padding: 0;\n margin: 0;\n list-style: none;\n }\n\n > li {\n margin-top: ","px;\n }\n"])),function(_a){var isMultiLine=_a.isMultiLine;return !isMultiLine&&css$2(templateObject_5$z||(templateObject_5$z=__makeTemplateObject(["\n display: flex;\n flex-wrap: wrap;\n flex-direction: row;\n align-items: center;\n "],["\n display: flex;\n flex-wrap: wrap;\n flex-direction: row;\n align-items: center;\n "])));},function(_a){var isMultiLine=_a.isMultiLine;return isMultiLine?3:0;});var Channels$2=_styled(ClickableChannelTitles).withConfig({displayName:"EventMetaInfo__Channels",componentId:"sc-l9y854-5"})(templateObject_7$j||(templateObject_7$j=__makeTemplateObject(["\n &&& li {\n margin-top: ","px;\n }\n"],["\n &&& li {\n margin-top: ","px;\n }\n"])),spacingS);var templateObject_1$2b,templateObject_2$1o,templateObject_3$V,templateObject_4$F,templateObject_5$z,templateObject_6$p,templateObject_7$j;var BannerImage=function BannerImage(_a){var imageUrl=_a.imageUrl,children=_a.children,className=_a.className,openImageUrl=_a.openImageUrl;return jsxs(Host$O,__assign({onClick:function(){return openImageUrl&&showPhoto();},className:classNames('bannerImage',className)},{children:[jsx$1(Image$1,{src:imageUrl,imageFit:ImageFit.cover,maximizeFrame:true,alt:""},void 0),children]}),void 0);};var Host$O=_styled.div.withConfig({displayName:"BannerImage__Host",componentId:"sc-1wfmp37-0"})(templateObject_1$2a||(templateObject_1$2a=__makeTemplateObject(["\n position: relative;\n height: inherit;\n\n /*\n The UI Fabric image component has a bug that it shows 1px on the left/ top\n or right side of the background when applying their cross browser image-fit: cover.\n This result in 1px gray/white \"border\".\n We just add 1px to the image width & height to cover this gap\n */\n .ms-Image {\n img {\n width: calc(100% + 1px);\n height: calc(100% + 1px);\n }\n }\n"],["\n position: relative;\n height: inherit;\n\n /*\n The UI Fabric image component has a bug that it shows 1px on the left/ top\n or right side of the background when applying their cross browser image-fit: cover.\n This result in 1px gray/white \"border\".\n We just add 1px to the image width & height to cover this gap\n */\n .ms-Image {\n img {\n width: calc(100% + 1px);\n height: calc(100% + 1px);\n }\n }\n"])));var templateObject_1$2a;function useImageEditorApi(){var api=useApi();var _a=useApiFactory(),createApiUrl=_a.createApiUrl,fetchFromApi=_a.fetchFromApi;var onRequestToken=useContext(AuthenticationContext).onRequestToken;return useMemo(function(){return {getImageInfo:getImageInfo,getImageEditorUrl:getImageEditorUrl,getOriginalImageEditorUrlWithToken:getOriginalImageEditorUrlWithToken,getImageEditorUrlWithToken:getImageEditorUrlWithToken,uploadImage:uploadImage};/**
|
|
131722
|
+
$$6({target:'Array',proto:true,forced:!STRICT_METHOD||!USES_TO_LENGTH},{reduce:function reduce(callbackfn/* , initialValue */){return $reduce(this,callbackfn,arguments.length,arguments.length>1?arguments[1]:undefined);}});var KeywordsInfo=function KeywordsInfo(_a){var keywords=_a.keywords,language=_a.language,className=_a.className,filterBaseUrl=_a.filterBaseUrl;var selectedKeywordGroups=useContext(LazySubscriptionContext).selectedKeywordGroups;if(selectedKeywordGroups==null){return null;}var availableKeywordGroups=selectedKeywordGroups===null||selectedKeywordGroups===void 0?void 0:selectedKeywordGroups.reduce(function(result,next){var _a;return __assign(__assign({},result),(_a={},_a[next.id]=next,_a));},{});var flatKeywords=getFlatKeywordList(keywords);var hasKeywords=flatKeywords&&flatKeywords.length>0;if(!hasKeywords){return null;}return jsx$1(Host$Q,__assign({"data-keywords":true},{children:renderKeywords()}),void 0);function renderKeywords(){var keywordsGroupsIds=Object.keys(keywords||[]);return keywordsGroupsIds.filter(function(id){return availableKeywordGroups[id];}).map(function(groupId){return keywords[groupId].length>0&&jsx$1(KeywordsGroup,{groupId:groupId,groupName:availableKeywordGroups[groupId].name,language:language,keywords:keywords,className:className,filterBaseUrl:filterBaseUrl},groupId);});}};var KeywordsGroup=function KeywordsGroup(_a){var groupId=_a.groupId,groupName=_a.groupName,keywords=_a.keywords,language=_a.language,className=_a.className,filterBaseUrl=_a.filterBaseUrl;return jsxs(KeywordsList$1,__assign({className:classNames('ms-fontColor-neutralSecondaryAlt',className)},{children:[jsxs(KeywordsListTitle,{children:[jsx$1(KeywordTitle,{groupName:groupName,language:language},void 0),":"]},void 0),keywords[groupId].map(function(k){var Title=jsx$1(KeywordTitle,{groupName:groupName,keywordName:k.name,language:language},void 0);return jsx$1(KeywordsListItem,{children:filterBaseUrl?jsx$1(NavLink,__assign({"data-keyword":true,className:"ms-fontColor-neutralSecondaryAlt",to:filterBaseUrl+"?"+queryString.stringify({keywords:k.id})},{children:Title}),void 0):jsxs(Fragment,{children:[" ",Title," "]},void 0)},groupName+k.name);})]}),void 0);};var Host$Q=_styled.div.withConfig({displayName:"KeywordsInfo__Host",componentId:"sc-woteiy-0"})(templateObject_1$2e||(templateObject_1$2e=__makeTemplateObject(["\n padding-right: ","px;\n flex: 1; /* IE fix */\n @media (min-width: 700px) {\n padding-right: ","px;\n }\n"],["\n padding-right: ","px;\n flex: 1; /* IE fix */\n @media (min-width: 700px) {\n padding-right: ","px;\n }\n"])),spacingM,spacingXl);var KeywordsList$1=_styled.dl.withConfig({displayName:"KeywordsInfo__KeywordsList",componentId:"sc-woteiy-1"})(templateObject_2$1r||(templateObject_2$1r=__makeTemplateObject(["\n width: 100%;\n margin: 0;\n\n + dl {\n margin-top: 5px;\n }\n"],["\n width: 100%;\n margin: 0;\n\n + dl {\n margin-top: 5px;\n }\n"])));var KeywordsListTitle=_styled.dt.withConfig({displayName:"KeywordsInfo__KeywordsListTitle",componentId:"sc-woteiy-2"})(templateObject_3$Y||(templateObject_3$Y=__makeTemplateObject(["\n display: inline-block;\n padding-right: 5px;\n word-break: normal;\n"],["\n display: inline-block;\n padding-right: 5px;\n word-break: normal;\n"])));var KeywordsListItem=_styled.dd.withConfig({displayName:"KeywordsInfo__KeywordsListItem",componentId:"sc-woteiy-3"})(templateObject_4$H||(templateObject_4$H=__makeTemplateObject(["\n display: inline-block;\n margin: 0;\n\n text-decoration: underline;\n\n &:not(:last-child) span::after {\n content: ',';\n padding-right: 5px;\n }\n"],["\n display: inline-block;\n margin: 0;\n\n text-decoration: underline;\n\n &:not(:last-child) span::after {\n content: ',';\n padding-right: 5px;\n }\n"])));var Keywords$3=function Keywords(_a){var keywords=_a.item.keywords,filterBaseUrl=_a.filterBaseUrl,className=_a.className,useGridKeywordTitle=_a.useGridKeywordTitle;var location=useLocation$1();var currentParamsObject=queryString.parse(location.search);var selectedKeywordGroups=useContext(LazySubscriptionContext).selectedKeywordGroups;if(selectedKeywordGroups==null){return null;}var availableKeywordGroups=selectedKeywordGroups===null||selectedKeywordGroups===void 0?void 0:selectedKeywordGroups.reduce(function(result,next){var _a;return __assign(__assign({},result),(_a={},_a[next.id]=next,_a));},{});var keywordsGroupsIds=Object.keys(keywords||[]);return jsx$1("span",__assign({className:className},{children:keywordsGroupsIds.filter(function(id){return availableKeywordGroups[id];}).map(function(groupId){return keywords[groupId].map(function(keyword){currentParamsObject.keywords=keyword.id;if(filterBaseUrl){return jsx$1(NavLink,__assign({"data-keyword":true,to:filterBaseUrl+"?"+queryString.stringify(currentParamsObject)},{children:useGridKeywordTitle?jsx$1(GridKeywordTitle,{keywordName:keyword.name,groupId:groupId},void 0):jsx$1(KeywordTitle,{keywordName:keyword.name,groupId:groupId,underlined:true},void 0)}),groupId+keyword.id);}return useGridKeywordTitle?jsx$1(GridKeywordTitle,{keywordName:keyword.name,groupId:groupId},groupId+keyword.id):jsx$1(KeywordTitle,{keywordName:keyword.name,groupId:groupId},groupId+keyword.id);});}).reduce(function(result,next){return result.concat(next);},[])}),void 0);};var FlatKeywords=_styled(Keywords$3).withConfig({displayName:"KeywordsInfo__FlatKeywords",componentId:"sc-woteiy-4"})(templateObject_5$B||(templateObject_5$B=__makeTemplateObject(["\n > a,\n > a:link,\n > a:visited,\n > span {\n color: ",";\n\n &:not(:last-child) {\n &::after {\n content: ', ';\n }\n }\n }\n\n a {\n position: relative;\n z-index: 1;\n }\n"],["\n > a,\n > a:link,\n > a:visited,\n > span {\n color: ",";\n\n &:not(:last-child) {\n &::after {\n content: ', ';\n }\n }\n }\n\n a {\n position: relative;\n z-index: 1;\n }\n"])),function(p){return p.theme.palette.neutralSecondaryAlt;});var templateObject_1$2e,templateObject_2$1r,templateObject_3$Y,templateObject_4$H,templateObject_5$B;var NewsService=/** @class */function(){function NewsService(){}NewsService.getNewsRouteWithRedirect=function(baseRoute,newsId,newsTitle,isExternalContent){var route=!isExternalContent?baseRoute:baseRoute.replace('/news','/redirect/news');return this.getNewsRoute(route,newsId,newsTitle,isExternalContent);};NewsService.getNewsRoute=function(baseRoute,newsId,newsTitle,isExternalContent){var route=baseRoute+"/"+encodeURIComponent(newsId);if(newsTitle){route=route+"/"+slugify(newsTitle,{remove:/[%.#?]/});}return isExternalContent?route+"?"+queryString.stringify({noRedirect:true}):route;};NewsService.getItemContentLanguages=function(item,languages){if(!item){return [];}return NewsService.getContentLanguages(item.contents,languages);};NewsService.getContentLanguages=function(contents,languages,contentValidator){if(!contents){return [];}var allLanguages=Object.keys(contents);if(!allLanguages.length){return [];}var activeLanguages=allLanguages.filter(function(l){return contents[l].active&&languages.find(function(sl){return sl.code===l;})&&(!contentValidator||contentValidator(contents[l]));});if(contentValidator){return activeLanguages;}return activeLanguages.length?activeLanguages:[allLanguages[0]];};NewsService.getLanguageForPublishableItem=function(item,user,contentValidator){if(!user||!item||!item.contents||!user.subscription){return null;}return NewsService.getLanguageForContent(item.contents,user,contentValidator);};NewsService.getLanguageForContent=function(contents,user,contentValidator){if(!contents){return null;}var activeLanguages=NewsService.getContentLanguages(contents,user.subscription.languages,contentValidator);return NewsService.getUserPreferredLanguage(activeLanguages,user);};NewsService.getUserPreferredLanguage=function(languages,user){if(!languages){return null;}var preferredLanguage=getPreferredContentLanguage(user);var subscription=user.subscription;if(languages.find(function(l){return l===preferredLanguage;})){return preferredLanguage;}if(languages.find(function(l){return l===subscription.defaultLanguage;})){return subscription.defaultLanguage;}return languages[0];};return NewsService;}();var ClickableOverlay=function ClickableOverlay(_a){var title=_a.title,itemId=_a.itemId,itemType=_a.itemType,baseRoute=_a.baseRoute,ariaLabelResourceKey=_a.ariaLabelResourceKey,onClick=_a.onClick,openTargetInNewWindow=_a.openTargetInNewWindow,isExternalContent=_a.isExternalContent;var formatMessage=useIntl().formatMessage;var targetRoute=itemType===ItemResourceTypes.Posts||itemType===ItemResourceTypes.Comments?baseRoute:NewsService.getNewsRoute(baseRoute,itemId,title,isExternalContent);if(openTargetInNewWindow){return jsx$1(ExternalLink$1,{href:targetRoute,target:"_blank",rel:"noopener noreferrer",onClick:onClick,"aria-label":ariaLabelResourceKey?formatMessage({id:ariaLabelResourceKey}):formatMessage({id:'AriaLabel.readMoreAbout'},{title:title}),"data-clickable-overlay":true},void 0);}return jsx$1(StyledLink$1,{to:targetRoute,onClick:onClick,"aria-label":ariaLabelResourceKey?formatMessage({id:ariaLabelResourceKey}):formatMessage({id:'AriaLabel.readMoreAbout'},{title:title}),"data-clickable-overlay":true},void 0);};var Style=css$2(templateObject_1$2d||(templateObject_1$2d=__makeTemplateObject(["\n width: 0;\n height: 0;\n\n &::before {\n content: '';\n position: absolute;\n top: 0;\n bottom: 0;\n right: 0;\n left: 0;\n z-index: 1;\n }\n"],["\n width: 0;\n height: 0;\n\n &::before {\n content: '';\n position: absolute;\n top: 0;\n bottom: 0;\n right: 0;\n left: 0;\n z-index: 1;\n }\n"])));var StyledLink$1=_styled(Link$4).withConfig({displayName:"ClickableOverlay__StyledLink",componentId:"sc-yfxl9c-0"})(templateObject_2$1q||(templateObject_2$1q=__makeTemplateObject(["\n ","\n"],["\n ","\n"])),Style);var ExternalLink$1=_styled.a.withConfig({displayName:"ClickableOverlay__ExternalLink",componentId:"sc-yfxl9c-1"})(templateObject_3$X||(templateObject_3$X=__makeTemplateObject(["\n ","\n"],["\n ","\n"])),Style);var templateObject_1$2d,templateObject_2$1q,templateObject_3$X;var PostItemTile=function PostItemTile(_a){var post=_a.post,readOnly=_a.readOnly,backgroundColor=_a.backgroundColor,className=_a.className;var features=useFeatures();var buildPath=useSubscriptionHandlePathBuilder().buildPath;return jsxs(PostHost,__assign({className:className,backgroundColor:backgroundColor},{children:[!readOnly&&jsx$1(ClickableOverlay,{baseRoute:buildPath("/posts/"+post.id),itemId:post.id,itemType:ItemResourceTypes.Posts,ariaLabelResourceKey:"AriaLabel.itemLink"},void 0),jsxs(Header$3,{children:[jsx$1(StyledPersonaCard$3,__assign({upn:post.author.userPrincipalName,domIdentifier:"avatar"},{children:jsx$1(Avatar,{upn:post.author.userPrincipalName,text:post.author.displayName,size:PersonaSize.size40,hidePersonaDetails:true},void 0)}),void 0),jsxs(HeaderMetadata$2,{children:[jsx$1(PostDisplayName$1,__assign({"data-author":true},{children:post.author.displayName}),void 0),jsx$1(PostDateTime$1,{className:"ms-fontColor-neutralTertiary",value:post.publishingDate},void 0),jsx$1(Modified,{modified:post.modified},void 0)]},void 0)]},void 0),jsx$1(Content$8,{children:jsx$1(ContentDisplay,{content:post.content,handlers:[ContentDisplayHandler.LineBreak,ContentDisplayHandler.Link,ContentDisplayHandler.Mention,ContentDisplayHandler.Hashtag]},void 0)},void 0),features.keywords&&features.postKeywords&&post.keywords&&jsx$1(StyledKeywordsInfo$1,{keywords:post.keywords},void 0)]}),void 0);};var PostHost=_styled.div.withConfig({displayName:"PostItemTile__PostHost",componentId:"sc-yu434m-0"})(templateObject_3$W||(templateObject_3$W=__makeTemplateObject(["\n ","\n\n display: flex;\n flex-direction: column;\n\n font-size: ","px;\n padding: ","px;\n\n position: relative;\n"],["\n ","\n\n display: flex;\n flex-direction: column;\n\n font-size: ","px;\n padding: ","px;\n\n position: relative;\n"])),function(p){return p.backgroundColor?css$2(templateObject_1$2c||(templateObject_1$2c=__makeTemplateObject(["\n background-color: ",";\n "],["\n background-color: ",";\n "])),p.backgroundColor):css$2(templateObject_2$1p||(templateObject_2$1p=__makeTemplateObject(["\n background-color: ",";\n "],["\n background-color: ",";\n "])),p.theme.palette.white);},fontSizeSmall,spacingM);var Header$3=_styled.div.withConfig({displayName:"PostItemTile__Header",componentId:"sc-yu434m-1"})(templateObject_4$G||(templateObject_4$G=__makeTemplateObject(["\n display: flex;\n align-items: center;\n"],["\n display: flex;\n align-items: center;\n"])));var StyledPersonaCard$3=_styled(PersonaCard).withConfig({displayName:"PostItemTile__StyledPersonaCard",componentId:"sc-yu434m-2"})(templateObject_5$A||(templateObject_5$A=__makeTemplateObject(["\n a,\n button {\n position: relative;\n z-index: 1;\n }\n"],["\n a,\n button {\n position: relative;\n z-index: 1;\n }\n"])));var HeaderMetadata$2=_styled.div.withConfig({displayName:"PostItemTile__HeaderMetadata",componentId:"sc-yu434m-3"})(templateObject_6$q||(templateObject_6$q=__makeTemplateObject(["\n flex: 1;\n font-size: ","px;\n padding-left: ","px;\n white-space: nowrap;\n"],["\n flex: 1;\n font-size: ","px;\n padding-left: ","px;\n white-space: nowrap;\n"])),fontSizeSmall,spacingS);var PostDisplayName$1=_styled.div.withConfig({displayName:"PostItemTile__PostDisplayName",componentId:"sc-yu434m-4"})(templateObject_7$k||(templateObject_7$k=__makeTemplateObject(["\n font-weight: bold;\n"],["\n font-weight: bold;\n"])));var PostDateTime$1=_styled(DateTime).withConfig({displayName:"PostItemTile__PostDateTime",componentId:"sc-yu434m-5"})(templateObject_8$i||(templateObject_8$i=__makeTemplateObject(["\n font-size: ","px;\n"],["\n font-size: ","px;\n"])),fontSizeSmaller);var Content$8=_styled.div.withConfig({displayName:"PostItemTile__Content",componentId:"sc-yu434m-6"})(templateObject_9$e||(templateObject_9$e=__makeTemplateObject(["\n padding-top: 15px;\n a {\n text-decoration: underline;\n }\n\n a,\n button {\n position: relative;\n z-index: 1;\n }\n"],["\n padding-top: 15px;\n a {\n text-decoration: underline;\n }\n\n a,\n button {\n position: relative;\n z-index: 1;\n }\n"])));var StyledKeywordsInfo$1=_styled(KeywordsInfo).withConfig({displayName:"PostItemTile__StyledKeywordsInfo",componentId:"sc-yu434m-7"})(templateObject_10$c||(templateObject_10$c=__makeTemplateObject(["\n margin-top: ","px;\n\n dd {\n text-decoration: none;\n }\n"],["\n margin-top: ","px;\n\n dd {\n text-decoration: none;\n }\n"])),spacingM);var templateObject_1$2c,templateObject_2$1p,templateObject_3$W,templateObject_4$G,templateObject_5$A,templateObject_6$q,templateObject_7$k,templateObject_8$i,templateObject_9$e,templateObject_10$c;var EventLocationLink=function EventLocationLink(_a){var location=_a.location,alternativeCaption=_a.alternativeCaption,className=_a.className;var locationLink=location.url||getGoogleMapsSearchLink(location.locationOnMap);return jsx$1(Fragment,{children:locationLink?jsx$1(TextLink,__assign({url:locationLink,ariaLabel:alternativeCaption||location.name},{children:alternativeCaption||location.name}),void 0):jsx$1("span",__assign({className:className},{children:alternativeCaption||location.name}),void 0)},void 0);};var EventLocationInfo=function EventLocationInfo(_a){var locations=_a.locations,className=_a.className;if(!locations||locations.length===0){return null;}var isMultiLine=locations.length>1;return jsx$1(Host$P,__assign({className:className},{children:jsxs(ListWrapper,__assign({"data-event-locations":true,isMultiLine:isMultiLine},{children:[jsx$1(Label,{resourceKey:"Events.locationsLabel",count:locations.length},void 0),jsx$1(List$2,__assign({isMultiLine:isMultiLine},{children:locations.map(function(l){return jsx$1("li",{children:jsx$1(EventLocationLink,{location:l},void 0)},l.locationId);})}),void 0)]}),void 0)}),void 0);};var EventPeopleInfo=function EventPeopleInfo(_a){var item=_a.item,className=_a.className,hideAnnouncer=_a.hideAnnouncer;var author=item.owner||item.author;var contactsCount=item.contacts&&item.contacts.length;if(hideAnnouncer&&contactsCount===0){return null;}var isMultiLine=contactsCount>1;return jsxs(Host$P,__assign({className:className},{children:[contactsCount>0&&jsxs(Contacts$1,__assign({"data-event-people":"contacts",isMultiLine:isMultiLine,hideAnnouncer:hideAnnouncer},{children:[jsx$1(Label,{resourceKey:"Events.contactsLabel",count:contactsCount},void 0),jsx$1(List$2,__assign({isMultiLine:isMultiLine},{children:item.contacts.map(function(c){return jsx$1("li",{children:jsx$1(EventUser,{user:c,className:"ms-fontColor-accent"},void 0)},c.userPrincipalName);})}),void 0)]}),void 0),!hideAnnouncer&&author&&jsxs(ListWrapper,__assign({"data-event-people":"author",isMultiLine:false},{children:[jsx$1(Label,{resourceKey:"Events.authorLabel"},void 0),jsx$1(EventUser,{user:author,className:"ms-fontColor-accent"},void 0)]}),void 0)]}),void 0);};var EventUser=function EventUser(_a){var user=_a.user,className=_a.className;return jsx$1("div",__assign({className:className},{children:jsx$1(StyledPersonaCard$2,__assign({upn:user.userPrincipalName},{children:user.displayName}),void 0)}),void 0);};var Label=function Label(_a){var resourceKey=_a.resourceKey,count=_a.count;return jsxs("div",{children:[jsx$1(FormattedMessage$1,{id:resourceKey,values:{count:count||1}},void 0),":\u00A0"]},void 0);};var EventChannelsDisplay=function EventChannelsDisplay(_a){var _b;var item=_a.item,language=_a.language,className=_a.className,allowFilterByChannels=_a.allowFilterByChannels,channelBackgroundColor=_a.channelBackgroundColor;var buildPath=useSubscriptionHandlePathBuilder().buildPath;if(!((_b=item===null||item===void 0?void 0:item.channels)===null||_b===void 0?void 0:_b.length)){return null;}return jsx$1(Channels$2,{channels:item.channels.map(function(c){return c.name;}),language:language,buildChannelFilterUrl:allowFilterByChannels?function(c){return buildPath("/events?"+queryString.stringify({channels:c}));}:null,channelBackgroundColor:channelBackgroundColor,className:className},void 0);};var Host$P=_styled.div.withConfig({displayName:"EventMetaInfo__Host",componentId:"sc-l9y854-0"})(templateObject_1$2b||(templateObject_1$2b=__makeTemplateObject(["\n display: flex;\n flex-wrap: wrap;\n font-size: ","px;\n"],["\n display: flex;\n flex-wrap: wrap;\n font-size: ","px;\n"])),fontSizeSmall);var ListWrapper=_styled.div.withConfig({displayName:"EventMetaInfo__ListWrapper",componentId:"sc-l9y854-1"})(templateObject_2$1o||(templateObject_2$1o=__makeTemplateObject(["\n display: flex;\n flex-wrap: wrap;\n width: 100%;\n text-align: left;\n\n flex-direction: ",";\n\n ","\n"],["\n display: flex;\n flex-wrap: wrap;\n width: 100%;\n text-align: left;\n\n flex-direction: ",";\n\n ","\n"])),function(_a){var isMultiLine=_a.isMultiLine;return isMultiLine?'column':'row';},function(_a){var isMultiLine=_a.isMultiLine;return isMultiLine&&'> div:first-child { padding-bottom: 3px }';});var Contacts$1=_styled(ListWrapper).withConfig({displayName:"EventMetaInfo__Contacts",componentId:"sc-l9y854-2"})(templateObject_3$V||(templateObject_3$V=__makeTemplateObject(["\n margin-bottom: ","px;\n"],["\n margin-bottom: ","px;\n"])),function(p){return !p.hideAnnouncer?spacingXs:0;});var StyledPersonaCard$2=_styled(PersonaCard).withConfig({displayName:"EventMetaInfo__StyledPersonaCard",componentId:"sc-l9y854-3"})(templateObject_4$F||(templateObject_4$F=__makeTemplateObject(["\n text-decoration: underline;\n"],["\n text-decoration: underline;\n"])));var List$2=_styled.ul.withConfig({displayName:"EventMetaInfo__List",componentId:"sc-l9y854-4"})(templateObject_6$p||(templateObject_6$p=__makeTemplateObject(["\n ",";\n\n &&& {\n padding: 0;\n margin: 0;\n list-style: none;\n }\n\n > li {\n margin-top: ","px;\n }\n"],["\n ",";\n\n &&& {\n padding: 0;\n margin: 0;\n list-style: none;\n }\n\n > li {\n margin-top: ","px;\n }\n"])),function(_a){var isMultiLine=_a.isMultiLine;return !isMultiLine&&css$2(templateObject_5$z||(templateObject_5$z=__makeTemplateObject(["\n display: flex;\n flex-wrap: wrap;\n flex-direction: row;\n align-items: center;\n "],["\n display: flex;\n flex-wrap: wrap;\n flex-direction: row;\n align-items: center;\n "])));},function(_a){var isMultiLine=_a.isMultiLine;return isMultiLine?3:0;});var Channels$2=_styled(ClickableChannelTitles).withConfig({displayName:"EventMetaInfo__Channels",componentId:"sc-l9y854-5"})(templateObject_7$j||(templateObject_7$j=__makeTemplateObject(["\n &&& li {\n margin-top: ","px;\n }\n"],["\n &&& li {\n margin-top: ","px;\n }\n"])),spacingS);var templateObject_1$2b,templateObject_2$1o,templateObject_3$V,templateObject_4$F,templateObject_5$z,templateObject_6$p,templateObject_7$j;var BannerImage=function BannerImage(_a){var imageUrl=_a.imageUrl,children=_a.children,className=_a.className,openImageUrl=_a.openImageUrl;return jsxs(Host$O,__assign({onClick:function(){return openImageUrl&&showPhoto();},className:classNames('bannerImage',className)},{children:[jsx$1(Image$1,{src:imageUrl,imageFit:ImageFit.cover,maximizeFrame:true,alt:""},void 0),children]}),void 0);};var Host$O=_styled.div.withConfig({displayName:"BannerImage__Host",componentId:"sc-1wfmp37-0"})(templateObject_1$2a||(templateObject_1$2a=__makeTemplateObject(["\n position: relative;\n height: inherit;\n\n /*\n The UI Fabric image component has a bug that it shows 1px on the left/ top\n or right side of the background when applying their cross browser image-fit: cover.\n This result in 1px gray/white \"border\".\n We just add 1px to the image width & height to cover this gap\n */\n .ms-Image {\n img {\n width: calc(100% + 1px);\n height: calc(100% + 1px);\n }\n }\n"],["\n position: relative;\n height: inherit;\n\n /*\n The UI Fabric image component has a bug that it shows 1px on the left/ top\n or right side of the background when applying their cross browser image-fit: cover.\n This result in 1px gray/white \"border\".\n We just add 1px to the image width & height to cover this gap\n */\n .ms-Image {\n img {\n width: calc(100% + 1px);\n height: calc(100% + 1px);\n }\n }\n"])));var templateObject_1$2a;function useImageEditorApi(){var api=useApi();var _a=useApiFactory(),createApiUrl=_a.createApiUrl,fetchFromApi=_a.fetchFromApi;var onRequestToken=useContext(AuthenticationContext).onRequestToken;return useMemo(function(){return {getImageInfo:getImageInfo,getImageEditorUrl:getImageEditorUrl,getOriginalImageEditorUrlWithToken:getOriginalImageEditorUrlWithToken,getImageEditorUrlWithToken:getImageEditorUrlWithToken,uploadImage:uploadImage};/**
|
|
131718
131723
|
* Retrieve information on a given image. Does not return the actual image.
|
|
131719
131724
|
*/function getImageInfo(itemId,identifier,resourceType){var path="editor/"+resourceType+"/"+itemId+"/images/"+identifier;return api.custom(path+"/info").get().then(function(res){return res.body().data();});}function getImageEditorUrl(itemId,subscriptionId,identifier,resourceType){return __awaiter(this,void 0,void 0,function(){var token;return __generator(this,function(_a){switch(_a.label){case 0:return [4/*yield*/,onRequestToken()];case 1:token=_a.sent();return [2/*return*/,getImageEditorUrlWithToken(token,itemId,subscriptionId,identifier,resourceType)];}});});}function getImageEditorUrlWithToken(token,itemId,subscriptionId,identifier,resourceType,width,height){var url=width?"/editor/"+resourceType+"/"+itemId+"/images/"+identifier+"/"+width+"/"+(height||''):"/editor/"+resourceType+"/"+itemId+"/images/"+identifier;return createApiUrl(url,{access_token:token,subscriptionId:subscriptionId});}function getOriginalImageEditorUrlWithToken(token,itemId,subscriptionId,identifier,resourceType){return createApiUrl("/editor/"+resourceType+"/"+itemId+"/images/"+identifier+"/original",{access_token:token,subscriptionId:subscriptionId});}function uploadImage(subscriptionId,resourceType,newImage){return __awaiter(this,void 0,void 0,function(){var fd,token,config;return __generator(this,function(_a){switch(_a.label){case 0:// validate or set defaults
|
|
131720
131725
|
if(!newImage.identifier){// identifer defaults to 'banner'
|
|
@@ -131722,10 +131727,10 @@ newImage.identifier='banner';}fd=new FormData();fd.append('image',newImage.image
|
|
|
131722
131727
|
// any promise failures are expected be handled from the code consuming the observable
|
|
131723
131728
|
return [4/*yield*/,fetchFromApi("/editor/"+resourceType+"/"+newImage.itemId+"/images/"+newImage.identifier+"/"+newImage.variant,config)];case 2:// error handling is not done here
|
|
131724
131729
|
// any promise failures are expected be handled from the code consuming the observable
|
|
131725
|
-
_a.sent();return [2/*return*/,{itemId:newImage.itemId,identifier:newImage.identifier,mimeType:newImage.image.type,extension:newImage.image.name.split('.').pop()}];}});});}},[api,createApiUrl,fetchFromApi,onRequestToken]);}var PublishableItemBanner=function PublishableItemBanner(props){var getImageUrlWithToken=useNewsApi().getImageUrlWithToken;var _a=useVideosApi(),getBannerVideoThumbnailUrl=_a.getBannerVideoThumbnailUrl,getVideoThumbnailUrl=_a.getVideoThumbnailUrl;var getImageEditorUrlWithToken=useImageEditorApi().getImageEditorUrlWithToken;var _b=useState$2(false),showPlayer=_b[0],setShowPlayer=_b[1];var user=useCurrentUser();var features=useFeatures();var onOpenExternalLink=useContext(LinkContext).onOpenExternalLink;var formatMessage=useIntl().formatMessage;useEffect$1(function(){if(props.hidePlayerIfActive){setShowPlayer(false);}},[props.hidePlayerIfActive]);if(!props.token||!props.bannerInfo){return null;}var isImage=props.bannerInfo.type==='image';var imageUrl=getImageUrl(props.useEditorRoutes,isImage,props.width,props.height);var isStreamVideo=props.bannerInfo.videoSource===VideoSource.MicrosoftStream;var streamVideoUrl=isStreamVideo&&getMicrosoftStreamVideoUrl(props.bannerInfo.videoId);var isPlayableVideo=!isImage&&!(isStreamVideo&&env.isNativeMobileApp);if(isPlayableVideo&&showPlayer){return jsx$1(StyledVideoView,{videoInfo:{id:props.bannerInfo.videoId,source:props.bannerInfo.videoSource,url:props.bannerInfo.videoUrl,isDirectUrl:props.bannerInfo.isDirectVideoUrl},autoplay:true,className:props.className},void 0);}return jsxs(StyledBannerImage,__assign({isVideo:!isImage,imageUrl:imageUrl,openImageUrl:props.canOpenImage&&env.isNativeMobileApp?getImageUrl(props.useEditorRoutes,true,'default'):null,className:props.className},{children:[isPlayableVideo&&jsx$1(VideoButtonOverlay,{onClick:handlePlayClick,iconProps:{iconName:'MSNVideosSolid',className:'video-icon'},ariaLabel:formatMessage({id:'Generic.watchVideo'})},void 0),isStreamVideo&&env.isNativeMobileApp&&(features.inAppBrowser?jsx$1(VideoLinkOverlay,__assign({url:streamVideoUrl,onClick:function(e){return __awaiter(void 0,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:e.stopPropagation();e.preventDefault();return [4/*yield*/,onOpenExternalLink(streamVideoUrl)];case 1:_a.sent();return [2/*return*/];}});});},ariaLabel:formatMessage({id:'Generic.watchMicrosoftStream'})},{children:jsx$1(VideoIcon,{iconName:"MSNVideosSolid",className:"video-icon"},void 0)}),void 0):jsx$1(VideoLinkOverlay,__assign({url:streamVideoUrl,ariaLabel:formatMessage({id:'Generic.watchMicrosoftStream'})},{children:jsx$1(VideoIcon,{iconName:"MSNVideosSolid",className:"video-icon"},void 0)}),void 0))]}),void 0);function getImageUrl(useEditorRoutes,isImage,width,height){var _a;if(isImage){return useEditorRoutes?getImageEditorUrlWithToken(props.token,props.itemId,user.subscription.id,props.bannerInfo.imageId,props.resourceType):getImageUrlWithToken(props.token,props.itemId,user.subscription.id,props.resourceType,props.bannerInfo.imageId,width,height);}else {return (_a=new VideoUrlParser(props.bannerInfo.videoUrl).thumbnailUrl)!==null&&_a!==void 0?_a:useEditorRoutes?getVideoThumbnailUrl(props.token,user.subscription.id,props.bannerInfo.videoSource,props.bannerInfo.videoId):getBannerVideoThumbnailUrl(props.token,props.itemId,user.subscription.id,props.resourceType);}}function handlePlayClick(e){var _a;e.stopPropagation();e.preventDefault();setShowPlayer(true);(_a=props.onPlayButtonClick)===null||_a===void 0?void 0:_a.call(props);}};var StyledBannerImage=_styled(BannerImage).withConfig({displayName:"PublishableItemBanner__StyledBannerImage",componentId:"sc-bjnycc-0"})(templateObject_2$1n||(templateObject_2$1n=__makeTemplateObject(["\n ","\n"],["\n ","\n"])),function(p){return p.isVideo&&css$2(templateObject_1$29||(templateObject_1$29=__makeTemplateObject(["\n position: relative;\n "],["\n position: relative;\n "])));});var BannerVideoOverlay=css$2(templateObject_3$U||(templateObject_3$U=__makeTemplateObject(["\n position: absolute;\n top: 0;\n bottom: 0;\n right: 0;\n left: 0;\n\n background-color: rgba(0, 0, 0, 0.33);\n\n .video-icon {\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n }\n\n &:hover {\n .video-icon {\n color: rgba(255, 255, 255, 0.85);\n }\n }\n"],["\n position: absolute;\n top: 0;\n bottom: 0;\n right: 0;\n left: 0;\n\n background-color: rgba(0, 0, 0, 0.33);\n\n .video-icon {\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n }\n\n &:hover {\n .video-icon {\n color: rgba(255, 255, 255, 0.85);\n }\n }\n"])));var VideoIconStyle=css$2(templateObject_4$E||(templateObject_4$E=__makeTemplateObject(["\n font-size: 50px;\n color: rgba(255, 255, 255, 0.5);\n"],["\n font-size: 50px;\n color: rgba(255, 255, 255, 0.5);\n"])));var VideoButtonOverlay=_styled(IconButton$1).withConfig({displayName:"PublishableItemBanner__VideoButtonOverlay",componentId:"sc-bjnycc-1"})(templateObject_5$y||(templateObject_5$y=__makeTemplateObject(["\n && {\n width: 100%;\n height: 100%;\n border: 0;\n margin: 0;\n padding: 0;\n z-index: 1;\n border-radius: 0;\n\n ","\n\n i.video-icon {\n ","\n }\n\n &&:hover {\n background-color: rgba(0, 0, 0, 0.33);\n }\n }\n"],["\n && {\n width: 100%;\n height: 100%;\n border: 0;\n margin: 0;\n padding: 0;\n z-index: 1;\n border-radius: 0;\n\n ","\n\n i.video-icon {\n ","\n }\n\n &&:hover {\n background-color: rgba(0, 0, 0, 0.33);\n }\n }\n"])),BannerVideoOverlay,VideoIconStyle);var VideoLinkOverlay=_styled(ExternalLinkHandler).withConfig({displayName:"PublishableItemBanner__VideoLinkOverlay",componentId:"sc-bjnycc-2"})(templateObject_6$o||(templateObject_6$o=__makeTemplateObject(["\n ","\n"],["\n ","\n"])),BannerVideoOverlay);var VideoIcon=_styled(Icon).withConfig({displayName:"PublishableItemBanner__VideoIcon",componentId:"sc-bjnycc-3"})(templateObject_7$i||(templateObject_7$i=__makeTemplateObject(["\n ","\n"],["\n ","\n"])),VideoIconStyle);var StyledVideoView=_styled(VideoView).withConfig({displayName:"PublishableItemBanner__StyledVideoView",componentId:"sc-bjnycc-4"})(templateObject_8$h||(templateObject_8$h=__makeTemplateObject(["\n height: 100%;\n"],["\n height: 100%;\n"])));var templateObject_1$29,templateObject_2$1n,templateObject_3$U,templateObject_4$E,templateObject_5$y,templateObject_6$o,templateObject_7$i,templateObject_8$h;var EventCardBanner=function EventCardBanner(_a){var item=_a.item,bannerWidth=_a.bannerWidth,bannerHostDefaultWidth=_a.bannerHostDefaultWidth,showPlaceholder=_a.showPlaceholder;if(!item.bannerInfo&&!showPlaceholder){return null;}return jsx$1("div",{children:jsx$1(LeftBannerWrapper,__assign({defaultWidth:bannerHostDefaultWidth,showPlaceholder:showPlaceholder},{children:jsx$1(PublishableItemBanner,{itemId:item.id,bannerInfo:item.bannerInfo,width:bannerWidth,token:item.fileAccessToken,resourceType:ItemResourceTypes.Events},void 0)}),void 0)},void 0);};var FeedbackCountButton=function FeedbackCountButton(_a){var className=_a.className,isActive=_a.isActive,activeIconName=_a.activeIconName,count=_a.count,iconName=_a.iconName,onClick=_a.onClick,readOnly=_a.readOnly,tooltipResourceKey=_a.tooltipResourceKey,tooltipResourceKeyValues=_a.tooltipResourceKeyValues,activeTooltipResourceKey=_a.activeTooltipResourceKey,activeTooltipResourceKeyValues=_a.activeTooltipResourceKeyValues,ariaLabel=_a.ariaLabel,feedbackType=_a.feedbackType,highlight=_a.highlight,hideZeroCount=_a.hideZeroCount,doNotRenderZeroCount=_a.doNotRenderZeroCount,hideTooltip=_a.hideTooltip;var resourceKey=isActive?activeTooltipResourceKey||tooltipResourceKey:tooltipResourceKey;var resourceValues=isActive?activeTooltipResourceKeyValues||tooltipResourceKeyValues:tooltipResourceKeyValues;return jsxs(CountButtonHost,__assign({className:className,"data-feedback":feedbackType,"data-feedback-button-isactive":isActive!==null&&isActive!==void 0?isActive:false,"data-feedback-count":count},{children:[jsx$1(IEMarginFix,{},void 0),jsx$1(PreloadIcons,{icons:[activeIconName,iconName]},void 0),jsx$1(TooltipHost,__assign({resourceKey:resourceKey,values:resourceValues,hidden:hideTooltip},{children:onClick?jsx$1(StyledIconButton$6,__assign({onClick:onClick,iconProps:{iconName:isActive?activeIconName:iconName},"data-feedback-button":feedbackType,disabled:readOnly,highlight:highlight,"data-unread-comment-highlight":highlight,ariaLabel:ariaLabel},{children:jsx$1(CountDisplay,{count:count,doNotRenderZeroCount:doNotRenderZeroCount,hideZeroCount:hideZeroCount},void 0)}),void 0):jsxs(Fragment,{children:[jsx$1(StyledIcon$7,{iconName:isActive?activeIconName:iconName,highlight:highlight,"data-unread-comment-highlight":highlight},void 0),jsx$1(CountDisplay,{count:count,doNotRenderZeroCount:doNotRenderZeroCount,hideZeroCount:hideZeroCount,ariaLabel:ariaLabel},void 0)]},void 0)}),void 0)]}),void 0);};var CountDisplay=function CountDisplay(_a){var count=_a.count,hideZeroCount=_a.hideZeroCount,doNotRenderZeroCount=_a.doNotRenderZeroCount,ariaLabel=_a.ariaLabel;var shouldNotRenderZeroCount=doNotRenderZeroCount&&!count;if(shouldNotRenderZeroCount){return null;}var shouldHideZeroCount=hideZeroCount&&!count;return jsx$1(CountLabel,__assign({isHidden:shouldHideZeroCount,"aria-label":ariaLabel},{children:count}),void 0);};var TooltipHost=_styled(Tooltip).withConfig({displayName:"FeedbackCountButton__TooltipHost",componentId:"sc-vg1ry1-0"})(templateObject_1$28||(templateObject_1$28=__makeTemplateObject(["\n && {\n display: flex;\n height: 100%;\n align-items: center;\n }\n"],["\n && {\n display: flex;\n height: 100%;\n align-items: center;\n }\n"])));var CountButtonHost=_styled.div.withConfig({displayName:"FeedbackCountButton__CountButtonHost",componentId:"sc-vg1ry1-1"})(templateObject_2$1m||(templateObject_2$1m=__makeTemplateObject(["\n display: flex;\n align-items: center;\n min-width: 60px;\n height: ","px; // ensure same height for feedback buttons\n\n margin-right: 9px;\n"],["\n display: flex;\n align-items: center;\n min-width: 60px;\n height: ","px; // ensure same height for feedback buttons\n\n margin-right: 9px;\n"])),feedbackButtonHeight);var IEMarginFix=createGlobalStyle(templateObject_3$T||(templateObject_3$T=__makeTemplateObject(["\n .browser-name-ie {\n "," {\n margin-right: 20px;\n }\n }\n"],["\n .browser-name-ie {\n "," {\n margin-right: 20px;\n }\n }\n"])),CountButtonHost);var StyledIconButton$6=_styled(IconButton).withConfig({displayName:"FeedbackCountButton__StyledIconButton",componentId:"sc-vg1ry1-2"})(templateObject_4$D||(templateObject_4$D=__makeTemplateObject(["\n && {\n margin: 0;\n padding: 0;\n width: 100%;\n font-size: inherit;\n\n &[disabled] {\n background: transparent;\n }\n }\n\n i {\n font-size: 22px;\n margin: 0;\n ","\n }\n\n user-select: none;\n"],["\n && {\n margin: 0;\n padding: 0;\n width: 100%;\n font-size: inherit;\n\n &[disabled] {\n background: transparent;\n }\n }\n\n i {\n font-size: 22px;\n margin: 0;\n ","\n }\n\n user-select: none;\n"])),function(p){return p.highlight&&unreadCommentHighlight;});var StyledIcon$7=_styled(Icon).withConfig({displayName:"FeedbackCountButton__StyledIcon",componentId:"sc-vg1ry1-3"})(templateObject_5$x||(templateObject_5$x=__makeTemplateObject(["\n font-size: 22px;\n user-select: none;\n\n ","\n"],["\n font-size: 22px;\n user-select: none;\n\n ","\n"])),function(p){return p.highlight&&unreadCommentHighlight;});var CountLabel=_styled.span.withConfig({displayName:"FeedbackCountButton__CountLabel",componentId:"sc-vg1ry1-4"})(templateObject_8$g||(templateObject_8$g=__makeTemplateObject(["\n margin-left: 7px;\n word-break: normal;\n align-self: center;\n ","\n ","\n"],["\n margin-left: 7px;\n word-break: normal;\n align-self: center;\n ","\n ","\n"])),function(p){return p.isHidden&&css$2(templateObject_6$n||(templateObject_6$n=__makeTemplateObject(["\n visibility: hidden;\n "],["\n visibility: hidden;\n "])));},function(p){return p.isDisabled&&css$2(templateObject_7$h||(templateObject_7$h=__makeTemplateObject(["\n color: ",";\n "],["\n color: ",";\n "])),p.theme.palette.neutralQuaternary);});var PreloadIcons=function PreloadIcons(_a){var icons=_a.icons;return jsx$1(Fragment,{children:icons.filter(function(i){return i;}).map(function(i){return jsx$1(PreloadIcon,{iconName:i},i);})},void 0);};var PreloadIcon=_styled(Icon).withConfig({displayName:"FeedbackCountButton__PreloadIcon",componentId:"sc-vg1ry1-5"})(templateObject_9$d||(templateObject_9$d=__makeTemplateObject(["\n position: fixed;\n left: -500px;\n"],["\n position: fixed;\n left: -500px;\n"])));var templateObject_1$28,templateObject_2$1m,templateObject_3$T,templateObject_4$D,templateObject_5$x,templateObject_6$n,templateObject_7$h,templateObject_8$g,templateObject_9$d;var EventCardCommentCount=function EventCardCommentCount(_a){var item=_a.item;var formatMessage=useIntl().formatMessage;return jsxs(Fragment,{children:[jsx$1(IEFix$1,{},void 0),jsx$1(StyledFeedbackCountButton,{tooltipResourceKey:"Events.numberOfComments",tooltipResourceKeyValues:{count:item.statistics.commentCount},ariaLabel:formatMessage({id:'AriaLabel.commentsButton'}),iconName:"Chat",count:item.statistics.commentCount,feedbackType:"comment",highlight:item.hasNewComments,className:"event-card-comments"},void 0)]},void 0);};var StyledFeedbackCountButton=_styled(FeedbackCountButton).withConfig({displayName:"EventCardCommentCount__StyledFeedbackCountButton",componentId:"sc-3prmx8-0"})(templateObject_1$27||(templateObject_1$27=__makeTemplateObject(["\n && {\n min-width: 0;\n margin-right: 0;\n }\n"],["\n && {\n min-width: 0;\n margin-right: 0;\n }\n"])));var IEFix$1=createGlobalStyle(templateObject_2$1l||(templateObject_2$1l=__makeTemplateObject(["\n .browser-name-ie {\n .event-card-comments {\n margin-right: 0 !important;\n }\n }\n"],["\n .browser-name-ie {\n .event-card-comments {\n margin-right: 0 !important;\n }\n }\n"])));var templateObject_1$27,templateObject_2$1l;var EventCancelInformation=function EventCancelInformation(_a){var _b;var item=_a.item,language=_a.language,className=_a.className;var user=useCurrentUser();if(!((_b=item.cancelInformation)===null||_b===void 0?void 0:_b.isCancelled)){return null;}var contents=item.cancelInformation.reasons||{};var reason=contents[language]||contents[NewsService.getUserPreferredLanguage(Object.keys(contents),user)]||Object.values(contents)[0];return jsxs(Host$N,__assign({className:className,"data-event-cancelled-info":true},{children:[jsxs(TitleContainer,{children:[jsx$1(CancelIcon,{iconName:"RemoveEvent"},void 0),jsx$1(Title$8,{id:"Events.cancel.cancelled"},void 0)]},void 0),reason]}),void 0);};var Host$N=_styled.div.withConfig({displayName:"EventCancelInformation__Host",componentId:"sc-rh6578-0"})(templateObject_1$26||(templateObject_1$26=__makeTemplateObject(["\n position: relative;\n padding: ","px;\n margin-top: ","px;\n\n font-size: ","px;\n\n :after {\n content: '';\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n background-color: ",";\n opacity: 0.1;\n }\n"],["\n position: relative;\n padding: ","px;\n margin-top: ","px;\n\n font-size: ","px;\n\n :after {\n content: '';\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n background-color: ",";\n opacity: 0.1;\n }\n"])),spacingM,spacingS,fontSizeSmall,function(p){return p.theme.palette.red;});var TitleContainer=_styled.div.withConfig({displayName:"EventCancelInformation__TitleContainer",componentId:"sc-rh6578-1"})(templateObject_2$1k||(templateObject_2$1k=__makeTemplateObject(["\n display: flex;\n align-items: center;\n padding-bottom: ","px;\n\n color: ",";\n\n *:not(:first-child) {\n padding-left: ","px;\n }\n"],["\n display: flex;\n align-items: center;\n padding-bottom: ","px;\n\n color: ",";\n\n *:not(:first-child) {\n padding-left: ","px;\n }\n"])),spacingXs,function(p){return p.theme.palette.redDark;},spacingXs);var CancelIcon=_styled(Icon).withConfig({displayName:"EventCancelInformation__CancelIcon",componentId:"sc-rh6578-2"})(templateObject_3$S||(templateObject_3$S=__makeTemplateObject(["\n font-size: 20px;\n"],["\n font-size: 20px;\n"])));var Title$8=_styled(FormattedMessageWithStyle).withConfig({displayName:"EventCancelInformation__Title",componentId:"sc-rh6578-3"})(templateObject_4$C||(templateObject_4$C=__makeTemplateObject(["\n font-weight: bold;\n"],["\n font-weight: bold;\n"])));var templateObject_1$26,templateObject_2$1k,templateObject_3$S,templateObject_4$C;var EventUserRegistrationContext=/*#__PURE__*/createContext(null);function getDeadlineInfos(item){var hasDeadline=item.registrationSettings.deadline!=null;var isPastDeadline=hasDeadline&&moment(item.registrationSettings.deadline).isBefore(moment());return {hasDeadline:hasDeadline,isPastDeadline:isPastDeadline};}var EventRegistrationButton=function EventRegistrationButton(_a){var isRegistered=_a.isRegistered,className=_a.className,disabled=_a.disabled,onClick=_a.onClick,showInfoMessage=_a.showInfoMessage,infoMessageResourceKey=_a.infoMessageResourceKey;var formatMessage=useIntl().formatMessage;return jsxs(Host$M,__assign({className:className,"aria-label":formatMessage({id:'Events.registration.sectionLabel'})},{children:[jsx$1(RegisterButton,{text:formatMessage({id:isRegistered?'Events.registration.deregisterButtonCaption':'Events.registration.registerButtonCaption'}),disabled:disabled,"data-event-register-button":!!isRegistered,onClick:function(e){e.preventDefault();onClick();},isRegistered:isRegistered},void 0),showInfoMessage&&jsxs(InfoMessage,__assign({"data-event-register-info":true},{children:[jsx$1(Icon,{iconName:"Info"},void 0),jsx$1(FormattedMessage$1,{id:infoMessageResourceKey},void 0)]}),void 0)]}),void 0);};var Host$M=_styled.div.withConfig({displayName:"EventRegistrationButton__Host",componentId:"sc-rvaf0t-0"})(templateObject_1$25||(templateObject_1$25=__makeTemplateObject(["\n display: flex;\n align-items: center;\n flex-wrap: wrap;\n"],["\n display: flex;\n align-items: center;\n flex-wrap: wrap;\n"])));var RegisterButton=_styled(PrimaryButton).withConfig({displayName:"EventRegistrationButton__RegisterButton",componentId:"sc-rvaf0t-1"})(templateObject_4$B||(templateObject_4$B=__makeTemplateObject(["\n && {\n min-width: 200px;\n border: 0;\n &:hover {\n border: 0;\n }\n ","\n ","\n }\n"],["\n && {\n min-width: 200px;\n border: 0;\n &:hover {\n border: 0;\n }\n ","\n ","\n }\n"])),function(p){return p.disabled&&css$2(templateObject_2$1j||(templateObject_2$1j=__makeTemplateObject(["\n background-color: ",";\n "],["\n background-color: ",";\n "])),p.theme.palette.neutralQuaternaryAlt);},function(p){return p.isRegistered&&css$2(templateObject_3$R||(templateObject_3$R=__makeTemplateObject(["\n &:not([disabled]) {\n background-color: ",";\n color: #fff;\n\n &:hover {\n background-color: ",";\n }\n }\n "],["\n &:not([disabled]) {\n background-color: ",";\n color: #fff;\n\n &:hover {\n background-color: ",";\n }\n }\n "])),p.theme.palette.red,p.theme.palette.redDark);});var InfoMessage=_styled.span.withConfig({displayName:"EventRegistrationButton__InfoMessage",componentId:"sc-rvaf0t-2"})(templateObject_5$w||(templateObject_5$w=__makeTemplateObject(["\n display: flex;\n align-items: center;\n font-style: italic;\n margin-top: ","px;\n font-size: ","px;\n\n i {\n padding-right: ","px;\n }\n"],["\n display: flex;\n align-items: center;\n font-style: italic;\n margin-top: ","px;\n font-size: ","px;\n\n i {\n padding-right: ","px;\n }\n"])),spacingXs,fontSizeSmall,spacingXs);var templateObject_1$25,templateObject_2$1j,templateObject_3$R,templateObject_4$B,templateObject_5$w;var $$6=_export;var DESCRIPTORS=descriptors;var global$2=global$m;var has=has$c;var isObject$1=isObject$c;var defineProperty=objectDefineProperty.f;var copyConstructorProperties=copyConstructorProperties$2;var NativeSymbol=global$2.Symbol;if(DESCRIPTORS&&typeof NativeSymbol=='function'&&(!('description'in NativeSymbol.prototype)||// Safari 12 bug
|
|
131730
|
+
_a.sent();return [2/*return*/,{itemId:newImage.itemId,identifier:newImage.identifier,mimeType:newImage.image.type,extension:newImage.image.name.split('.').pop()}];}});});}},[api,createApiUrl,fetchFromApi,onRequestToken]);}var PublishableItemBanner=function PublishableItemBanner(props){var getImageUrlWithToken=useNewsApi().getImageUrlWithToken;var _a=useVideosApi(),getBannerVideoThumbnailUrl=_a.getBannerVideoThumbnailUrl,getVideoThumbnailUrl=_a.getVideoThumbnailUrl;var getImageEditorUrlWithToken=useImageEditorApi().getImageEditorUrlWithToken;var _b=useState$2(false),showPlayer=_b[0],setShowPlayer=_b[1];var user=useCurrentUser();var features=useFeatures();var onOpenExternalLink=useContext(LinkContext).onOpenExternalLink;var formatMessage=useIntl().formatMessage;useEffect$1(function(){if(props.hidePlayerIfActive){setShowPlayer(false);}},[props.hidePlayerIfActive]);if(!props.token||!props.bannerInfo){return null;}var isImage=props.bannerInfo.type==='image';var imageUrl=getImageUrl(props.useEditorRoutes,isImage,props.width,props.height);var isStreamVideo=props.bannerInfo.videoSource===VideoSource.MicrosoftStream;var streamVideoUrl=isStreamVideo&&getMicrosoftStreamVideoUrl(props.bannerInfo.videoId);var isPlayableVideo=!isImage&&!(isStreamVideo&&env.isNativeMobileApp);if(isPlayableVideo&&showPlayer){return jsx$1(StyledVideoView,{videoInfo:{id:props.bannerInfo.videoId,source:props.bannerInfo.videoSource,url:props.bannerInfo.videoUrl,isDirectUrl:props.bannerInfo.isDirectVideoUrl},autoplay:true,className:props.className},void 0);}return jsxs(StyledBannerImage,__assign({isVideo:!isImage,imageUrl:imageUrl,openImageUrl:props.canOpenImage&&env.isNativeMobileApp?getImageUrl(props.useEditorRoutes,true,'default'):null,className:props.className},{children:[isPlayableVideo&&jsx$1(VideoButtonOverlay,{onClick:handlePlayClick,iconProps:{iconName:'MSNVideosSolid',className:'video-icon'},ariaLabel:formatMessage({id:'Generic.watchVideo'})},void 0),isStreamVideo&&env.isNativeMobileApp&&(features.inAppBrowser?jsx$1(VideoLinkOverlay,__assign({url:streamVideoUrl,onClick:function(e){return __awaiter(void 0,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:e.stopPropagation();e.preventDefault();return [4/*yield*/,onOpenExternalLink(streamVideoUrl)];case 1:_a.sent();return [2/*return*/];}});});},ariaLabel:formatMessage({id:'Generic.watchMicrosoftStream'})},{children:jsx$1(VideoIcon,{iconName:"MSNVideosSolid",className:"video-icon"},void 0)}),void 0):jsx$1(VideoLinkOverlay,__assign({url:streamVideoUrl,ariaLabel:formatMessage({id:'Generic.watchMicrosoftStream'})},{children:jsx$1(VideoIcon,{iconName:"MSNVideosSolid",className:"video-icon"},void 0)}),void 0))]}),void 0);function getImageUrl(useEditorRoutes,isImage,width,height){var _a;if(isImage){return useEditorRoutes?getImageEditorUrlWithToken(props.token,props.itemId,user.subscription.id,props.bannerInfo.imageId,props.resourceType):getImageUrlWithToken(props.token,props.itemId,user.subscription.id,props.resourceType,props.bannerInfo.imageId,width,height);}else {return (_a=new VideoUrlParser(props.bannerInfo.videoUrl).thumbnailUrl)!==null&&_a!==void 0?_a:useEditorRoutes?getVideoThumbnailUrl(props.token,user.subscription.id,props.bannerInfo.videoSource,props.bannerInfo.videoId):getBannerVideoThumbnailUrl(props.token,props.itemId,user.subscription.id,props.resourceType);}}function handlePlayClick(e){var _a;e.stopPropagation();e.preventDefault();setShowPlayer(true);(_a=props.onPlayButtonClick)===null||_a===void 0?void 0:_a.call(props);}};var StyledBannerImage=_styled(BannerImage).withConfig({displayName:"PublishableItemBanner__StyledBannerImage",componentId:"sc-bjnycc-0"})(templateObject_2$1n||(templateObject_2$1n=__makeTemplateObject(["\n ","\n"],["\n ","\n"])),function(p){return p.isVideo&&css$2(templateObject_1$29||(templateObject_1$29=__makeTemplateObject(["\n position: relative;\n "],["\n position: relative;\n "])));});var BannerVideoOverlay=css$2(templateObject_3$U||(templateObject_3$U=__makeTemplateObject(["\n position: absolute;\n top: 0;\n bottom: 0;\n right: 0;\n left: 0;\n\n background-color: rgba(0, 0, 0, 0.33);\n\n .video-icon {\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n }\n\n &:hover {\n .video-icon {\n color: rgba(255, 255, 255, 0.85);\n }\n }\n"],["\n position: absolute;\n top: 0;\n bottom: 0;\n right: 0;\n left: 0;\n\n background-color: rgba(0, 0, 0, 0.33);\n\n .video-icon {\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n }\n\n &:hover {\n .video-icon {\n color: rgba(255, 255, 255, 0.85);\n }\n }\n"])));var VideoIconStyle=css$2(templateObject_4$E||(templateObject_4$E=__makeTemplateObject(["\n font-size: 50px;\n color: rgba(255, 255, 255, 0.5);\n"],["\n font-size: 50px;\n color: rgba(255, 255, 255, 0.5);\n"])));var VideoButtonOverlay=_styled(IconButton$1).withConfig({displayName:"PublishableItemBanner__VideoButtonOverlay",componentId:"sc-bjnycc-1"})(templateObject_5$y||(templateObject_5$y=__makeTemplateObject(["\n && {\n width: 100%;\n height: 100%;\n border: 0;\n margin: 0;\n padding: 0;\n z-index: 1;\n border-radius: 0;\n\n ","\n\n i.video-icon {\n ","\n }\n\n &&:hover {\n background-color: rgba(0, 0, 0, 0.33);\n }\n }\n"],["\n && {\n width: 100%;\n height: 100%;\n border: 0;\n margin: 0;\n padding: 0;\n z-index: 1;\n border-radius: 0;\n\n ","\n\n i.video-icon {\n ","\n }\n\n &&:hover {\n background-color: rgba(0, 0, 0, 0.33);\n }\n }\n"])),BannerVideoOverlay,VideoIconStyle);var VideoLinkOverlay=_styled(ExternalLinkHandler).withConfig({displayName:"PublishableItemBanner__VideoLinkOverlay",componentId:"sc-bjnycc-2"})(templateObject_6$o||(templateObject_6$o=__makeTemplateObject(["\n ","\n"],["\n ","\n"])),BannerVideoOverlay);var VideoIcon=_styled(Icon).withConfig({displayName:"PublishableItemBanner__VideoIcon",componentId:"sc-bjnycc-3"})(templateObject_7$i||(templateObject_7$i=__makeTemplateObject(["\n ","\n"],["\n ","\n"])),VideoIconStyle);var StyledVideoView=_styled(VideoView).withConfig({displayName:"PublishableItemBanner__StyledVideoView",componentId:"sc-bjnycc-4"})(templateObject_8$h||(templateObject_8$h=__makeTemplateObject(["\n height: 100%;\n"],["\n height: 100%;\n"])));var templateObject_1$29,templateObject_2$1n,templateObject_3$U,templateObject_4$E,templateObject_5$y,templateObject_6$o,templateObject_7$i,templateObject_8$h;var EventCardBanner=function EventCardBanner(_a){var item=_a.item,bannerWidth=_a.bannerWidth,bannerHostDefaultWidth=_a.bannerHostDefaultWidth,showPlaceholder=_a.showPlaceholder;if(!item.bannerInfo&&!showPlaceholder){return null;}return jsx$1("div",{children:jsx$1(LeftBannerWrapper,__assign({defaultWidth:bannerHostDefaultWidth,showPlaceholder:showPlaceholder},{children:jsx$1(PublishableItemBanner,{itemId:item.id,bannerInfo:item.bannerInfo,width:bannerWidth,token:item.fileAccessToken,resourceType:ItemResourceTypes.Events},void 0)}),void 0)},void 0);};var FeedbackCountButton=function FeedbackCountButton(_a){var className=_a.className,isActive=_a.isActive,activeIconName=_a.activeIconName,count=_a.count,iconName=_a.iconName,onClick=_a.onClick,readOnly=_a.readOnly,tooltipResourceKey=_a.tooltipResourceKey,tooltipResourceKeyValues=_a.tooltipResourceKeyValues,activeTooltipResourceKey=_a.activeTooltipResourceKey,activeTooltipResourceKeyValues=_a.activeTooltipResourceKeyValues,ariaLabel=_a.ariaLabel,feedbackType=_a.feedbackType,highlight=_a.highlight,hideZeroCount=_a.hideZeroCount,doNotRenderZeroCount=_a.doNotRenderZeroCount,hideTooltip=_a.hideTooltip;var resourceKey=isActive?activeTooltipResourceKey||tooltipResourceKey:tooltipResourceKey;var resourceValues=isActive?activeTooltipResourceKeyValues||tooltipResourceKeyValues:tooltipResourceKeyValues;return jsxs(CountButtonHost,__assign({className:className,"data-feedback":feedbackType,"data-feedback-button-isactive":isActive!==null&&isActive!==void 0?isActive:false,"data-feedback-count":count},{children:[jsx$1(IEMarginFix,{},void 0),jsx$1(PreloadIcons,{icons:[activeIconName,iconName]},void 0),jsx$1(TooltipHost,__assign({resourceKey:resourceKey,values:resourceValues,hidden:hideTooltip},{children:onClick?jsx$1(StyledIconButton$6,__assign({onClick:onClick,iconProps:{iconName:isActive?activeIconName:iconName},"data-feedback-button":feedbackType,disabled:readOnly,highlight:highlight,"data-unread-comment-highlight":highlight,ariaLabel:ariaLabel},{children:jsx$1(CountDisplay,{count:count,doNotRenderZeroCount:doNotRenderZeroCount,hideZeroCount:hideZeroCount},void 0)}),void 0):jsxs(Fragment,{children:[jsx$1(StyledIcon$7,{iconName:isActive?activeIconName:iconName,highlight:highlight,"data-unread-comment-highlight":highlight},void 0),jsx$1(CountDisplay,{count:count,doNotRenderZeroCount:doNotRenderZeroCount,hideZeroCount:hideZeroCount,ariaLabel:ariaLabel},void 0)]},void 0)}),void 0)]}),void 0);};var CountDisplay=function CountDisplay(_a){var count=_a.count,hideZeroCount=_a.hideZeroCount,doNotRenderZeroCount=_a.doNotRenderZeroCount,ariaLabel=_a.ariaLabel;var shouldNotRenderZeroCount=doNotRenderZeroCount&&!count;if(shouldNotRenderZeroCount){return null;}var shouldHideZeroCount=hideZeroCount&&!count;return jsx$1(CountLabel,__assign({isHidden:shouldHideZeroCount,"aria-label":ariaLabel},{children:count}),void 0);};var TooltipHost=_styled(Tooltip).withConfig({displayName:"FeedbackCountButton__TooltipHost",componentId:"sc-vg1ry1-0"})(templateObject_1$28||(templateObject_1$28=__makeTemplateObject(["\n && {\n display: flex;\n height: 100%;\n align-items: center;\n }\n"],["\n && {\n display: flex;\n height: 100%;\n align-items: center;\n }\n"])));var CountButtonHost=_styled.div.withConfig({displayName:"FeedbackCountButton__CountButtonHost",componentId:"sc-vg1ry1-1"})(templateObject_2$1m||(templateObject_2$1m=__makeTemplateObject(["\n display: flex;\n align-items: center;\n min-width: 60px;\n height: ","px; // ensure same height for feedback buttons\n\n margin-right: 9px;\n"],["\n display: flex;\n align-items: center;\n min-width: 60px;\n height: ","px; // ensure same height for feedback buttons\n\n margin-right: 9px;\n"])),feedbackButtonHeight);var IEMarginFix=createGlobalStyle(templateObject_3$T||(templateObject_3$T=__makeTemplateObject(["\n .browser-name-ie {\n "," {\n margin-right: 20px;\n }\n }\n"],["\n .browser-name-ie {\n "," {\n margin-right: 20px;\n }\n }\n"])),CountButtonHost);var StyledIconButton$6=_styled(IconButton).withConfig({displayName:"FeedbackCountButton__StyledIconButton",componentId:"sc-vg1ry1-2"})(templateObject_4$D||(templateObject_4$D=__makeTemplateObject(["\n && {\n margin: 0;\n padding: 0;\n width: 100%;\n font-size: inherit;\n\n &[disabled] {\n background: transparent;\n }\n }\n\n i {\n font-size: 22px;\n margin: 0;\n ","\n }\n\n user-select: none;\n"],["\n && {\n margin: 0;\n padding: 0;\n width: 100%;\n font-size: inherit;\n\n &[disabled] {\n background: transparent;\n }\n }\n\n i {\n font-size: 22px;\n margin: 0;\n ","\n }\n\n user-select: none;\n"])),function(p){return p.highlight&&unreadCommentHighlight;});var StyledIcon$7=_styled(Icon).withConfig({displayName:"FeedbackCountButton__StyledIcon",componentId:"sc-vg1ry1-3"})(templateObject_5$x||(templateObject_5$x=__makeTemplateObject(["\n font-size: 22px;\n user-select: none;\n\n ","\n"],["\n font-size: 22px;\n user-select: none;\n\n ","\n"])),function(p){return p.highlight&&unreadCommentHighlight;});var CountLabel=_styled.span.withConfig({displayName:"FeedbackCountButton__CountLabel",componentId:"sc-vg1ry1-4"})(templateObject_8$g||(templateObject_8$g=__makeTemplateObject(["\n margin-left: 7px;\n word-break: normal;\n align-self: center;\n ","\n ","\n"],["\n margin-left: 7px;\n word-break: normal;\n align-self: center;\n ","\n ","\n"])),function(p){return p.isHidden&&css$2(templateObject_6$n||(templateObject_6$n=__makeTemplateObject(["\n visibility: hidden;\n "],["\n visibility: hidden;\n "])));},function(p){return p.isDisabled&&css$2(templateObject_7$h||(templateObject_7$h=__makeTemplateObject(["\n color: ",";\n "],["\n color: ",";\n "])),p.theme.palette.neutralQuaternary);});var PreloadIcons=function PreloadIcons(_a){var icons=_a.icons;return jsx$1(Fragment,{children:icons.filter(function(i){return i;}).map(function(i){return jsx$1(PreloadIcon,{iconName:i},i);})},void 0);};var PreloadIcon=_styled(Icon).withConfig({displayName:"FeedbackCountButton__PreloadIcon",componentId:"sc-vg1ry1-5"})(templateObject_9$d||(templateObject_9$d=__makeTemplateObject(["\n position: fixed;\n left: -500px;\n"],["\n position: fixed;\n left: -500px;\n"])));var templateObject_1$28,templateObject_2$1m,templateObject_3$T,templateObject_4$D,templateObject_5$x,templateObject_6$n,templateObject_7$h,templateObject_8$g,templateObject_9$d;var EventCardCommentCount=function EventCardCommentCount(_a){var item=_a.item;var formatMessage=useIntl().formatMessage;return jsxs(Fragment,{children:[jsx$1(IEFix$1,{},void 0),jsx$1(StyledFeedbackCountButton,{tooltipResourceKey:"Events.numberOfComments",tooltipResourceKeyValues:{count:item.statistics.commentCount},ariaLabel:formatMessage({id:'AriaLabel.commentsButton'}),iconName:"Chat",count:item.statistics.commentCount,feedbackType:"comment",highlight:item.hasNewComments,className:"event-card-comments"},void 0)]},void 0);};var StyledFeedbackCountButton=_styled(FeedbackCountButton).withConfig({displayName:"EventCardCommentCount__StyledFeedbackCountButton",componentId:"sc-3prmx8-0"})(templateObject_1$27||(templateObject_1$27=__makeTemplateObject(["\n && {\n min-width: 0;\n margin-right: 0;\n }\n"],["\n && {\n min-width: 0;\n margin-right: 0;\n }\n"])));var IEFix$1=createGlobalStyle(templateObject_2$1l||(templateObject_2$1l=__makeTemplateObject(["\n .browser-name-ie {\n .event-card-comments {\n margin-right: 0 !important;\n }\n }\n"],["\n .browser-name-ie {\n .event-card-comments {\n margin-right: 0 !important;\n }\n }\n"])));var templateObject_1$27,templateObject_2$1l;var EventCancelInformation=function EventCancelInformation(_a){var _b;var item=_a.item,language=_a.language,className=_a.className;var user=useCurrentUser();if(!((_b=item.cancelInformation)===null||_b===void 0?void 0:_b.isCancelled)){return null;}var contents=item.cancelInformation.reasons||{};var reason=contents[language]||contents[NewsService.getUserPreferredLanguage(Object.keys(contents),user)]||Object.values(contents)[0];return jsxs(Host$N,__assign({className:className,"data-event-cancelled-info":true},{children:[jsxs(TitleContainer,{children:[jsx$1(CancelIcon,{iconName:"RemoveEvent"},void 0),jsx$1(Title$8,{id:"Events.cancel.cancelled"},void 0)]},void 0),reason]}),void 0);};var Host$N=_styled.div.withConfig({displayName:"EventCancelInformation__Host",componentId:"sc-rh6578-0"})(templateObject_1$26||(templateObject_1$26=__makeTemplateObject(["\n position: relative;\n padding: ","px;\n margin-top: ","px;\n\n font-size: ","px;\n\n :after {\n content: '';\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n background-color: ",";\n opacity: 0.1;\n }\n"],["\n position: relative;\n padding: ","px;\n margin-top: ","px;\n\n font-size: ","px;\n\n :after {\n content: '';\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n background-color: ",";\n opacity: 0.1;\n }\n"])),spacingM,spacingS,fontSizeSmall,function(p){return p.theme.palette.red;});var TitleContainer=_styled.div.withConfig({displayName:"EventCancelInformation__TitleContainer",componentId:"sc-rh6578-1"})(templateObject_2$1k||(templateObject_2$1k=__makeTemplateObject(["\n display: flex;\n align-items: center;\n padding-bottom: ","px;\n\n color: ",";\n\n *:not(:first-child) {\n padding-left: ","px;\n }\n"],["\n display: flex;\n align-items: center;\n padding-bottom: ","px;\n\n color: ",";\n\n *:not(:first-child) {\n padding-left: ","px;\n }\n"])),spacingXs,function(p){return p.theme.palette.redDark;},spacingXs);var CancelIcon=_styled(Icon).withConfig({displayName:"EventCancelInformation__CancelIcon",componentId:"sc-rh6578-2"})(templateObject_3$S||(templateObject_3$S=__makeTemplateObject(["\n font-size: 20px;\n"],["\n font-size: 20px;\n"])));var Title$8=_styled(FormattedMessageWithStyle).withConfig({displayName:"EventCancelInformation__Title",componentId:"sc-rh6578-3"})(templateObject_4$C||(templateObject_4$C=__makeTemplateObject(["\n font-weight: bold;\n"],["\n font-weight: bold;\n"])));var templateObject_1$26,templateObject_2$1k,templateObject_3$S,templateObject_4$C;var EventUserRegistrationContext=/*#__PURE__*/createContext(null);function getDeadlineInfos(item){var hasDeadline=item.registrationSettings.deadline!=null;var isPastDeadline=hasDeadline&&moment(item.registrationSettings.deadline).isBefore(moment());return {hasDeadline:hasDeadline,isPastDeadline:isPastDeadline};}var EventRegistrationButton=function EventRegistrationButton(_a){var isRegistered=_a.isRegistered,className=_a.className,disabled=_a.disabled,onClick=_a.onClick,showInfoMessage=_a.showInfoMessage,infoMessageResourceKey=_a.infoMessageResourceKey;var formatMessage=useIntl().formatMessage;return jsxs(Host$M,__assign({className:className,"aria-label":formatMessage({id:'Events.registration.sectionLabel'})},{children:[jsx$1(RegisterButton,{text:formatMessage({id:isRegistered?'Events.registration.deregisterButtonCaption':'Events.registration.registerButtonCaption'}),disabled:disabled,"data-event-register-button":!!isRegistered,onClick:function(e){e.preventDefault();onClick();},isRegistered:isRegistered},void 0),showInfoMessage&&jsxs(InfoMessage,__assign({"data-event-register-info":true},{children:[jsx$1(Icon,{iconName:"Info"},void 0),jsx$1(FormattedMessage$1,{id:infoMessageResourceKey},void 0)]}),void 0)]}),void 0);};var Host$M=_styled.div.withConfig({displayName:"EventRegistrationButton__Host",componentId:"sc-rvaf0t-0"})(templateObject_1$25||(templateObject_1$25=__makeTemplateObject(["\n display: flex;\n align-items: center;\n flex-wrap: wrap;\n"],["\n display: flex;\n align-items: center;\n flex-wrap: wrap;\n"])));var RegisterButton=_styled(PrimaryButton).withConfig({displayName:"EventRegistrationButton__RegisterButton",componentId:"sc-rvaf0t-1"})(templateObject_4$B||(templateObject_4$B=__makeTemplateObject(["\n && {\n min-width: 200px;\n border: 0;\n &:hover {\n border: 0;\n }\n ","\n ","\n }\n"],["\n && {\n min-width: 200px;\n border: 0;\n &:hover {\n border: 0;\n }\n ","\n ","\n }\n"])),function(p){return p.disabled&&css$2(templateObject_2$1j||(templateObject_2$1j=__makeTemplateObject(["\n background-color: ",";\n "],["\n background-color: ",";\n "])),p.theme.palette.neutralQuaternaryAlt);},function(p){return p.isRegistered&&css$2(templateObject_3$R||(templateObject_3$R=__makeTemplateObject(["\n &:not([disabled]) {\n background-color: ",";\n color: #fff;\n\n &:hover {\n background-color: ",";\n }\n }\n "],["\n &:not([disabled]) {\n background-color: ",";\n color: #fff;\n\n &:hover {\n background-color: ",";\n }\n }\n "])),p.theme.palette.red,p.theme.palette.redDark);});var InfoMessage=_styled.span.withConfig({displayName:"EventRegistrationButton__InfoMessage",componentId:"sc-rvaf0t-2"})(templateObject_5$w||(templateObject_5$w=__makeTemplateObject(["\n display: flex;\n align-items: center;\n font-style: italic;\n margin-top: ","px;\n font-size: ","px;\n\n i {\n padding-right: ","px;\n }\n"],["\n display: flex;\n align-items: center;\n font-style: italic;\n margin-top: ","px;\n font-size: ","px;\n\n i {\n padding-right: ","px;\n }\n"])),spacingXs,fontSizeSmall,spacingXs);var templateObject_1$25,templateObject_2$1j,templateObject_3$R,templateObject_4$B,templateObject_5$w;var $$5=_export;var DESCRIPTORS=descriptors;var global$2=global$m;var has=has$c;var isObject$1=isObject$c;var defineProperty=objectDefineProperty.f;var copyConstructorProperties=copyConstructorProperties$2;var NativeSymbol=global$2.Symbol;if(DESCRIPTORS&&typeof NativeSymbol=='function'&&(!('description'in NativeSymbol.prototype)||// Safari 12 bug
|
|
131726
131731
|
NativeSymbol().description!==undefined)){var EmptyStringDescriptionStore={};// wrap Symbol constructor for correct work with undefined description
|
|
131727
131732
|
var SymbolWrapper=function Symbol(){var description=arguments.length<1||arguments[0]===undefined?undefined:String(arguments[0]);var result=this instanceof SymbolWrapper?new NativeSymbol(description)// in Edge 13, String(Symbol(undefined)) === 'Symbol(undefined)'
|
|
131728
|
-
:description===undefined?NativeSymbol():NativeSymbol(description);if(description==='')EmptyStringDescriptionStore[result]=true;return result;};copyConstructorProperties(SymbolWrapper,NativeSymbol);var symbolPrototype=SymbolWrapper.prototype=NativeSymbol.prototype;symbolPrototype.constructor=SymbolWrapper;var symbolToString=symbolPrototype.toString;var native=String(NativeSymbol('test'))=='Symbol(test)';var regexp=/^Symbol\((.*)\)[^)]+$/;defineProperty(symbolPrototype,'description',{configurable:true,get:function description(){var symbol=isObject$1(this)?this.valueOf():this;var string=symbolToString.call(symbol);if(has(EmptyStringDescriptionStore,symbol))return '';var desc=native?string.slice(7,-1):string.replace(regexp,'$1');return desc===''?undefined:desc;}});$$
|
|
131733
|
+
:description===undefined?NativeSymbol():NativeSymbol(description);if(description==='')EmptyStringDescriptionStore[result]=true;return result;};copyConstructorProperties(SymbolWrapper,NativeSymbol);var symbolPrototype=SymbolWrapper.prototype=NativeSymbol.prototype;symbolPrototype.constructor=SymbolWrapper;var symbolToString=symbolPrototype.toString;var native=String(NativeSymbol('test'))=='Symbol(test)';var regexp=/^Symbol\((.*)\)[^)]+$/;defineProperty(symbolPrototype,'description',{configurable:true,get:function description(){var symbol=isObject$1(this)?this.valueOf():this;var string=symbolToString.call(symbol);if(has(EmptyStringDescriptionStore,symbol))return '';var desc=native?string.slice(7,-1):string.replace(regexp,'$1');return desc===''?undefined:desc;}});$$5({global:true,forced:true},{Symbol:SymbolWrapper});}function getLocationQuestionId(item){return "location_id_"+item.id;}function getLocationPollDefinitions(item,formatMessage,result,isOnBehalfOf){if(!item.locations||item.locations.length<2){return {};}var locationQuestionId=getLocationQuestionId(item);return {translations:__spreadArray([{language:'en',id:locationQuestionId,text:formatMessage({id:!isOnBehalfOf?'Events.registration.locations.questionTitle':'Events.registration.locations.onBehalfOfQuestionTitle'})}],item.locations.map(function(l){return {language:'en',id:l.locationId,text:l.name};})),question:{questionId:locationQuestionId,isMultiChoice:false,choices:item.locations.map(function(l){return getLocationChoice(locationQuestionId,l,result,formatMessage,isOnBehalfOf);})}};}function getLocationChoice(locationQuestionId,location,result,formatMessage,isOnBehalfOf){var _a,_b,_c,_d,_e;var choice={choiceId:location.locationId};if(!location.maxNumberOfSeats){return choice;}var takenSeats=(_e=(_d=(_c=(_b=(_a=result===null||result===void 0?void 0:result.answers)===null||_a===void 0?void 0:_a.find(function(a){return a.questionId===locationQuestionId;}))===null||_b===void 0?void 0:_b.choices)===null||_c===void 0?void 0:_c.find(function(c){return c.choiceId===location.locationId;}))===null||_d===void 0?void 0:_d.count)!==null&&_e!==void 0?_e:0;var availableSeats=Math.max(location.maxNumberOfSeats-takenSeats,0);choice.description=formatMessage({id:'Events.registration.locations.leftSeats'},{total:location.maxNumberOfSeats,available:availableSeats,b:function(text){return jsx$1("strong",{children:text},void 0);}});if(availableSeats===0){choice.disabled=!isOnBehalfOf;}return choice;}var EventRegistrationLocationSeatsInfo=function EventRegistrationLocationSeatsInfo(_a){var hasAnySeatsLeft=_a.hasAnySeatsLeft,locations=_a.locations,className=_a.className;if(!(locations===null||locations===void 0?void 0:locations.length)){return null;}if(locations.length>1){if(hasAnySeatsLeft){// in this case we don't want to render anything, because it's already rendered by the poll anyway
|
|
131729
131734
|
return null;}return jsx$1(MessageContainer,__assign({domIdentifier:"multi-location-no-seats-left",className:className},{children:jsx$1(NoSeatsMessage,{id:"Events.registration.locations.noSeatsLeft"},void 0)}),void 0);}var location=locations[0];if(hasAnySeatsLeft){return jsx$1(MessageContainer,__assign({domIdentifier:"one-location-number-of-seats-left",className:className},{children:jsx$1(SeatsInfoMessage,{id:"Events.registration.locations.seatsLeftInLocation",values:{available:location.seatsLeft,b:function(text){return jsx$1("span",{children:text},void 0);}}},void 0)}),void 0);}return jsx$1(MessageContainer,__assign({domIdentifier:"one-location-no-seats-left",className:className},{children:jsx$1(NoSeatsMessage,{id:"Events.registration.locations.leftSeats",values:{total:location.maxNumberOfSeats,available:location.seatsLeft,b:function(text){return jsx$1("span",{children:text},void 0);}}},void 0)}),void 0);};var SeatsInfoMessage=_styled(FormattedMessageWithStyle)(templateObject_1$24||(templateObject_1$24=__makeTemplateObject(["\n font-size: ","px;\n\n span {\n font-weight: bold;\n }\n"],["\n font-size: ","px;\n\n span {\n font-weight: bold;\n }\n"])),fontSizeSmall);var NoSeatsMessage=_styled(FormattedMessageWithStyle)(templateObject_2$1i||(templateObject_2$1i=__makeTemplateObject(["\n color: ",";\n font-size: ","px;\n\n span {\n font-weight: bold;\n }\n"],["\n color: ",";\n font-size: ","px;\n\n span {\n font-weight: bold;\n }\n"])),function(p){return p.theme.palette.neutralSecondaryAlt;},fontSizeSmall);var MessageContainer=function MessageContainer(_a){var domIdentifier=_a.domIdentifier,className=_a.className,children=_a.children;return jsx$1("div",__assign({"data-seats-info":domIdentifier,className:className},{children:children}),void 0);};var templateObject_1$24,templateObject_2$1i;var EventRegistrationInfoDescription=_styled(FormattedMessageWithStyle).withConfig({displayName:"EventRegistrationInfoDescription",componentId:"sc-1shfbk2-0"})(templateObject_1$23||(templateObject_1$23=__makeTemplateObject(["\n font-size: ","px;\n\n time {\n font-weight: bold;\n }\n"],["\n font-size: ","px;\n\n time {\n font-weight: bold;\n }\n"])),fontSizeSmall);var templateObject_1$23;var EventRegistrationRegisterStatusInfo=function EventRegistrationRegisterStatusInfo(_a){var isRegistered=_a.isRegistered,onBehalfOfUpn=_a.onBehalfOfUpn,className=_a.className;if(!isRegistered){return null;}return jsx$1(EventRegistrationInfoDescription,{className:className,id:onBehalfOfUpn?'Events.registration.onBehalfOfIsRegistered':'Events.registration.userIsRegistered'},void 0);};var EventRegistrationDeadlineInfo=function EventRegistrationDeadlineInfo(_a){var item=_a.item,isRegistered=_a.isRegistered,className=_a.className;var _b=getDeadlineInfos(item),isPastDeadline=_b.isPastDeadline,hasDeadline=_b.hasDeadline;if(isRegistered||!hasDeadline){return null;}return jsx$1(EventRegistrationInfoDescription,{className:className,id:"Events.registration.deadline.title",values:{isPast:isPastDeadline,deadlineRelative:hasDeadline&&jsx$1(DateTime,{value:item.registrationSettings.deadline,showAsRelative:true},void 0)}},void 0);};var EventUserRegistrationFullSeriesDialog=function EventUserRegistrationFullSeriesDialog(_a){var item=_a.item,visible=_a.visible,isRegistered=_a.isRegistered,onClick=_a.onClick,onDismiss=_a.onDismiss;var formatMessage=useIntl().formatMessage;var recurrenceSettingsEndDate=item.recurrenceSettings.endDate;return jsxs(Dialog,__assign({hidden:!visible,modalProps:{isBlocking:false},dialogContentProps:{type:DialogType.normal,title:formatMessage({id:isRegistered?'Events.registration.recurringEvent.deregister':'Events.registration.recurringEvent.register'})},onDismiss:onDismiss},{children:[jsxs(DialogContent$1,__assign({"data-registration-full-series":true},{children:[recurrenceSettingsEndDate&&jsx$1(FormattedMessage$1,{id:"Events.registration.lastOccurrence",values:{date:moment(recurrenceSettingsEndDate).format('L')},tagName:"p"},void 0),jsx$1(FormattedMessage$1,{id:isRegistered?'Events.registration.fullSeriesDeregistered':'Events.registration.fullSeriesRegistered',tagName:"p"},void 0)]}),void 0),jsxs(DialogFooter,{children:[jsx$1(DefaultButton,__assign({onClick:onDismiss,"data-button":"cancel"},{children:jsx$1(FormattedMessage$1,{id:"Generic.Cancel"},void 0)}),void 0),jsx$1(PrimaryButton,__assign({onClick:function(){return onClick(!isRegistered);},"data-button":"save"},{children:jsx$1(FormattedMessage$1,{id:isRegistered?'Events.registration.deregisterButtonCaption':'Events.registration.registerButtonCaption'},void 0)}),void 0)]},void 0)]}),void 0);};var DialogContent$1=_styled.div.withConfig({displayName:"EventUserRegistrationFullSeriesDialog__DialogContent",componentId:"sc-8ec3oi-0"})(templateObject_1$22||(templateObject_1$22=__makeTemplateObject(["\n display: flex;\n flex-direction: column;\n\n > p {\n margin-top: 0;\n }\n"],["\n display: flex;\n flex-direction: column;\n\n > p {\n margin-top: 0;\n }\n"])));var templateObject_1$22;var feedbackCache={};function useFeedbackApi(){var api=useApi();return useMemo(function(){return {getFeedback:getFeedback,setFeedback:setFeedback,unsetFeedback:unsetFeedback,updatePollAnswers:updatePollAnswers,getPollResult:getPollResult,getLikers:getLikers};function getFeedback(type,itemId,onBehalfOfUpn){var cacheKey=itemId+(onBehalfOfUpn||'');if(feedbackCache[cacheKey]!=null){return feedbackCache[cacheKey];}return feedbackCache[cacheKey]=api.custom(type+"/"+itemId+"/feedback?"+queryString.stringify({onBehalfOfUpn:onBehalfOfUpn})).get().then(function(result){return result.body().data();});}function setFeedback(type,itemId,feedbackType){delete feedbackCache[itemId];return api.custom(type+"/"+itemId+"/feedback/"+feedbackType).put({}).then(function(){return null;});}function unsetFeedback(type,itemId,feedbackType){delete feedbackCache[itemId];return api.custom(type+"/"+itemId+"/feedback/"+feedbackType).delete().then(function(){return null;});}function updatePollAnswers(type,itemId,answers){delete feedbackCache[itemId];return api.custom(type+"/"+itemId+"/feedback/poll/answers").put(answers).then(function(){return null;});}function getPollResult(type,itemId){return api.custom(type+"/"+itemId+"/feedback/poll/result").get().then(function(result){return result.body().data();});}function getLikers(type,itemId,filter){return api.custom(type+"/"+itemId+"/feedback/likes").get(filter).then(function(result){return result.body().data();});}},[api]);}function useEventRegistrationApi(){var api=useApi();return useMemo(function(){return {setEventRegistration:setEventRegistration,getEventRegistrationResults:getEventRegistrationResults,getParticipants:getParticipants};function setEventRegistration(itemId,response,pollAnswers,locationId,onBehalfOfUpn){var cacheKey=itemId+(onBehalfOfUpn||'');delete feedbackCache[cacheKey];return api.custom("events/"+itemId+"/feedback/registration").put({response:response,pollAnswers:pollAnswers,locationId:locationId,onBehalfOfUpn:onBehalfOfUpn}).then(function(){return null;});}function getEventRegistrationResults(itemId){return api.custom("events/"+itemId+"/feedback/registration/result").get().then(function(result){return result.body().data();});}function getParticipants(eventId){return api.custom("events/"+eventId+"/feedback/registration/participants").get().then(function(result){return result.body().data();}).then(function(r){return r.participants;});}},[api]);}var EventUserRegistration=function EventUserRegistration(_a){var _b,_c;var disabled=_a.disabled,hideInfoMessage=_a.hideInfoMessage,className=_a.className;var history=useHistory();var user=useCurrentUserContext().user;var refreshUserDetails=useRefreshUserDetails();var _d=useState$2(false),isSaving=_d[0],setIsSaving=_d[1];var _e=useState$2(false),showRegisterFullSeriesDialog=_e[0],setShowRegisterFullSeriesDialog=_e[1];var toastHandleRef=useRef$1(null);var buildPath=useSubscriptionHandlePathBuilder().buildPath;var followPublicPublishableItemComments=useManageCurrentUserApi().followPublicPublishableItemComments;var setEventRegistration=useEventRegistrationApi().setEventRegistration;var _f=useContext(EventUserRegistrationContext),hasPollContext=_f.hasPollContext,submitPoll=_f.submitPoll,answers=_f.answers,hasMissingAnswers=_f.hasMissingAnswers,reset=_f.reset,isLoading=_f.isLoading,onBehalfOfUpn=_f.onBehalfOfUpn,item=_f.item,eventResponse=_f.eventResponse,setEventResponse=_f.setEventResponse,seatsInfo=_f.seatsInfo;var _g=useNotificationContext(),dismissToast=_g.dismissToast,showToast=_g.showToast,showError=_g.showError;useListener(RegisterFullSeriesTriggerAction.type,function(action){if(action.recurrenceSeriesId===item.recurrenceSeriesId){setEventResponse(action.response);}return false;},[]);if(isLoading||!item.registrationSettings||!item.registrationSettings.enabled||((_b=item.cancelInformation)===null||_b===void 0?void 0:_b.isCancelled)){return null;}var isRegistered=eventResponse===EventResponse.Registered;var isFullSeriesRegistrationModeEnabled=((_c=item.registrationSettings)===null||_c===void 0?void 0:_c.seriesMode)===SeriesRegistrationMode.FullSeries;var hasPoll=item.poll&&item.poll.questions&&item.poll.questions.length>0||item.locations&&item.locations.length>1;var showInfoMessage=!hideInfoMessage&&isFullSeriesRegistrationModeEnabled&&hasPollContext;return jsxs("div",__assign({className:className},{children:[jsx$1(DeadlineInfo,{item:item,isRegistered:isRegistered},void 0),jsx$1(SeatsInfo,{hasAnySeatsLeft:seatsInfo.hasAnySeatsLeft,locations:seatsInfo.locations},void 0),jsx$1(StatusInfo,{isRegistered:isRegistered,onBehalfOfUpn:onBehalfOfUpn},void 0),jsx$1(EventRegistrationButton,{isRegistered:isRegistered,disabled:isButtonDisabled(),onClick:function(){return handleClick(!isRegistered);},showInfoMessage:showInfoMessage,infoMessageResourceKey:isRegistered?'Events.registration.fullSeriesDeregistered':'Events.registration.fullSeriesRegistered'},void 0),showRegisterFullSeriesDialog&&jsx$1(EventUserRegistrationFullSeriesDialog,{item:item,visible:showRegisterFullSeriesDialog,onClick:handleRegisterFullSeriesClick,onDismiss:function(){return setShowRegisterFullSeriesDialog(false);},isRegistered:isRegistered},void 0)]}),void 0);function isButtonDisabled(){if(disabled||isLoading||isSaving){return true;}var isPastDeadline=getDeadlineInfos(item).isPastDeadline;if(isRegistered){return !onBehalfOfUpn&&isPastDeadline;}if(hasMissingAnswers){return true;}if(onBehalfOfUpn){return false;}return !seatsInfo.hasAnySeatsLeft||isPastDeadline;}function handleClick(doRegister){return __awaiter(this,void 0,void 0,function(){var language,contents,targetRoute;return __generator(this,function(_a){switch(_a.label){case 0:if(!doRegister){if(isFullSeriesRegistrationModeEnabled&&!hasPollContext){setShowRegisterFullSeriesDialog(true);return [2/*return*/];}deregister();return [2/*return*/];}if(isFullSeriesRegistrationModeEnabled&&!hasPoll&&!hasPollContext){setShowRegisterFullSeriesDialog(true);return [2/*return*/];}if(hasPoll&&!hasPollContext){language=NewsService.getLanguageForPublishableItem(item,user);contents=item.contents[language];targetRoute=NewsService.getNewsRoute('events',item.id,contents.title);history.push(buildPath(targetRoute));return [2/*return*/];}return [4/*yield*/,register()];case 1:_a.sent();return [2/*return*/];}});});}function handleRegisterFullSeriesClick(doRegister){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_b){switch(_b.label){case 0:setShowRegisterFullSeriesDialog(false);if(!doRegister)return [3/*break*/,2];return [4/*yield*/,register()];case 1:_b.sent();return [3/*break*/,4];case 2:return [4/*yield*/,deregister()];case 3:_b.sent();_b.label=4;case 4:triggerEvent(RegisterFullSeriesTriggerAction.create(item.recurrenceSeriesId,doRegister?EventResponse.Registered:EventResponse.NotSet));return [2/*return*/];}});});}function register(){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:return [4/*yield*/,submitPoll(function(){return toggleRegistration(true,answers,onBehalfOfUpn);})];case 1:_a.sent();return [2/*return*/];}});});}function deregister(){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:return [4/*yield*/,toggleRegistration(false,null,onBehalfOfUpn)];case 1:_a.sent();return [4/*yield*/,reset()];case 2:_a.sent();return [2/*return*/];}});});}function toggleRegistration(doRegister,answersToSet,onBehalfOfUpn){return __awaiter(this,void 0,void 0,function(){var newResponse,locationQuestionId_1,locationId,registerOnBehalfOfUserStringResource,error_1;return __generator(this,function(_a){switch(_a.label){case 0:if(isSaving){return [2/*return*/];}setIsSaving(true);_a.label=1;case 1:_a.trys.push([1,3,4,5]);newResponse=doRegister?EventResponse.Registered:EventResponse.NotSet;setEventResponse(newResponse);if(!answersToSet){answersToSet=[];}locationQuestionId_1=getLocationQuestionId(item);locationId=answersToSet.filter(function(a){return a.questionId===locationQuestionId_1;}).map(function(a){return a.choiceIds[0];})[0];answersToSet=answersToSet.filter(function(a){return a.questionId!==locationQuestionId_1;});return [4/*yield*/,setEventRegistration(item.id,newResponse,answersToSet,locationId,onBehalfOfUpn)];case 2:_a.sent();refreshUserDetails();triggerEvent(EventResponseTriggerAction.create(item.id,newResponse,locationId,onBehalfOfUpn));if(doRegister&&!onBehalfOfUpn){followPublicPublishableItemComments(item.id,ItemResourceTypes.Events);triggerEvent(FollowCommentsTriggerAction.create(item.id,true));}dismissToast(toastHandleRef.current);registerOnBehalfOfUserStringResource=isHiddenMail(onBehalfOfUpn)?'Events.registration.onBehalfOfRegistrationSuccess.hiddenMail':'Events.registration.onBehalfOfRegistrationSuccess';toastHandleRef.current=showToast(doRegister?onBehalfOfUpn?registerOnBehalfOfUserStringResource:'Events.registration.registrationSuccess':onBehalfOfUpn?'Events.registration.onBehalfOfDeregistrationSuccess':'Events.registration.deregistrationSuccess',{mail:onBehalfOfUpn});return [3/*break*/,5];case 3:error_1=_a.sent();logger.error(error_1);showError('Generic.error');setEventResponse(eventResponse);return [3/*break*/,5];case 4:setIsSaving(false);return [7/*endfinally*/];case 5:return [2/*return*/];}});});}};var DeadlineInfo=_styled(EventRegistrationDeadlineInfo).withConfig({displayName:"EventUserRegistration__DeadlineInfo",componentId:"sc-1mvozes-0"})(templateObject_1$21||(templateObject_1$21=__makeTemplateObject(["\n margin-bottom: ","px;\n"],["\n margin-bottom: ","px;\n"])),spacingS);var SeatsInfo=_styled(EventRegistrationLocationSeatsInfo).withConfig({displayName:"EventUserRegistration__SeatsInfo",componentId:"sc-1mvozes-1"})(templateObject_2$1h||(templateObject_2$1h=__makeTemplateObject(["\n margin-bottom: ","px;\n"],["\n margin-bottom: ","px;\n"])),spacingS);var StatusInfo=_styled(EventRegistrationRegisterStatusInfo).withConfig({displayName:"EventUserRegistration__StatusInfo",componentId:"sc-1mvozes-2"})(templateObject_3$Q||(templateObject_3$Q=__makeTemplateObject(["\n margin-bottom: ","px;\n"],["\n margin-bottom: ","px;\n"])),spacingS);var templateObject_1$21,templateObject_2$1h,templateObject_3$Q;var EventCardUserRegistration=function EventCardUserRegistration(_a){var item=_a.item,disabled=_a.disabled,className=_a.className;var _b=useState$2(item.userResponse),eventResponse=_b[0],setEventResponse=_b[1];var isRegistered=eventResponse===EventResponse.Registered;// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
131730
131735
|
var seatsInfo=useMemo(getSeatsInfo,[isRegistered,item.id]);return jsx$1(EventUserRegistrationContext.Provider,__assign({value:{hasPollContext:false,item:item,submitPoll:function(savePollAnswers){return savePollAnswers();},reset:function(){return Promise.resolve();},answers:null,hasMissingAnswers:false,onBehalfOfUpn:null,isLoading:false,eventResponse:eventResponse,setEventResponse:setEventResponse,seatsInfo:seatsInfo}},{children:jsx$1(EventUserRegistration,{disabled:disabled,className:className},void 0)}),void 0);function getSeatsInfo(){var _a;if(!item.registrationSettings||!item.registrationSettings.enabled||((_a=item.cancelInformation)===null||_a===void 0?void 0:_a.isCancelled)||isRegistered){return {hasAnySeatsLeft:true};}var locationsWithSeats=item.locations.filter(function(l){return l.maxNumberOfSeats>0;});var hasLocationsWithoutSeats=locationsWithSeats.length!==item.locations.length;if(!locationsWithSeats.length||hasLocationsWithoutSeats){return {hasAnySeatsLeft:true};}var participantsCount=getTotalParticipants();if(locationsWithSeats.length===1){var location_1=locationsWithSeats[0];var seatsLeft=Math.max(location_1.maxNumberOfSeats-participantsCount,0);return {hasAnySeatsLeft:seatsLeft>0,locations:[__assign(__assign({},location_1),{seatsLeft:seatsLeft})]};}// in this case we don't really know if we have any left seats or not
|
|
131731
131736
|
// since to get this information we need to load all results of all items
|
|
@@ -131734,12 +131739,7 @@ var seatsInfo=useMemo(getSeatsInfo,[isRegistered,item.id]);return jsx$1(EventUse
|
|
|
131734
131739
|
return {hasAnySeatsLeft:true,locations:undefined};}function getTotalParticipants(){if(item.userResponse!==eventResponse){return (item.statistics.participantsCount||0)+(eventResponse===EventResponse.Registered?1:-1);}return item.statistics.participantsCount||0;}};var pageSize=50;var defaultShimmerCount=7;var LikersList=function LikersList(_a){var itemId=_a.itemId,itemType=_a.itemType,likersCount=_a.likersCount,className=_a.className;var getLikers=useFeedbackApi().getLikers;var initialPageSize=Math.min(likersCount,pageSize);var _b=usePromise$2(loadLikers,null,[itemId]),likersInfo=_b[0],isLoading=_b[1],loadNextPage=_b[5];var isInitialLoading=!(likersInfo===null||likersInfo===void 0?void 0:likersInfo.likers)&&isLoading;var isLoadingNextPage=(likersInfo===null||likersInfo===void 0?void 0:likersInfo.likers)&&isLoading;var scrollContainer=useRef$1(null);return jsxs(Fragment,{children:[jsx$1(LikersListShimmer,__assign({count:Math.min(likersCount,defaultShimmerCount),isLoading:isInitialLoading&&likersCount>0},{children:jsxs(List$1,__assign({className:className,"data-likers-list":true,ref:scrollContainer,onScroll:handleScroll},{children:[likersInfo===null||likersInfo===void 0?void 0:likersInfo.likers.map(function(i){return jsx$1("li",{children:jsx$1(PersonaCard,__assign({upn:i.userPrincipalName},{children:jsx$1(StyledAvatar$2,{"data-liker":i.userPrincipalName,upn:i.userPrincipalName,text:i.displayName},void 0)}),void 0)},i.id);}),isLoadingNextPage&&jsx$1(StyledSpinner$3,{},void 0),likersInfo&&!likersInfo.token&&likersInfo.likers.length>defaultShimmerCount&&jsx$1(UsersLoadedIndicator,{children:jsx$1(FormattedMessage$1,{id:"Generic.finishedLoadingLikers"},void 0)},void 0)]}),void 0)}),void 0),(likersInfo===null||likersInfo===void 0?void 0:likersInfo.likers)&&!likersInfo.likers.length&&jsx$1(FormattedMessage$1,{id:"Generic.nobodyLikesThis"},void 0)]},void 0);function loadLikers(likersInfo){if(likersInfo===void 0){likersInfo={likers:[],token:null};}return __awaiter(this,void 0,void 0,function(){var result;return __generator(this,function(_a){switch(_a.label){case 0:return [4/*yield*/,getLikers(itemType,itemId,{pageSize:!likersInfo.token?initialPageSize:pageSize,token:likersInfo.token})];case 1:result=_a.sent();return [2/*return*/,{likers:likersInfo.likers.concat(result.items),token:result.paginationToken}];}});});}function handleScroll(){return __awaiter(this,void 0,void 0,function(){var container,err_1;return __generator(this,function(_a){switch(_a.label){case 0:container=scrollContainer.current;if(!container){return [2/*return*/];}// check if we reached the end of the pagination
|
|
131735
131740
|
// or we are already loading the next page
|
|
131736
131741
|
if(likersInfo.token==null||isLoading){return [2/*return*/];}// check if user scrolled enough
|
|
131737
|
-
if(container.scrollHeight-container.scrollTop>container.clientHeight+300){return [2/*return*/];}_a.label=1;case 1:_a.trys.push([1,3,,4]);return [4/*yield*/,loadNextPage(likersInfo)];case 2:_a.sent();return [3/*break*/,4];case 3:err_1=_a.sent();logger.error(err_1);return [3/*break*/,4];case 4:return [2/*return*/];}});});}};var StyledAvatar$2=_styled(Avatar).withConfig({displayName:"LikersList__StyledAvatar",componentId:"sc-a990fb-0"})(templateObject_1$20||(templateObject_1$20=__makeTemplateObject(["\n .ms-Persona-primaryText {\n white-space: initial;\n }\n"],["\n .ms-Persona-primaryText {\n white-space: initial;\n }\n"])));var List$1=_styled.ul.withConfig({displayName:"LikersList__List",componentId:"sc-a990fb-1"})(templateObject_2$1g||(templateObject_2$1g=__makeTemplateObject(["\n list-style: none;\n margin: 0;\n padding: 4px;\n\n max-height: ","px;\n overflow-y: auto;\n\n display: flex;\n flex-direction: column;\n\n li {\n display: flex;\n flex: 1 1 auto;\n margin-top: ","px;\n }\n"],["\n list-style: none;\n margin: 0;\n padding: 4px;\n\n max-height: ","px;\n overflow-y: auto;\n\n display: flex;\n flex-direction: column;\n\n li {\n display: flex;\n flex: 1 1 auto;\n margin-top: ","px;\n }\n"])),defaultShimmerCount*58,spacingS);var StyledSpinner$3=_styled(Spinner).withConfig({displayName:"LikersList__StyledSpinner",componentId:"sc-a990fb-2"})(templateObject_3$P||(templateObject_3$P=__makeTemplateObject(["\n margin: ","px 0;\n\n & > .ms-Spinner {\n height: 38px;\n }\n"],["\n margin: ","px 0;\n\n & > .ms-Spinner {\n height: 38px;\n }\n"])),spacingS);var LikersListShimmer=function LikersListShimmer(_a){var count=_a.count,isLoading=_a.isLoading,children=_a.children;return jsx$1(Shimmer,__assign({isDataLoaded:!isLoading,customElementsGroup:Array.from(Array(count)).map(function(_,i){return jsx$1(UserShimmer$1,{},i);})},{children:children}),void 0);};var UserShimmer$1=function UserShimmer(){return jsxs(Fragment,{children:[jsx$1(ShimmerElementsGroup,{shimmerElements:[{type:ShimmerElementType.gap,height:10,width:'100%'}]},void 0),jsx$1(ShimmerElementsGroup,{shimmerElements:[{type:ShimmerElementType.circle,height:48,verticalAlign:'bottom'},{type:ShimmerElementType.gap,height:15},{type:ShimmerElementType.gap,height:15},{type:ShimmerElementType.line,height:18}]},void 0)]},void 0);};var UsersLoadedIndicator=_styled.div.withConfig({displayName:"LikersList__UsersLoadedIndicator",componentId:"sc-a990fb-3"})(templateObject_4$A||(templateObject_4$A=__makeTemplateObject(["\n margin-top: ","px;\n font-style: italic;\n display: flex;\n justify-content: center;\n"],["\n margin-top: ","px;\n font-style: italic;\n display: flex;\n justify-content: center;\n"])),spacingM);var templateObject_1$20,templateObject_2$1g,templateObject_3$P,templateObject_4$A;_styled.div.withConfig({displayName:"LongPressLikeButton__ButtonHost",componentId:"sc-1n5c9rg-0"})(templateObject_1$1$||(templateObject_1$1$=__makeTemplateObject(["\n * {\n // try to fix ios behavior\n -webkit-touch-callout: none !important;\n -webkit-user-select: none !important;\n -khtml-user-select: none !important;\n -moz-user-select: none !important;\n -ms-user-select: none !important;\n user-select: none !important;\n -webkit-text-size-adjust: none;\n }\n"],["\n * {\n // try to fix ios behavior\n -webkit-touch-callout: none !important;\n -webkit-user-select: none !important;\n -khtml-user-select: none !important;\n -moz-user-select: none !important;\n -ms-user-select: none !important;\n user-select: none !important;\n -webkit-text-size-adjust: none;\n }\n"])));createGlobalStyle(templateObject_2$1f||(templateObject_2$1f=__makeTemplateObject(["\n .dialog-likers-list {\n .ms-Dialog-main {\n @media (max-width: ","px) {\n width: 100% !important;\n }\n }\n }\n"],["\n .dialog-likers-list {\n .ms-Dialog-main {\n @media (max-width: ","px) {\n width: 100% !important;\n }\n }\n }\n"])),maxScreenSize.small);var templateObject_1$1$,templateObject_2$1f;var HoverLikeButton=function HoverLikeButton(_a){var itemId=_a.itemId,itemType=_a.itemType,likersCount=_a.likersCount,children=_a.children;var _b=useState$2(false),showCallout=_b[0],setshowCallout=_b[1];var buttonRef=useRef$1(null);var timeout=useRef$1(null);useEffect$1(function(){return function(){return window.clearTimeout(timeout.current);};},[]);return jsxs("div",__assign({ref:buttonRef,onMouseEnter:startOpenCalloutTimer,onMouseLeave:cancelOpenCalloutTimer,onFocus:startOpenCalloutTimer,onBlur:cancelOpenCalloutTimer},{children:[jsx$1("div",{children:children},void 0),showCallout&&jsx$1(LikersCallout,{itemId:itemId,itemType:itemType,target:buttonRef.current,likersCount:likersCount,onDismiss:function(){return setshowCallout(false);}},void 0)]}),void 0);function startOpenCalloutTimer(){if(!likersCount){return;}window.clearTimeout(timeout.current);timeout.current=window.setTimeout(function(){setshowCallout(true);},1000);}function cancelOpenCalloutTimer(){window.clearTimeout(timeout.current);}};var LikersCallout=function LikersCallout(_a){var itemId=_a.itemId,itemType=_a.itemType,onDismiss=_a.onDismiss,target=_a.target,likersCount=_a.likersCount;return jsxs(StyledCallout,__assign({target:target,onDismiss:onDismiss,directionalHint:DirectionalHint$1.leftCenter},{children:[jsxs(LikedBy,{children:[jsx$1(FormattedMessage$1,{id:"Generic.likers"},void 0),":"]},void 0),jsx$1(LikersList,{itemId:itemId,itemType:itemType,likersCount:likersCount},void 0)]}),void 0);};var StyledCallout=_styled(Callout).withConfig({displayName:"HoverLikeButton__StyledCallout",componentId:"sc-1f0a2ni-0"})(templateObject_1$1_||(templateObject_1$1_=__makeTemplateObject(["\n padding: ","px;\n .ms-Callout-main {\n min-height: ","px;\n overflow-y: hidden;\n width: 225px;\n\n .ms-TooltipHost {\n white-space: initial;\n }\n }\n"],["\n padding: ","px;\n .ms-Callout-main {\n min-height: ","px;\n overflow-y: hidden;\n width: 225px;\n\n .ms-TooltipHost {\n white-space: initial;\n }\n }\n"])),spacingM,spacingXl);var LikedBy=_styled.span.withConfig({displayName:"HoverLikeButton__LikedBy",componentId:"sc-1f0a2ni-1"})(templateObject_2$1e||(templateObject_2$1e=__makeTemplateObject(["\n font-weight: bold;\n"],["\n font-weight: bold;\n"])));var templateObject_1$1_,templateObject_2$1e;var LikeButton=function LikeButton(_a){var itemId=_a.itemId,itemType=_a.itemType,isActive=_a.isActive,count=_a.count,onClick=_a.onClick,isDemoContent=_a.isDemoContent,doNotRenderZeroCount=_a.doNotRenderZeroCount,readOnly=_a.readOnly,className=_a.className;var features=useFeatures();var formatMessage=useIntl().formatMessage;var user=useCurrentUser();var likeButton=jsx$1(FeedbackCountButton,{className:className,tooltipResourceKey:"Generic.like",activeTooltipResourceKey:"Generic.unlike",ariaLabel:formatMessage({id:isActive?'AriaLabel.unlikeItemButton':'AriaLabel.likeItemButton'}),iconName:"Like",activeIconName:"LikeSolid",isActive:isActive,onClick:onClick,count:count,feedbackType:"like",doNotRenderZeroCount:doNotRenderZeroCount,readOnly:readOnly,hideTooltip:features.showLikers},void 0);if(!features.showLikers||isDemoContent||user.isPublicUser){return likeButton;}return jsx$1(HoverLikeButton,__assign({itemId:itemId,itemType:itemType,likersCount:count},{children:likeButton}),void 0);};function hasFeedbackType(feedbackSettings,feedbackType){return feedbackSettings&&feedbackSettings.feedbackOptions&&feedbackSettings.feedbackOptions.findIndex(function(f){return f===feedbackType;})>-1;}var CardLikeButton=function CardLikeButton(_a){var _b,_c,_d;var item=_a.item,itemResourceType=_a.itemResourceType,className=_a.className;var _e=useState$2(item.isLiked),isLiked=_e[0],setIsLiked=_e[1];var _f=useState$2((_c=(_b=item.statistics)===null||_b===void 0?void 0:_b.likeCount)!==null&&_c!==void 0?_c:0),likeCount=_f[0],setLikeCount=_f[1];var _g=useState$2(false),isSaving=_g[0],setIsSaving=_g[1];var features=useFeatures();var _h=useFeedbackApi(),setFeedback=_h.setFeedback,unsetFeedback=_h.unsetFeedback;var metadata=(_d=item.metadata)!==null&&_d!==void 0?_d:{};var hasLikesEnabled=hasFeedbackType(metadata.feedbackSettings,'like');var showError=useNotificationContext().showError;if(!features.likes||!hasLikesEnabled){return null;}return jsx$1(StyledLikeButton$2,{itemId:item.id,itemType:itemResourceType,isActive:isLiked,count:likeCount,onClick:handleClick,doNotRenderZeroCount:true,className:className,isDemoContent:item.isDemoContent},void 0);function handleClick(){return __awaiter(this,void 0,void 0,function(){var isNowLiked,oldCount;return __generator(this,function(_b){switch(_b.label){case 0:if(isSaving){return [2/*return*/];}isNowLiked=!isLiked;oldCount=likeCount;_b.label=1;case 1:_b.trys.push([1,6,7,8]);setIsSaving(true);setIsLiked(isNowLiked);setLikeCount(isNowLiked?oldCount+1:oldCount-1);if(!isNowLiked)return [3/*break*/,3];return [4/*yield*/,setFeedback(itemResourceType,item.id,'like')];case 2:_b.sent();return [3/*break*/,5];case 3:return [4/*yield*/,unsetFeedback(itemResourceType,item.id,'like')];case 4:_b.sent();_b.label=5;case 5:return [3/*break*/,8];case 6:_b.sent();setIsLiked(!isNowLiked);showError('NewsArticle.setFeedback_error');setLikeCount(oldCount);return [3/*break*/,8];case 7:setIsSaving(false);return [7/*endfinally*/];case 8:return [2/*return*/];}});});}};var StyledLikeButton$2=_styled(LikeButton).withConfig({displayName:"CardLikeButton__StyledLikeButton",componentId:"sc-10mlzn4-0"})(templateObject_1$1Z||(templateObject_1$1Z=__makeTemplateObject(["\n min-width: 1px;\n margin: 0 4px;\n font-size: 0.9rem;\n font-weight: normal;\n\n i {\n font-size: 22px;\n font-weight: 400;\n }\n"],["\n min-width: 1px;\n margin: 0 4px;\n font-size: 0.9rem;\n font-weight: normal;\n\n i {\n font-size: 22px;\n font-weight: 400;\n }\n"])));var templateObject_1$1Z;var EventRecurrenceSeriesInfo=function EventRecurrenceSeriesInfo(_a){var _b;var eventItem=_a.eventItem,className=_a.className;if(!(eventItem===null||eventItem===void 0?void 0:eventItem.recurrenceSeriesId)){return null;}var endDate=(_b=eventItem.recurrenceSettings)===null||_b===void 0?void 0:_b.endDate;return jsx$1(Host$L,__assign({className:className},{children:jsx$1(StyledTooltip$3,__assign({resourceKey:"Events.editor.recurrence.iconTooltip",values:{endDate:moment(endDate).format('LL')},hidden:!endDate},{children:jsxs(Container$2,{children:[jsx$1(StyledIcon$6,{iconName:"RecurringEvent"},void 0),jsx$1(FormattedMessage$1,{id:"Events.editor.recurrence.series"},void 0)]},void 0)}),void 0)}),void 0);};var Host$L=_styled.div.withConfig({displayName:"EventRecurrenceSeriesInfo__Host",componentId:"sc-12fly5n-0"})(templateObject_1$1Y||(templateObject_1$1Y=__makeTemplateObject(["\n display: flex;\n font-size: ","px;\n"],["\n display: flex;\n font-size: ","px;\n"])),fontSizeSmall);var StyledTooltip$3=_styled(Tooltip).withConfig({displayName:"EventRecurrenceSeriesInfo__StyledTooltip",componentId:"sc-12fly5n-1"})(templateObject_2$1d||(templateObject_2$1d=__makeTemplateObject(["\n z-index: 1;\n"],["\n z-index: 1;\n"])));var Container$2=_styled.div.withConfig({displayName:"EventRecurrenceSeriesInfo__Container",componentId:"sc-12fly5n-2"})(templateObject_3$O||(templateObject_3$O=__makeTemplateObject(["\n display: flex;\n align-items: center;\n"],["\n display: flex;\n align-items: center;\n"])));var StyledIcon$6=_styled(Icon).withConfig({displayName:"EventRecurrenceSeriesInfo__StyledIcon",componentId:"sc-12fly5n-3"})(templateObject_4$z||(templateObject_4$z=__makeTemplateObject(["\n font-size: ","px;\n padding-right: ","px;\n"],["\n font-size: ","px;\n padding-right: ","px;\n"])),fontSizeMedium,spacingXs);var templateObject_1$1Y,templateObject_2$1d,templateObject_3$O,templateObject_4$z;var EventRecurrenceSeriesInfoNavLink=function EventRecurrenceSeriesInfoNavLink(_a){var recurrenceSeriesId=_a.recurrenceSeriesId,title=_a.title,children=_a.children,className=_a.className;var buildPath=useSubscriptionHandlePathBuilder().buildPath;if(!recurrenceSeriesId){return null;}return jsx$1(StyledNavLink$2,__assign({to:buildPath("/events/upcoming?"+queryString.stringify({seriesId:recurrenceSeriesId,seriesTitle:title})),className:className},{children:children}),void 0);};var StyledNavLink$2=_styled(NavLink).withConfig({displayName:"EventRecurrenceSeriesInfoNavLink__StyledNavLink",componentId:"sc-1szm15-0"})(templateObject_1$1X||(templateObject_1$1X=__makeTemplateObject(["\n &&& {\n color: ",";\n text-decoration: none;\n }\n"],["\n &&& {\n color: ",";\n text-decoration: none;\n }\n"])),function(p){return p.theme.textColors.default;});var templateObject_1$1X;var EventCard=function EventCard(_a){var _b,_c,_d,_e,_f;var item=_a.item,language=_a.language,styleDefinition=_a.styleDefinition,allowFilterByChannels=_a.allowFilterByChannels,showFeedbackButtons=_a.showFeedbackButtons,readOnly=_a.readOnly,className=_a.className;var user=useCurrentUser();var buildPath=useSubscriptionHandlePathBuilder().buildPath;var windowSize=useWindowSize$2();var highlight=!!user.unreadEvents.find(function(e){return e.itemId===item.id||e.itemId===item.recurrenceSeriesId;});var userLanguage=getPreferredContentLanguage(user);var contents=item.contents[language];var targetRoute=NewsService.getNewsRoute(buildPath('/events'),item.id,contents.title);var isCancelled=(_b=item.cancelInformation)===null||_b===void 0?void 0:_b.isCancelled;var hasNoRegistration=!isCancelled&&!((_c=item.registrationSettings)===null||_c===void 0?void 0:_c.enabled);var hasManyLocationsAndContacts=((_d=item.locations)===null||_d===void 0?void 0:_d.length)+((_e=item.contacts)===null||_e===void 0?void 0:_e.length)>=6;var bannerOnTheLeft=windowSize.width>767;var bannerWidth=bannerOnTheLeft&&hasManyLocationsAndContacts?750:450;return jsxs(Host$K,__assign({className:className,highlight:highlight,styleDefinition:styleDefinition,"data-item-id":item.id,"data-card-highlight":highlight,"data-no-registration":hasNoRegistration,"data-banner":(_f=item.bannerInfo)===null||_f===void 0?void 0:_f.type},{children:[jsx$1(IEFix,{},void 0),!readOnly&&jsx$1(ClickableOverlay,{baseRoute:buildPath('/events'),title:contents.title,itemId:item.id,itemType:ItemResourceTypes.Events},void 0),jsx$1(EventCardBanner,{item:item,bannerWidth:bannerWidth,bannerHostDefaultWidth:styleDefinition===null||styleDefinition===void 0?void 0:styleDefinition.bannerHostWidth,showPlaceholder:!item.bannerInfo&&(styleDefinition===null||styleDefinition===void 0?void 0:styleDefinition.showPlaceholderIfNoBannerInfo)},void 0),jsxs(Content$7,{children:[jsxs(Header$2,__assign({"data-card-header":true},{children:[jsx$1(Dates,{startDate:item.startDate,endDate:item.endDate,isCancelled:isCancelled,className:"event-card-dates"},void 0),showFeedbackButtons&&jsx$1(Feedback,{item:item,type:"header",targetRoute:targetRoute},void 0)]}),void 0),readOnly?jsx$1(RecurrenceSeriesInfo$1,{eventItem:item},void 0):jsx$1(EventRecurrenceSeriesInfoNavLink,{recurrenceSeriesId:item.recurrenceSeriesId,title:contents.title,children:jsx$1(RecurrenceSeriesInfo$1,{eventItem:item},void 0)},void 0),jsx$1(Title$7,{children:readOnly?contents.title:jsx$1(StyledLink,__assign({to:targetRoute},{children:contents.title}),void 0)},void 0),jsxs(Footer$1,{children:[jsxs(FooterStart,{children:[jsx$1(Locations,{locations:item.locations},void 0),jsx$1(Contacts,{item:item,hideAnnouncer:true},void 0),jsx$1(EventChannelsDisplay,{item:item,language:userLanguage,allowFilterByChannels:allowFilterByChannels,channelBackgroundColor:styleDefinition===null||styleDefinition===void 0?void 0:styleDefinition.channelsBackgroundColor},void 0)]},void 0),jsxs(FooterEnd,{children:[jsx$1(Registration,{item:item,disabled:readOnly},void 0),jsx$1(CancelInfo,{item:item},void 0),showFeedbackButtons&&jsx$1(Feedback,{item:item,type:"footer",targetRoute:targetRoute},void 0)]},void 0)]},void 0)]},void 0)]}),void 0);};var Host$K=_styled.article.withConfig({displayName:"EventCard__Host",componentId:"sc-19skrau-0"})(templateObject_4$y||(templateObject_4$y=__makeTemplateObject(["\n ","\n\n display: flex;\n width: 100%;\n position: relative;\n\n @media (max-width: ","px) {\n flex-direction: column;\n }\n\n ","\n\n color: ",";\n"],["\n ","\n\n display: flex;\n width: 100%;\n position: relative;\n\n @media (max-width: ","px) {\n flex-direction: column;\n }\n\n ","\n\n color: ",";\n"])),function(p){return p.styleDefinition?css$2(templateObject_1$1W||(templateObject_1$1W=__makeTemplateObject(["\n background-color: ",";\n ",";\n "],["\n background-color: ",";\n ",";\n "])),p.styleDefinition.backgroundColor||p.theme.palette.white,!p.styleDefinition.noShadow&&CardBorderInline(2,2)):css$2(templateObject_2$1c||(templateObject_2$1c=__makeTemplateObject(["\n ",";\n background-color: ",";\n "],["\n ",";\n background-color: ",";\n "])),CardBorderInline(2,2),p.theme.palette.white);},maxScreenSize.medium,function(p){return p.highlight&&css$2(templateObject_3$N||(templateObject_3$N=__makeTemplateObject(["\n position: relative;\n\n &::after {\n ",";\n }\n "],["\n position: relative;\n\n &::after {\n ",";\n }\n "])),BannerHighlightStyle$1);},function(p){return p.theme.textColors.default;});var BannerHighlightStyle$1=css$2(templateObject_5$v||(templateObject_5$v=__makeTemplateObject(["\n content: '';\n position: absolute;\n top: 0;\n bottom: 0;\n right: 0;\n width: ","px;\n display: block;\n background-color: ",";\n"],["\n content: '';\n position: absolute;\n top: 0;\n bottom: 0;\n right: 0;\n width: ","px;\n display: block;\n background-color: ",";\n"])),spacingXs,function(p){return p.theme.palette.accent;});var StyledLink=_styled(Link$4).withConfig({displayName:"EventCard__StyledLink",componentId:"sc-19skrau-1"})(templateObject_6$m||(templateObject_6$m=__makeTemplateObject(["\n &&& {\n &,\n :link,\n :visited {\n color: ",";\n text-decoration: none;\n }\n }\n"],["\n &&& {\n &,\n :link,\n :visited {\n color: ",";\n text-decoration: none;\n }\n }\n"])),function(p){return p.theme.textColors.default;});var Title$7=_styled.h3.withConfig({displayName:"EventCard__Title",componentId:"sc-19skrau-2"})(templateObject_7$g||(templateObject_7$g=__makeTemplateObject(["\n font-size: ","px;\n"],["\n font-size: ","px;\n"])),fontSizeMedium);var Header$2=_styled.div.withConfig({displayName:"EventCard__Header",componentId:"sc-19skrau-3"})(templateObject_8$f||(templateObject_8$f=__makeTemplateObject(["\n display: flex;\n justify-content: space-between;\n align-items: center;\n width: 100%;\n\n @media (max-width: ","px) {\n flex-direction: column;\n align-items: flex-start;\n > *:not(:first-child) {\n padding-top: ","px;\n }\n }\n\n a,\n button {\n position: relative;\n z-index: 1;\n }\n"],["\n display: flex;\n justify-content: space-between;\n align-items: center;\n width: 100%;\n\n @media (max-width: ","px) {\n flex-direction: column;\n align-items: flex-start;\n > *:not(:first-child) {\n padding-top: ","px;\n }\n }\n\n a,\n button {\n position: relative;\n z-index: 1;\n }\n"])),maxScreenSize.medium,spacingXs);var RecurrenceSeriesInfo$1=_styled(EventRecurrenceSeriesInfo).withConfig({displayName:"EventCard__RecurrenceSeriesInfo",componentId:"sc-19skrau-4"})(templateObject_9$c||(templateObject_9$c=__makeTemplateObject(["\n margin-top: ","px;\n"],["\n margin-top: ","px;\n"])),spacingS);var Content$7=_styled.div.withConfig({displayName:"EventCard__Content",componentId:"sc-19skrau-5"})(templateObject_10$b||(templateObject_10$b=__makeTemplateObject(["\n padding: ","px;\n flex-grow: 1;\n\n color: ",";\n"],["\n padding: ","px;\n flex-grow: 1;\n\n color: ",";\n"])),spacingM,function(p){return p.theme.textColors.default;});var Footer$1=_styled.div.withConfig({displayName:"EventCard__Footer",componentId:"sc-19skrau-6"})(templateObject_11$7||(templateObject_11$7=__makeTemplateObject(["\n margin-top: ","px;\n\n display: flex;\n justify-content: space-between;\n align-items: flex-end;\n\n @media (max-width: ","px) {\n flex-direction: column;\n align-items: stretch;\n }\n\n a,\n button {\n position: relative;\n z-index: 1;\n }\n"],["\n margin-top: ","px;\n\n display: flex;\n justify-content: space-between;\n align-items: flex-end;\n\n @media (max-width: ","px) {\n flex-direction: column;\n align-items: stretch;\n }\n\n a,\n button {\n position: relative;\n z-index: 1;\n }\n"])),spacingM,maxScreenSize.medium);var FooterStart=_styled.div.withConfig({displayName:"EventCard__FooterStart",componentId:"sc-19skrau-7"})(templateObject_12$6||(templateObject_12$6=__makeTemplateObject(["\n flex: 1 1 100%;\n\n margin-right: ","px;\n\n > *:first-child:not(:only-child) {\n margin-bottom: ","px;\n }\n\n @media (max-width: ","px) {\n flex: 1 1 auto;\n }\n"],["\n flex: 1 1 100%;\n\n margin-right: ","px;\n\n > *:first-child:not(:only-child) {\n margin-bottom: ","px;\n }\n\n @media (max-width: ","px) {\n flex: 1 1 auto;\n }\n"])),spacingXs,spacingS,maxScreenSize.medium);var FooterEnd=_styled.div.withConfig({displayName:"EventCard__FooterEnd",componentId:"sc-19skrau-8"})(templateObject_13$5||(templateObject_13$5=__makeTemplateObject(["\n flex: 0 0 200px;\n\n @media (max-width: ","px) {\n margin-top: ","px;\n flex: 1 1 auto;\n }\n"],["\n flex: 0 0 200px;\n\n @media (max-width: ","px) {\n margin-top: ","px;\n flex: 1 1 auto;\n }\n"])),maxScreenSize.medium,spacingS);var HeaderFeedback=css$2(templateObject_14$5||(templateObject_14$5=__makeTemplateObject(["\n display: none;\n @media (min-width: ","px) {\n display: flex;\n align-items: center;\n }\n"],["\n display: none;\n @media (min-width: ","px) {\n display: flex;\n align-items: center;\n }\n"])),minScreenSize.medium);var FooterFeedback=css$2(templateObject_15$5||(templateObject_15$5=__makeTemplateObject(["\n display: flex;\n align-items: center;\n justify-content: flex-end;\n margin-top: ","px;\n\n @media (min-width: ","px) {\n display: none;\n }\n"],["\n display: flex;\n align-items: center;\n justify-content: flex-end;\n margin-top: ","px;\n\n @media (min-width: ","px) {\n display: none;\n }\n"])),spacingS,minScreenSize.medium);var FeedbackHost=_styled.div.withConfig({displayName:"EventCard__FeedbackHost",componentId:"sc-19skrau-9"})(templateObject_16$5||(templateObject_16$5=__makeTemplateObject(["\n ",";\n"],["\n ",";\n"])),function(_a){var isHeader=_a.isHeader;return isHeader?HeaderFeedback:FooterFeedback;});var Feedback=function Feedback(_a){var item=_a.item,type=_a.type,targetRoute=_a.targetRoute;var user=useCurrentUser();var showCommentCount=item.statistics&&item.statistics.commentCount>0&&hasFeedbackType(item.metadata.feedbackSettings,'comment')&&!user.isPublicUser;return jsxs(FeedbackHost,__assign({isHeader:type==='header'},{children:[jsx$1(EventCardLikeButton,{item:item,itemResourceType:ItemResourceTypes.Events},void 0),showCommentCount&&jsx$1(StyledLink,__assign({to:targetRoute+"#comments","aria-hidden":"true"},{children:jsx$1(EventCardCommentCount,{item:item},void 0)}),void 0)]}),void 0);};var EventCardLikeButton=_styled(CardLikeButton).withConfig({displayName:"EventCard__EventCardLikeButton",componentId:"sc-19skrau-10"})(templateObject_17$4||(templateObject_17$4=__makeTemplateObject(["\n && {\n button {\n min-height: 23px;\n display: flex;\n margin-right: 9px;\n font-size: 1rem;\n }\n }\n"],["\n && {\n button {\n min-height: 23px;\n display: flex;\n margin-right: 9px;\n font-size: 1rem;\n }\n }\n"])));var Registration=_styled(EventCardUserRegistration).withConfig({displayName:"EventCard__Registration",componentId:"sc-19skrau-11"})(templateObject_18$3||(templateObject_18$3=__makeTemplateObject(["\n && {\n margin-top: ","px;\n button {\n width: 100%;\n }\n\n @media (min-width: ","px) {\n text-align: right;\n button {\n width: initial;\n }\n }\n }\n"],["\n && {\n margin-top: ","px;\n button {\n width: 100%;\n }\n\n @media (min-width: ","px) {\n text-align: right;\n button {\n width: initial;\n }\n }\n }\n"])),spacingS,minScreenSize.medium);var Dates=_styled(DateTimeRange).withConfig({displayName:"EventCard__Dates",componentId:"sc-19skrau-12"})(templateObject_19$3||(templateObject_19$3=__makeTemplateObject(["\n flex: 1;\n font-size: ","px;\n font-weight: 500;\n opacity: ",";\n padding-right: ","px;\n"],["\n flex: 1;\n font-size: ","px;\n font-weight: 500;\n opacity: ",";\n padding-right: ","px;\n"])),fontSizeSmall,function(_a){var isCancelled=_a.isCancelled;return isCancelled?0.4:1;},spacingS);var Locations=_styled(EventLocationInfo).withConfig({displayName:"EventCard__Locations",componentId:"sc-19skrau-13"})(templateObject_20$2||(templateObject_20$2=__makeTemplateObject([""],[""])));var Contacts=_styled(EventPeopleInfo).withConfig({displayName:"EventCard__Contacts",componentId:"sc-19skrau-14"})(templateObject_21$1||(templateObject_21$1=__makeTemplateObject(["\n flex-direction: column;\n"],["\n flex-direction: column;\n"])));var CancelInfo=_styled(EventCancelInformation).withConfig({displayName:"EventCard__CancelInfo",componentId:"sc-19skrau-15"})(templateObject_22$1||(templateObject_22$1=__makeTemplateObject(["\n margin: 0 -","px;\n @media (min-width: ","px) {\n margin: 0;\n }\n"],["\n margin: 0 -","px;\n @media (min-width: ","px) {\n margin: 0;\n }\n"])),spacingM,minScreenSize.medium);var IEFix=createGlobalStyle(templateObject_23$1||(templateObject_23$1=__makeTemplateObject(["\n .browser-name-ie {\n .event-card-dates {\n flex: 1 1 0%;\n flex-basis: 0%;\n }\n }\n"],["\n .browser-name-ie {\n .event-card-dates {\n flex: 1 1 0%;\n flex-basis: 0%;\n }\n }\n"])));var templateObject_1$1W,templateObject_2$1c,templateObject_3$N,templateObject_4$y,templateObject_5$v,templateObject_6$m,templateObject_7$g,templateObject_8$f,templateObject_9$c,templateObject_10$b,templateObject_11$7,templateObject_12$6,templateObject_13$5,templateObject_14$5,templateObject_15$5,templateObject_16$5,templateObject_17$4,templateObject_18$3,templateObject_19$3,templateObject_20$2,templateObject_21$1,templateObject_22$1,templateObject_23$1;var $$5=_export;var aFunction$1=aFunction$7;var toObject$1=toObject$7;var fails$j=fails$i;var arrayMethodIsStrict=arrayMethodIsStrict$2;var test$1=[];var nativeSort=test$1.sort;// IE8-
|
|
131738
|
-
var FAILS_ON_UNDEFINED=fails$j(function(){test$1.sort(undefined);});// V8 bug
|
|
131739
|
-
var FAILS_ON_NULL=fails$j(function(){test$1.sort(null);});// Old WebKit
|
|
131740
|
-
var STRICT_METHOD=arrayMethodIsStrict('sort');var FORCED$1=FAILS_ON_UNDEFINED||!FAILS_ON_NULL||!STRICT_METHOD;// `Array.prototype.sort` method
|
|
131741
|
-
// https://tc39.github.io/ecma262/#sec-array.prototype.sort
|
|
131742
|
-
$$5({target:'Array',proto:true,forced:FORCED$1},{sort:function sort(comparefn){return comparefn===undefined?nativeSort.call(toObject$1(this)):nativeSort.call(toObject$1(this),aFunction$1(comparefn));}});function useExternalContentHandler(){var _this=this;var history=useHistory();var onRequestToken=useContext(AuthenticationContext).onRequestToken;var trackExternalItem=useNewsApi().trackExternalItem;var createApiUrl=useApiFactory().createApiUrl;var currentUser=useCurrentUser();var webAppUrls=useSubscriptionWebAppUrls();var _a=useContext(LinkContext),onOpenExternalLink=_a.onOpenExternalLink,tryGetInternalLink=_a.tryGetInternalLink;var refreshUserDetails=useRefreshUserDetails();return function(item,itemType,openInNewTab){return __awaiter(_this,void 0,void 0,function(){var language,externalContentUrl,internalLink,token;return __generator(this,function(_a){switch(_a.label){case 0:if(!(item===null||item===void 0?void 0:item.useExternalContent)){return [2/*return*/,null];}language=getPreferredContentLanguage(currentUser);externalContentUrl=getExternalContentUrl(item,language);if(!externalContentUrl){return [2/*return*/,null];}internalLink=tryGetInternalLink(externalContentUrl,webAppUrls);if(internalLink){// no API redirect; only the unread & page views tracking
|
|
131742
|
+
if(container.scrollHeight-container.scrollTop>container.clientHeight+300){return [2/*return*/];}_a.label=1;case 1:_a.trys.push([1,3,,4]);return [4/*yield*/,loadNextPage(likersInfo)];case 2:_a.sent();return [3/*break*/,4];case 3:err_1=_a.sent();logger.error(err_1);return [3/*break*/,4];case 4:return [2/*return*/];}});});}};var StyledAvatar$2=_styled(Avatar).withConfig({displayName:"LikersList__StyledAvatar",componentId:"sc-a990fb-0"})(templateObject_1$20||(templateObject_1$20=__makeTemplateObject(["\n .ms-Persona-primaryText {\n white-space: initial;\n }\n"],["\n .ms-Persona-primaryText {\n white-space: initial;\n }\n"])));var List$1=_styled.ul.withConfig({displayName:"LikersList__List",componentId:"sc-a990fb-1"})(templateObject_2$1g||(templateObject_2$1g=__makeTemplateObject(["\n list-style: none;\n margin: 0;\n padding: 4px;\n\n max-height: ","px;\n overflow-y: auto;\n\n display: flex;\n flex-direction: column;\n\n li {\n display: flex;\n flex: 1 1 auto;\n margin-top: ","px;\n }\n"],["\n list-style: none;\n margin: 0;\n padding: 4px;\n\n max-height: ","px;\n overflow-y: auto;\n\n display: flex;\n flex-direction: column;\n\n li {\n display: flex;\n flex: 1 1 auto;\n margin-top: ","px;\n }\n"])),defaultShimmerCount*58,spacingS);var StyledSpinner$3=_styled(Spinner).withConfig({displayName:"LikersList__StyledSpinner",componentId:"sc-a990fb-2"})(templateObject_3$P||(templateObject_3$P=__makeTemplateObject(["\n margin: ","px 0;\n\n & > .ms-Spinner {\n height: 38px;\n }\n"],["\n margin: ","px 0;\n\n & > .ms-Spinner {\n height: 38px;\n }\n"])),spacingS);var LikersListShimmer=function LikersListShimmer(_a){var count=_a.count,isLoading=_a.isLoading,children=_a.children;return jsx$1(Shimmer,__assign({isDataLoaded:!isLoading,customElementsGroup:Array.from(Array(count)).map(function(_,i){return jsx$1(UserShimmer$1,{},i);})},{children:children}),void 0);};var UserShimmer$1=function UserShimmer(){return jsxs(Fragment,{children:[jsx$1(ShimmerElementsGroup,{shimmerElements:[{type:ShimmerElementType.gap,height:10,width:'100%'}]},void 0),jsx$1(ShimmerElementsGroup,{shimmerElements:[{type:ShimmerElementType.circle,height:48,verticalAlign:'bottom'},{type:ShimmerElementType.gap,height:15},{type:ShimmerElementType.gap,height:15},{type:ShimmerElementType.line,height:18}]},void 0)]},void 0);};var UsersLoadedIndicator=_styled.div.withConfig({displayName:"LikersList__UsersLoadedIndicator",componentId:"sc-a990fb-3"})(templateObject_4$A||(templateObject_4$A=__makeTemplateObject(["\n margin-top: ","px;\n font-style: italic;\n display: flex;\n justify-content: center;\n"],["\n margin-top: ","px;\n font-style: italic;\n display: flex;\n justify-content: center;\n"])),spacingM);var templateObject_1$20,templateObject_2$1g,templateObject_3$P,templateObject_4$A;_styled.div.withConfig({displayName:"LongPressLikeButton__ButtonHost",componentId:"sc-1n5c9rg-0"})(templateObject_1$1$||(templateObject_1$1$=__makeTemplateObject(["\n * {\n // try to fix ios behavior\n -webkit-touch-callout: none !important;\n -webkit-user-select: none !important;\n -khtml-user-select: none !important;\n -moz-user-select: none !important;\n -ms-user-select: none !important;\n user-select: none !important;\n -webkit-text-size-adjust: none;\n }\n"],["\n * {\n // try to fix ios behavior\n -webkit-touch-callout: none !important;\n -webkit-user-select: none !important;\n -khtml-user-select: none !important;\n -moz-user-select: none !important;\n -ms-user-select: none !important;\n user-select: none !important;\n -webkit-text-size-adjust: none;\n }\n"])));createGlobalStyle(templateObject_2$1f||(templateObject_2$1f=__makeTemplateObject(["\n .dialog-likers-list {\n .ms-Dialog-main {\n @media (max-width: ","px) {\n width: 100% !important;\n }\n }\n }\n"],["\n .dialog-likers-list {\n .ms-Dialog-main {\n @media (max-width: ","px) {\n width: 100% !important;\n }\n }\n }\n"])),maxScreenSize.small);var templateObject_1$1$,templateObject_2$1f;var HoverLikeButton=function HoverLikeButton(_a){var itemId=_a.itemId,itemType=_a.itemType,likersCount=_a.likersCount,children=_a.children;var _b=useState$2(false),showCallout=_b[0],setshowCallout=_b[1];var buttonRef=useRef$1(null);var timeout=useRef$1(null);useEffect$1(function(){return function(){return window.clearTimeout(timeout.current);};},[]);return jsxs("div",__assign({ref:buttonRef,onMouseEnter:startOpenCalloutTimer,onMouseLeave:cancelOpenCalloutTimer,onFocus:startOpenCalloutTimer,onBlur:cancelOpenCalloutTimer},{children:[jsx$1("div",{children:children},void 0),showCallout&&jsx$1(LikersCallout,{itemId:itemId,itemType:itemType,target:buttonRef.current,likersCount:likersCount,onDismiss:function(){return setshowCallout(false);}},void 0)]}),void 0);function startOpenCalloutTimer(){if(!likersCount){return;}window.clearTimeout(timeout.current);timeout.current=window.setTimeout(function(){setshowCallout(true);},1000);}function cancelOpenCalloutTimer(){window.clearTimeout(timeout.current);}};var LikersCallout=function LikersCallout(_a){var itemId=_a.itemId,itemType=_a.itemType,onDismiss=_a.onDismiss,target=_a.target,likersCount=_a.likersCount;return jsxs(StyledCallout,__assign({target:target,onDismiss:onDismiss,directionalHint:DirectionalHint$1.leftCenter},{children:[jsxs(LikedBy,{children:[jsx$1(FormattedMessage$1,{id:"Generic.likers"},void 0),":"]},void 0),jsx$1(LikersList,{itemId:itemId,itemType:itemType,likersCount:likersCount},void 0)]}),void 0);};var StyledCallout=_styled(Callout).withConfig({displayName:"HoverLikeButton__StyledCallout",componentId:"sc-1f0a2ni-0"})(templateObject_1$1_||(templateObject_1$1_=__makeTemplateObject(["\n padding: ","px;\n .ms-Callout-main {\n min-height: ","px;\n overflow-y: hidden;\n width: 225px;\n\n .ms-TooltipHost {\n white-space: initial;\n }\n }\n"],["\n padding: ","px;\n .ms-Callout-main {\n min-height: ","px;\n overflow-y: hidden;\n width: 225px;\n\n .ms-TooltipHost {\n white-space: initial;\n }\n }\n"])),spacingM,spacingXl);var LikedBy=_styled.span.withConfig({displayName:"HoverLikeButton__LikedBy",componentId:"sc-1f0a2ni-1"})(templateObject_2$1e||(templateObject_2$1e=__makeTemplateObject(["\n font-weight: bold;\n"],["\n font-weight: bold;\n"])));var templateObject_1$1_,templateObject_2$1e;var LikeButton=function LikeButton(_a){var itemId=_a.itemId,itemType=_a.itemType,isActive=_a.isActive,count=_a.count,onClick=_a.onClick,isDemoContent=_a.isDemoContent,doNotRenderZeroCount=_a.doNotRenderZeroCount,readOnly=_a.readOnly,className=_a.className;var features=useFeatures();var formatMessage=useIntl().formatMessage;var user=useCurrentUser();var likeButton=jsx$1(FeedbackCountButton,{className:className,tooltipResourceKey:"Generic.like",activeTooltipResourceKey:"Generic.unlike",ariaLabel:formatMessage({id:isActive?'AriaLabel.unlikeItemButton':'AriaLabel.likeItemButton'}),iconName:"Like",activeIconName:"LikeSolid",isActive:isActive,onClick:onClick,count:count,feedbackType:"like",doNotRenderZeroCount:doNotRenderZeroCount,readOnly:readOnly,hideTooltip:features.showLikers},void 0);if(!features.showLikers||isDemoContent||user.isPublicUser){return likeButton;}return jsx$1(HoverLikeButton,__assign({itemId:itemId,itemType:itemType,likersCount:count},{children:likeButton}),void 0);};function hasFeedbackType(feedbackSettings,feedbackType){return feedbackSettings&&feedbackSettings.feedbackOptions&&feedbackSettings.feedbackOptions.findIndex(function(f){return f===feedbackType;})>-1;}var CardLikeButton=function CardLikeButton(_a){var _b,_c,_d;var item=_a.item,itemResourceType=_a.itemResourceType,className=_a.className;var _e=useState$2(item.isLiked),isLiked=_e[0],setIsLiked=_e[1];var _f=useState$2((_c=(_b=item.statistics)===null||_b===void 0?void 0:_b.likeCount)!==null&&_c!==void 0?_c:0),likeCount=_f[0],setLikeCount=_f[1];var _g=useState$2(false),isSaving=_g[0],setIsSaving=_g[1];var features=useFeatures();var _h=useFeedbackApi(),setFeedback=_h.setFeedback,unsetFeedback=_h.unsetFeedback;var metadata=(_d=item.metadata)!==null&&_d!==void 0?_d:{};var hasLikesEnabled=hasFeedbackType(metadata.feedbackSettings,'like');var showError=useNotificationContext().showError;if(!features.likes||!hasLikesEnabled){return null;}return jsx$1(StyledLikeButton$2,{itemId:item.id,itemType:itemResourceType,isActive:isLiked,count:likeCount,onClick:handleClick,doNotRenderZeroCount:true,className:className,isDemoContent:item.isDemoContent},void 0);function handleClick(){return __awaiter(this,void 0,void 0,function(){var isNowLiked,oldCount;return __generator(this,function(_b){switch(_b.label){case 0:if(isSaving){return [2/*return*/];}isNowLiked=!isLiked;oldCount=likeCount;_b.label=1;case 1:_b.trys.push([1,6,7,8]);setIsSaving(true);setIsLiked(isNowLiked);setLikeCount(isNowLiked?oldCount+1:oldCount-1);if(!isNowLiked)return [3/*break*/,3];return [4/*yield*/,setFeedback(itemResourceType,item.id,'like')];case 2:_b.sent();return [3/*break*/,5];case 3:return [4/*yield*/,unsetFeedback(itemResourceType,item.id,'like')];case 4:_b.sent();_b.label=5;case 5:return [3/*break*/,8];case 6:_b.sent();setIsLiked(!isNowLiked);showError('NewsArticle.setFeedback_error');setLikeCount(oldCount);return [3/*break*/,8];case 7:setIsSaving(false);return [7/*endfinally*/];case 8:return [2/*return*/];}});});}};var StyledLikeButton$2=_styled(LikeButton).withConfig({displayName:"CardLikeButton__StyledLikeButton",componentId:"sc-10mlzn4-0"})(templateObject_1$1Z||(templateObject_1$1Z=__makeTemplateObject(["\n min-width: 1px;\n margin: 0 4px;\n font-size: 0.9rem;\n font-weight: normal;\n\n i {\n font-size: 22px;\n font-weight: 400;\n }\n"],["\n min-width: 1px;\n margin: 0 4px;\n font-size: 0.9rem;\n font-weight: normal;\n\n i {\n font-size: 22px;\n font-weight: 400;\n }\n"])));var templateObject_1$1Z;var EventRecurrenceSeriesInfo=function EventRecurrenceSeriesInfo(_a){var _b;var eventItem=_a.eventItem,className=_a.className;if(!(eventItem===null||eventItem===void 0?void 0:eventItem.recurrenceSeriesId)){return null;}var endDate=(_b=eventItem.recurrenceSettings)===null||_b===void 0?void 0:_b.endDate;return jsx$1(Host$L,__assign({className:className},{children:jsx$1(StyledTooltip$3,__assign({resourceKey:"Events.editor.recurrence.iconTooltip",values:{endDate:moment(endDate).format('LL')},hidden:!endDate},{children:jsxs(Container$2,{children:[jsx$1(StyledIcon$6,{iconName:"RecurringEvent"},void 0),jsx$1(FormattedMessage$1,{id:"Events.editor.recurrence.series"},void 0)]},void 0)}),void 0)}),void 0);};var Host$L=_styled.div.withConfig({displayName:"EventRecurrenceSeriesInfo__Host",componentId:"sc-12fly5n-0"})(templateObject_1$1Y||(templateObject_1$1Y=__makeTemplateObject(["\n display: flex;\n font-size: ","px;\n"],["\n display: flex;\n font-size: ","px;\n"])),fontSizeSmall);var StyledTooltip$3=_styled(Tooltip).withConfig({displayName:"EventRecurrenceSeriesInfo__StyledTooltip",componentId:"sc-12fly5n-1"})(templateObject_2$1d||(templateObject_2$1d=__makeTemplateObject(["\n z-index: 1;\n"],["\n z-index: 1;\n"])));var Container$2=_styled.div.withConfig({displayName:"EventRecurrenceSeriesInfo__Container",componentId:"sc-12fly5n-2"})(templateObject_3$O||(templateObject_3$O=__makeTemplateObject(["\n display: flex;\n align-items: center;\n"],["\n display: flex;\n align-items: center;\n"])));var StyledIcon$6=_styled(Icon).withConfig({displayName:"EventRecurrenceSeriesInfo__StyledIcon",componentId:"sc-12fly5n-3"})(templateObject_4$z||(templateObject_4$z=__makeTemplateObject(["\n font-size: ","px;\n padding-right: ","px;\n"],["\n font-size: ","px;\n padding-right: ","px;\n"])),fontSizeMedium,spacingXs);var templateObject_1$1Y,templateObject_2$1d,templateObject_3$O,templateObject_4$z;var EventRecurrenceSeriesInfoNavLink=function EventRecurrenceSeriesInfoNavLink(_a){var recurrenceSeriesId=_a.recurrenceSeriesId,title=_a.title,children=_a.children,className=_a.className;var buildPath=useSubscriptionHandlePathBuilder().buildPath;if(!recurrenceSeriesId){return null;}return jsx$1(StyledNavLink$2,__assign({to:buildPath("/events/upcoming?"+queryString.stringify({seriesId:recurrenceSeriesId,seriesTitle:title})),className:className},{children:children}),void 0);};var StyledNavLink$2=_styled(NavLink).withConfig({displayName:"EventRecurrenceSeriesInfoNavLink__StyledNavLink",componentId:"sc-1szm15-0"})(templateObject_1$1X||(templateObject_1$1X=__makeTemplateObject(["\n &&& {\n color: ",";\n text-decoration: none;\n }\n"],["\n &&& {\n color: ",";\n text-decoration: none;\n }\n"])),function(p){return p.theme.textColors.default;});var templateObject_1$1X;var EventCard=function EventCard(_a){var _b,_c,_d,_e,_f;var item=_a.item,language=_a.language,styleDefinition=_a.styleDefinition,allowFilterByChannels=_a.allowFilterByChannels,showFeedbackButtons=_a.showFeedbackButtons,readOnly=_a.readOnly,className=_a.className;var user=useCurrentUser();var buildPath=useSubscriptionHandlePathBuilder().buildPath;var windowSize=useWindowSize$2();var highlight=!!user.unreadEvents.find(function(e){return e.itemId===item.id||e.itemId===item.recurrenceSeriesId;});var userLanguage=getPreferredContentLanguage(user);var contents=item.contents[language];var targetRoute=NewsService.getNewsRoute(buildPath('/events'),item.id,contents.title);var isCancelled=(_b=item.cancelInformation)===null||_b===void 0?void 0:_b.isCancelled;var hasNoRegistration=!isCancelled&&!((_c=item.registrationSettings)===null||_c===void 0?void 0:_c.enabled);var hasManyLocationsAndContacts=((_d=item.locations)===null||_d===void 0?void 0:_d.length)+((_e=item.contacts)===null||_e===void 0?void 0:_e.length)>=6;var bannerOnTheLeft=windowSize.width>767;var bannerWidth=bannerOnTheLeft&&hasManyLocationsAndContacts?750:450;return jsxs(Host$K,__assign({className:className,highlight:highlight,styleDefinition:styleDefinition,"data-item-id":item.id,"data-card-highlight":highlight,"data-no-registration":hasNoRegistration,"data-banner":(_f=item.bannerInfo)===null||_f===void 0?void 0:_f.type},{children:[jsx$1(IEFix,{},void 0),!readOnly&&jsx$1(ClickableOverlay,{baseRoute:buildPath('/events'),title:contents.title,itemId:item.id,itemType:ItemResourceTypes.Events},void 0),jsx$1(EventCardBanner,{item:item,bannerWidth:bannerWidth,bannerHostDefaultWidth:styleDefinition===null||styleDefinition===void 0?void 0:styleDefinition.bannerHostWidth,showPlaceholder:!item.bannerInfo&&(styleDefinition===null||styleDefinition===void 0?void 0:styleDefinition.showPlaceholderIfNoBannerInfo)},void 0),jsxs(Content$7,{children:[jsxs(Header$2,__assign({"data-card-header":true},{children:[jsx$1(Dates,{startDate:item.startDate,endDate:item.endDate,isCancelled:isCancelled,className:"event-card-dates"},void 0),showFeedbackButtons&&jsx$1(Feedback,{item:item,type:"header",targetRoute:targetRoute},void 0)]}),void 0),readOnly?jsx$1(RecurrenceSeriesInfo$1,{eventItem:item},void 0):jsx$1(EventRecurrenceSeriesInfoNavLink,{recurrenceSeriesId:item.recurrenceSeriesId,title:contents.title,children:jsx$1(RecurrenceSeriesInfo$1,{eventItem:item},void 0)},void 0),jsx$1(Title$7,{children:readOnly?contents.title:jsx$1(StyledLink,__assign({to:targetRoute},{children:contents.title}),void 0)},void 0),jsxs(Footer$1,{children:[jsxs(FooterStart,{children:[jsx$1(Locations,{locations:item.locations},void 0),jsx$1(Contacts,{item:item,hideAnnouncer:true},void 0),jsx$1(EventChannelsDisplay,{item:item,language:userLanguage,allowFilterByChannels:allowFilterByChannels,channelBackgroundColor:styleDefinition===null||styleDefinition===void 0?void 0:styleDefinition.channelsBackgroundColor},void 0)]},void 0),jsxs(FooterEnd,{children:[jsx$1(Registration,{item:item,disabled:readOnly},void 0),jsx$1(CancelInfo,{item:item},void 0),showFeedbackButtons&&jsx$1(Feedback,{item:item,type:"footer",targetRoute:targetRoute},void 0)]},void 0)]},void 0)]},void 0)]}),void 0);};var Host$K=_styled.article.withConfig({displayName:"EventCard__Host",componentId:"sc-19skrau-0"})(templateObject_4$y||(templateObject_4$y=__makeTemplateObject(["\n ","\n\n display: flex;\n width: 100%;\n position: relative;\n\n @media (max-width: ","px) {\n flex-direction: column;\n }\n\n ","\n\n color: ",";\n"],["\n ","\n\n display: flex;\n width: 100%;\n position: relative;\n\n @media (max-width: ","px) {\n flex-direction: column;\n }\n\n ","\n\n color: ",";\n"])),function(p){return p.styleDefinition?css$2(templateObject_1$1W||(templateObject_1$1W=__makeTemplateObject(["\n background-color: ",";\n ",";\n "],["\n background-color: ",";\n ",";\n "])),p.styleDefinition.backgroundColor||p.theme.palette.white,!p.styleDefinition.noShadow&&CardBorderInline(2,2)):css$2(templateObject_2$1c||(templateObject_2$1c=__makeTemplateObject(["\n ",";\n background-color: ",";\n "],["\n ",";\n background-color: ",";\n "])),CardBorderInline(2,2),p.theme.palette.white);},maxScreenSize.medium,function(p){return p.highlight&&css$2(templateObject_3$N||(templateObject_3$N=__makeTemplateObject(["\n position: relative;\n\n &::after {\n ",";\n }\n "],["\n position: relative;\n\n &::after {\n ",";\n }\n "])),BannerHighlightStyle$1);},function(p){return p.theme.textColors.default;});var BannerHighlightStyle$1=css$2(templateObject_5$v||(templateObject_5$v=__makeTemplateObject(["\n content: '';\n position: absolute;\n top: 0;\n bottom: 0;\n right: 0;\n width: ","px;\n display: block;\n background-color: ",";\n"],["\n content: '';\n position: absolute;\n top: 0;\n bottom: 0;\n right: 0;\n width: ","px;\n display: block;\n background-color: ",";\n"])),spacingXs,function(p){return p.theme.palette.accent;});var StyledLink=_styled(Link$4).withConfig({displayName:"EventCard__StyledLink",componentId:"sc-19skrau-1"})(templateObject_6$m||(templateObject_6$m=__makeTemplateObject(["\n &&& {\n &,\n :link,\n :visited {\n color: ",";\n text-decoration: none;\n }\n }\n"],["\n &&& {\n &,\n :link,\n :visited {\n color: ",";\n text-decoration: none;\n }\n }\n"])),function(p){return p.theme.textColors.default;});var Title$7=_styled.h3.withConfig({displayName:"EventCard__Title",componentId:"sc-19skrau-2"})(templateObject_7$g||(templateObject_7$g=__makeTemplateObject(["\n font-size: ","px;\n"],["\n font-size: ","px;\n"])),fontSizeMedium);var Header$2=_styled.div.withConfig({displayName:"EventCard__Header",componentId:"sc-19skrau-3"})(templateObject_8$f||(templateObject_8$f=__makeTemplateObject(["\n display: flex;\n justify-content: space-between;\n align-items: center;\n width: 100%;\n\n @media (max-width: ","px) {\n flex-direction: column;\n align-items: flex-start;\n > *:not(:first-child) {\n padding-top: ","px;\n }\n }\n\n a,\n button {\n position: relative;\n z-index: 1;\n }\n"],["\n display: flex;\n justify-content: space-between;\n align-items: center;\n width: 100%;\n\n @media (max-width: ","px) {\n flex-direction: column;\n align-items: flex-start;\n > *:not(:first-child) {\n padding-top: ","px;\n }\n }\n\n a,\n button {\n position: relative;\n z-index: 1;\n }\n"])),maxScreenSize.medium,spacingXs);var RecurrenceSeriesInfo$1=_styled(EventRecurrenceSeriesInfo).withConfig({displayName:"EventCard__RecurrenceSeriesInfo",componentId:"sc-19skrau-4"})(templateObject_9$c||(templateObject_9$c=__makeTemplateObject(["\n margin-top: ","px;\n"],["\n margin-top: ","px;\n"])),spacingS);var Content$7=_styled.div.withConfig({displayName:"EventCard__Content",componentId:"sc-19skrau-5"})(templateObject_10$b||(templateObject_10$b=__makeTemplateObject(["\n padding: ","px;\n flex-grow: 1;\n\n color: ",";\n"],["\n padding: ","px;\n flex-grow: 1;\n\n color: ",";\n"])),spacingM,function(p){return p.theme.textColors.default;});var Footer$1=_styled.div.withConfig({displayName:"EventCard__Footer",componentId:"sc-19skrau-6"})(templateObject_11$7||(templateObject_11$7=__makeTemplateObject(["\n margin-top: ","px;\n\n display: flex;\n justify-content: space-between;\n align-items: flex-end;\n\n @media (max-width: ","px) {\n flex-direction: column;\n align-items: stretch;\n }\n\n a,\n button {\n position: relative;\n z-index: 1;\n }\n"],["\n margin-top: ","px;\n\n display: flex;\n justify-content: space-between;\n align-items: flex-end;\n\n @media (max-width: ","px) {\n flex-direction: column;\n align-items: stretch;\n }\n\n a,\n button {\n position: relative;\n z-index: 1;\n }\n"])),spacingM,maxScreenSize.medium);var FooterStart=_styled.div.withConfig({displayName:"EventCard__FooterStart",componentId:"sc-19skrau-7"})(templateObject_12$6||(templateObject_12$6=__makeTemplateObject(["\n flex: 1 1 100%;\n\n margin-right: ","px;\n\n > *:first-child:not(:only-child) {\n margin-bottom: ","px;\n }\n\n @media (max-width: ","px) {\n flex: 1 1 auto;\n }\n"],["\n flex: 1 1 100%;\n\n margin-right: ","px;\n\n > *:first-child:not(:only-child) {\n margin-bottom: ","px;\n }\n\n @media (max-width: ","px) {\n flex: 1 1 auto;\n }\n"])),spacingXs,spacingS,maxScreenSize.medium);var FooterEnd=_styled.div.withConfig({displayName:"EventCard__FooterEnd",componentId:"sc-19skrau-8"})(templateObject_13$5||(templateObject_13$5=__makeTemplateObject(["\n flex: 0 0 200px;\n\n @media (max-width: ","px) {\n margin-top: ","px;\n flex: 1 1 auto;\n }\n"],["\n flex: 0 0 200px;\n\n @media (max-width: ","px) {\n margin-top: ","px;\n flex: 1 1 auto;\n }\n"])),maxScreenSize.medium,spacingS);var HeaderFeedback=css$2(templateObject_14$5||(templateObject_14$5=__makeTemplateObject(["\n display: none;\n @media (min-width: ","px) {\n display: flex;\n align-items: center;\n }\n"],["\n display: none;\n @media (min-width: ","px) {\n display: flex;\n align-items: center;\n }\n"])),minScreenSize.medium);var FooterFeedback=css$2(templateObject_15$5||(templateObject_15$5=__makeTemplateObject(["\n display: flex;\n align-items: center;\n justify-content: flex-end;\n margin-top: ","px;\n\n @media (min-width: ","px) {\n display: none;\n }\n"],["\n display: flex;\n align-items: center;\n justify-content: flex-end;\n margin-top: ","px;\n\n @media (min-width: ","px) {\n display: none;\n }\n"])),spacingS,minScreenSize.medium);var FeedbackHost=_styled.div.withConfig({displayName:"EventCard__FeedbackHost",componentId:"sc-19skrau-9"})(templateObject_16$5||(templateObject_16$5=__makeTemplateObject(["\n ",";\n"],["\n ",";\n"])),function(_a){var isHeader=_a.isHeader;return isHeader?HeaderFeedback:FooterFeedback;});var Feedback=function Feedback(_a){var item=_a.item,type=_a.type,targetRoute=_a.targetRoute;var user=useCurrentUser();var showCommentCount=item.statistics&&item.statistics.commentCount>0&&hasFeedbackType(item.metadata.feedbackSettings,'comment')&&!user.isPublicUser;return jsxs(FeedbackHost,__assign({isHeader:type==='header'},{children:[jsx$1(EventCardLikeButton,{item:item,itemResourceType:ItemResourceTypes.Events},void 0),showCommentCount&&jsx$1(StyledLink,__assign({to:targetRoute+"#comments","aria-hidden":"true"},{children:jsx$1(EventCardCommentCount,{item:item},void 0)}),void 0)]}),void 0);};var EventCardLikeButton=_styled(CardLikeButton).withConfig({displayName:"EventCard__EventCardLikeButton",componentId:"sc-19skrau-10"})(templateObject_17$4||(templateObject_17$4=__makeTemplateObject(["\n && {\n button {\n min-height: 23px;\n display: flex;\n margin-right: 9px;\n font-size: 1rem;\n }\n }\n"],["\n && {\n button {\n min-height: 23px;\n display: flex;\n margin-right: 9px;\n font-size: 1rem;\n }\n }\n"])));var Registration=_styled(EventCardUserRegistration).withConfig({displayName:"EventCard__Registration",componentId:"sc-19skrau-11"})(templateObject_18$3||(templateObject_18$3=__makeTemplateObject(["\n && {\n margin-top: ","px;\n button {\n width: 100%;\n }\n\n @media (min-width: ","px) {\n text-align: right;\n button {\n width: initial;\n }\n }\n }\n"],["\n && {\n margin-top: ","px;\n button {\n width: 100%;\n }\n\n @media (min-width: ","px) {\n text-align: right;\n button {\n width: initial;\n }\n }\n }\n"])),spacingS,minScreenSize.medium);var Dates=_styled(DateTimeRange).withConfig({displayName:"EventCard__Dates",componentId:"sc-19skrau-12"})(templateObject_19$3||(templateObject_19$3=__makeTemplateObject(["\n flex: 1;\n font-size: ","px;\n font-weight: 500;\n opacity: ",";\n padding-right: ","px;\n"],["\n flex: 1;\n font-size: ","px;\n font-weight: 500;\n opacity: ",";\n padding-right: ","px;\n"])),fontSizeSmall,function(_a){var isCancelled=_a.isCancelled;return isCancelled?0.4:1;},spacingS);var Locations=_styled(EventLocationInfo).withConfig({displayName:"EventCard__Locations",componentId:"sc-19skrau-13"})(templateObject_20$2||(templateObject_20$2=__makeTemplateObject([""],[""])));var Contacts=_styled(EventPeopleInfo).withConfig({displayName:"EventCard__Contacts",componentId:"sc-19skrau-14"})(templateObject_21$1||(templateObject_21$1=__makeTemplateObject(["\n flex-direction: column;\n"],["\n flex-direction: column;\n"])));var CancelInfo=_styled(EventCancelInformation).withConfig({displayName:"EventCard__CancelInfo",componentId:"sc-19skrau-15"})(templateObject_22$1||(templateObject_22$1=__makeTemplateObject(["\n margin: 0 -","px;\n @media (min-width: ","px) {\n margin: 0;\n }\n"],["\n margin: 0 -","px;\n @media (min-width: ","px) {\n margin: 0;\n }\n"])),spacingM,minScreenSize.medium);var IEFix=createGlobalStyle(templateObject_23$1||(templateObject_23$1=__makeTemplateObject(["\n .browser-name-ie {\n .event-card-dates {\n flex: 1 1 0%;\n flex-basis: 0%;\n }\n }\n"],["\n .browser-name-ie {\n .event-card-dates {\n flex: 1 1 0%;\n flex-basis: 0%;\n }\n }\n"])));var templateObject_1$1W,templateObject_2$1c,templateObject_3$N,templateObject_4$y,templateObject_5$v,templateObject_6$m,templateObject_7$g,templateObject_8$f,templateObject_9$c,templateObject_10$b,templateObject_11$7,templateObject_12$6,templateObject_13$5,templateObject_14$5,templateObject_15$5,templateObject_16$5,templateObject_17$4,templateObject_18$3,templateObject_19$3,templateObject_20$2,templateObject_21$1,templateObject_22$1,templateObject_23$1;function useExternalContentHandler(){var _this=this;var history=useHistory();var onRequestToken=useContext(AuthenticationContext).onRequestToken;var trackExternalItem=useNewsApi().trackExternalItem;var createApiUrl=useApiFactory().createApiUrl;var currentUser=useCurrentUser();var webAppUrls=useSubscriptionWebAppUrls();var _a=useContext(LinkContext),onOpenExternalLink=_a.onOpenExternalLink,tryGetInternalLink=_a.tryGetInternalLink;var refreshUserDetails=useRefreshUserDetails();return function(item,itemType,openInNewTab){return __awaiter(_this,void 0,void 0,function(){var language,externalContentUrl,internalLink,token;return __generator(this,function(_a){switch(_a.label){case 0:if(!(item===null||item===void 0?void 0:item.useExternalContent)){return [2/*return*/,null];}language=getPreferredContentLanguage(currentUser);externalContentUrl=getExternalContentUrl(item,language);if(!externalContentUrl){return [2/*return*/,null];}internalLink=tryGetInternalLink(externalContentUrl,webAppUrls);if(internalLink){// no API redirect; only the unread & page views tracking
|
|
131743
131743
|
trackExternalItem(item.id,itemType).then(function(){return refreshUserDetails();},logger.error);history.push(internalLink);return [2/*return*/,true];}return [4/*yield*/,onRequestToken()];case 1:token=_a.sent();if(!token){return [2/*return*/,false];}return [4/*yield*/,redirectToExternalContent(item.id,itemType,token,openInNewTab)];case 2:_a.sent();refreshUserDetails();return [2/*return*/,true];}});});};function redirectToExternalContent(itemId,itemType,token,openNewTab){return __awaiter(this,void 0,void 0,function(){var apiExternalContentRedirectRoute;return __generator(this,function(_a){switch(_a.label){case 0:apiExternalContentRedirectRoute=createApiUrl("/"+itemType+"/"+encodeURIComponent(itemId)+"/external_url",{access_token:token});return [4/*yield*/,onOpenExternalLink(apiExternalContentRedirectRoute,openNewTab)];case 1:_a.sent();return [2/*return*/];}});});}}function useExternalContentClickHandler(){var _this=this;var handleExternalContent=useExternalContentHandler();return function(e,item,itemType){return __awaiter(_this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:if(!item.useExternalContent){return [2/*return*/];}e.stopPropagation();e.preventDefault();return [4/*yield*/,handleExternalContent(item,itemType,true)];case 1:_a.sent();return [2/*return*/];}});});};}function useExternalContentRedirectHandler(item,resourceType,noRedirect){var _this=this;var handleExternalContent=useExternalContentHandler();useEffect$1(function(){if(noRedirect){return;}(function(){return __awaiter(_this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:return [4/*yield*/,handleExternalContent(item,resourceType)];case 1:return [2/*return*/,_a.sent()];}});});})();// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
131744
131744
|
},[item===null||item===void 0?void 0:item.id]);}function usePagesClickHandler(){var user=useCurrentUser();var userToken=useCurrentToken();var onOpenExternalLink=useContext(LinkContext).onOpenExternalLink;var getDocumentFileUrl=usePagesApi().getDocumentFileUrl;var createApiUrl=useApiFactory().createApiUrl;var handleExternalContent=useExternalContentHandler();var _a=useFileAccessTokenApi(),exchangeShortLivedToken=_a.exchangeShortLivedToken,getPublishableItemShortLivedToken=_a.getPublishableItemShortLivedToken,createDownloadClickHandler=_a.createDownloadClickHandler;return useMemo(function(){return {createPageClickHandler:createPageClickHandler,createDocumentClickHandler:createDocumentClickHandler};// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
131745
131745
|
},[user.subscription.id,userToken,getDocumentFileUrl,handleExternalContent]);function createPageClickHandler(page,basePath,additionalOnClick,ignoreExternalContent){var _this=this;if(!page.useExternalContent||// we don't want the editor view to open the external page
|
|
@@ -131847,7 +131847,7 @@ var existingNode=allNodesById[node.id];if(existingNode){if(existingNode.id===pag
|
|
|
131847
131847
|
// for this case the blockProps would be an empty object and
|
|
131848
131848
|
// we need to set the showPages and showDocuments to true
|
|
131849
131849
|
var InlinePageListByCurrentPage=function InlinePageListByCurrentPage(_a){var _b=_a.blockProps,props=_b===void 0?{showDocuments:true,showPages:true}:_b;var item=useDetailViewContext().item;var getSubpages=usePagesApi().getSubpages;var buildPath=useSubscriptionHandlePathBuilder().buildPath;var _c=useItemLoaderByCurrentPage(item.id,defaultPageSize,item.navigationContext,{showPages:props.showPages,showDocuments:props.showDocuments},getAllSubItems,[item===null||item===void 0?void 0:item.id]),items=_c.pageItems,pagingProps=_c.pagingProps;if(items.length===0){return null;}return jsx$1(InlinePageListWithPaging,{pages:items,pagingProps:pagingProps,baseRoute:buildPath('pages'),filterBaseUrl:buildPath('/pages/search')},void 0);function getAllSubItems(id,pageType){return __awaiter(this,void 0,void 0,function(){var result;return __generator(this,function(_a){switch(_a.label){case 0:return [4/*yield*/,getSubpages(id,{pageType:pageType})];case 1:result=_a.sent();return [2/*return*/,result.items];}});});}};var InlinePageList=function InlinePageList(_a){var blockProps=_a.blockProps;if(blockProps===null||blockProps===void 0?void 0:blockProps.keywords){return jsx$1(InlinePageListByKeywords,{keywords:blockProps.keywords.split(','),showPages:blockProps.showPages,showDocuments:blockProps.showDocuments},void 0);}if(blockProps===null||blockProps===void 0?void 0:blockProps.pageId){return jsx$1(InlinePageListByPageId,{pageId:blockProps.pageId,showPages:blockProps.showPages,showDocuments:blockProps.showDocuments},void 0);}return jsx$1(InlinePageListByCurrentPage,{blockProps:blockProps},void 0);};var InlinePageListMapper={component:InlinePageList,type:EntityType.InlinePageList,getPropsFromHtml:function(nodeName,node){if(nodeName!=='div'){return null;}var pageListId=node.getAttribute('data-page-list-id');if(pageListId==null){return null;}var showChildren=node.getAttribute('data-show-children')==='true';var showDocumentsAttribute=node.getAttribute('data-show-documents');var showPagesAttribute=node.getAttribute('data-show-pages');var pageId=node.getAttribute('data-page-id');var keywords=node.getAttribute('data-keywords');if(!showDocumentsAttribute&&!showPagesAttribute){// ensure backwards compatibility
|
|
131850
|
-
return {id:pageListId,showChildren:showChildren,showPages:true,showDocuments:false,pageId:pageId,keywords:keywords};}var showDocuments=showDocumentsAttribute==='true';var showPages=showPagesAttribute==='true';return {id:pageListId,showChildren:showChildren,showDocuments:showDocuments,showPages:showPages,pageId:pageId,keywords:keywords};}};var PageBreadcrumb=function PageBreadcrumb(_a){var page=_a.page,target=_a.target,languageOverride=_a.language,hideCurrentPageNode=_a.hideCurrentPageNode,className=_a.className;var user=useCurrentUser();var formatMessage=useIntl().formatMessage;var history=useHistory();if(!page||!page.navigationContext){return null;}var _b=getBreadcrumbsItems(page,target,handleOnClick,function(page){return getTitle(page,user,formatMessage,languageOverride);},formatMessage,hideCurrentPageNode),parentNode=_b.parentNode,breadcrumbItems=_b.breadcrumbItems;return jsxs("div",__assign({className:className},{children:[jsx$1(LargeScreenBreadcrumb,{items:breadcrumbItems,onRenderItem:renderBreadcrumbItem,overflowIndex:1,"data-breadcrumb":true,overflowAriaLabel:formatMessage({id:'AriaLabel.otherPages'}),focusZoneProps:{handleTabKey:1}},void 0),jsx$1(MobileBreadcrumb,{target:target,parentNode:parentNode},void 0)]}),void 0);function renderBreadcrumbItem(item){if(item.key==='home'){return jsx$1(BreadcrumbHomeItem,__assign({to:item.href,"aria-label":item.text,"data-pages-home-icon":true},{children:jsx$1(HomeIcon,{iconName:"HomeSolid"},void 0)}),void 0);}if(item.isCurrentItem){return jsx$1(BreadcrumbCurrentItem,__assign({"aria-current":"page"},{children:item.text}),void 0);}return jsx$1(BreadcrumbItem,__assign({to:item.href,"data-page-breadcrumb-node":item.key},{children:item.text}),void 0);}function handleOnClick(e,item){e.stopPropagation();e.preventDefault();history.push({pathname:item.href});}};var MobileBreadcrumb=function MobileBreadcrumb(_a){var target=_a.target,parentNode=_a.parentNode;var formatMessage=useIntl().formatMessage;return jsxs(MobileBreadcrumbHost,__assign({"data-mobile-breadcrumb":true},{children:[jsx$1("li",{children:jsx$1(BreadcrumbHomeItem,__assign({to:target,"aria-label":formatMessage({id:'Generic.home'}),"data-pages-home-icon":true},{children:jsx$1(HomeIcon,{iconName:"HomeSolid"},void 0)}),void 0)},void 0),parentNode&&jsxs(ParentNode,{children:[jsx$1(LeftChevronIcon,{iconName:"ChevronLeft"},void 0),jsx$1(BreadcrumbItem,__assign({to:NewsService.getNewsRoute(target,parentNode.id,parentNode.title),"data-page-breadcrumb-parent-node":parentNode.id},{children:parentNode.title}),void 0)]},void 0)]}),void 0);};var MobileBreadcrumbHost=_styled.ul.withConfig({displayName:"PageBreadcrumb__MobileBreadcrumbHost",componentId:"sc-1m4qq1d-0"})(templateObject_1$R||(templateObject_1$R=__makeTemplateObject(["\n display: none;\n align-items: center;\n padding: 0;\n margin: 0;\n list-style: none;\n font-size: ","px;\n\n @media (max-width: ","px) {\n display: flex;\n }\n"],["\n display: none;\n align-items: center;\n padding: 0;\n margin: 0;\n list-style: none;\n font-size: ","px;\n\n @media (max-width: ","px) {\n display: flex;\n }\n"])),fontSizeSmall,maxScreenSize.medium);var ParentNode=_styled.li.withConfig({displayName:"PageBreadcrumb__ParentNode",componentId:"sc-1m4qq1d-1"})(templateObject_2$w||(templateObject_2$w=__makeTemplateObject(["\n margin: 0 ","px;\n text-overflow: ellipsis;\n overflow: hidden;\n white-space: nowrap;\n color: ",";\n"],["\n margin: 0 ","px;\n text-overflow: ellipsis;\n overflow: hidden;\n white-space: nowrap;\n color: ",";\n"])),spacingM,function(p){return p.theme.palette.accent;});var LeftChevronIcon=_styled(Icon).withConfig({displayName:"PageBreadcrumb__LeftChevronIcon",componentId:"sc-1m4qq1d-2"})(templateObject_3$n||(templateObject_3$n=__makeTemplateObject(["\n font-size: 10px;\n font-weight: bold;\n color: ",";\n"],["\n font-size: 10px;\n font-weight: bold;\n color: ",";\n"])),function(p){return p.theme.palette.accent;});var LargeScreenBreadcrumb=_styled(Breadcrumb).withConfig({displayName:"PageBreadcrumb__LargeScreenBreadcrumb",componentId:"sc-1m4qq1d-3"})(templateObject_4$d||(templateObject_4$d=__makeTemplateObject(["\n && {\n margin: 0;\n }\n\n .ms-Breadcrumb-chevron {\n font-weight: bold;\n }\n\n @media (max-width: ","px) {\n display: none;\n }\n"],["\n && {\n margin: 0;\n }\n\n .ms-Breadcrumb-chevron {\n font-weight: bold;\n }\n\n @media (max-width: ","px) {\n display: none;\n }\n"])),maxScreenSize.medium);var HomeIcon=_styled(Icon).withConfig({displayName:"PageBreadcrumb__HomeIcon",componentId:"sc-1m4qq1d-4"})(templateObject_5$c||(templateObject_5$c=__makeTemplateObject(["\n padding-top: 1px;\n"],["\n padding-top: 1px;\n"])));var BreadcrumbItem=_styled(NavLink).withConfig({displayName:"PageBreadcrumb__BreadcrumbItem",componentId:"sc-1m4qq1d-5"})(templateObject_6$6$1||(templateObject_6$6$1=__makeTemplateObject(["\n padding: 0 ","px;\n color: ",";\n"],["\n padding: 0 ","px;\n color: ",";\n"])),spacingS,function(p){return p.theme.palette.accent;});var BreadcrumbHomeItem=_styled(NavLink).withConfig({displayName:"PageBreadcrumb__BreadcrumbHomeItem",componentId:"sc-1m4qq1d-6"})(templateObject_7$4$1||(templateObject_7$4$1=__makeTemplateObject(["\n color: ",";\n\n + i {\n padding-left: ","px;\n }\n"],["\n color: ",";\n\n + i {\n padding-left: ","px;\n }\n"])),function(p){return p.theme.palette.accent;},spacingS);var BreadcrumbCurrentItem=_styled.div.withConfig({displayName:"PageBreadcrumb__BreadcrumbCurrentItem",componentId:"sc-1m4qq1d-7"})(templateObject_8$4$1||(templateObject_8$4$1=__makeTemplateObject(["\n padding-left: ","px;\n color: ",";\n"],["\n padding-left: ","px;\n color: ",";\n"])),spacingS,function(p){return p.theme.palette.neutralSecondaryAlt;});var templateObject_1$R,templateObject_2$w,templateObject_3$n,templateObject_4$d,templateObject_5$c,templateObject_6$6$1,templateObject_7$4$1,templateObject_8$4$1;var DetailViewPageDocumentDownload=function DetailViewPageDocumentDownload(){var user=useCurrentUser();var _a=useDetailViewContext(),item=_a.item,preferredContent=_a.content;if(!item){return null;}var content=(preferredContent===null||preferredContent===void 0?void 0:preferredContent.fileInfo)?preferredContent:getContentForPage(item,user).content;if(!(content===null||content===void 0?void 0:content.fileInfo)){return null;}return jsx$1(PageDocumentDownloadButton,{item:item,content:content},void 0);};var PageDocumentDownloadButton=function PageDocumentDownloadButton(_a){var item=_a.item,content=_a.content,basePath=_a.basePath;var _b=useInlinePageDocument({pageId:item.id,fileId:content.fileInfo.fileId,extension:content.fileInfo.extension,title:content.title,fileName:content.fileInfo.fileName},item,basePath),fileUrl=_b.fileUrl,iconName=_b.iconName,title=_b.title,fileName=_b.fileName,onPageDocumentDownloadClick=_b.onPageDocumentDownloadClick;return jsxs(Host$k,{children:[jsx$1(FormattedMessage$1,{id:"Pages.documents.buttonDownloadInfo"},void 0),jsx$1(DownloadButton,{fileUrl:fileUrl,fileName:fileName,title:title,fileIconName:iconName,onClick:onPageDocumentDownloadClick},void 0)]},void 0);};var Host$k=_styled.div.withConfig({displayName:"DetailViewPageDocumentDownload__Host",componentId:"sc-1gtkslm-0"})(templateObject_1$Q||(templateObject_1$Q=__makeTemplateObject(["\n margin-top: ","px;\n"],["\n margin-top: ","px;\n"])),spacingM);var DownloadButton=_styled(InlinePageDocumentDownloadButton).withConfig({displayName:"DetailViewPageDocumentDownload__DownloadButton",componentId:"sc-1gtkslm-1"})(templateObject_2$v||(templateObject_2$v=__makeTemplateObject(["\n margin-top: ","px;\n @media (min-width: ","px) {\n width: 50%;\n }\n"],["\n margin-top: ","px;\n @media (min-width: ","px) {\n width: 50%;\n }\n"])),spacingS,minScreenSize.medium);var templateObject_1$Q,templateObject_2$v;_styled(PublishableItemBanner).withConfig({displayName:"CardBanner__StyledBanner",componentId:"sc-mqzdnh-0"})(templateObject_1$P||(templateObject_1$P=__makeTemplateObject(["\n &.video-view-container {\n height: 100%; /* this is needed for not overlapping the card title */\n }\n"],["\n &.video-view-container {\n height: 100%; /* this is needed for not overlapping the card title */\n }\n"])));var templateObject_1$P;_styled.div.withConfig({displayName:"Card__Host",componentId:"sc-1m8ygh-0"})(templateObject_1$O||(templateObject_1$O=__makeTemplateObject(["\n &.card {\n display: flex;\n background-color: white;\n box-shadow: 1px 1px 4px grey;\n box-sizing: border-box;\n\n width: 100%;\n\n margin-bottom: 10px;\n\n &[data-packed] {\n opacity: 1;\n }\n\n &.card-enter,\n &.card-appear {\n opacity: 0.01;\n }\n\n &.card-enter.card-enter-active,\n &.card-appear.card-appear-active {\n opacity: 1;\n transition: opacity 0.75s ease-in;\n }\n\n @media all and (min-width: ","px) {\n transition: opacity 0.75s ease-in;\n opacity: 0;\n width: ","px;\n }\n\n @media all and (min-width: ","px) {\n width: ","px;\n }\n\n @media all and (min-width: ","px) {\n width: ","px;\n }\n\n @media all and (min-width: ","px) {\n width: ","px;\n }\n }\n"],["\n &.card {\n display: flex;\n background-color: white;\n box-shadow: 1px 1px 4px grey;\n box-sizing: border-box;\n\n width: 100%;\n\n margin-bottom: 10px;\n\n &[data-packed] {\n opacity: 1;\n }\n\n &.card-enter,\n &.card-appear {\n opacity: 0.01;\n }\n\n &.card-enter.card-enter-active,\n &.card-appear.card-appear-active {\n opacity: 1;\n transition: opacity 0.75s ease-in;\n }\n\n @media all and (min-width: ","px) {\n transition: opacity 0.75s ease-in;\n opacity: 0;\n width: ","px;\n }\n\n @media all and (min-width: ","px) {\n width: ","px;\n }\n\n @media all and (min-width: ","px) {\n width: ","px;\n }\n\n @media all and (min-width: ","px) {\n width: ","px;\n }\n }\n"])),minScreenSize.small,cardWidthS,minScreenSize.medium,cardWidthM,minScreenSize.large,cardWidthL,minScreenSize.xLarge,cardWidthXL);_styled.article.withConfig({displayName:"Card__Article",componentId:"sc-1m8ygh-1"})(templateObject_3$m||(templateObject_3$m=__makeTemplateObject(["\n position: relative;\n display: flex;\n flex-direction: column;\n width: 100%;\n\n ","\n\n > .card-banner {\n height: calc(((100vw - ","px) * (1 / ",")));\n flex: 0 1 auto;\n }\n\n .card-title {\n margin-top: 7px;\n margin-bottom: 0;\n font-size: 1.1em;\n }\n\n .card-metaInfo {\n font-size: 0.9em;\n }\n\n .card-metaInfo {\n padding-top: ","px;\n color: #666;\n }\n\n @media all and (min-width: ","px) {\n > .card-banner {\n height: calc(","px * (1 / ","));\n }\n\n .card-title {\n margin-top: 7px;\n font-size: 1.3em;\n }\n\n .card-metaInfo {\n font-size: 0.9em;\n }\n }\n\n @media all and (min-width: ","px) {\n > .card-banner {\n height: calc(","px * (1 / ","));\n }\n\n @media all and (min-width: ","px) {\n > .card-banner {\n height: calc(","px * (1 / ","));\n }\n }\n\n @media all and (min-width: ","px) {\n > .card-banner {\n height: calc(","px * (1 / ","));\n }\n }\n }\n"],["\n position: relative;\n display: flex;\n flex-direction: column;\n width: 100%;\n\n ","\n\n > .card-banner {\n height: calc(((100vw - ","px) * (1 / ",")));\n flex: 0 1 auto;\n }\n\n .card-title {\n margin-top: 7px;\n margin-bottom: 0;\n font-size: 1.1em;\n }\n\n .card-metaInfo {\n font-size: 0.9em;\n }\n\n .card-metaInfo {\n padding-top: ","px;\n color: #666;\n }\n\n @media all and (min-width: ","px) {\n > .card-banner {\n height: calc(","px * (1 / ","));\n }\n\n .card-title {\n margin-top: 7px;\n font-size: 1.3em;\n }\n\n .card-metaInfo {\n font-size: 0.9em;\n }\n }\n\n @media all and (min-width: ","px) {\n > .card-banner {\n height: calc(","px * (1 / ","));\n }\n\n @media all and (min-width: ","px) {\n > .card-banner {\n height: calc(","px * (1 / ","));\n }\n }\n\n @media all and (min-width: ","px) {\n > .card-banner {\n height: calc(","px * (1 / ","));\n }\n }\n }\n"])),function(p){return p.highlight&&css$2(templateObject_2$u||(templateObject_2$u=__makeTemplateObject(["\n &::after {\n content: '';\n position: absolute;\n top: 0;\n bottom: 0;\n right: 0;\n width: ","px;\n display: block;\n background-color: ",";\n }\n "],["\n &::after {\n content: '';\n position: absolute;\n top: 0;\n bottom: 0;\n right: 0;\n width: ","px;\n display: block;\n background-color: ",";\n }\n "])),spacingXs,function(p){return p.theme.palette.accent;});},spacingM,bannerAspectRatio,spacingM,minScreenSize.small,cardWidthS,bannerAspectRatio,minScreenSize.medium,cardWidthM,bannerAspectRatio,minScreenSize.large,cardWidthL,bannerAspectRatio,minScreenSize.xLarge,cardWidthXL,bannerAspectRatio);var templateObject_1$O,templateObject_2$u,templateObject_3$m;var LanguageSelector=function LanguageSelector(props){var history=useHistory();var currentUser=useCurrentUser();var buildPath=useSubscriptionHandlePathBuilder().buildPath;var getAllLanguagesLocalized=useLanguageApi().getAllLanguagesLocalized;var intl=useIntl();var formatMessage=intl.formatMessage;var languageDefinitions=usePromise$2(function(){return getAllLanguagesLocalized(intl);})[0];var features=useFeatures();if(languageDefinitions==null){return null;}if(props.chromeless)return jsx$1(ActionButton,__assign({iconProps:{iconName:'World'},menuProps:{items:getContextualMenuItems(),className:'lt-reach-callout'},className:classNames(props.className,'header-button')},{children:formatMessage({id:"Generic.languages."+props.selectedLanguage})}),void 0);return jsx$1(Tooltip,__assign({resourceKey:"Generic.translate"},{children:jsx$1(LanguageSelectorButton,{menuIconProps:{iconName:'World'},menuProps:{items:getContextualMenuItems(),className:'lt-reach-callout',isBeakVisible:props.showBeak},className:classNames(props.className,'header-button'),"data-language-selector-button":true,ariaLabel:formatMessage({id:'AriaLabel.autoTranslation'})},void 0)}),void 0);function getContextualMenuItems(){if(props.languages==null){return [];}var menuItems=[];var preferredLanguageItem=getPreferredLanguageItem();if(preferredLanguageItem){menuItems.push(preferredLanguageItem);}var activeLanguagesItems=getActiveLanguagesItems();activeLanguagesItems.sort(function(a,b){return a.text.localeCompare(b.text);});menuItems=menuItems.concat(activeLanguagesItems);if(!props.hideEditLanguagePreferences){var editLanguagePreferencesItem={key:'edit',text:formatMessage({id:'Generic.editLanguagePreferences'}),iconProps:{iconName:'PlayerSettings'},onClick:handleEditLanguagePreferences,className:'lt-reach-languageselector-menu-item'};menuItems.push(editLanguagePreferencesItem);}return menuItems;}function handleEditLanguagePreferences(){if(props.onEditLanguagePreferencesClick){props.onEditLanguagePreferencesClick();}else {history.push(buildPath('/user'));}}function getActiveLanguagesItems(){return props.languages.map(function(l){var fullLanguage=languageDefinitions.find(function(ld){return ld.code===l;});return {key:l,text:fullLanguage.localizedName,iconProps:{iconName:'World'},onClick:function(){return props.onLanguageChange(l.toString());},className:classNames('lt-reach-languageselector-menu-item',l===props.selectedLanguage&&'selected')};});}function getPreferredLanguageItem(){if(!features.automaticTranslation){return null;}if(!props.onTranslateClick){return null;}var preferredContentLanguage=getPreferredContentLanguage(currentUser);var shouldAddPreferredContentLanguage=preferredContentLanguage!=null&&!contentLanguagesWithoutAutomaticTranslation.includes(preferredContentLanguage)&&allAvailableContentLanguages.includes(preferredContentLanguage)&&props.languages.indexOf(preferredContentLanguage)<0;if(!shouldAddPreferredContentLanguage){return null;}return {key:preferredContentLanguage,text:formatMessage({id:'Generic.automaticTranslation'},{language:formatMessage({id:"Generic.languages."+preferredContentLanguage})}),iconProps:{iconName:'Robot'},onClick:function(){return props.onTranslateClick(preferredContentLanguage);},className:classNames('lt-reach-languageselector-menu-item',preferredContentLanguage===props.selectedLanguage&&'selected')};}};var LanguageSelectorButton=_styled(IconButton).withConfig({displayName:"LanguageSelector__LanguageSelectorButton",componentId:"sc-48zwek-0"})(templateObject_1$N||(templateObject_1$N=__makeTemplateObject(["\n && {\n height: 100%;\n margin: 0;\n background-color: transparent;\n }\n"],["\n && {\n height: 100%;\n margin: 0;\n background-color: transparent;\n }\n"])));var templateObject_1$N;_styled.article.withConfig({displayName:"DetailViewArticle__Host",componentId:"sc-we2q7z-0"})(templateObject_1$M||(templateObject_1$M=__makeTemplateObject(["\n min-width: 300px;\n width: 100%;\n\n flex: 1 0 auto;\n display: flex;\n flex-flow: column nowrap;\n\n @media (min-width: ","px) {\n box-shadow: 1px 1px 4px grey;\n max-width: ","px;\n }\n"],["\n min-width: 300px;\n width: 100%;\n\n flex: 1 0 auto;\n display: flex;\n flex-flow: column nowrap;\n\n @media (min-width: ","px) {\n box-shadow: 1px 1px 4px grey;\n max-width: ","px;\n }\n"])),minScreenSize.large+1,maxContentWidth);var templateObject_1$M;var DetailViewBanner=function DetailViewBanner(){var _a=useDetailViewContext(),item=_a.item,resourceType=_a.resourceType,isEditorPreview=_a.isEditorPreview;if(!item.bannerInfo){return null;}return jsx$1(Banner$3,{itemId:item.id,token:item.fileAccessToken,bannerInfo:item.bannerInfo,useEditorRoutes:isEditorPreview,width:getMaxImageWidth(),canOpenImage:true,resourceType:resourceType},void 0);};var Banner$3=_styled(PublishableItemBanner).withConfig({displayName:"DetailViewBanner__Banner",componentId:"sc-1wuqvtw-0"})(templateObject_1$L||(templateObject_1$L=__makeTemplateObject(["\n && {\n height: calc(100vw * (1 / ","));\n\n @media (min-width: ","px) {\n height: calc(\n (","px - (2 * ","px)) *\n (1 / ",")\n );\n }\n }\n"],["\n && {\n height: calc(100vw * (1 / ","));\n\n @media (min-width: ","px) {\n height: calc(\n (","px - (2 * ","px)) *\n (1 / ",")\n );\n }\n }\n"])),bannerAspectRatio,minScreenSize.large+1,minScreenSize.large,spacingM,bannerAspectRatio);var templateObject_1$L;var DetailViewIntro=function DetailViewIntro(){var content=useDetailViewContext().content;var hasIntro=content.intro&&content.intro.length>0;if(!hasIntro){return null;}return jsx$1(DetailIntro,{children:content.intro},void 0);};var DetailIntro=_styled.p.withConfig({displayName:"DetailViewIntro__DetailIntro",componentId:"sc-1kubhyf-0"})(templateObject_1$K||(templateObject_1$K=__makeTemplateObject(["\n margin: 0;\n font-size: ","px;\n line-height: 26px;\n font-weight: normal;\n\n min-width: 100%;\n width: 100px;\n\n @media (min-width: ","px) {\n margin-top: ","px;\n margin-bottom: ","px;\n line-height: 24px;\n font-size: ","px;\n }\n"],["\n margin: 0;\n font-size: ","px;\n line-height: 26px;\n font-weight: normal;\n\n min-width: 100%;\n width: 100px;\n\n @media (min-width: ","px) {\n margin-top: ","px;\n margin-bottom: ","px;\n line-height: 24px;\n font-size: ","px;\n }\n"])),fontSizeNormal,minScreenSize.small,spacingS,spacingS+2,fontSizeMedium+2);var templateObject_1$K;var DetailMainSection=function DetailMainSection(_a){var children=_a.children;return jsx$1(DetailMainStyledSection,__assign({className:"detail-view-main"},{children:children}),void 0);};var DetailMainStyledSection=_styled.section.withConfig({displayName:"DetailViewMainSection__DetailMainStyledSection",componentId:"sc-ifywhg-0"})(templateObject_1$J||(templateObject_1$J=__makeTemplateObject(["\n position: relative;\n flex: 1 0 auto;\n display: flex;\n flex-direction: column;\n padding: ","px ","px\n ","px;\n font-size: 16px;\n\n @media (min-width: ","px) {\n padding: ","px\n ","px ","px;\n }\n"],["\n position: relative;\n flex: 1 0 auto;\n display: flex;\n flex-direction: column;\n padding: ","px ","px\n ","px;\n font-size: 16px;\n\n @media (min-width: ","px) {\n padding: ","px\n ","px ","px;\n }\n"])),detailViewSectionPadding-5,detailViewSectionPadding,detailViewSectionPadding,minScreenSize.small,detailViewSectionPaddingLarge-10,detailViewSectionPaddingLarge,detailViewSectionPaddingLarge);var templateObject_1$J;var GutterMarkerIcon=function GutterMarkerIcon(_a){var iconName=_a.iconName,children=_a.children,isActive=_a.isActive,color=_a.color,tooltipResourceKey=_a.tooltipResourceKey,className=_a.className;return jsxs(Host$h$1,__assign({className:className},{children:[jsx$1(IconContainer$1,__assign({isActive:isActive,className:isActive?"ms-bgColor-"+color:'ms-bgColor-white'},{children:isActive&&jsx$1(StyledTooltip,__assign({resourceKey:tooltipResourceKey},{children:jsx$1(StyledIcon$2$1,{className:"ms-fontColor-white",iconName:iconName},void 0)}),void 0)}),void 0),isActive?jsx$1(ActiveContent,__assign({className:"ms-borderColor-"+color},{children:children}),void 0):jsx$1(Content$3,{children:children},void 0)]}),void 0);};var Host$h$1=_styled.div.withConfig({displayName:"GutterMakerIcon__Host",componentId:"sc-aa2cf4-0"})(templateObject_1$I||(templateObject_1$I=__makeTemplateObject(["\n margin: 0;\n display: flex;\n align-content: center;\n"],["\n margin: 0;\n display: flex;\n align-content: center;\n"])));var StyledIcon$2$1=_styled(Icon).withConfig({displayName:"GutterMakerIcon__StyledIcon",componentId:"sc-aa2cf4-1"})(templateObject_2$t||(templateObject_2$t=__makeTemplateObject(["\n font-size: 25px;\n"],["\n font-size: 25px;\n"])));var Content$3=_styled.div.withConfig({displayName:"GutterMakerIcon__Content",componentId:"sc-aa2cf4-2"})(templateObject_3$l||(templateObject_3$l=__makeTemplateObject(["\n flex: 1 1 auto;\n flex-basis: 100%; /*IE fix*/\n\n display: flex;\n align-items: center;\n\n box-sizing: border-box;\n"],["\n flex: 1 1 auto;\n flex-basis: 100%; /*IE fix*/\n\n display: flex;\n align-items: center;\n\n box-sizing: border-box;\n"])));var ActiveContent=_styled(Content$3).withConfig({displayName:"GutterMakerIcon__ActiveContent",componentId:"sc-aa2cf4-3"})(templateObject_4$c$1||(templateObject_4$c$1=__makeTemplateObject(["\n padding-left: 10px;\n min-height: 50px;\n\n border-bottom-style: solid;\n border-bottom-width: 4px;\n"],["\n padding-left: 10px;\n min-height: 50px;\n\n border-bottom-style: solid;\n border-bottom-width: 4px;\n"])));var IconContainer$1=_styled.div.withConfig({displayName:"GutterMakerIcon__IconContainer",componentId:"sc-aa2cf4-4"})(templateObject_5$b||(templateObject_5$b=__makeTemplateObject(["\n flex-grow: 0;\n flex-shrink: 0;\n flex-basis: ",";\n\n display: flex;\n justify-content: center;\n align-items: center;\n\n padding: 10px 0;\n"],["\n flex-grow: 0;\n flex-shrink: 0;\n flex-basis: ",";\n\n display: flex;\n justify-content: center;\n align-items: center;\n\n padding: 10px 0;\n"])),function(_a){var isActive=_a.isActive;return isActive?'50px':'auto';});var StyledTooltip=_styled(Tooltip).withConfig({displayName:"GutterMakerIcon__StyledTooltip",componentId:"sc-aa2cf4-5"})(templateObject_6$5$1||(templateObject_6$5$1=__makeTemplateObject(["\n && {\n display: inherit;\n }\n"],["\n && {\n display: inherit;\n }\n"])));var templateObject_1$I,templateObject_2$t,templateObject_3$l,templateObject_4$c$1,templateObject_5$b,templateObject_6$5$1;var DetailViewTitle=function DetailViewTitle(){var _a=useDetailViewContext(),content=_a.content,item=_a.item;var hasAlert=hasFlag(item.knownState,KnownNewsState.Alert);return jsx$1(GutterMarkerIcon,__assign({iconName:"Warning",isActive:hasAlert,color:"red",tooltipResourceKey:"NewsArticle.alert"},{children:jsx$1(Title$4,__assign({"data-title":true},{children:content.title}),void 0)}),void 0);};var Title$4=_styled.h1.withConfig({displayName:"DetailViewTitle__Title",componentId:"sc-1jbzvna-0"})(templateObject_1$H||(templateObject_1$H=__makeTemplateObject(["\n color: black;\n width: 100%;\n font-size: ","px;\n line-height: 29px;\n margin: 0;\n\n @media (min-width: ","px) {\n font-size: 2.2em;\n line-height: 42px;\n }\n"],["\n color: black;\n width: 100%;\n font-size: ","px;\n line-height: 29px;\n margin: 0;\n\n @media (min-width: ","px) {\n font-size: 2.2em;\n line-height: 42px;\n }\n"])),fontSizeLarge-1,minScreenSize.small);var templateObject_1$H;_styled(ItemMetaInfo).withConfig({displayName:"NewsDetailViewMetaInfo__DetailMetaInfo",componentId:"sc-kib7we-0"})(templateObject_1$G||(templateObject_1$G=__makeTemplateObject(["\n display: flex;\n font-size: ","px;\n margin-top: 12px;\n"],["\n display: flex;\n font-size: ","px;\n margin-top: 12px;\n"])),fontSizeSmall);var templateObject_1$G;var mappers=[InlineImageMapper,InlineFileMapper,InlineQuoteMapper,InlineGalleryMapper,InlineCodeMapper,InlineVideoMapper,InlineTable,InlineContactMapper,InlinePageListMapper,InlineUrlPreviewMapper];var RichTextViewer=function RichTextViewer(_a){var html=_a.html;return jsx$1(TextViewer,{html:html,componentMappers:mappers},void 0);};var DetailViewBody=function DetailViewBody(){var _a=useDetailViewContext(),content=_a.content,resourceType=_a.resourceType;var bodyHtml=content&&content.body;return jsx$1(DetailBody$1,__assign({className:"lt-reach-detail-view-body","data-item-type":resourceType},{children:jsx$1(ItemBodyWrapper,{children:jsx$1(RichTextViewer,{html:bodyHtml},void 0)},void 0)}),void 0);};var DetailBody$1=_styled.div.withConfig({displayName:"DetailViewBody__DetailBody",componentId:"sc-7b4trq-0"})(templateObject_1$F||(templateObject_1$F=__makeTemplateObject(["\n flex: 1 0 auto;\n box-sizing: border-box;\n min-width: 100%;\n width: 100px;\n margin-top: 35px;\n\n // So that headings have the correct semantics for accessibility (i.e. title is h1, subheadings start at h2),\n // but maintain the same visual design, this styles each heading to look one \"step\" larger\n // e.g. h2 looks like h1, etc.\n && {\n h2 {\n font-size: ","px;\n margin: ","px 0;\n }\n\n h3 {\n font-size: ","px;\n }\n\n h4 {\n font-size: ","px;\n }\n\n h3,\n h4,\n h5,\n h6 {\n margin: ","px 0;\n }\n }\n"],["\n flex: 1 0 auto;\n box-sizing: border-box;\n min-width: 100%;\n width: 100px;\n margin-top: 35px;\n\n // So that headings have the correct semantics for accessibility (i.e. title is h1, subheadings start at h2),\n // but maintain the same visual design, this styles each heading to look one \"step\" larger\n // e.g. h2 looks like h1, etc.\n && {\n h2 {\n font-size: ","px;\n margin: ","px 0;\n }\n\n h3 {\n font-size: ","px;\n }\n\n h4 {\n font-size: ","px;\n }\n\n h3,\n h4,\n h5,\n h6 {\n margin: ","px 0;\n }\n }\n"])),fontSizeLarge-1,spacingS+2,fontSizeLarge-3,fontSizeLarge-5,spacingS);var templateObject_1$F;var DetailViewKeywords=function DetailViewKeywords(_a){var filterBaseUrl=_a.filterBaseUrl;var features=useFeatures();var _b=useDetailViewContext(),item=_b.item,userPreferredLanguage=_b.userPreferredLanguage;var formatMessage=useIntl().formatMessage;if(!features.keywords){return null;}return jsx$1(Fragment,{children:Object.keys(item.keywords).length>0&&jsx$1(KeywordsSection,__assign({"aria-label":formatMessage({id:'AriaLabel.section.keywords'})},{children:jsx$1(KeywordsInfo,{keywords:item.keywords,language:userPreferredLanguage,filterBaseUrl:filterBaseUrl},void 0)}),void 0)},void 0);};var KeywordsSection=_styled.section.withConfig({displayName:"DetailViewKeywords__KeywordsSection",componentId:"sc-ltysu4-0"})(templateObject_1$E||(templateObject_1$E=__makeTemplateObject(["\n margin-top: 2em;\n display: flex;\n\n @media (max-width: ","px) {\n font-size: ","px;\n }\n"],["\n margin-top: 2em;\n display: flex;\n\n @media (max-width: ","px) {\n font-size: ","px;\n }\n"])),maxScreenSize.medium,fontSizeSmall);var templateObject_1$E;var ConfirmationBox=function ConfirmationBox(_a){var disabled=_a.disabled,checked=_a.checked,onChange=_a.onChange;var formatMessage=useIntl().formatMessage;return jsx$1(Host$g$1,{children:jsx$1(NeutralCheckBox,{disabled:disabled,checked:checked,onChange:function(_,value){return onChange(value);},label:formatMessage({id:checked?'NewsArticle.confirmed':'NewsArticle.confirm'})},void 0)},void 0);};var Host$g$1=_styled.div.withConfig({displayName:"ConfirmationBox__Host",componentId:"sc-1m5alil-0"})(templateObject_1$D||(templateObject_1$D=__makeTemplateObject(["\n .ms-Checkbox-text {\n font-weight: bold;\n color: black;\n }\n"],["\n .ms-Checkbox-text {\n font-weight: bold;\n color: black;\n }\n"])));var templateObject_1$D;var ConfirmationSection=function ConfirmationSection(_a){var item=_a.item,showDescription=_a.showDescription,readOnly=_a.readOnly,className=_a.className;var refreshStatistics=useNewsApi().refreshStatistics;var _b=useNotificationContext(),dismissToast=_b.dismissToast,showToast=_b.showToast,showError=_b.showError;var _c=useFeedbackApi(),getFeedback=_c.getFeedback,setFeedback=_c.setFeedback,unsetFeedback=_c.unsetFeedback;var _d=usePromise$2(function(){return getFeedback(ItemResourceTypes.News,item.id);}),summary=_d[0],isLoading=_d[1];var _e=useState$2(null),userChecked=_e[0],setChecked=_e[1];var toastHandle=useRef$1(null);var checked=userChecked!==null?userChecked:summary!=null&&!!summary.records.find(function(r){return r.type==='confirm';});return jsxs(Host$f$1,__assign({isLoading:isLoading,className:className},{children:[showDescription&&jsx$1(FormattedMessage$1,{id:"NewsArticle.confirmationRequiredDescription",tagName:"p"},void 0),jsx$1(StyledGutterMarkerIcon,__assign({iconName:"Completed",isActive:!isLoading&&!checked,color:"green"},{children:readOnly?jsx$1(ConfirmationBox,{checked:checked,disabled:true},void 0):jsx$1(ConfirmationBox,{checked:checked,disabled:checked,onChange:handleClickConfirm},void 0)}),void 0)]}),void 0);function handleClickConfirm(){return __awaiter(this,void 0,void 0,function(){var error_1;return __generator(this,function(_a){switch(_a.label){case 0:setChecked(true);_a.label=1;case 1:_a.trys.push([1,4,,5]);return [4/*yield*/,setFeedback(ItemResourceTypes.News,item.id,'confirm')];case 2:_a.sent();toastHandle.current=showToast('NewsArticle.confirmationSuccessToast',{},jsx$1(DefaultButton,__assign({onClick:handleUndo},{children:jsx$1(FormattedMessage$1,{id:"Generic.undo"},void 0)}),void 0),{autoClose:false});return [4/*yield*/,refreshStatistics(item.id,{confirmationCount:1})];case 3:_a.sent();return [3/*break*/,5];case 4:error_1=_a.sent();logger.error(error_1);showError('Generic.error');setChecked(false);return [3/*break*/,5];case 5:return [2/*return*/];}});});}function handleUndo(){return __awaiter(this,void 0,void 0,function(){var error_2;return __generator(this,function(_a){switch(_a.label){case 0:_a.trys.push([0,3,,4]);dismissToast(toastHandle.current);toastHandle.current=null;return [4/*yield*/,unsetFeedback(ItemResourceTypes.News,item.id,'confirm')];case 1:_a.sent();return [4/*yield*/,refreshStatistics(item.id,{confirmationCount:-1})];case 2:_a.sent();setChecked(false);return [3/*break*/,4];case 3:error_2=_a.sent();logger.error(error_2);showError('Generic.error');return [3/*break*/,4];case 4:return [2/*return*/];}});});}};var Host$f$1=_styled.div.withConfig({displayName:"ConfirmationSection__Host",componentId:"sc-1g2fxdb-0"})(templateObject_1$C||(templateObject_1$C=__makeTemplateObject(["\n width: 100%;\n\n opacity: ",";\n\n > p {\n margin: 0 0 5px ","px;\n font-style: italic;\n }\n\n @media (min-width: ","px) {\n > p {\n margin: 0 0 ","px 0;\n }\n }\n\n @media (max-width: ","px) {\n font-size: ","px;\n }\n"],["\n width: 100%;\n\n opacity: ",";\n\n > p {\n margin: 0 0 5px ","px;\n font-style: italic;\n }\n\n @media (min-width: ","px) {\n > p {\n margin: 0 0 ","px 0;\n }\n }\n\n @media (max-width: ","px) {\n font-size: ","px;\n }\n"])),function(_a){var isLoading=_a.isLoading;return isLoading?0.4:1;},spacingM,minScreenSize.small,spacingS,maxScreenSize.medium,fontSizeSmall);var StyledGutterMarkerIcon=_styled(GutterMarkerIcon).withConfig({displayName:"ConfirmationSection__StyledGutterMarkerIcon",componentId:"sc-1g2fxdb-1"})(templateObject_2$s||(templateObject_2$s=__makeTemplateObject(["\n @media (max-width: ","px) {\n margin: 0 ","px 0;\n }\n"],["\n @media (max-width: ","px) {\n margin: 0 ","px 0;\n }\n"])),maxScreenSize.small,spacingM);var templateObject_1$C,templateObject_2$s;var DetailViewConfirmations=function DetailViewConfirmations(){var features=useFeatures();var _a=useDetailViewContext(),item=_a.item,isEditorPreview=_a.isEditorPreview;var formatMessage=useIntl().formatMessage;if(!showConfirmationBox()){return null;}return jsx$1(ConfirmationHost,__assign({"aria-label":formatMessage({id:'NewsArticle.confirmation'})},{children:jsx$1(ConfirmationSection,{item:item,showDescription:true,readOnly:isEditorPreview},void 0)}),void 0);function showConfirmationBox(){return features.confirmation&&item.metadata&&item.metadata.feedbackSettings&&item.metadata.feedbackSettings.feedbackOptions.indexOf('confirm')>=0;}};var ConfirmationHost=_styled.section.withConfig({displayName:"DetailViewConfirmations__ConfirmationHost",componentId:"sc-f8jogv-0"})(templateObject_1$B||(templateObject_1$B=__makeTemplateObject(["\n margin-bottom: ","px;\n\n @media (min-width: ","px) {\n padding: 0 ","px 0 ","px;\n }\n"],["\n margin-bottom: ","px;\n\n @media (min-width: ","px) {\n padding: 0 ","px 0 ","px;\n }\n"])),spacingL,minScreenSize.small,spacingXl,spacingXl);var templateObject_1$B;var DetailViewPageViewTracker=function DetailViewPageViewTracker(){var _a=useDetailViewContext(),resourceType=_a.resourceType,itemId=_a.itemId;usePageViewTracker(resourceType,itemId);return null;};var FeedbackButtonBookmark=function FeedbackButtonBookmark(_a){var isReadOnly=_a.isReadOnly;var _b=useContext(FeedbackButtonContext),item=_b.item,bookmarkCount=_b.statistics.bookmarkCount;return jsxs(CountButtonHost,{children:[jsx$1(BookmarkButton,{item:item,isReadOnly:isReadOnly},void 0),jsx$1(CountLabel,__assign({isDisabled:isReadOnly},{children:bookmarkCount}),void 0)]},void 0);};var NewsDetailViewFeedbackSection=function NewsDetailViewFeedbackSection(_a){var _b;var hideLikes=_a.hideLikes,hideComments=_a.hideComments,hideProfileUrl=_a.hideProfileUrl,disableLoginForPublicUser=_a.disableLoginForPublicUser;var _c=useDetailViewContext(),item=_c.item,resourceType=_c.resourceType,contentLanguage=_c.contentLanguage,isEditorPreview=_c.isEditorPreview;return jsxs(StyledFeedbackSection,__assign({item:item,language:contentLanguage,type:resourceType,feedbackSettings:(_b=item.metadata)===null||_b===void 0?void 0:_b.feedbackSettings,hideComments:hideComments,hideProfileUrl:hideProfileUrl,disableLoginForPublicUser:disableLoginForPublicUser,isReadOnly:isEditorPreview},{children:[!hideLikes&&jsx$1(FeedbackButtonLike,{isReadOnly:isEditorPreview},void 0),jsx$1(FeedbackButtonBookmark,{isReadOnly:isEditorPreview},void 0),!hideComments&&jsx$1(FeedbackButtonComments,{},void 0),jsx$1(FeedbackButtonViews,{},void 0),jsx$1(FeedbackButtonShare,{isReadOnly:isEditorPreview},void 0),jsx$1(FeedbackButtonConfirmations,{},void 0)]}),void 0);};var StyledFeedbackSection=_styled(FeedbackSection).withConfig({displayName:"NewsDetailViewFeedbackSection__StyledFeedbackSection",componentId:"sc-pjpy6x-0"})(templateObject_1$A||(templateObject_1$A=__makeTemplateObject(["\n ","\n"],["\n ","\n"])),DetailViewSectionPadding);var templateObject_1$A;var DetailViewBodyExternalContent=function DetailViewBodyExternalContent(_a){var itemType=_a.itemType;var content=useDetailViewContext().content;var externalUrl=content&&content.externalUrl;return jsx$1(DetailBody,__assign({className:"lt-reach-detail-view-body"},{children:jsx$1(ItemBodyWrapper,{children:jsx$1(FormattedMessageWithStyle,{id:"ExternalLink."+itemType+".navigateTo",tagName:"p",values:{url:jsx$1(ExternalLink$2,__assign({href:externalUrl,className:"ms-fontColor-accent",target:"_blank",rel:"noopener noreferrer"},{children:externalUrl}),void 0)}},void 0)},void 0)}),void 0);};var DetailBody=_styled.div.withConfig({displayName:"DetailViewBodyExternalContent__DetailBody",componentId:"sc-1xjgw89-0"})(templateObject_1$z||(templateObject_1$z=__makeTemplateObject(["\n flex: 1 0 auto;\n box-sizing: border-box;\n min-width: 100%;\n width: 100px;\n margin-top: 35px;\n"],["\n flex: 1 0 auto;\n box-sizing: border-box;\n min-width: 100%;\n width: 100px;\n margin-top: 35px;\n"])));var templateObject_1$z;var DetailViewHeadline=function DetailViewHeadline(){var content=useDetailViewContext().content;var features=useFeatures();if(!features.contentHeadline||!content.headline){return null;}return jsx$1(Headline$1$1,__assign({"data-detail-view-headline":true},{children:content.headline}),void 0);};var Headline$1$1=_styled.p.withConfig({displayName:"DetailViewHeadline__Headline",componentId:"sc-wsid06-0"})(templateObject_1$y||(templateObject_1$y=__makeTemplateObject(["\n width: 100%;\n font-weight: bold;\n font-size: ","px;\n line-height: 26px;\n margin: 0;\n\n @media (min-width: ","px) {\n line-height: 22px;\n font-size: ","px;\n margin-bottom: ","px;\n }\n"],["\n width: 100%;\n font-weight: bold;\n font-size: ","px;\n line-height: 26px;\n margin: 0;\n\n @media (min-width: ","px) {\n line-height: 22px;\n font-size: ","px;\n margin-bottom: ","px;\n }\n"])),fontSizeNormal,minScreenSize.small,fontSizeMedium,spacingS);var templateObject_1$y;var StateIcon=function StateIcon(_a){var status=_a.status,isActive=_a.isActive,_b=_a.width,width=_b===void 0?16:_b,activeColor=_a.activeColor;var textColors=useContext(ThemeContext$1).theme.textColors;if(status===WorkflowStatus.draft){return jsx$1(Draft,{width:width,color:isActive?activeColor||textColors.onSecondary:textColors.default},void 0);}else if(status===WorkflowStatus.rejected){return jsx$1(Draft,{width:width,color:isActive?activeColor:'#b90000'},void 0);}else if(status===WorkflowStatus.ready){return jsx$1(Ready,{width:width,color:isActive?activeColor||textColors.onSecondary:textColors.default},void 0);}return null;};var Draft=function Draft(_a){var color=_a.color,className=_a.className,_b=_a.width,width=_b===void 0?16.25:_b;var ratio=20/16.25;return jsx$1("svg",__assign({className:className,version:"1.1",id:"Layer_1",x:"0px",y:"0px",width:width+"px",height:width*ratio+"px",viewBox:"0 0 16.25 20",enableBackground:"new 0 0 16.25 20"},{children:jsx$1("path",{fill:color,d:"M10,6.25V0h0.89l5.36,5.361V6.25H10z M11.25,5h2.861L11.25,2.139V5z M10,0H9.25v1.25H10V0z M7.675,1.25H6.1\n\tV0h1.575V1.25z M4.525,1.25H2.95V0h1.575V1.25z M1.25,17.057H0v-1.567h1.25V17.057z M1.25,13.921H0v-1.568h1.25V13.921z\n\t M1.25,10.784H0V9.216h1.25V10.784z M1.25,7.647H0V6.08h1.25V7.647z M1.25,4.512H0V2.943h1.25V4.512z M13.375,\n\t 20h-1.5v-1.25h1.5V20z\n\t M10.375,20h-1.5v-1.25h1.5V20z M7.375,20h-1.5v-1.25h1.5V20z M4.375,20h-1.5v-1.25h1.5V20z M16.25,\n\t 16.964H15v-1.661h1.25V16.964z\n\t M16.25,13.643H15v-1.661h1.25V13.643z M16.25,10.321H15V8.66h1.25V10.321z M16.25,6.25H15V7h1.25V6.25z\n\t M1.25,18.75H0V20h1.25\n\tV18.75z M1.25,0H0v1.25h1.25V0z M16.25,18.75H15V20h1.25V18.75z"},void 0)}),void 0);};var Ready=function Ready(_a){var color=_a.color,className=_a.className,_b=_a.width,width=_b===void 0?18.564:_b;var ratio=20/18.564;return jsx$1("svg",__assign({className:className,version:"1.1",id:"Layer_1",x:"0px",y:"0px",width:width+"px",height:width*ratio+"px",viewBox:"0 0 18.564 20",enableBackground:"new 0 0 18.564 20"},{children:jsx$1("path",{fill:color,d:"M10,6.25v-5H1.25v17.5H10V20H0V0h10.889l5.361,5.361V12.5L15,13.75v-7.5H10z M18.564,14.551L13.125,20\n \tl-2.627-2.637l0.879-0.879l1.748,1.738l4.561-4.551L18.564,14.551z M11.25,5h2.861L11.25,2.139V5z"},void 0)}),void 0);};function useCommonEditorApi(){var api=useApi();return useMemo(function(){return {list:list,getTaskViewCounts:getTaskViewCounts};function list(type,filter,token,sortDefinition){var _a;var params=Object.assign({},__assign(__assign(__assign({},filter),getCommaSeparatedChannelsString((_a=filter===null||filter===void 0?void 0:filter.channels)===null||_a===void 0?void 0:_a.items)),getCommaSeparatedKeywordsString(filter===null||filter===void 0?void 0:filter.keywords)),{token:token},sortDefinition);return api.custom("editor/"+type+"?"+queryString.stringify(params)).get().then(function(res){return res.body().data();});}function getTaskViewCounts(type,groupId){return __awaiter(this,void 0,void 0,function(){var response;return __generator(this,function(_a){switch(_a.label){case 0:return [4/*yield*/,api.custom("editor/"+type+"/taskcounts?"+queryString.stringify({groupId:groupId})).get(groupId)];case 1:response=_a.sent();return [4/*yield*/,response.body().data()];case 2:return [2/*return*/,_a.sent()];}});});}},[api]);}var LogicalOperator;(function(LogicalOperator){LogicalOperator["Or"]="or";LogicalOperator["And"]="and";})(LogicalOperator||(LogicalOperator={}));var SortFieldsDefinitionBuilder=/** @class */function(){function SortFieldsDefinitionBuilder(){this.sort=[];}SortFieldsDefinitionBuilder.prototype.addSortField=function(field,direction){this.sort.push(field+":"+SortFieldsDefinitionBuilder.getSortDirectionAsString(direction));return this;};SortFieldsDefinitionBuilder.getSortDirectionAsString=function(direction){return direction===SortDirection.asc?'asc':'desc';};return SortFieldsDefinitionBuilder;}();var EventSortFieldsDefinitionBuilder=/** @class */function(_super){__extends(EventSortFieldsDefinitionBuilder,_super);function EventSortFieldsDefinitionBuilder(){return _super!==null&&_super.apply(this,arguments)||this;}EventSortFieldsDefinitionBuilder.create=function(){return new EventSortFieldsDefinitionBuilder();};return EventSortFieldsDefinitionBuilder;}(SortFieldsDefinitionBuilder);EventSortFieldsDefinitionBuilder.create().addSortField('startDate',SortDirection.desc);EventSortFieldsDefinitionBuilder.create().addSortField('publishingDate',SortDirection.desc);var ItemType;(function(ItemType){ItemType[ItemType["None"]=0]="None";ItemType[ItemType["News"]=1]="News";ItemType[ItemType["Post"]=2]="Post";ItemType[ItemType["Page"]=4]="Page";ItemType[ItemType["Event"]=8]="Event";})(ItemType||(ItemType={}));var BaseFilterDefinitionImpl=/** @class */function(){function BaseFilterDefinitionImpl(){}return BaseFilterDefinitionImpl;}();__spreadArray(__spreadArray([],Object.keys(new BaseFilterDefinitionImpl())),['hideChrome','teams']);var KeywordPickerGroup=function KeywordPickerGroup(_a){var group=_a.group,keywords=_a.keywords,expanded=_a.expanded,selectedKeywords=_a.selectedKeywords,onChange=_a.onChange,mandatoryKeywordIds=_a.mandatoryKeywordIds;var _b=useState$2(null),isExpanded=_b[0],setIsExpanded=_b[1];var isSelected=!!selectedKeywords.find(function(k){return k.groupId===group.id;});var isCollapsed=!(isExpanded===true||expanded);return jsxs(Host$e$1,{children:[jsxs(GroupButton,__assign({onClick:toggle,iconProps:{iconName:isCollapsed?'CaretRightSolid8':'CaretDownSolid8'},"aria-expanded":!isCollapsed,"aria-controls":group.name+"-list"},{children:[isSelected&&jsx$1(CheckMarkIcon,{iconName:"CheckMark"},void 0),jsx$1(ButtonLabel,__assign({"data-keyword-group":group.name,isSelected:isSelected},{children:jsx$1(KeywordTitle,{groupName:group.name},void 0)}),void 0)]}),void 0),jsx$1(KeywordsList,__assign({id:group.name+"-list","data-keyword-picker-group-list":true,isCollapsed:isCollapsed},{children:keywords.map(function(k){var checked=isKeywordSelected(k);var disabled=isKeywordDisabled(k);return jsx$1(KeywordItem,__assign({"data-keyword":k.name,"data-is-checked":checked,"data-is-disabled":disabled},{children:jsx$1(Checkbox,{label:k.name,onRenderLabel:function(){return jsx$1(KeywordTitle,{groupName:group.name,keywordName:k.name},void 0);},checked:checked,onChange:function(_e,isChecked){return handleChange(isChecked,k);},disabled:disabled},k.id)}),k.name);})}),void 0)]},void 0);function toggle(){setIsExpanded(!isExpanded);}function isKeywordSelected(keyword){return !!selectedKeywords.find(function(k){return k.id===keyword.id;});}function isKeywordDisabled(keyword){return mandatoryKeywordIds===null||mandatoryKeywordIds===void 0?void 0:mandatoryKeywordIds.some(function(id){return id===keyword.id;});}function handleChange(add,keyword){if(onChange){var result=selectedKeywords.filter(function(k){return keyword.id!==k.id;});if(add){result.push(keyword);}onChange(result);}}};var Host$e$1=_styled.div.withConfig({displayName:"KeywordPickerGroup__Host",componentId:"sc-pu16jm-0"})(templateObject_1$x||(templateObject_1$x=__makeTemplateObject(["\n margin-bottom: ","px;\n"],["\n margin-bottom: ","px;\n"])),spacingS);var GroupButton=_styled(ActionButton).withConfig({displayName:"KeywordPickerGroup__GroupButton",componentId:"sc-pu16jm-1"})(templateObject_2$r||(templateObject_2$r=__makeTemplateObject(["\n && {\n height: auto;\n font-size: ","px;\n padding: 0;\n border: 0;\n\n i {\n font-size: ","px;\n\n &:first-child {\n margin: 0;\n }\n }\n }\n"],["\n && {\n height: auto;\n font-size: ","px;\n padding: 0;\n border: 0;\n\n i {\n font-size: ","px;\n\n &:first-child {\n margin: 0;\n }\n }\n }\n"])),fontSizeNormal,fontSizeSmall);var CheckMarkIcon=_styled(Icon).withConfig({displayName:"KeywordPickerGroup__CheckMarkIcon",componentId:"sc-pu16jm-2"})(templateObject_3$k||(templateObject_3$k=__makeTemplateObject(["\n margin-right: 6px;\n margin-left: 12px;\n width: 15px;\n"],["\n margin-right: 6px;\n margin-left: 12px;\n width: 15px;\n"])));var ButtonLabel=_styled.span.withConfig({displayName:"KeywordPickerGroup__ButtonLabel",componentId:"sc-pu16jm-3"})(templateObject_5$a||(templateObject_5$a=__makeTemplateObject(["\n display: inline-flex;\n flex: 1 0 auto;\n\n ","\n"],["\n display: inline-flex;\n flex: 1 0 auto;\n\n ","\n"])),function(p){return !p.isSelected&&css$2(templateObject_4$b$1||(templateObject_4$b$1=__makeTemplateObject(["\n margin-left: 33px; // checkmark icon space\n "],["\n margin-left: 33px; // checkmark icon space\n "])));});var KeywordsList=_styled.ul.withConfig({displayName:"KeywordPickerGroup__KeywordsList",componentId:"sc-pu16jm-4"})(templateObject_7$3$1||(templateObject_7$3$1=__makeTemplateObject(["\n ","\n padding: 0;\n margin: 0 0 0 ","px;\n list-style: none;\n"],["\n ","\n padding: 0;\n margin: 0 0 0 ","px;\n list-style: none;\n"])),function(p){return p.isCollapsed&&css$2(templateObject_6$4$1||(templateObject_6$4$1=__makeTemplateObject(["\n display: none;\n "],["\n display: none;\n "])));},spacingX+10);var KeywordItem=_styled.li.withConfig({displayName:"KeywordPickerGroup__KeywordItem",componentId:"sc-pu16jm-5"})(templateObject_8$3$1||(templateObject_8$3$1=__makeTemplateObject(["\n display: flex;\n align-items: center;\n margin-top: 9px;\n"],["\n display: flex;\n align-items: center;\n margin-top: 9px;\n"])));var templateObject_1$x,templateObject_2$r,templateObject_3$k,templateObject_4$b$1,templateObject_5$a,templateObject_6$4$1,templateObject_7$3$1,templateObject_8$3$1;var KeywordPicker=function KeywordPicker(_a){var _b;var value=_a.value,onChange=_a.onChange,showSelectionToggle=_a.showSelectionToggle,incomingAvailableKeywords=_a.availableKeywords,mandatoryKeywordIds=_a.mandatoryKeywordIds,className=_a.className;var formatMessage=useIntl().formatMessage;var user=useCurrentUser();var _c=useContext(LazySubscriptionContext),allKeywords=_c.allKeywords,selectedKeywordGroups=_c.selectedKeywordGroups;var _d=useState$2(null),searchedKeywords=_d[0],setSearchedKeywords=_d[1];var _e=useState$2(null),searchText=_e[0],setSearchText=_e[1];var selectedKeywords=getSelectedKeywords();var availableKeywords=incomingAvailableKeywords!==null&&incomingAvailableKeywords!==void 0?incomingAvailableKeywords:allKeywords;var visibleKeywords=(_b=searchedKeywords!==null&&searchedKeywords!==void 0?searchedKeywords:availableKeywords)!==null&&_b!==void 0?_b:[];var mandatoryKeywords=mandatoryKeywordIds?availableKeywords.filter(function(k){return mandatoryKeywordIds.includes(k.id);}):[];var noKeywordGroups=(selectedKeywordGroups===null||selectedKeywordGroups===void 0?void 0:selectedKeywordGroups.length)===0;var noAvailableKeywords=!noKeywordGroups&&(availableKeywords===null||availableKeywords===void 0?void 0:availableKeywords.length)===0;var isEmpty=visibleKeywords.length===0;return jsxs(Host$d$1,__assign({className:classNames('keyword-picker',className)},{children:[(noKeywordGroups||noAvailableKeywords)&&jsx$1("span",__assign({className:"keyword-picker-empty"},{children:jsx$1(FormattedMessage$1,{id:noKeywordGroups?'KeywordPicker.noGroupsDefined':'KeywordPicker.noAvailableKeywordsForGroup'},void 0)}),void 0),!noKeywordGroups&&!noAvailableKeywords&&jsxs("div",{children:[jsxs(SearchHost,__assign({className:"keyword-picker-search","data-keyword-picker-search":true},{children:[jsx$1(TextField,{onChange:handleSearch,value:searchText||'',placeholder:formatMessage({id:'KeywordPicker.search'})},void 0),searchText&&jsx$1(SearchCancelButton,{iconProps:{iconName:'Cancel'},onClick:function(){return handleSearch(null,null);},"aria-hidden":"true"},void 0)]}),void 0),showSelectionToggle&&jsx$1(StyledToggleAllButtons,{toggleAll:handleToggleAll},void 0),jsxs(KeywordPickerTree,__assign({className:"keyword-picker-tree"},{children:[isEmpty&&jsx$1(FormattedMessage$1,{id:"KeywordPicker.emptySearch"},void 0),!isEmpty&&selectedKeywordGroups&&selectedKeywordGroups.sort(function(a,b){return a.name.localeCompare(b.name);}).map(function(g){var keywords=visibleKeywords.filter(function(k){return k.groupId===g.id;});return keywords.length===0?null:jsx$1(KeywordPickerGroup,{expanded:!!searchText,group:g,keywords:keywords,selectedKeywords:selectedKeywords,onChange:onChange,mandatoryKeywordIds:mandatoryKeywordIds},g.id);})]}),void 0)]},void 0)]}),void 0);function getSelectedKeywords(){if(value==null||allKeywords==null){return [];}return value.map(function(k){return typeof k==='string'?allKeywords.find(function(a){return a.id===k;}):k;}).filter(function(k){return k;});}function handleSearch(_,text){var hasSearch=text&&text.length;var keywords=hasSearch?availableKeywords.filter(function(k){return getKeywordTitle(user,k.translations,k.name).toLocaleLowerCase().indexOf(text.toLocaleLowerCase())>=0;}):availableKeywords;setSearchedKeywords(keywords);setSearchText(hasSearch?text:null);}function handleToggleAll(checkAll){onChange(checkAll?availableKeywords:mandatoryKeywords);}};var KeywordPickerTree=_styled.div.withConfig({displayName:"KeywordPicker__KeywordPickerTree",componentId:"sc-1ejjfwa-0"})(templateObject_1$w||(templateObject_1$w=__makeTemplateObject(["\n padding-left: 4px;\n"],["\n padding-left: 4px;\n"])));var StyledToggleAllButtons=_styled(ToggleAllButtons).withConfig({displayName:"KeywordPicker__StyledToggleAllButtons",componentId:"sc-1ejjfwa-1"})(templateObject_2$q||(templateObject_2$q=__makeTemplateObject(["\n padding-left: 4px;\n"],["\n padding-left: 4px;\n"])));var Host$d$1=_styled.div.withConfig({displayName:"KeywordPicker__Host",componentId:"sc-1ejjfwa-2"})(templateObject_3$j||(templateObject_3$j=__makeTemplateObject(["\n overflow-x: hidden;\n overflow-y: auto;\n\n .ms-TextField-fieldGroup {\n background: none;\n }\n"],["\n overflow-x: hidden;\n overflow-y: auto;\n\n .ms-TextField-fieldGroup {\n background: none;\n }\n"])));var SearchHost=_styled.div.withConfig({displayName:"KeywordPicker__SearchHost",componentId:"sc-1ejjfwa-3"})(templateObject_4$a$1||(templateObject_4$a$1=__makeTemplateObject(["\n position: relative;\n margin-bottom: 8px;\n"],["\n position: relative;\n margin-bottom: 8px;\n"])));var SearchCancelButton=_styled(IconButton).withConfig({displayName:"KeywordPicker__SearchCancelButton",componentId:"sc-1ejjfwa-4"})(templateObject_5$9$1||(templateObject_5$9$1=__makeTemplateObject(["\n position: absolute;\n top: 0;\n right: 0;\n z-index: 10;\n\n &&&:focus::after {\n outline-offset: -2px;\n }\n"],["\n position: absolute;\n top: 0;\n right: 0;\n z-index: 10;\n\n &&&:focus::after {\n outline-offset: -2px;\n }\n"])));var templateObject_1$w,templateObject_2$q,templateObject_3$j,templateObject_4$a$1,templateObject_5$9$1;var $$2=_export;var requireObjectCoercible$1$1=requireObjectCoercible$c;var isRegExp=isRegexp;var getRegExpFlags=regexpFlags$1$1;var wellKnownSymbol$1=wellKnownSymbol$l;var REPLACE$2=wellKnownSymbol$1('replace');var RegExpPrototype$3=RegExp.prototype;// `String.prototype.replaceAll` method
|
|
131850
|
+
return {id:pageListId,showChildren:showChildren,showPages:true,showDocuments:false,pageId:pageId,keywords:keywords};}var showDocuments=showDocumentsAttribute==='true';var showPages=showPagesAttribute==='true';return {id:pageListId,showChildren:showChildren,showDocuments:showDocuments,showPages:showPages,pageId:pageId,keywords:keywords};}};var PageBreadcrumb=function PageBreadcrumb(_a){var page=_a.page,target=_a.target,languageOverride=_a.language,hideCurrentPageNode=_a.hideCurrentPageNode,className=_a.className;var user=useCurrentUser();var formatMessage=useIntl().formatMessage;var history=useHistory();if(!page||!page.navigationContext){return null;}var _b=getBreadcrumbsItems(page,target,handleOnClick,function(page){return getTitle(page,user,formatMessage,languageOverride);},formatMessage,hideCurrentPageNode),parentNode=_b.parentNode,breadcrumbItems=_b.breadcrumbItems;return jsxs("div",__assign({className:className},{children:[jsx$1(LargeScreenBreadcrumb,{items:breadcrumbItems,onRenderItem:renderBreadcrumbItem,overflowIndex:1,"data-breadcrumb":true,overflowAriaLabel:formatMessage({id:'AriaLabel.otherPages'}),focusZoneProps:{handleTabKey:1}},void 0),jsx$1(MobileBreadcrumb,{target:target,parentNode:parentNode},void 0)]}),void 0);function renderBreadcrumbItem(item){if(item.key==='home'){return jsx$1(BreadcrumbHomeItem,__assign({to:item.href,"aria-label":item.text,"data-pages-home-icon":true},{children:jsx$1(HomeIcon,{iconName:"HomeSolid"},void 0)}),void 0);}if(item.isCurrentItem){return jsx$1(BreadcrumbCurrentItem,__assign({"aria-current":"page"},{children:item.text}),void 0);}return jsx$1(BreadcrumbItem,__assign({to:item.href,"data-page-breadcrumb-node":item.key},{children:item.text}),void 0);}function handleOnClick(e,item){e.stopPropagation();e.preventDefault();history.push({pathname:item.href});}};var MobileBreadcrumb=function MobileBreadcrumb(_a){var target=_a.target,parentNode=_a.parentNode;var formatMessage=useIntl().formatMessage;return jsxs(MobileBreadcrumbHost,__assign({"data-mobile-breadcrumb":true},{children:[jsx$1("li",{children:jsx$1(BreadcrumbHomeItem,__assign({to:target,"aria-label":formatMessage({id:'Generic.home'}),"data-pages-home-icon":true},{children:jsx$1(HomeIcon,{iconName:"HomeSolid"},void 0)}),void 0)},void 0),parentNode&&jsxs(ParentNode,{children:[jsx$1(LeftChevronIcon,{iconName:"ChevronLeft"},void 0),jsx$1(BreadcrumbItem,__assign({to:NewsService.getNewsRoute(target,parentNode.id,parentNode.title),"data-page-breadcrumb-parent-node":parentNode.id},{children:parentNode.title}),void 0)]},void 0)]}),void 0);};var MobileBreadcrumbHost=_styled.ul.withConfig({displayName:"PageBreadcrumb__MobileBreadcrumbHost",componentId:"sc-1m4qq1d-0"})(templateObject_1$R||(templateObject_1$R=__makeTemplateObject(["\n display: none;\n align-items: center;\n padding: 0;\n margin: 0;\n list-style: none;\n font-size: ","px;\n\n @media (max-width: ","px) {\n display: flex;\n }\n"],["\n display: none;\n align-items: center;\n padding: 0;\n margin: 0;\n list-style: none;\n font-size: ","px;\n\n @media (max-width: ","px) {\n display: flex;\n }\n"])),fontSizeSmall,maxScreenSize.medium);var ParentNode=_styled.li.withConfig({displayName:"PageBreadcrumb__ParentNode",componentId:"sc-1m4qq1d-1"})(templateObject_2$w||(templateObject_2$w=__makeTemplateObject(["\n margin: 0 ","px;\n text-overflow: ellipsis;\n overflow: hidden;\n white-space: nowrap;\n color: ",";\n"],["\n margin: 0 ","px;\n text-overflow: ellipsis;\n overflow: hidden;\n white-space: nowrap;\n color: ",";\n"])),spacingM,function(p){return p.theme.palette.accent;});var LeftChevronIcon=_styled(Icon).withConfig({displayName:"PageBreadcrumb__LeftChevronIcon",componentId:"sc-1m4qq1d-2"})(templateObject_3$n||(templateObject_3$n=__makeTemplateObject(["\n font-size: 10px;\n font-weight: bold;\n color: ",";\n"],["\n font-size: 10px;\n font-weight: bold;\n color: ",";\n"])),function(p){return p.theme.palette.accent;});var LargeScreenBreadcrumb=_styled(Breadcrumb).withConfig({displayName:"PageBreadcrumb__LargeScreenBreadcrumb",componentId:"sc-1m4qq1d-3"})(templateObject_4$d||(templateObject_4$d=__makeTemplateObject(["\n && {\n margin: 0;\n }\n\n .ms-Breadcrumb-chevron {\n font-weight: bold;\n }\n\n @media (max-width: ","px) {\n display: none;\n }\n"],["\n && {\n margin: 0;\n }\n\n .ms-Breadcrumb-chevron {\n font-weight: bold;\n }\n\n @media (max-width: ","px) {\n display: none;\n }\n"])),maxScreenSize.medium);var HomeIcon=_styled(Icon).withConfig({displayName:"PageBreadcrumb__HomeIcon",componentId:"sc-1m4qq1d-4"})(templateObject_5$c||(templateObject_5$c=__makeTemplateObject(["\n padding-top: 1px;\n"],["\n padding-top: 1px;\n"])));var BreadcrumbItem=_styled(NavLink).withConfig({displayName:"PageBreadcrumb__BreadcrumbItem",componentId:"sc-1m4qq1d-5"})(templateObject_6$6$1||(templateObject_6$6$1=__makeTemplateObject(["\n padding: 0 ","px;\n color: ",";\n"],["\n padding: 0 ","px;\n color: ",";\n"])),spacingS,function(p){return p.theme.palette.accent;});var BreadcrumbHomeItem=_styled(NavLink).withConfig({displayName:"PageBreadcrumb__BreadcrumbHomeItem",componentId:"sc-1m4qq1d-6"})(templateObject_7$4$1||(templateObject_7$4$1=__makeTemplateObject(["\n color: ",";\n\n + i {\n padding-left: ","px;\n }\n"],["\n color: ",";\n\n + i {\n padding-left: ","px;\n }\n"])),function(p){return p.theme.palette.accent;},spacingS);var BreadcrumbCurrentItem=_styled.div.withConfig({displayName:"PageBreadcrumb__BreadcrumbCurrentItem",componentId:"sc-1m4qq1d-7"})(templateObject_8$4$1||(templateObject_8$4$1=__makeTemplateObject(["\n padding-left: ","px;\n color: ",";\n"],["\n padding-left: ","px;\n color: ",";\n"])),spacingS,function(p){return p.theme.palette.neutralSecondaryAlt;});var templateObject_1$R,templateObject_2$w,templateObject_3$n,templateObject_4$d,templateObject_5$c,templateObject_6$6$1,templateObject_7$4$1,templateObject_8$4$1;var DetailViewPageDocumentDownload=function DetailViewPageDocumentDownload(){var user=useCurrentUser();var _a=useDetailViewContext(),item=_a.item,preferredContent=_a.content;if(!item){return null;}var content=(preferredContent===null||preferredContent===void 0?void 0:preferredContent.fileInfo)?preferredContent:getContentForPage(item,user).content;if(!(content===null||content===void 0?void 0:content.fileInfo)){return null;}return jsx$1(PageDocumentDownloadButton,{item:item,content:content},void 0);};var PageDocumentDownloadButton=function PageDocumentDownloadButton(_a){var item=_a.item,content=_a.content,basePath=_a.basePath;var _b=useInlinePageDocument({pageId:item.id,fileId:content.fileInfo.fileId,extension:content.fileInfo.extension,title:content.title,fileName:content.fileInfo.fileName},item,basePath),fileUrl=_b.fileUrl,iconName=_b.iconName,title=_b.title,fileName=_b.fileName,onPageDocumentDownloadClick=_b.onPageDocumentDownloadClick;return jsxs(Host$k,{children:[jsx$1(FormattedMessage$1,{id:"Pages.documents.buttonDownloadInfo"},void 0),jsx$1(DownloadButton,{fileUrl:fileUrl,fileName:fileName,title:title,fileIconName:iconName,onClick:onPageDocumentDownloadClick},void 0)]},void 0);};var Host$k=_styled.div.withConfig({displayName:"DetailViewPageDocumentDownload__Host",componentId:"sc-1gtkslm-0"})(templateObject_1$Q||(templateObject_1$Q=__makeTemplateObject(["\n margin-top: ","px;\n"],["\n margin-top: ","px;\n"])),spacingM);var DownloadButton=_styled(InlinePageDocumentDownloadButton).withConfig({displayName:"DetailViewPageDocumentDownload__DownloadButton",componentId:"sc-1gtkslm-1"})(templateObject_2$v||(templateObject_2$v=__makeTemplateObject(["\n margin-top: ","px;\n @media (min-width: ","px) {\n width: 50%;\n }\n"],["\n margin-top: ","px;\n @media (min-width: ","px) {\n width: 50%;\n }\n"])),spacingS,minScreenSize.medium);var templateObject_1$Q,templateObject_2$v;_styled(PublishableItemBanner).withConfig({displayName:"CardBanner__StyledBanner",componentId:"sc-mqzdnh-0"})(templateObject_1$P||(templateObject_1$P=__makeTemplateObject(["\n &.video-view-container {\n height: 100%; /* this is needed for not overlapping the card title */\n }\n"],["\n &.video-view-container {\n height: 100%; /* this is needed for not overlapping the card title */\n }\n"])));var templateObject_1$P;_styled.div.withConfig({displayName:"Card__Host",componentId:"sc-1m8ygh-0"})(templateObject_1$O||(templateObject_1$O=__makeTemplateObject(["\n &.card {\n display: flex;\n background-color: white;\n box-shadow: 1px 1px 4px grey;\n box-sizing: border-box;\n\n width: 100%;\n\n margin-bottom: 10px;\n\n &[data-packed] {\n opacity: 1;\n }\n\n &.card-enter,\n &.card-appear {\n opacity: 0.01;\n }\n\n &.card-enter.card-enter-active,\n &.card-appear.card-appear-active {\n opacity: 1;\n transition: opacity 0.75s ease-in;\n }\n\n @media all and (min-width: ","px) {\n transition: opacity 0.75s ease-in;\n opacity: 0;\n width: ","px;\n }\n\n @media all and (min-width: ","px) {\n width: ","px;\n }\n\n @media all and (min-width: ","px) {\n width: ","px;\n }\n\n @media all and (min-width: ","px) {\n width: ","px;\n }\n }\n"],["\n &.card {\n display: flex;\n background-color: white;\n box-shadow: 1px 1px 4px grey;\n box-sizing: border-box;\n\n width: 100%;\n\n margin-bottom: 10px;\n\n &[data-packed] {\n opacity: 1;\n }\n\n &.card-enter,\n &.card-appear {\n opacity: 0.01;\n }\n\n &.card-enter.card-enter-active,\n &.card-appear.card-appear-active {\n opacity: 1;\n transition: opacity 0.75s ease-in;\n }\n\n @media all and (min-width: ","px) {\n transition: opacity 0.75s ease-in;\n opacity: 0;\n width: ","px;\n }\n\n @media all and (min-width: ","px) {\n width: ","px;\n }\n\n @media all and (min-width: ","px) {\n width: ","px;\n }\n\n @media all and (min-width: ","px) {\n width: ","px;\n }\n }\n"])),minScreenSize.small,cardWidthS,minScreenSize.medium,cardWidthM,minScreenSize.large,cardWidthL,minScreenSize.xLarge,cardWidthXL);_styled.article.withConfig({displayName:"Card__Article",componentId:"sc-1m8ygh-1"})(templateObject_3$m||(templateObject_3$m=__makeTemplateObject(["\n position: relative;\n display: flex;\n flex-direction: column;\n width: 100%;\n\n ","\n\n > .card-banner {\n height: calc(((100vw - ","px) * (1 / ",")));\n flex: 0 1 auto;\n }\n\n .card-title {\n margin-top: 7px;\n margin-bottom: 0;\n font-size: 1.1em;\n }\n\n .card-metaInfo {\n font-size: 0.9em;\n }\n\n .card-metaInfo {\n padding-top: ","px;\n color: #666;\n }\n\n @media all and (min-width: ","px) {\n > .card-banner {\n height: calc(","px * (1 / ","));\n }\n\n .card-title {\n margin-top: 7px;\n font-size: 1.3em;\n }\n\n .card-metaInfo {\n font-size: 0.9em;\n }\n }\n\n @media all and (min-width: ","px) {\n > .card-banner {\n height: calc(","px * (1 / ","));\n }\n\n @media all and (min-width: ","px) {\n > .card-banner {\n height: calc(","px * (1 / ","));\n }\n }\n\n @media all and (min-width: ","px) {\n > .card-banner {\n height: calc(","px * (1 / ","));\n }\n }\n }\n"],["\n position: relative;\n display: flex;\n flex-direction: column;\n width: 100%;\n\n ","\n\n > .card-banner {\n height: calc(((100vw - ","px) * (1 / ",")));\n flex: 0 1 auto;\n }\n\n .card-title {\n margin-top: 7px;\n margin-bottom: 0;\n font-size: 1.1em;\n }\n\n .card-metaInfo {\n font-size: 0.9em;\n }\n\n .card-metaInfo {\n padding-top: ","px;\n color: #666;\n }\n\n @media all and (min-width: ","px) {\n > .card-banner {\n height: calc(","px * (1 / ","));\n }\n\n .card-title {\n margin-top: 7px;\n font-size: 1.3em;\n }\n\n .card-metaInfo {\n font-size: 0.9em;\n }\n }\n\n @media all and (min-width: ","px) {\n > .card-banner {\n height: calc(","px * (1 / ","));\n }\n\n @media all and (min-width: ","px) {\n > .card-banner {\n height: calc(","px * (1 / ","));\n }\n }\n\n @media all and (min-width: ","px) {\n > .card-banner {\n height: calc(","px * (1 / ","));\n }\n }\n }\n"])),function(p){return p.highlight&&css$2(templateObject_2$u||(templateObject_2$u=__makeTemplateObject(["\n &::after {\n content: '';\n position: absolute;\n top: 0;\n bottom: 0;\n right: 0;\n width: ","px;\n display: block;\n background-color: ",";\n }\n "],["\n &::after {\n content: '';\n position: absolute;\n top: 0;\n bottom: 0;\n right: 0;\n width: ","px;\n display: block;\n background-color: ",";\n }\n "])),spacingXs,function(p){return p.theme.palette.accent;});},spacingM,bannerAspectRatio,spacingM,minScreenSize.small,cardWidthS,bannerAspectRatio,minScreenSize.medium,cardWidthM,bannerAspectRatio,minScreenSize.large,cardWidthL,bannerAspectRatio,minScreenSize.xLarge,cardWidthXL,bannerAspectRatio);var templateObject_1$O,templateObject_2$u,templateObject_3$m;var LanguageSelector=function LanguageSelector(props){var history=useHistory();var currentUser=useCurrentUser();var buildPath=useSubscriptionHandlePathBuilder().buildPath;var getAllLanguagesLocalized=useLanguageApi().getAllLanguagesLocalized;var intl=useIntl();var formatMessage=intl.formatMessage;var languageDefinitions=usePromise$2(function(){return getAllLanguagesLocalized(intl);})[0];var features=useFeatures();if(languageDefinitions==null){return null;}if(props.chromeless)return jsx$1(ActionButton,__assign({iconProps:{iconName:'World'},menuProps:{items:getContextualMenuItems(),className:'lt-reach-callout'},className:classNames(props.className,'header-button')},{children:formatMessage({id:"Generic.languages."+props.selectedLanguage})}),void 0);return jsx$1(Tooltip,__assign({resourceKey:"Generic.translate"},{children:jsx$1(LanguageSelectorButton,{menuIconProps:{iconName:'World'},menuProps:{items:getContextualMenuItems(),className:'lt-reach-callout',isBeakVisible:props.showBeak},className:classNames(props.className,'header-button'),"data-language-selector-button":true,ariaLabel:formatMessage({id:'AriaLabel.autoTranslation'})},void 0)}),void 0);function getContextualMenuItems(){if(props.languages==null){return [];}var menuItems=[];var preferredLanguageItem=getPreferredLanguageItem();if(preferredLanguageItem){menuItems.push(preferredLanguageItem);}var activeLanguagesItems=getActiveLanguagesItems();activeLanguagesItems.sort(function(a,b){return a.text.localeCompare(b.text);});menuItems=menuItems.concat(activeLanguagesItems);if(!props.hideEditLanguagePreferences){var editLanguagePreferencesItem={key:'edit',text:formatMessage({id:'Generic.editLanguagePreferences'}),iconProps:{iconName:'PlayerSettings'},onClick:handleEditLanguagePreferences,className:'lt-reach-languageselector-menu-item'};menuItems.push(editLanguagePreferencesItem);}return menuItems;}function handleEditLanguagePreferences(){if(props.onEditLanguagePreferencesClick){props.onEditLanguagePreferencesClick();}else {history.push(buildPath('/user'));}}function getActiveLanguagesItems(){return props.languages.map(function(l){var fullLanguage=languageDefinitions.find(function(ld){return ld.code===l;});return {key:l,text:fullLanguage.localizedName,iconProps:{iconName:'World'},onClick:function(){return props.onLanguageChange(l.toString());},className:classNames('lt-reach-languageselector-menu-item',l===props.selectedLanguage&&'selected')};});}function getPreferredLanguageItem(){if(!features.automaticTranslation){return null;}if(!props.onTranslateClick){return null;}var preferredContentLanguage=getPreferredContentLanguage(currentUser);var shouldAddPreferredContentLanguage=preferredContentLanguage!=null&&!contentLanguagesWithoutAutomaticTranslation.includes(preferredContentLanguage)&&allAvailableContentLanguages.includes(preferredContentLanguage)&&props.languages.indexOf(preferredContentLanguage)<0;if(!shouldAddPreferredContentLanguage){return null;}return {key:preferredContentLanguage,text:formatMessage({id:'Generic.automaticTranslation'},{language:formatMessage({id:"Generic.languages."+preferredContentLanguage})}),iconProps:{iconName:'Robot'},onClick:function(){return props.onTranslateClick(preferredContentLanguage);},className:classNames('lt-reach-languageselector-menu-item',preferredContentLanguage===props.selectedLanguage&&'selected')};}};var LanguageSelectorButton=_styled(IconButton).withConfig({displayName:"LanguageSelector__LanguageSelectorButton",componentId:"sc-48zwek-0"})(templateObject_1$N||(templateObject_1$N=__makeTemplateObject(["\n && {\n height: 100%;\n margin: 0;\n background-color: transparent;\n }\n"],["\n && {\n height: 100%;\n margin: 0;\n background-color: transparent;\n }\n"])));var templateObject_1$N;_styled.article.withConfig({displayName:"DetailViewArticle__Host",componentId:"sc-we2q7z-0"})(templateObject_1$M||(templateObject_1$M=__makeTemplateObject(["\n min-width: 300px;\n width: 100%;\n\n flex: 1 0 auto;\n display: flex;\n flex-flow: column nowrap;\n\n @media (min-width: ","px) {\n box-shadow: 1px 1px 4px grey;\n max-width: ","px;\n }\n"],["\n min-width: 300px;\n width: 100%;\n\n flex: 1 0 auto;\n display: flex;\n flex-flow: column nowrap;\n\n @media (min-width: ","px) {\n box-shadow: 1px 1px 4px grey;\n max-width: ","px;\n }\n"])),minScreenSize.large+1,maxContentWidth);var templateObject_1$M;var DetailViewBanner=function DetailViewBanner(){var _a=useDetailViewContext(),item=_a.item,resourceType=_a.resourceType,isEditorPreview=_a.isEditorPreview;if(!item.bannerInfo){return null;}return jsx$1(Banner$3,{itemId:item.id,token:item.fileAccessToken,bannerInfo:item.bannerInfo,useEditorRoutes:isEditorPreview,width:getMaxImageWidth(),canOpenImage:true,resourceType:resourceType},void 0);};var Banner$3=_styled(PublishableItemBanner).withConfig({displayName:"DetailViewBanner__Banner",componentId:"sc-1wuqvtw-0"})(templateObject_1$L||(templateObject_1$L=__makeTemplateObject(["\n && {\n height: calc(100vw * (1 / ","));\n\n @media (min-width: ","px) {\n height: calc(\n (","px - (2 * ","px)) *\n (1 / ",")\n );\n }\n }\n"],["\n && {\n height: calc(100vw * (1 / ","));\n\n @media (min-width: ","px) {\n height: calc(\n (","px - (2 * ","px)) *\n (1 / ",")\n );\n }\n }\n"])),bannerAspectRatio,minScreenSize.large+1,minScreenSize.large,spacingM,bannerAspectRatio);var templateObject_1$L;var DetailViewIntro=function DetailViewIntro(){var content=useDetailViewContext().content;var hasIntro=content.intro&&content.intro.length>0;if(!hasIntro){return null;}return jsx$1(DetailIntro,{children:content.intro},void 0);};var DetailIntro=_styled.p.withConfig({displayName:"DetailViewIntro__DetailIntro",componentId:"sc-1kubhyf-0"})(templateObject_1$K||(templateObject_1$K=__makeTemplateObject(["\n margin: 0;\n font-size: ","px;\n line-height: 26px;\n font-weight: normal;\n\n min-width: 100%;\n width: 100px;\n\n @media (min-width: ","px) {\n margin-top: ","px;\n margin-bottom: ","px;\n line-height: 24px;\n font-size: ","px;\n }\n"],["\n margin: 0;\n font-size: ","px;\n line-height: 26px;\n font-weight: normal;\n\n min-width: 100%;\n width: 100px;\n\n @media (min-width: ","px) {\n margin-top: ","px;\n margin-bottom: ","px;\n line-height: 24px;\n font-size: ","px;\n }\n"])),fontSizeNormal,minScreenSize.small,spacingS,spacingS+2,fontSizeMedium+2);var templateObject_1$K;var DetailMainSection=function DetailMainSection(_a){var children=_a.children;return jsx$1(DetailMainStyledSection,__assign({className:"detail-view-main"},{children:children}),void 0);};var DetailMainStyledSection=_styled.section.withConfig({displayName:"DetailViewMainSection__DetailMainStyledSection",componentId:"sc-ifywhg-0"})(templateObject_1$J||(templateObject_1$J=__makeTemplateObject(["\n position: relative;\n flex: 1 0 auto;\n display: flex;\n flex-direction: column;\n padding: ","px ","px\n ","px;\n font-size: 16px;\n\n @media (min-width: ","px) {\n padding: ","px\n ","px ","px;\n }\n"],["\n position: relative;\n flex: 1 0 auto;\n display: flex;\n flex-direction: column;\n padding: ","px ","px\n ","px;\n font-size: 16px;\n\n @media (min-width: ","px) {\n padding: ","px\n ","px ","px;\n }\n"])),detailViewSectionPadding-5,detailViewSectionPadding,detailViewSectionPadding,minScreenSize.small,detailViewSectionPaddingLarge-10,detailViewSectionPaddingLarge,detailViewSectionPaddingLarge);var templateObject_1$J;var GutterMarkerIcon=function GutterMarkerIcon(_a){var iconName=_a.iconName,children=_a.children,isActive=_a.isActive,color=_a.color,tooltipResourceKey=_a.tooltipResourceKey,className=_a.className;return jsxs(Host$h$1,__assign({className:className},{children:[jsx$1(IconContainer$1,__assign({isActive:isActive,className:isActive?"ms-bgColor-"+color:'ms-bgColor-white'},{children:isActive&&jsx$1(StyledTooltip,__assign({resourceKey:tooltipResourceKey},{children:jsx$1(StyledIcon$2$1,{className:"ms-fontColor-white",iconName:iconName},void 0)}),void 0)}),void 0),isActive?jsx$1(ActiveContent,__assign({className:"ms-borderColor-"+color},{children:children}),void 0):jsx$1(Content$3,{children:children},void 0)]}),void 0);};var Host$h$1=_styled.div.withConfig({displayName:"GutterMakerIcon__Host",componentId:"sc-aa2cf4-0"})(templateObject_1$I||(templateObject_1$I=__makeTemplateObject(["\n margin: 0;\n display: flex;\n align-content: center;\n"],["\n margin: 0;\n display: flex;\n align-content: center;\n"])));var StyledIcon$2$1=_styled(Icon).withConfig({displayName:"GutterMakerIcon__StyledIcon",componentId:"sc-aa2cf4-1"})(templateObject_2$t||(templateObject_2$t=__makeTemplateObject(["\n font-size: 25px;\n"],["\n font-size: 25px;\n"])));var Content$3=_styled.div.withConfig({displayName:"GutterMakerIcon__Content",componentId:"sc-aa2cf4-2"})(templateObject_3$l||(templateObject_3$l=__makeTemplateObject(["\n flex: 1 1 auto;\n flex-basis: 100%; /*IE fix*/\n\n display: flex;\n align-items: center;\n\n box-sizing: border-box;\n"],["\n flex: 1 1 auto;\n flex-basis: 100%; /*IE fix*/\n\n display: flex;\n align-items: center;\n\n box-sizing: border-box;\n"])));var ActiveContent=_styled(Content$3).withConfig({displayName:"GutterMakerIcon__ActiveContent",componentId:"sc-aa2cf4-3"})(templateObject_4$c$1||(templateObject_4$c$1=__makeTemplateObject(["\n padding-left: 10px;\n min-height: 50px;\n\n border-bottom-style: solid;\n border-bottom-width: 4px;\n"],["\n padding-left: 10px;\n min-height: 50px;\n\n border-bottom-style: solid;\n border-bottom-width: 4px;\n"])));var IconContainer$1=_styled.div.withConfig({displayName:"GutterMakerIcon__IconContainer",componentId:"sc-aa2cf4-4"})(templateObject_5$b||(templateObject_5$b=__makeTemplateObject(["\n flex-grow: 0;\n flex-shrink: 0;\n flex-basis: ",";\n\n display: flex;\n justify-content: center;\n align-items: center;\n\n padding: 10px 0;\n"],["\n flex-grow: 0;\n flex-shrink: 0;\n flex-basis: ",";\n\n display: flex;\n justify-content: center;\n align-items: center;\n\n padding: 10px 0;\n"])),function(_a){var isActive=_a.isActive;return isActive?'50px':'auto';});var StyledTooltip=_styled(Tooltip).withConfig({displayName:"GutterMakerIcon__StyledTooltip",componentId:"sc-aa2cf4-5"})(templateObject_6$5$1||(templateObject_6$5$1=__makeTemplateObject(["\n && {\n display: inherit;\n }\n"],["\n && {\n display: inherit;\n }\n"])));var templateObject_1$I,templateObject_2$t,templateObject_3$l,templateObject_4$c$1,templateObject_5$b,templateObject_6$5$1;var DetailViewTitle=function DetailViewTitle(){var _a=useDetailViewContext(),content=_a.content,item=_a.item;var hasAlert=hasFlag(item.knownState,KnownNewsState.Alert);return jsx$1(GutterMarkerIcon,__assign({iconName:"Warning",isActive:hasAlert,color:"red",tooltipResourceKey:"NewsArticle.alert"},{children:jsx$1(Title$4,__assign({"data-title":true},{children:content.title}),void 0)}),void 0);};var Title$4=_styled.h1.withConfig({displayName:"DetailViewTitle__Title",componentId:"sc-1jbzvna-0"})(templateObject_1$H||(templateObject_1$H=__makeTemplateObject(["\n color: black;\n width: 100%;\n font-size: ","px;\n line-height: 29px;\n margin: 0;\n\n @media (min-width: ","px) {\n font-size: 2.2em;\n line-height: 42px;\n }\n"],["\n color: black;\n width: 100%;\n font-size: ","px;\n line-height: 29px;\n margin: 0;\n\n @media (min-width: ","px) {\n font-size: 2.2em;\n line-height: 42px;\n }\n"])),fontSizeLarge-1,minScreenSize.small);var templateObject_1$H;_styled(ItemMetaInfo).withConfig({displayName:"NewsDetailViewMetaInfo__DetailMetaInfo",componentId:"sc-kib7we-0"})(templateObject_1$G||(templateObject_1$G=__makeTemplateObject(["\n display: flex;\n font-size: ","px;\n margin-top: 12px;\n"],["\n display: flex;\n font-size: ","px;\n margin-top: 12px;\n"])),fontSizeSmall);var templateObject_1$G;var mappers=[InlineImageMapper,InlineFileMapper,InlineQuoteMapper,InlineGalleryMapper,InlineCodeMapper,InlineVideoMapper,InlineTable,InlineContactMapper,InlinePageListMapper,InlineUrlPreviewMapper];var RichTextViewer=function RichTextViewer(_a){var html=_a.html;return jsx$1(TextViewer,{html:html,componentMappers:mappers},void 0);};var DetailViewBody=function DetailViewBody(){var _a=useDetailViewContext(),content=_a.content,resourceType=_a.resourceType;var bodyHtml=content&&content.body;return jsx$1(DetailBody$1,__assign({className:"lt-reach-detail-view-body","data-item-type":resourceType},{children:jsx$1(ItemBodyWrapper,{children:jsx$1(RichTextViewer,{html:bodyHtml},void 0)},void 0)}),void 0);};var DetailBody$1=_styled.div.withConfig({displayName:"DetailViewBody__DetailBody",componentId:"sc-7b4trq-0"})(templateObject_1$F||(templateObject_1$F=__makeTemplateObject(["\n flex: 1 0 auto;\n box-sizing: border-box;\n min-width: 100%;\n width: 100px;\n margin-top: 35px;\n\n // So that headings have the correct semantics for accessibility (i.e. title is h1, subheadings start at h2),\n // but maintain the same visual design, this styles each heading to look one \"step\" larger\n // e.g. h2 looks like h1, etc.\n && {\n h2 {\n font-size: ","px;\n margin: ","px 0;\n }\n\n h3 {\n font-size: ","px;\n }\n\n h4 {\n font-size: ","px;\n }\n\n h3,\n h4,\n h5,\n h6 {\n margin: ","px 0;\n }\n }\n"],["\n flex: 1 0 auto;\n box-sizing: border-box;\n min-width: 100%;\n width: 100px;\n margin-top: 35px;\n\n // So that headings have the correct semantics for accessibility (i.e. title is h1, subheadings start at h2),\n // but maintain the same visual design, this styles each heading to look one \"step\" larger\n // e.g. h2 looks like h1, etc.\n && {\n h2 {\n font-size: ","px;\n margin: ","px 0;\n }\n\n h3 {\n font-size: ","px;\n }\n\n h4 {\n font-size: ","px;\n }\n\n h3,\n h4,\n h5,\n h6 {\n margin: ","px 0;\n }\n }\n"])),fontSizeLarge-1,spacingS+2,fontSizeLarge-3,fontSizeLarge-5,spacingS);var templateObject_1$F;var DetailViewKeywords=function DetailViewKeywords(_a){var filterBaseUrl=_a.filterBaseUrl;var features=useFeatures();var _b=useDetailViewContext(),item=_b.item,userPreferredLanguage=_b.userPreferredLanguage;var formatMessage=useIntl().formatMessage;if(!features.keywords){return null;}return jsx$1(Fragment,{children:Object.keys(item.keywords).length>0&&jsx$1(KeywordsSection,__assign({"aria-label":formatMessage({id:'AriaLabel.section.keywords'})},{children:jsx$1(KeywordsInfo,{keywords:item.keywords,language:userPreferredLanguage,filterBaseUrl:filterBaseUrl},void 0)}),void 0)},void 0);};var KeywordsSection=_styled.section.withConfig({displayName:"DetailViewKeywords__KeywordsSection",componentId:"sc-ltysu4-0"})(templateObject_1$E||(templateObject_1$E=__makeTemplateObject(["\n margin-top: 2em;\n display: flex;\n\n @media (max-width: ","px) {\n font-size: ","px;\n }\n"],["\n margin-top: 2em;\n display: flex;\n\n @media (max-width: ","px) {\n font-size: ","px;\n }\n"])),maxScreenSize.medium,fontSizeSmall);var templateObject_1$E;var ConfirmationBox=function ConfirmationBox(_a){var disabled=_a.disabled,checked=_a.checked,onChange=_a.onChange;var formatMessage=useIntl().formatMessage;return jsx$1(Host$g$1,{children:jsx$1(NeutralCheckBox,{disabled:disabled,checked:checked,onChange:function(_,value){return onChange(value);},label:formatMessage({id:checked?'NewsArticle.confirmed':'NewsArticle.confirm'})},void 0)},void 0);};var Host$g$1=_styled.div.withConfig({displayName:"ConfirmationBox__Host",componentId:"sc-1m5alil-0"})(templateObject_1$D||(templateObject_1$D=__makeTemplateObject(["\n .ms-Checkbox-text {\n font-weight: bold;\n color: black;\n }\n"],["\n .ms-Checkbox-text {\n font-weight: bold;\n color: black;\n }\n"])));var templateObject_1$D;var ConfirmationSection=function ConfirmationSection(_a){var item=_a.item,showDescription=_a.showDescription,readOnly=_a.readOnly,className=_a.className;var refreshStatistics=useNewsApi().refreshStatistics;var _b=useNotificationContext(),dismissToast=_b.dismissToast,showToast=_b.showToast,showError=_b.showError;var _c=useFeedbackApi(),getFeedback=_c.getFeedback,setFeedback=_c.setFeedback,unsetFeedback=_c.unsetFeedback;var _d=usePromise$2(function(){return getFeedback(ItemResourceTypes.News,item.id);}),summary=_d[0],isLoading=_d[1];var _e=useState$2(null),userChecked=_e[0],setChecked=_e[1];var toastHandle=useRef$1(null);var checked=userChecked!==null?userChecked:summary!=null&&!!summary.records.find(function(r){return r.type==='confirm';});return jsxs(Host$f$1,__assign({isLoading:isLoading,className:className},{children:[showDescription&&jsx$1(FormattedMessage$1,{id:"NewsArticle.confirmationRequiredDescription",tagName:"p"},void 0),jsx$1(StyledGutterMarkerIcon,__assign({iconName:"Completed",isActive:!isLoading&&!checked,color:"green"},{children:readOnly?jsx$1(ConfirmationBox,{checked:checked,disabled:true},void 0):jsx$1(ConfirmationBox,{checked:checked,disabled:checked,onChange:handleClickConfirm},void 0)}),void 0)]}),void 0);function handleClickConfirm(){return __awaiter(this,void 0,void 0,function(){var error_1;return __generator(this,function(_a){switch(_a.label){case 0:setChecked(true);_a.label=1;case 1:_a.trys.push([1,4,,5]);return [4/*yield*/,setFeedback(ItemResourceTypes.News,item.id,'confirm')];case 2:_a.sent();toastHandle.current=showToast('NewsArticle.confirmationSuccessToast',{},jsx$1(DefaultButton,__assign({onClick:handleUndo},{children:jsx$1(FormattedMessage$1,{id:"Generic.undo"},void 0)}),void 0),{autoClose:false});return [4/*yield*/,refreshStatistics(item.id,{confirmationCount:1})];case 3:_a.sent();return [3/*break*/,5];case 4:error_1=_a.sent();logger.error(error_1);showError('Generic.error');setChecked(false);return [3/*break*/,5];case 5:return [2/*return*/];}});});}function handleUndo(){return __awaiter(this,void 0,void 0,function(){var error_2;return __generator(this,function(_a){switch(_a.label){case 0:_a.trys.push([0,3,,4]);dismissToast(toastHandle.current);toastHandle.current=null;return [4/*yield*/,unsetFeedback(ItemResourceTypes.News,item.id,'confirm')];case 1:_a.sent();return [4/*yield*/,refreshStatistics(item.id,{confirmationCount:-1})];case 2:_a.sent();setChecked(false);return [3/*break*/,4];case 3:error_2=_a.sent();logger.error(error_2);showError('Generic.error');return [3/*break*/,4];case 4:return [2/*return*/];}});});}};var Host$f$1=_styled.div.withConfig({displayName:"ConfirmationSection__Host",componentId:"sc-1g2fxdb-0"})(templateObject_1$C||(templateObject_1$C=__makeTemplateObject(["\n width: 100%;\n\n opacity: ",";\n\n > p {\n margin: 0 0 5px ","px;\n font-style: italic;\n }\n\n @media (min-width: ","px) {\n > p {\n margin: 0 0 ","px 0;\n }\n }\n\n @media (max-width: ","px) {\n font-size: ","px;\n }\n"],["\n width: 100%;\n\n opacity: ",";\n\n > p {\n margin: 0 0 5px ","px;\n font-style: italic;\n }\n\n @media (min-width: ","px) {\n > p {\n margin: 0 0 ","px 0;\n }\n }\n\n @media (max-width: ","px) {\n font-size: ","px;\n }\n"])),function(_a){var isLoading=_a.isLoading;return isLoading?0.4:1;},spacingM,minScreenSize.small,spacingS,maxScreenSize.medium,fontSizeSmall);var StyledGutterMarkerIcon=_styled(GutterMarkerIcon).withConfig({displayName:"ConfirmationSection__StyledGutterMarkerIcon",componentId:"sc-1g2fxdb-1"})(templateObject_2$s||(templateObject_2$s=__makeTemplateObject(["\n @media (max-width: ","px) {\n margin: 0 ","px 0;\n }\n"],["\n @media (max-width: ","px) {\n margin: 0 ","px 0;\n }\n"])),maxScreenSize.small,spacingM);var templateObject_1$C,templateObject_2$s;var DetailViewConfirmations=function DetailViewConfirmations(){var features=useFeatures();var _a=useDetailViewContext(),item=_a.item,isEditorPreview=_a.isEditorPreview;var formatMessage=useIntl().formatMessage;if(!showConfirmationBox()){return null;}return jsx$1(ConfirmationHost,__assign({"aria-label":formatMessage({id:'NewsArticle.confirmation'})},{children:jsx$1(ConfirmationSection,{item:item,showDescription:true,readOnly:isEditorPreview},void 0)}),void 0);function showConfirmationBox(){return features.confirmation&&item.metadata&&item.metadata.feedbackSettings&&item.metadata.feedbackSettings.feedbackOptions.indexOf('confirm')>=0;}};var ConfirmationHost=_styled.section.withConfig({displayName:"DetailViewConfirmations__ConfirmationHost",componentId:"sc-f8jogv-0"})(templateObject_1$B||(templateObject_1$B=__makeTemplateObject(["\n margin-bottom: ","px;\n\n @media (min-width: ","px) {\n padding: 0 ","px 0 ","px;\n }\n"],["\n margin-bottom: ","px;\n\n @media (min-width: ","px) {\n padding: 0 ","px 0 ","px;\n }\n"])),spacingL,minScreenSize.small,spacingXl,spacingXl);var templateObject_1$B;var DetailViewPageViewTracker=function DetailViewPageViewTracker(){var _a=useDetailViewContext(),resourceType=_a.resourceType,itemId=_a.itemId;usePageViewTracker(resourceType,itemId);return null;};var FeedbackButtonBookmark=function FeedbackButtonBookmark(_a){var isReadOnly=_a.isReadOnly;var _b=useContext(FeedbackButtonContext),item=_b.item,bookmarkCount=_b.statistics.bookmarkCount;return jsxs(CountButtonHost,{children:[jsx$1(BookmarkButton,{item:item,isReadOnly:isReadOnly},void 0),jsx$1(CountLabel,__assign({isDisabled:isReadOnly},{children:bookmarkCount}),void 0)]},void 0);};var NewsDetailViewFeedbackSection=function NewsDetailViewFeedbackSection(_a){var _b;var hideLikes=_a.hideLikes,hideComments=_a.hideComments,hideProfileUrl=_a.hideProfileUrl,disableLoginForPublicUser=_a.disableLoginForPublicUser;var _c=useDetailViewContext(),item=_c.item,resourceType=_c.resourceType,contentLanguage=_c.contentLanguage,isEditorPreview=_c.isEditorPreview;return jsxs(StyledFeedbackSection,__assign({item:item,language:contentLanguage,type:resourceType,feedbackSettings:(_b=item.metadata)===null||_b===void 0?void 0:_b.feedbackSettings,hideComments:hideComments,hideProfileUrl:hideProfileUrl,disableLoginForPublicUser:disableLoginForPublicUser,isReadOnly:isEditorPreview},{children:[!hideLikes&&jsx$1(FeedbackButtonLike,{isReadOnly:isEditorPreview},void 0),jsx$1(FeedbackButtonBookmark,{isReadOnly:isEditorPreview},void 0),!hideComments&&jsx$1(FeedbackButtonComments,{},void 0),jsx$1(FeedbackButtonViews,{},void 0),jsx$1(FeedbackButtonShare,{isReadOnly:isEditorPreview},void 0),jsx$1(FeedbackButtonConfirmations,{},void 0)]}),void 0);};var StyledFeedbackSection=_styled(FeedbackSection).withConfig({displayName:"NewsDetailViewFeedbackSection__StyledFeedbackSection",componentId:"sc-pjpy6x-0"})(templateObject_1$A||(templateObject_1$A=__makeTemplateObject(["\n ","\n"],["\n ","\n"])),DetailViewSectionPadding);var templateObject_1$A;var DetailViewBodyExternalContent=function DetailViewBodyExternalContent(_a){var itemType=_a.itemType;var content=useDetailViewContext().content;var externalUrl=content&&content.externalUrl;return jsx$1(DetailBody,__assign({className:"lt-reach-detail-view-body"},{children:jsx$1(ItemBodyWrapper,{children:jsx$1(FormattedMessageWithStyle,{id:"ExternalLink."+itemType+".navigateTo",tagName:"p",values:{url:jsx$1(ExternalLink$2,__assign({href:externalUrl,className:"ms-fontColor-accent",target:"_blank",rel:"noopener noreferrer"},{children:externalUrl}),void 0)}},void 0)},void 0)}),void 0);};var DetailBody=_styled.div.withConfig({displayName:"DetailViewBodyExternalContent__DetailBody",componentId:"sc-1xjgw89-0"})(templateObject_1$z||(templateObject_1$z=__makeTemplateObject(["\n flex: 1 0 auto;\n box-sizing: border-box;\n min-width: 100%;\n width: 100px;\n margin-top: 35px;\n"],["\n flex: 1 0 auto;\n box-sizing: border-box;\n min-width: 100%;\n width: 100px;\n margin-top: 35px;\n"])));var templateObject_1$z;var DetailViewHeadline=function DetailViewHeadline(){var content=useDetailViewContext().content;var features=useFeatures();if(!features.contentHeadline||!content.headline){return null;}return jsx$1(Headline$1$1,__assign({"data-detail-view-headline":true},{children:content.headline}),void 0);};var Headline$1$1=_styled.p.withConfig({displayName:"DetailViewHeadline__Headline",componentId:"sc-wsid06-0"})(templateObject_1$y||(templateObject_1$y=__makeTemplateObject(["\n width: 100%;\n font-weight: bold;\n font-size: ","px;\n line-height: 26px;\n margin: 0;\n\n @media (min-width: ","px) {\n line-height: 22px;\n font-size: ","px;\n margin-bottom: ","px;\n }\n"],["\n width: 100%;\n font-weight: bold;\n font-size: ","px;\n line-height: 26px;\n margin: 0;\n\n @media (min-width: ","px) {\n line-height: 22px;\n font-size: ","px;\n margin-bottom: ","px;\n }\n"])),fontSizeNormal,minScreenSize.small,fontSizeMedium,spacingS);var templateObject_1$y;var StateIcon=function StateIcon(_a){var status=_a.status,isActive=_a.isActive,_b=_a.width,width=_b===void 0?16:_b,activeColor=_a.activeColor;var textColors=useContext(ThemeContext$1).theme.textColors;if(status===WorkflowStatus.draft){return jsx$1(Draft,{width:width,color:isActive?activeColor||textColors.onSecondary:textColors.default},void 0);}else if(status===WorkflowStatus.rejected){return jsx$1(Draft,{width:width,color:isActive?activeColor:'#b90000'},void 0);}else if(status===WorkflowStatus.ready){return jsx$1(Ready,{width:width,color:isActive?activeColor||textColors.onSecondary:textColors.default},void 0);}return null;};var Draft=function Draft(_a){var color=_a.color,className=_a.className,_b=_a.width,width=_b===void 0?16.25:_b;var ratio=20/16.25;return jsx$1("svg",__assign({className:className,version:"1.1",id:"Layer_1",x:"0px",y:"0px",width:width+"px",height:width*ratio+"px",viewBox:"0 0 16.25 20",enableBackground:"new 0 0 16.25 20"},{children:jsx$1("path",{fill:color,d:"M10,6.25V0h0.89l5.36,5.361V6.25H10z M11.25,5h2.861L11.25,2.139V5z M10,0H9.25v1.25H10V0z M7.675,1.25H6.1\n\tV0h1.575V1.25z M4.525,1.25H2.95V0h1.575V1.25z M1.25,17.057H0v-1.567h1.25V17.057z M1.25,13.921H0v-1.568h1.25V13.921z\n\t M1.25,10.784H0V9.216h1.25V10.784z M1.25,7.647H0V6.08h1.25V7.647z M1.25,4.512H0V2.943h1.25V4.512z M13.375,\n\t 20h-1.5v-1.25h1.5V20z\n\t M10.375,20h-1.5v-1.25h1.5V20z M7.375,20h-1.5v-1.25h1.5V20z M4.375,20h-1.5v-1.25h1.5V20z M16.25,\n\t 16.964H15v-1.661h1.25V16.964z\n\t M16.25,13.643H15v-1.661h1.25V13.643z M16.25,10.321H15V8.66h1.25V10.321z M16.25,6.25H15V7h1.25V6.25z\n\t M1.25,18.75H0V20h1.25\n\tV18.75z M1.25,0H0v1.25h1.25V0z M16.25,18.75H15V20h1.25V18.75z"},void 0)}),void 0);};var Ready=function Ready(_a){var color=_a.color,className=_a.className,_b=_a.width,width=_b===void 0?18.564:_b;var ratio=20/18.564;return jsx$1("svg",__assign({className:className,version:"1.1",id:"Layer_1",x:"0px",y:"0px",width:width+"px",height:width*ratio+"px",viewBox:"0 0 18.564 20",enableBackground:"new 0 0 18.564 20"},{children:jsx$1("path",{fill:color,d:"M10,6.25v-5H1.25v17.5H10V20H0V0h10.889l5.361,5.361V12.5L15,13.75v-7.5H10z M18.564,14.551L13.125,20\n \tl-2.627-2.637l0.879-0.879l1.748,1.738l4.561-4.551L18.564,14.551z M11.25,5h2.861L11.25,2.139V5z"},void 0)}),void 0);};function useCommonEditorApi(){var api=useApi();return useMemo(function(){return {list:list,getTaskViewCounts:getTaskViewCounts};function list(type,filter,token,sortDefinition){var params=Object.assign({},__assign(__assign(__assign({},filter),getCommaSeparatedChannelsString(filter===null||filter===void 0?void 0:filter.channels)),getCommaSeparatedKeywordsString(filter===null||filter===void 0?void 0:filter.keywords)),{token:token},sortDefinition);return api.custom("editor/"+type+"?"+queryString.stringify(params)).get().then(function(res){return res.body().data();});}function getTaskViewCounts(type,groupId){return __awaiter(this,void 0,void 0,function(){var response;return __generator(this,function(_a){switch(_a.label){case 0:return [4/*yield*/,api.custom("editor/"+type+"/taskcounts?"+queryString.stringify({groupId:groupId})).get(groupId)];case 1:response=_a.sent();return [4/*yield*/,response.body().data()];case 2:return [2/*return*/,_a.sent()];}});});}},[api]);}var KeywordPickerGroup=function KeywordPickerGroup(_a){var group=_a.group,keywords=_a.keywords,expanded=_a.expanded,selectedKeywords=_a.selectedKeywords,onChange=_a.onChange,mandatoryKeywordIds=_a.mandatoryKeywordIds;var _b=useState$2(null),isExpanded=_b[0],setIsExpanded=_b[1];var isSelected=!!selectedKeywords.find(function(k){return k.groupId===group.id;});var isCollapsed=!(isExpanded===true||expanded);return jsxs(Host$e$1,{children:[jsxs(GroupButton,__assign({onClick:toggle,iconProps:{iconName:isCollapsed?'CaretRightSolid8':'CaretDownSolid8'},"aria-expanded":!isCollapsed,"aria-controls":group.name+"-list"},{children:[isSelected&&jsx$1(CheckMarkIcon,{iconName:"CheckMark"},void 0),jsx$1(ButtonLabel,__assign({"data-keyword-group":group.name,isSelected:isSelected},{children:jsx$1(KeywordTitle,{groupName:group.name},void 0)}),void 0)]}),void 0),jsx$1(KeywordsList,__assign({id:group.name+"-list","data-keyword-picker-group-list":true,isCollapsed:isCollapsed},{children:keywords.map(function(k){var checked=isKeywordSelected(k);var disabled=isKeywordDisabled(k);return jsx$1(KeywordItem,__assign({"data-keyword":k.name,"data-is-checked":checked,"data-is-disabled":disabled},{children:jsx$1(Checkbox,{label:k.name,onRenderLabel:function(){return jsx$1(KeywordTitle,{groupName:group.name,keywordName:k.name},void 0);},checked:checked,onChange:function(_e,isChecked){return handleChange(isChecked,k);},disabled:disabled},k.id)}),k.name);})}),void 0)]},void 0);function toggle(){setIsExpanded(!isExpanded);}function isKeywordSelected(keyword){return !!selectedKeywords.find(function(k){return k.id===keyword.id;});}function isKeywordDisabled(keyword){return mandatoryKeywordIds===null||mandatoryKeywordIds===void 0?void 0:mandatoryKeywordIds.some(function(id){return id===keyword.id;});}function handleChange(add,keyword){if(onChange){var result=selectedKeywords.filter(function(k){return keyword.id!==k.id;});if(add){result.push(keyword);}onChange(result);}}};var Host$e$1=_styled.div.withConfig({displayName:"KeywordPickerGroup__Host",componentId:"sc-pu16jm-0"})(templateObject_1$x||(templateObject_1$x=__makeTemplateObject(["\n margin-bottom: ","px;\n"],["\n margin-bottom: ","px;\n"])),spacingS);var GroupButton=_styled(ActionButton).withConfig({displayName:"KeywordPickerGroup__GroupButton",componentId:"sc-pu16jm-1"})(templateObject_2$r||(templateObject_2$r=__makeTemplateObject(["\n && {\n height: auto;\n font-size: ","px;\n padding: 0;\n border: 0;\n\n i {\n font-size: ","px;\n\n &:first-child {\n margin: 0;\n }\n }\n }\n"],["\n && {\n height: auto;\n font-size: ","px;\n padding: 0;\n border: 0;\n\n i {\n font-size: ","px;\n\n &:first-child {\n margin: 0;\n }\n }\n }\n"])),fontSizeNormal,fontSizeSmall);var CheckMarkIcon=_styled(Icon).withConfig({displayName:"KeywordPickerGroup__CheckMarkIcon",componentId:"sc-pu16jm-2"})(templateObject_3$k||(templateObject_3$k=__makeTemplateObject(["\n margin-right: 6px;\n margin-left: 12px;\n width: 15px;\n"],["\n margin-right: 6px;\n margin-left: 12px;\n width: 15px;\n"])));var ButtonLabel=_styled.span.withConfig({displayName:"KeywordPickerGroup__ButtonLabel",componentId:"sc-pu16jm-3"})(templateObject_5$a||(templateObject_5$a=__makeTemplateObject(["\n display: inline-flex;\n flex: 1 0 auto;\n\n ","\n"],["\n display: inline-flex;\n flex: 1 0 auto;\n\n ","\n"])),function(p){return !p.isSelected&&css$2(templateObject_4$b$1||(templateObject_4$b$1=__makeTemplateObject(["\n margin-left: 33px; // checkmark icon space\n "],["\n margin-left: 33px; // checkmark icon space\n "])));});var KeywordsList=_styled.ul.withConfig({displayName:"KeywordPickerGroup__KeywordsList",componentId:"sc-pu16jm-4"})(templateObject_7$3$1||(templateObject_7$3$1=__makeTemplateObject(["\n ","\n padding: 0;\n margin: 0 0 0 ","px;\n list-style: none;\n"],["\n ","\n padding: 0;\n margin: 0 0 0 ","px;\n list-style: none;\n"])),function(p){return p.isCollapsed&&css$2(templateObject_6$4$1||(templateObject_6$4$1=__makeTemplateObject(["\n display: none;\n "],["\n display: none;\n "])));},spacingX+10);var KeywordItem=_styled.li.withConfig({displayName:"KeywordPickerGroup__KeywordItem",componentId:"sc-pu16jm-5"})(templateObject_8$3$1||(templateObject_8$3$1=__makeTemplateObject(["\n display: flex;\n align-items: center;\n margin-top: 9px;\n"],["\n display: flex;\n align-items: center;\n margin-top: 9px;\n"])));var templateObject_1$x,templateObject_2$r,templateObject_3$k,templateObject_4$b$1,templateObject_5$a,templateObject_6$4$1,templateObject_7$3$1,templateObject_8$3$1;var KeywordPicker=function KeywordPicker(_a){var _b;var value=_a.value,onChange=_a.onChange,showSelectionToggle=_a.showSelectionToggle,incomingAvailableKeywords=_a.availableKeywords,mandatoryKeywordIds=_a.mandatoryKeywordIds,className=_a.className;var formatMessage=useIntl().formatMessage;var user=useCurrentUser();var _c=useContext(LazySubscriptionContext),allKeywords=_c.allKeywords,selectedKeywordGroups=_c.selectedKeywordGroups;var _d=useState$2(null),searchedKeywords=_d[0],setSearchedKeywords=_d[1];var _e=useState$2(null),searchText=_e[0],setSearchText=_e[1];var selectedKeywords=getSelectedKeywords();var availableKeywords=incomingAvailableKeywords!==null&&incomingAvailableKeywords!==void 0?incomingAvailableKeywords:allKeywords;var visibleKeywords=(_b=searchedKeywords!==null&&searchedKeywords!==void 0?searchedKeywords:availableKeywords)!==null&&_b!==void 0?_b:[];var mandatoryKeywords=mandatoryKeywordIds?availableKeywords.filter(function(k){return mandatoryKeywordIds.includes(k.id);}):[];var noKeywordGroups=(selectedKeywordGroups===null||selectedKeywordGroups===void 0?void 0:selectedKeywordGroups.length)===0;var noAvailableKeywords=!noKeywordGroups&&(availableKeywords===null||availableKeywords===void 0?void 0:availableKeywords.length)===0;var isEmpty=visibleKeywords.length===0;return jsxs(Host$d$1,__assign({className:classNames('keyword-picker',className)},{children:[(noKeywordGroups||noAvailableKeywords)&&jsx$1("span",__assign({className:"keyword-picker-empty"},{children:jsx$1(FormattedMessage$1,{id:noKeywordGroups?'KeywordPicker.noGroupsDefined':'KeywordPicker.noAvailableKeywordsForGroup'},void 0)}),void 0),!noKeywordGroups&&!noAvailableKeywords&&jsxs("div",{children:[jsxs(SearchHost,__assign({className:"keyword-picker-search","data-keyword-picker-search":true},{children:[jsx$1(TextField,{onChange:handleSearch,value:searchText||'',placeholder:formatMessage({id:'KeywordPicker.search'})},void 0),searchText&&jsx$1(SearchCancelButton,{iconProps:{iconName:'Cancel'},onClick:function(){return handleSearch(null,null);},"aria-hidden":"true"},void 0)]}),void 0),showSelectionToggle&&jsx$1(StyledToggleAllButtons,{toggleAll:handleToggleAll},void 0),jsxs(KeywordPickerTree,__assign({className:"keyword-picker-tree"},{children:[isEmpty&&jsx$1(FormattedMessage$1,{id:"KeywordPicker.emptySearch"},void 0),!isEmpty&&selectedKeywordGroups&&selectedKeywordGroups.sort(function(a,b){return a.name.localeCompare(b.name);}).map(function(g){var keywords=visibleKeywords.filter(function(k){return k.groupId===g.id;});return keywords.length===0?null:jsx$1(KeywordPickerGroup,{expanded:!!searchText,group:g,keywords:keywords,selectedKeywords:selectedKeywords,onChange:onChange,mandatoryKeywordIds:mandatoryKeywordIds},g.id);})]}),void 0)]},void 0)]}),void 0);function getSelectedKeywords(){if(value==null||allKeywords==null){return [];}return value.map(function(k){return typeof k==='string'?allKeywords.find(function(a){return a.id===k;}):k;}).filter(function(k){return k;});}function handleSearch(_,text){var hasSearch=text&&text.length;var keywords=hasSearch?availableKeywords.filter(function(k){return getKeywordTitle(user,k.translations,k.name).toLocaleLowerCase().indexOf(text.toLocaleLowerCase())>=0;}):availableKeywords;setSearchedKeywords(keywords);setSearchText(hasSearch?text:null);}function handleToggleAll(checkAll){onChange(checkAll?availableKeywords:mandatoryKeywords);}};var KeywordPickerTree=_styled.div.withConfig({displayName:"KeywordPicker__KeywordPickerTree",componentId:"sc-1ejjfwa-0"})(templateObject_1$w||(templateObject_1$w=__makeTemplateObject(["\n padding-left: 4px;\n"],["\n padding-left: 4px;\n"])));var StyledToggleAllButtons=_styled(ToggleAllButtons).withConfig({displayName:"KeywordPicker__StyledToggleAllButtons",componentId:"sc-1ejjfwa-1"})(templateObject_2$q||(templateObject_2$q=__makeTemplateObject(["\n padding-left: 4px;\n"],["\n padding-left: 4px;\n"])));var Host$d$1=_styled.div.withConfig({displayName:"KeywordPicker__Host",componentId:"sc-1ejjfwa-2"})(templateObject_3$j||(templateObject_3$j=__makeTemplateObject(["\n overflow-x: hidden;\n overflow-y: auto;\n\n .ms-TextField-fieldGroup {\n background: none;\n }\n"],["\n overflow-x: hidden;\n overflow-y: auto;\n\n .ms-TextField-fieldGroup {\n background: none;\n }\n"])));var SearchHost=_styled.div.withConfig({displayName:"KeywordPicker__SearchHost",componentId:"sc-1ejjfwa-3"})(templateObject_4$a$1||(templateObject_4$a$1=__makeTemplateObject(["\n position: relative;\n margin-bottom: 8px;\n"],["\n position: relative;\n margin-bottom: 8px;\n"])));var SearchCancelButton=_styled(IconButton).withConfig({displayName:"KeywordPicker__SearchCancelButton",componentId:"sc-1ejjfwa-4"})(templateObject_5$9$1||(templateObject_5$9$1=__makeTemplateObject(["\n position: absolute;\n top: 0;\n right: 0;\n z-index: 10;\n\n &&&:focus::after {\n outline-offset: -2px;\n }\n"],["\n position: absolute;\n top: 0;\n right: 0;\n z-index: 10;\n\n &&&:focus::after {\n outline-offset: -2px;\n }\n"])));var templateObject_1$w,templateObject_2$q,templateObject_3$j,templateObject_4$a$1,templateObject_5$9$1;var $$2=_export;var requireObjectCoercible$1$1=requireObjectCoercible$c;var isRegExp=isRegexp;var getRegExpFlags=regexpFlags$1$1;var wellKnownSymbol$1=wellKnownSymbol$l;var REPLACE$2=wellKnownSymbol$1('replace');var RegExpPrototype$3=RegExp.prototype;// `String.prototype.replaceAll` method
|
|
131851
131851
|
// https://github.com/tc39/proposal-string-replace-all
|
|
131852
131852
|
$$2({target:'String',proto:true},{replaceAll:function replaceAll(searchValue,replaceValue){var O=requireObjectCoercible$1$1(this);var IS_REG_EXP,flags,replacer,string,searchString,template,result,position,index;if(searchValue!=null){IS_REG_EXP=isRegExp(searchValue);if(IS_REG_EXP){flags=String(requireObjectCoercible$1$1('flags'in RegExpPrototype$3?searchValue.flags:getRegExpFlags.call(searchValue)));if(!~flags.indexOf('g'))throw TypeError('`.replaceAll` does not allow non-global regexes');}replacer=searchValue[REPLACE$2];if(replacer!==undefined){return replacer.call(searchValue,O,replaceValue);}}string=String(O);searchString=String(searchValue);if(searchString==='')return replaceAll.call(string,/(?:)/g,replaceValue);template=string.split(searchString);if(typeof replaceValue!=='function'){return template.join(String(replaceValue));}result=template[0];position=result.length;for(index=1;index<template.length;index++){result+=String(replaceValue(searchString,position,string));position+=searchString.length+template[index].length;result+=template[index];}return result;}});_styled.div.withConfig({displayName:"Textarea__Host",componentId:"sc-170lrb4-0"})(templateObject_1$v||(templateObject_1$v=__makeTemplateObject(["\n display: flex;\n align-items: flex-end;\n position: relative;\n"],["\n display: flex;\n align-items: flex-end;\n position: relative;\n"])));_styled.textarea.withConfig({displayName:"Textarea__StyledTextarea",componentId:"sc-170lrb4-1"})(templateObject_2$p||(templateObject_2$p=__makeTemplateObject(["\n flex: 1 0 auto;\n justify-content: space-between;\n overflow: hidden;\n resize: none;\n min-height: 5px;\n\n ","\n"],["\n flex: 1 0 auto;\n justify-content: space-between;\n overflow: hidden;\n resize: none;\n min-height: 5px;\n\n ","\n"])),InputPlaceholder('font-style: italic'));_styled(IconButton$1).withConfig({displayName:"Textarea__StyledIconButton",componentId:"sc-170lrb4-2"})(templateObject_3$i||(templateObject_3$i=__makeTemplateObject(["\n position: absolute;\n bottom: 2px;\n right: 2px;\n"],["\n position: absolute;\n bottom: 2px;\n right: 2px;\n"])));var templateObject_1$v,templateObject_2$p,templateObject_3$i;var InsertFilesDialogHost=_styled.div.withConfig({displayName:"InsertFilesButton__InsertFilesDialogHost",componentId:"sc-1q7gx3n-0"})(templateObject_2$o||(templateObject_2$o=__makeTemplateObject(["\n ","\n\n position: relative;\n padding: ","px;\n text-align: center;\n\n > div {\n display: flex;\n align-items: center;\n justify-content: center;\n }\n"],["\n ","\n\n position: relative;\n padding: ","px;\n text-align: center;\n\n > div {\n display: flex;\n align-items: center;\n justify-content: center;\n }\n"])),function(p){return p.isActive&&css$2(templateObject_1$u||(templateObject_1$u=__makeTemplateObject(["\n &::after {\n content: '';\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n\n border: 2px black dashed;\n }\n "],["\n &::after {\n content: '';\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n\n border: 2px black dashed;\n }\n "])));},spacingM);_styled.p.withConfig({displayName:"InsertFilesButton__DragAndDropText",componentId:"sc-1q7gx3n-1"})(templateObject_3$h||(templateObject_3$h=__makeTemplateObject(["\n font-size: ","px;\n margin: ","px auto 0 auto;\n"],["\n font-size: ","px;\n margin: ","px auto 0 auto;\n"])),fontSizeSmall,spacingS);_styled(DefaultButton).withConfig({displayName:"InsertFilesButton__SelectFileButton",componentId:"sc-1q7gx3n-2"})(templateObject_4$9$1||(templateObject_4$9$1=__makeTemplateObject(["\n margin-top: ","px;\n\n span {\n font-weight: normal;\n }\n"],["\n margin-top: ","px;\n\n span {\n font-weight: normal;\n }\n"])),spacingM);_styled.div.withConfig({displayName:"InsertFilesButton__ButtonsContainer",componentId:"sc-1q7gx3n-3"})(templateObject_5$8$1||(templateObject_5$8$1=__makeTemplateObject(["\n display: flex;\n flex-direction: column;\n"],["\n display: flex;\n flex-direction: column;\n"])));var templateObject_1$u,templateObject_2$o,templateObject_3$h,templateObject_4$9$1,templateObject_5$8$1;_styled(InsertFilesDialogHost).withConfig({displayName:"InsertImagesButton__Host",componentId:"sc-63tjy6-0"})(templateObject_1$t$1||(templateObject_1$t$1=__makeTemplateObject(["\n cursor: pointer;\n"],["\n cursor: pointer;\n"])));_styled(PrimaryButton).withConfig({displayName:"InsertImagesButton__StyledButton",componentId:"sc-63tjy6-1"})(templateObject_2$n||(templateObject_2$n=__makeTemplateObject(["\n && {\n display: block;\n margin: 10px auto;\n background-color: transparent;\n color: inherit;\n font-size: large;\n line-height: 2em;\n border: none;\n\n &:hover {\n background-color: transparent;\n color: inherit;\n border: 0;\n }\n }\n"],["\n && {\n display: block;\n margin: 10px auto;\n background-color: transparent;\n color: inherit;\n font-size: large;\n line-height: 2em;\n border: none;\n\n &:hover {\n background-color: transparent;\n color: inherit;\n border: 0;\n }\n }\n"])));_styled.div.withConfig({displayName:"InsertImagesButton__Text",componentId:"sc-63tjy6-2"})(templateObject_3$g||(templateObject_3$g=__makeTemplateObject(["\n max-width: 100%;\n font-size: large;\n"],["\n max-width: 100%;\n font-size: large;\n"])));var templateObject_1$t$1,templateObject_2$n,templateObject_3$g;_styled.div.withConfig({displayName:"InsertVideoDialog__VideoHost",componentId:"sc-12gp7sa-0"})(templateObject_1$s$1||(templateObject_1$s$1=__makeTemplateObject(["\n width: 100%;\n margin-top: ","px;\n\n .video-view-container--youtube {\n &:after {\n padding-bottom: calc(9 / 16 * 100%);\n }\n }\n"],["\n width: 100%;\n margin-top: ","px;\n\n .video-view-container--youtube {\n &:after {\n padding-bottom: calc(9 / 16 * 100%);\n }\n }\n"])),spacingS);_styled(TextField).withConfig({displayName:"InsertVideoDialog__StyledTextField",componentId:"sc-12gp7sa-1"})(templateObject_2$m||(templateObject_2$m=__makeTemplateObject(["\n width: 510px;\n\n label {\n font-weight: normal;\n }\n"],["\n width: 510px;\n\n label {\n font-weight: normal;\n }\n"])));var templateObject_1$s$1,templateObject_2$m;var DateTimePicker=function DateTimePicker(props){var timeField=useRef$1();var formatMessage=useIntl().formatMessage;var _a=useState$2(getTime(props.date)),time=_a[0],setTime=_a[1];var _b=useState$2(false),timeHasFocus=_b[0],setTimeHasFocus=_b[1];var _c=useState$2(null),timeErrorMessageResourceKey=_c[0],setTimeErrorMessageResourceKey=_c[1];var momentMonths=['January','February','March','April','May','June','July','August','September','October','November','December'];var momentWeekdays=['Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday'];useEffect$1(function(){// do not update if the user is typing time
|
|
131853
131853
|
if(!timeHasFocus){// We might not know that the time field has the focus after an onBlur from the date field.
|
|
@@ -131875,13 +131875,13 @@ if(typeof C=='function'&&(C===Array||isArray(C.prototype)))C=undefined;else if(i
|
|
|
131875
131875
|
// https://github.com/tc39/proposal-flatMap
|
|
131876
131876
|
$$h({target:'Array',proto:true},{flatMap:function flatMap(callbackfn/* , thisArg */){var O=toObject(this);var sourceLen=toLength$c(O.length);var A;aFunction(callbackfn);A=arraySpeciesCreate(O,0);A.length=flattenIntoArray(A,O,O,sourceLen,0,1,callbackfn,arguments.length>1?arguments[1]:undefined);return A;}});// this method was added to unscopables after implementation
|
|
131877
131877
|
// in popular engines, so it's moved to a separate module
|
|
131878
|
-
var addToUnscopables=addToUnscopables$2;addToUnscopables('flatMap');var StreamItemTypes;(function(StreamItemTypes){StreamItemTypes["Post"]="POST";StreamItemTypes["News"]="NEWS";StreamItemTypes["Event"]="EVENT";StreamItemTypes["Page"]="PAGE";})(StreamItemTypes||(StreamItemTypes={}));var StreamConversationScope;(function(StreamConversationScope){StreamConversationScope["Public"]="PUBLIC";StreamConversationScope["Editor"]="EDITOR";StreamConversationScope["Posts"]="POSTS";})(StreamConversationScope||(StreamConversationScope={}));var StreamKnownNewsState;(function(StreamKnownNewsState){StreamKnownNewsState["Unconfirmed"]="UNCONFIRMED";StreamKnownNewsState["Alert"]="ALERT";})(StreamKnownNewsState||(StreamKnownNewsState={}));function isPost(item){return item.type===StreamItemTypes.Post;}function isNews(item){return item.type===StreamItemTypes.News;}function isEvent(item){return item.type===StreamItemTypes.Event;}function isPage(item){return item.type===StreamItemTypes.Page;}function convertProperties(items,user,subscriptionChannels){return items.map(function(i){var _a,_b,_c;var mappedItem=__assign(__assign({},i),{keywords:getGroupedKeywords(i.keywordsList)});if(isPost(i)){return __assign(__assign({},mappedItem),{groupId:i.groupIds[0],attachments:(_a=i.postAttachments)===null||_a===void 0?void 0:_a.map(function(i){return __assign(__assign({},i),{type:getAttachmentType(i.type)});}),comments:__assign(__assign({},i.postComments),{items:(_b=i.postComments)===null||_b===void 0?void 0:_b.items.map(function(c){var _a;return __assign(__assign({},c),{conversationScope:getConversationScope(c.streamConversationScope),fileAccessToken:i.fileAccessToken,attachments:(_a=c.postCommentAttachments)===null||_a===void 0?void 0:_a.map(function(a){return __assign(__assign({},a),{type:getAttachmentType(a.type)});})});})})});}return __assign(__assign(__assign(__assign({},mappedItem),{userResponse:isEvent(i)?i.userResponseType&&getEventResponse(i.userResponseType):null,channels:(i.channelsList||[]).map(function(c){return {name:getChannelDisplayName(subscriptionChannels,c,user,getPreferredContentLanguage(user))};}),contents:i.contentsList.reduce(function(a,b){var _a;return __assign(__assign({},a),(_a={},_a[b.language]=b,_a));},{}),bannerInfo:i.bannerInfo&&__assign(__assign({},i.bannerInfo),{videoSource:convertStringToVideoSource((_c=i.bannerInfo)===null||_c===void 0?void 0:_c.videoSource)})}),getPageInfos(i)),getKnownNewsState(i));});}function getKnownNewsState(item){var _a,_b;if(!isNews(item)){return {};}var state=KnownNewsState.None;if((_a=item.knownNewsState)===null||_a===void 0?void 0:_a.includes(StreamKnownNewsState.Alert)){state|=KnownNewsState.Alert;}if((_b=item.knownNewsState)===null||_b===void 0?void 0:_b.includes(StreamKnownNewsState.Unconfirmed)){state|=KnownNewsState.Unconfirmed;}return {knownState:state};}function getPageInfos(item){if(!isPage(item)){return {};}return {pageType:getPageType(item.streamPageType),navigationContext:unflattenNavigationContext(item)};}function unflattenNavigationContext(item){var itemNavigationContext;var currentNavigationContext;var parentId=item.parentId;while(parentId!=null){var parent_1=item.path.find(function(c){return c.id===parentId;});if(!itemNavigationContext){itemNavigationContext={parent:parent_1};}else {currentNavigationContext.parent=parent_1;}parentId=parent_1.parentId;currentNavigationContext=parent_1;}return itemNavigationContext||{};}function getAttachmentType(source){switch(source){case GraphQLAttachmentType.News:return AttachmentType.News;case GraphQLAttachmentType.Event:return AttachmentType.Event;case GraphQLAttachmentType.Page:return AttachmentType.Page;case GraphQLAttachmentType.Post:return AttachmentType.Post;case GraphQLAttachmentType.Image:return AttachmentType.Image;case GraphQLAttachmentType.File:return AttachmentType.File;case GraphQLAttachmentType.VimeoVideo:return AttachmentType.VimeoVideo;case GraphQLAttachmentType.YouTubeVideo:return AttachmentType.YouTubeVideo;case GraphQLAttachmentType.Giphy:return AttachmentType.Giphy;default:return null;}}function getConversationScope(streamScope){switch(streamScope){case StreamConversationScope.Public:return ConversationScope.Public;case StreamConversationScope.Editor:return ConversationScope.Editor;case StreamConversationScope.Posts:return ConversationScope.Posts;default:return null;}}function getPageType(pageType){return pageType==='PAGE'?PageType.Page:PageType.Document;}function getEventResponse(source){switch(source){case StreamEventResponse.NotSet:return EventResponse.NotSet;case StreamEventResponse.Registered:return EventResponse.Registered;case StreamEventResponse.Declined:return EventResponse.Declined;default:return null;}}var StreamEventResponse;(function(StreamEventResponse){StreamEventResponse["NotSet"]="NOTSET";StreamEventResponse["Registered"]="REGISTERED";StreamEventResponse["Declined"]="DECLINED";})(StreamEventResponse||(StreamEventResponse={}));var CHANNELS_CONDITION=function CHANNELS_CONDITION(channels,allChannels,operator){var _a;if(operator===void 0){operator=LogicalOperator.Or;}if(!channels||!channels.length){return '';}var filterChannels=(_a=channels===null||channels===void 0?void 0:channels.map(function(c){var _a;return (_a=allChannels===null||allChannels===void 0?void 0:allChannels.find(function(uc){return uc.name===c;}))===null||_a===void 0?void 0:_a.id;}))===null||_a===void 0?void 0:_a.map(function(c){return "\""+c+"\"";});if(!filterChannels){return '';}if(operator===LogicalOperator.And){var channelConditions=filterChannels.map(function(c){return "{ channels: { some: { eq: "+c+" } } }";});return "and: [\n "+channelConditions.join()+"\n ]";}return "channels: { some: { in: ["+filterChannels+"] } }";};var KEYWORDS_OR_CONDITION=function KEYWORDS_OR_CONDITION(keywords){if(!keywords||!keywords.length){return '';}return "keywordIds: { some: { in: ["+(keywords===null||keywords===void 0?void 0:keywords.map(function(k){return "\""+k+"\"";}))+"] } }";};var OWNER_CONDITION=function OWNER_CONDITION(owner){if(!owner){return '';}return "or: [\n { author: { userPrincipalName: { eq: \""+owner+"\" } } }\n { owner: { userPrincipalName: { eq: \""+owner+"\" } } }\n { onBehalfOf: { userPrincipalName: { eq: \""+owner+"\" } } }\n ]";};var PUBLISHING_DATE_CONDITION=function PUBLISHING_DATE_CONDITION(beforeDate,afterDate){if(!beforeDate&&!afterDate){return '';}if(beforeDate&&afterDate){return "and: [\n { publishingDate: { gt: \""+afterDate+"\" } }\n { publishingDate: { lt: \""+beforeDate+"\" } }\n ]";}return afterDate?"publishingDate: { gt: \""+afterDate+"\" }":"publishingDate: { lt: \""+beforeDate+"\" }";};var AUTHORS_CONDITION=function AUTHORS_CONDITION(authors){if(!authors||!authors.length){return '';}return "or: [\n { owner: { userPrincipalName: { in: ["+(authors===null||authors===void 0?void 0:authors.map(function(a){return "\""+a+"\"";}))+"] } } }\n { onBehalfOf: { userPrincipalName: { in: ["+(authors===null||authors===void 0?void 0:authors.map(function(a){return "\""+a+"\"";}))+"] } } }\n ]";};gql(templateObject_2$5$1||(templateObject_2$5$1=__makeTemplateObject(["\n mutation MarkStreamAsRead {\n markStreamAsRead\n }\n"],["\n mutation MarkStreamAsRead {\n markStreamAsRead\n }\n"])));gql(templateObject_3$2$1||(templateObject_3$2$1=__makeTemplateObject(["\n mutation MarkItemsAsRead($itemIds: [String]) {\n markItemsAsRead(itemIds: $itemIds)\n }\n"],["\n mutation MarkItemsAsRead($itemIds: [String]) {\n markItemsAsRead(itemIds: $itemIds)\n }\n"])));var templateObject_2$5$1,templateObject_3$2$1;var EditorListItem=function EditorListItem(props){var user=useCurrentUser();var formatMessage=useIntl().formatMessage;var itemDomRef=useRef$1();var webAppUrl=useConfiguration().webAppUrl;if(props.language==null){return null;}var item=props.item;var className=classNames(props.className,'editor-list-item',{'editor-list-item-rejected ms-borderColor-red':item.status===WorkflowStatus.rejected&&isCurrentUserItemOwner()},{'editor-list-item-selected ms-fontColor-onSecondary ms-bgColor-themeSecondary':props.isSelected},{'ms-bgColor-white':!props.isSelected},{'editor-list-item--highlighted':props.highlighted});return jsxs(ListItem,__assign({className:className,"data-item-is-published":props.isPublishedItem,"data-is-focusable":true,"data-item-is-selected":props.isSelected,"data-item-id":item.id,ref:itemDomRef},{children:[props.useExternalLink?jsx$1(ExternalLink,__assign({href:""+webAppUrl+props.basePath+"/"+item.id+"/"+props.language,className:"editor-list-content",target:"_blank",rel:"noopener noreferrer",onClick:function(e){var _a;return (_a=props.onClick)===null||_a===void 0?void 0:_a.call(props,e,itemDomRef.current,item,getTitle());}},{children:props.onRenderContent(item,getTitle(),props.isSelected)}),void 0):jsx$1(Content$9,__assign({to:props.basePath+"/"+item.id+"/"+props.language,onClick:function(e){var _a;return (_a=props.onClick)===null||_a===void 0?void 0:_a.call(props,e,itemDomRef.current,item,getTitle());},className:"editor-list-content"},{children:props.onRenderContent(item,getTitle(),props.isSelected)}),void 0),jsxs(Options,{children:[props.allowSelection&&jsx$1(SelectedIconOption,{children:jsx$1(SelectedIcon,{"data-item-select":true,iconProps:{iconName:'CompletedSolid'},ariaLabel:formatMessage({id:'AriaLabel.editor.selectItemButton'}),onClick:toggleSelect,isTouch:env.isTouchDevice,isSelected:props.isSelected,className:classNames('ms-fontColor-neutralTertiary',{'ms-fontColor-themeDarkAlt':props.isSelected})},void 0)},void 0),jsx$1(StatusOption,{status:item.status,isActive:props.isSelected},void 0),jsx$1(Option,__assign({className:"editor-list-persona"},{children:item.owner&&jsx$1(Avatar,{upn:item.owner.userPrincipalName,size:PersonaSize.size48,text:props.item.owner.displayName,hidePersonaDetails:true},void 0)}),void 0)]},void 0)]}),void 0);function isCurrentUserItemOwner(){return props.item.owner&&props.item.owner.userPrincipalName===user.userPrincipalName;}function getTitle(){var title=props.item.contents[props.language].title;return title==null||title.trim().length===0?"<"+formatMessage({id:'Generic.noTitle'})+">":title;}function toggleSelect(){props.onSelect(props.item,!props.isSelected);}};var EditorItemTitle=_styled.h2.withConfig({displayName:"EditorListItem__EditorItemTitle",componentId:"sc-zoqzrc-0"})(templateObject_1$6$1||(templateObject_1$6$1=__makeTemplateObject(["\n && {\n font-weight: 600;\n margin: 0;\n font-size: 17px;\n text-overflow: ellipsis;\n white-space: nowrap;\n overflow: hidden;\n @media (max-width: 700px) {\n font-size: 15px;\n }\n }\n"],["\n && {\n font-weight: 600;\n margin: 0;\n font-size: 17px;\n text-overflow: ellipsis;\n white-space: nowrap;\n overflow: hidden;\n @media (max-width: 700px) {\n font-size: 15px;\n }\n }\n"])));var SelectedIcon=_styled(IconButton$1).withConfig({displayName:"EditorListItem__SelectedIcon",componentId:"sc-zoqzrc-1"})(templateObject_2$4$1||(templateObject_2$4$1=__makeTemplateObject(["\n padding: 0;\n height: 100%;\n width: auto;\n font-size: inherit;\n\n opacity: ",";\n\n &:focus {\n opacity: 1;\n }\n\n i {\n font-size: inherit;\n line-height: unset;\n height: auto;\n width: auto;\n padding: 0 19px 0 10px;\n }\n"],["\n padding: 0;\n height: 100%;\n width: auto;\n font-size: inherit;\n\n opacity: ",";\n\n &:focus {\n opacity: 1;\n }\n\n i {\n font-size: inherit;\n line-height: unset;\n height: auto;\n width: auto;\n padding: 0 19px 0 10px;\n }\n"])),function(p){return p.isSelected?1:p.isTouch?0.1:0;});var ListItem=_styled.div.withConfig({displayName:"EditorListItem__ListItem",componentId:"sc-zoqzrc-2"})(templateObject_3$1$1||(templateObject_3$1$1=__makeTemplateObject(["\n position: relative;\n font-family: 'Roboto', sans-serif;\n text-decoration: none;\n ",";\n\n display: flex;\n flex-flow: row nowrap;\n text-align: left;\n\n a,\n a:hover,\n a:active,\n a:visited {\n color: ",";\n text-decoration: none;\n }\n\n &.editor-list-item-rejected {\n border-left-width: 10px;\n border-style: solid;\n border-top: 0;\n border-bottom: 0;\n border-right: 0;\n > .editor-list-content {\n margin-left: 6px;\n }\n }\n\n &:hover {\n "," {\n opacity: 1;\n }\n }\n"],["\n position: relative;\n font-family: 'Roboto', sans-serif;\n text-decoration: none;\n ",";\n\n display: flex;\n flex-flow: row nowrap;\n text-align: left;\n\n a,\n a:hover,\n a:active,\n a:visited {\n color: ",";\n text-decoration: none;\n }\n\n &.editor-list-item-rejected {\n border-left-width: 10px;\n border-style: solid;\n border-top: 0;\n border-bottom: 0;\n border-right: 0;\n > .editor-list-content {\n margin-left: 6px;\n }\n }\n\n &:hover {\n "," {\n opacity: 1;\n }\n }\n"])),CardBorderInline(2,2),function(p){return p.theme.textColors.default;},SelectedIcon);var Options=_styled.div.withConfig({displayName:"EditorListItem__Options",componentId:"sc-zoqzrc-3"})(templateObject_4$1$1||(templateObject_4$1$1=__makeTemplateObject(["\n flex: 0 1 auto;\n display: flex;\n flex-flow: row nowrap;\n padding-right: 15px;\n\n @media (max-width: 700px) {\n padding-right: 6px;\n }\n"],["\n flex: 0 1 auto;\n display: flex;\n flex-flow: row nowrap;\n padding-right: 15px;\n\n @media (max-width: 700px) {\n padding-right: 6px;\n }\n"])));var Option=_styled.div.withConfig({displayName:"EditorListItem__Option",componentId:"sc-zoqzrc-4"})(templateObject_5$1$1||(templateObject_5$1$1=__makeTemplateObject(["\n padding: 6px 25px 6px 6px;\n font-size: 24px;\n text-align: center;\n display: flex;\n flex-flow: row nowrap;\n align-items: center;\n justify-content: center;\n\n flex: 0 1 auto;\n\n &.editor-list-persona {\n width: 32px;\n }\n > div {\n height: 24px;\n }\n\n @media (max-width: 700px) {\n padding: 5px;\n i {\n font-size: 0.9em !important;\n padding: 0;\n }\n }\n"],["\n padding: 6px 25px 6px 6px;\n font-size: 24px;\n text-align: center;\n display: flex;\n flex-flow: row nowrap;\n align-items: center;\n justify-content: center;\n\n flex: 0 1 auto;\n\n &.editor-list-persona {\n width: 32px;\n }\n > div {\n height: 24px;\n }\n\n @media (max-width: 700px) {\n padding: 5px;\n i {\n font-size: 0.9em !important;\n padding: 0;\n }\n }\n"])));var SelectedIconOption=_styled(Option).withConfig({displayName:"EditorListItem__SelectedIconOption",componentId:"sc-zoqzrc-5"})(templateObject_6$s||(templateObject_6$s=__makeTemplateObject(["\n padding: 6px;\n"],["\n padding: 6px;\n"])));var LinkStyle=css$2(templateObject_7$m||(templateObject_7$m=__makeTemplateObject(["\n padding: ","px;\n flex: 1 0 auto;\n /* todo: This smells, but it's required to make the ellipsis work. How to avoid it?*/\n width: 100px;\n margin: ","px ","px ","px ","px;\n\n @media (max-width: 700px) {\n margin: ","px;\n }\n"],["\n padding: ","px;\n flex: 1 0 auto;\n /* todo: This smells, but it's required to make the ellipsis work. How to avoid it?*/\n width: 100px;\n margin: ","px ","px ","px ","px;\n\n @media (max-width: 700px) {\n margin: ","px;\n }\n"])),spacingXs,spacingS,spacingS,spacingS,spacingS+6,spacingXs);var Content$9=_styled(Link$4).withConfig({displayName:"EditorListItem__Content",componentId:"sc-zoqzrc-6"})(templateObject_8$k||(templateObject_8$k=__makeTemplateObject(["\n ",";\n"],["\n ",";\n"])),LinkStyle);var ExternalLink=_styled.a.withConfig({displayName:"EditorListItem__ExternalLink",componentId:"sc-zoqzrc-7"})(templateObject_9$f||(templateObject_9$f=__makeTemplateObject(["\n ",";\n"],["\n ",";\n"])),LinkStyle);var StatusOption=function StatusOption(_a){var _b=_a.status,status=_b===void 0?WorkflowStatus.draft:_b,isActive=_a.isActive;if(status===WorkflowStatus.deleted){return null;}return jsx$1(Option,{children:status===WorkflowStatus.approved?jsx$1("img",{style:{width:'20px'},alt:""},void 0):jsx$1(Tooltip,__assign({resourceKey:'EditorList.'+status||WorkflowStatus.draft},{children:jsx$1(StateIcon,{status:status||WorkflowStatus.draft,width:20,isActive:isActive},void 0)}),void 0)},void 0);};var templateObject_1$6$1,templateObject_2$4$1,templateObject_3$1$1,templateObject_4$1$1,templateObject_5$1$1,templateObject_6$s,templateObject_7$m,templateObject_8$k,templateObject_9$f;var NewsEditorItem=function NewsEditorItem(_a){var title=_a.title,item=_a.item,isSelected=_a.isSelected;return jsxs(Fragment,{children:[jsx$1(EditorItemTitle,__assign({className:classNames({'ms-fontColor-onSecondary':isSelected})},{children:title}),void 0),jsx$1(DateInfo,__assign({className:classNames('ms-fontSize-m',{'ms-fontColor-onSecondary':isSelected})},{children:jsx$1(MetaInfo$1,{dateMode:DateMode.Published,item:item,expiryDate:item.expiryDate,channels:item.channels,readOnly:true,showChannels:true,hideAvatar:true,hideDisplayName:true},void 0)}),void 0)]},void 0);};var MetaInfo$1=_styled(ItemMetaInfo).withConfig({displayName:"NewsEditorItem__MetaInfo",componentId:"sc-1kz3wt0-0"})(templateObject_1$5$1||(templateObject_1$5$1=__makeTemplateObject(["\n [data-meta-info-details] {\n padding-left: 0;\n }\n"],["\n [data-meta-info-details] {\n padding-left: 0;\n }\n"])));var DateInfo=_styled.div.withConfig({displayName:"NewsEditorItem__DateInfo",componentId:"sc-1kz3wt0-1"})(templateObject_2$3$1||(templateObject_2$3$1=__makeTemplateObject(["\n padding-top: 8px;\n @media (max-width: 700px) {\n font-size: 12px;\n }\n"],["\n padding-top: 8px;\n @media (max-width: 700px) {\n font-size: 12px;\n }\n"])));var templateObject_1$5$1,templateObject_2$3$1;var EventDates=_styled.div.withConfig({displayName:"EventEditorItem__EventDates",componentId:"sc-1irp2hc-0"})(templateObject_1$4$1||(templateObject_1$4$1=__makeTemplateObject(["\n margin-top: ","px;\n font-size: ","px;\n\n display: flex;\n flex-direction: column;\n"],["\n margin-top: ","px;\n font-size: ","px;\n\n display: flex;\n flex-direction: column;\n"])),spacingS,fontSizeSmall);_styled.div.withConfig({displayName:"EventEditorItem__EmptyEventDates",componentId:"sc-1irp2hc-1"})(templateObject_2$2$1||(templateObject_2$2$1=__makeTemplateObject(["\n font-style: italic;\n"],["\n font-style: italic;\n"])));_styled.div.withConfig({displayName:"EventEditorItem__EventDateAndRecurrenceInfo",componentId:"sc-1irp2hc-2"})(templateObject_3$13||(templateObject_3$13=__makeTemplateObject(["\n display: flex;\n align-items: center;\n"],["\n display: flex;\n align-items: center;\n"])));_styled(EventRecurrenceSeriesInfo).withConfig({displayName:"EventEditorItem__RecurrenceSeriesInfo",componentId:"sc-1irp2hc-3"})(templateObject_4$K||(templateObject_4$K=__makeTemplateObject(["\n margin-top: ","px;\n"],["\n margin-top: ","px;\n"])),spacingS);_styled(EventDates).withConfig({displayName:"EventEditorItem__DatesInfo",componentId:"sc-1irp2hc-4"})(templateObject_5$D||(templateObject_5$D=__makeTemplateObject(["\n margin-right: ","px;\n"],["\n margin-right: ","px;\n"])),spacingM);var templateObject_1$4$1,templateObject_2$2$1,templateObject_3$13,templateObject_4$K,templateObject_5$D;var CreateNewItemButton=function CreateNewItemButton(_a){var type=_a.type,groupId=_a.groupId,onClick=_a.onClick,className=_a.className;var baseRoute=useBaseRoute();var history=useHistory();var buildPath=useSubscriptionHandlePathBuilder().buildPath;var intl=useIntl();var user=useCurrentUser();var hasSelectedGroup=!!groupId;var groups=getGroupItems();if(hasSelectedGroup||groups.length===1){return jsx$1(StyledPrimaryButton,__assign({iconProps:{iconName:'AddTo'},onClick:function(){return handleOnClick(hasSelectedGroup?undefined:groups[0].key);},className:className,"data-button-create":type},{children:jsx$1(FormattedMessage$1,{id:"EditorList."+type+"CreateButton"},void 0)}),void 0);}if(!groups.length){return null;}return jsx$1(MenuButton,__assign({iconProps:{iconName:'AddTo'},menuProps:{items:groups,calloutProps:{calloutMaxWidth:300},className:'lt-reach-callout'},className:className,"data-button-create":type},{children:jsx$1(FormattedMessage$1,{id:"EditorList."+type+"CreateButton"},void 0)}),void 0);function getGroupItems(){return getGroupsWithExplicitMinRole(GroupRoles.Author,user).map(function(g){return {key:g.id,onClick:function(){return handleOnClick(g.id);},text:getGroupName(g,user,intl)};});}function openEditor(id){history.push(buildPath("/editor/"+type+"/groups/"+id+"/new"));}function handleOnClick(id){if(onClick){onClick(groupId||id);}else {hasSelectedGroup?history.push(baseRoute+"/new"):openEditor(id);}}};var MenuButton=_styled(CommandBarButton).withConfig({displayName:"CreateNewItemButton__MenuButton",componentId:"sc-18o74g9-0"})(templateObject_1$3$1||(templateObject_1$3$1=__makeTemplateObject(["\n && {\n background-color: ",";\n &:hover {\n background-color: ",";\n i,\n span {\n color: ",";\n background-color: transparent;\n }\n }\n\n // the ms-fontColor on the button is not applied on the icons\n i,\n span {\n color: ",";\n }\n }\n\n height: 32px;\n padding: 0 ","px;\n\n i:first-child {\n margin: 0 ","px 0 0;\n }\n\n span {\n white-space: pre;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n"],["\n && {\n background-color: ",";\n &:hover {\n background-color: ",";\n i,\n span {\n color: ",";\n background-color: transparent;\n }\n }\n\n // the ms-fontColor on the button is not applied on the icons\n i,\n span {\n color: ",";\n }\n }\n\n height: 32px;\n padding: 0 ","px;\n\n i:first-child {\n margin: 0 ","px 0 0;\n }\n\n span {\n white-space: pre;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n"])),function(p){return p.theme.semanticColors.primaryButtonBackground;},function(p){return p.theme.semanticColors.primaryButtonBackgroundHovered;},function(p){return p.theme.semanticColors.primaryButtonTextHovered;},function(p){return p.theme.semanticColors.primaryButtonText;},spacingS,spacingS);var StyledPrimaryButton=_styled(PrimaryButton).withConfig({displayName:"CreateNewItemButton__StyledPrimaryButton",componentId:"sc-18o74g9-1"})(templateObject_2$1$1||(templateObject_2$1$1=__makeTemplateObject(["\n padding: 0 ","px;\n\n i {\n margin: 0 ","px 0 0;\n }\n\n span {\n white-space: pre;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n"],["\n padding: 0 ","px;\n\n i {\n margin: 0 ","px 0 0;\n }\n\n span {\n white-space: pre;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n"])),spacingS,spacingS);var templateObject_1$3$1,templateObject_2$1$1;function useEditorApi(){var api=useApi();var fetchFromApi=useApiFactory().fetchFromApi;var sendBeacon=useBeaconHandler();var onRequestToken=useContext(AuthenticationContext).onRequestToken;return useMemo(function(){return {cloneItem:cloneItem,getDeletedItems:getDeletedItems,getVersion:getVersion,getVersions:getVersions,deleteDraft:deleteDraft,deleteRange:deleteRange,deletePermanently:deletePermanently,bulkSetStatus:bulkSetStatus,setStatus:setStatus,removeLease:removeLease,keepLeaseAlive:keepLeaseAlive,saveItem:saveItem,updateGroups:updateGroups,translateContent:translateContent};function translateContent(itemId,translateFrom,translateTo){return api.all("editor/news/"+itemId+"/contents/"+translateFrom+"/translations?"+queryString.stringify({languages:translateTo})).getAll().then(function(response){return response.body(false);});}function updateGroups(itemType,itemId,groupIds){return api.custom("editor/"+itemType+"/"+itemId+"/groups").put(groupIds).then(function(response){return response.body().data();});}function cloneItem(itemType,itemId){return api.all("editor/"+itemType+"?"+queryString.stringify({cloneFromItem:itemId})).post({}).then(function(response){return response.body().data();});}function getDeletedItems(type,filter,token){var _a;var params=Object.assign({},__assign(__assign(__assign({},filter),getCommaSeparatedChannelsString((_a=filter===null||filter===void 0?void 0:filter.channels)===null||_a===void 0?void 0:_a.items)),getCommaSeparatedKeywordsString(filter===null||filter===void 0?void 0:filter.keywords)),{token:token,pageSize:30});return api.all("editor/"+type+"/recyclebin").get('',params).then(function(res){return res.body().data();});}function getVersions(type,itemId){return from(api.all("editor/"+type+"/"+itemId+"/versions").getAll()).pipe(map(function(response){return response.body().map(function(group){return group.data();});}));}function getVersion(type,itemId,versionId){return api.all("editor/"+type+"/"+itemId+"/versions").get(versionId).then(function(response){return response.body().data();});}function deleteDraft(leaseId,itemId,type){var url="editor/"+type+"/"+itemId+"/draft";if(leaseId){url+="?leaseId="+leaseId;}return api.custom(url).delete();}function deleteRange(type,ids){var data=ids.map(function(id){return {id:id,status:WorkflowStatus.deleted};});return api.custom("editor/"+type).patch(data).then(function(response){return response.body().map(function(item){return item.data();});}).catch(function(){// set null as a result in case of error
|
|
131878
|
+
var addToUnscopables=addToUnscopables$2;addToUnscopables('flatMap');var StreamItemTypes;(function(StreamItemTypes){StreamItemTypes["Post"]="POST";StreamItemTypes["News"]="NEWS";StreamItemTypes["Event"]="EVENT";StreamItemTypes["Page"]="PAGE";})(StreamItemTypes||(StreamItemTypes={}));var StreamConversationScope;(function(StreamConversationScope){StreamConversationScope["Public"]="PUBLIC";StreamConversationScope["Editor"]="EDITOR";StreamConversationScope["Posts"]="POSTS";})(StreamConversationScope||(StreamConversationScope={}));var StreamKnownNewsState;(function(StreamKnownNewsState){StreamKnownNewsState["Unconfirmed"]="UNCONFIRMED";StreamKnownNewsState["Alert"]="ALERT";})(StreamKnownNewsState||(StreamKnownNewsState={}));function isPost(item){return item.type===StreamItemTypes.Post;}function isNews(item){return item.type===StreamItemTypes.News;}function isEvent(item){return item.type===StreamItemTypes.Event;}function isPage(item){return item.type===StreamItemTypes.Page;}function convertProperties(items,user,subscriptionChannels){return items.map(function(i){var _a,_b,_c;var mappedItem=__assign(__assign({},i),{keywords:getGroupedKeywords(i.keywordsList)});if(isPost(i)){return __assign(__assign({},mappedItem),{groupId:i.groupIds[0],attachments:(_a=i.postAttachments)===null||_a===void 0?void 0:_a.map(function(i){return __assign(__assign({},i),{type:getAttachmentType(i.type)});}),comments:__assign(__assign({},i.postComments),{items:(_b=i.postComments)===null||_b===void 0?void 0:_b.items.map(function(c){var _a;return __assign(__assign({},c),{conversationScope:getConversationScope(c.streamConversationScope),fileAccessToken:i.fileAccessToken,attachments:(_a=c.postCommentAttachments)===null||_a===void 0?void 0:_a.map(function(a){return __assign(__assign({},a),{type:getAttachmentType(a.type)});})});})})});}return __assign(__assign(__assign(__assign({},mappedItem),{userResponse:isEvent(i)?i.userResponseType&&getEventResponse(i.userResponseType):null,channels:(i.channelsList||[]).map(function(c){return {name:getChannelDisplayName(subscriptionChannels,c,user,getPreferredContentLanguage(user))};}),contents:i.contentsList.reduce(function(a,b){var _a;return __assign(__assign({},a),(_a={},_a[b.language]=b,_a));},{}),bannerInfo:i.bannerInfo&&__assign(__assign({},i.bannerInfo),{videoSource:convertStringToVideoSource((_c=i.bannerInfo)===null||_c===void 0?void 0:_c.videoSource)})}),getPageInfos(i)),getKnownNewsState(i));});}function getKnownNewsState(item){var _a,_b;if(!isNews(item)){return {};}var state=KnownNewsState.None;if((_a=item.knownNewsState)===null||_a===void 0?void 0:_a.includes(StreamKnownNewsState.Alert)){state|=KnownNewsState.Alert;}if((_b=item.knownNewsState)===null||_b===void 0?void 0:_b.includes(StreamKnownNewsState.Unconfirmed)){state|=KnownNewsState.Unconfirmed;}return {knownState:state};}function getPageInfos(item){if(!isPage(item)){return {};}return {pageType:getPageType(item.streamPageType),navigationContext:unflattenNavigationContext(item)};}function unflattenNavigationContext(item){var itemNavigationContext;var currentNavigationContext;var parentId=item.parentId;while(parentId!=null){var parent_1=item.path.find(function(c){return c.id===parentId;});if(!itemNavigationContext){itemNavigationContext={parent:parent_1};}else {currentNavigationContext.parent=parent_1;}parentId=parent_1.parentId;currentNavigationContext=parent_1;}return itemNavigationContext||{};}function getAttachmentType(source){switch(source){case GraphQLAttachmentType.News:return AttachmentType.News;case GraphQLAttachmentType.Event:return AttachmentType.Event;case GraphQLAttachmentType.Page:return AttachmentType.Page;case GraphQLAttachmentType.Post:return AttachmentType.Post;case GraphQLAttachmentType.Image:return AttachmentType.Image;case GraphQLAttachmentType.File:return AttachmentType.File;case GraphQLAttachmentType.VimeoVideo:return AttachmentType.VimeoVideo;case GraphQLAttachmentType.YouTubeVideo:return AttachmentType.YouTubeVideo;case GraphQLAttachmentType.Giphy:return AttachmentType.Giphy;default:return null;}}function getConversationScope(streamScope){switch(streamScope){case StreamConversationScope.Public:return ConversationScope.Public;case StreamConversationScope.Editor:return ConversationScope.Editor;case StreamConversationScope.Posts:return ConversationScope.Posts;default:return null;}}function getPageType(pageType){return pageType==='PAGE'?PageType.Page:PageType.Document;}function getEventResponse(source){switch(source){case StreamEventResponse.NotSet:return EventResponse.NotSet;case StreamEventResponse.Registered:return EventResponse.Registered;case StreamEventResponse.Declined:return EventResponse.Declined;default:return null;}}var StreamEventResponse;(function(StreamEventResponse){StreamEventResponse["NotSet"]="NOTSET";StreamEventResponse["Registered"]="REGISTERED";StreamEventResponse["Declined"]="DECLINED";})(StreamEventResponse||(StreamEventResponse={}));var CHANNELS_CONDITION=function CHANNELS_CONDITION(channels,allChannels){var _a,_b;if(!channels){return '';}var channelIds=(_b=(_a=channels.items)===null||_a===void 0?void 0:_a.map(function(c){var _a;return ((_a=allChannels===null||allChannels===void 0?void 0:allChannels.find(function(uc){return uc.name===c;}))===null||_a===void 0?void 0:_a.id)||"INVALID_CHANNEL_"+c;}))===null||_b===void 0?void 0:_b.map(function(c){return "\""+c+"\"";});if(!(channelIds===null||channelIds===void 0?void 0:channelIds.length)){return '';}if(channels.operator===LogicalOperator.And){var channelConditions=channelIds.map(function(c){return "{ channels: { some: { eq: "+c+" } } }";});return "and: [\n "+channelConditions.join()+"\n ]";}return "channels: { some: { in: ["+channelIds+"] } }";};var KEYWORDS_OR_CONDITION=function KEYWORDS_OR_CONDITION(keywords){if(!keywords||!keywords.length){return '';}return "keywordIds: { some: { in: ["+(keywords===null||keywords===void 0?void 0:keywords.map(function(k){return "\""+k+"\"";}))+"] } }";};var OWNER_CONDITION=function OWNER_CONDITION(owner){if(!owner){return '';}return "or: [\n { author: { userPrincipalName: { eq: \""+owner+"\" } } }\n { owner: { userPrincipalName: { eq: \""+owner+"\" } } }\n { onBehalfOf: { userPrincipalName: { eq: \""+owner+"\" } } }\n ]";};var PUBLISHING_DATE_CONDITION=function PUBLISHING_DATE_CONDITION(beforeDate,afterDate){if(!beforeDate&&!afterDate){return '';}if(beforeDate&&afterDate){return "and: [\n { publishingDate: { gt: \""+afterDate+"\" } }\n { publishingDate: { lt: \""+beforeDate+"\" } }\n ]";}return afterDate?"publishingDate: { gt: \""+afterDate+"\" }":"publishingDate: { lt: \""+beforeDate+"\" }";};var AUTHORS_CONDITION=function AUTHORS_CONDITION(authors){if(!authors||!authors.length){return '';}return "or: [\n { owner: { userPrincipalName: { in: ["+(authors===null||authors===void 0?void 0:authors.map(function(a){return "\""+a+"\"";}))+"] } } }\n { onBehalfOf: { userPrincipalName: { in: ["+(authors===null||authors===void 0?void 0:authors.map(function(a){return "\""+a+"\"";}))+"] } } }\n ]";};gql(templateObject_2$5$1||(templateObject_2$5$1=__makeTemplateObject(["\n mutation MarkStreamAsRead {\n markStreamAsRead\n }\n"],["\n mutation MarkStreamAsRead {\n markStreamAsRead\n }\n"])));gql(templateObject_3$2$1||(templateObject_3$2$1=__makeTemplateObject(["\n mutation MarkItemsAsRead($itemIds: [String]) {\n markItemsAsRead(itemIds: $itemIds)\n }\n"],["\n mutation MarkItemsAsRead($itemIds: [String]) {\n markItemsAsRead(itemIds: $itemIds)\n }\n"])));var templateObject_2$5$1,templateObject_3$2$1;var EditorListItem=function EditorListItem(props){var user=useCurrentUser();var formatMessage=useIntl().formatMessage;var itemDomRef=useRef$1();var webAppUrl=useConfiguration().webAppUrl;if(props.language==null){return null;}var item=props.item;var className=classNames(props.className,'editor-list-item',{'editor-list-item-rejected ms-borderColor-red':item.status===WorkflowStatus.rejected&&isCurrentUserItemOwner()},{'editor-list-item-selected ms-fontColor-onSecondary ms-bgColor-themeSecondary':props.isSelected},{'ms-bgColor-white':!props.isSelected},{'editor-list-item--highlighted':props.highlighted});return jsxs(ListItem,__assign({className:className,"data-item-is-published":props.isPublishedItem,"data-is-focusable":true,"data-item-is-selected":props.isSelected,"data-item-id":item.id,ref:itemDomRef},{children:[props.useExternalLink?jsx$1(ExternalLink,__assign({href:""+webAppUrl+props.basePath+"/"+item.id+"/"+props.language,className:"editor-list-content",target:"_blank",rel:"noopener noreferrer",onClick:function(e){var _a;return (_a=props.onClick)===null||_a===void 0?void 0:_a.call(props,e,itemDomRef.current,item,getTitle());}},{children:props.onRenderContent(item,getTitle(),props.isSelected)}),void 0):jsx$1(Content$9,__assign({to:props.basePath+"/"+item.id+"/"+props.language,onClick:function(e){var _a;return (_a=props.onClick)===null||_a===void 0?void 0:_a.call(props,e,itemDomRef.current,item,getTitle());},className:"editor-list-content"},{children:props.onRenderContent(item,getTitle(),props.isSelected)}),void 0),jsxs(Options,{children:[props.allowSelection&&jsx$1(SelectedIconOption,{children:jsx$1(SelectedIcon,{"data-item-select":true,iconProps:{iconName:'CompletedSolid'},ariaLabel:formatMessage({id:'AriaLabel.editor.selectItemButton'}),onClick:toggleSelect,isTouch:env.isTouchDevice,isSelected:props.isSelected,className:classNames('ms-fontColor-neutralTertiary',{'ms-fontColor-themeDarkAlt':props.isSelected})},void 0)},void 0),jsx$1(StatusOption,{status:item.status,isActive:props.isSelected},void 0),jsx$1(Option,__assign({className:"editor-list-persona"},{children:item.owner&&jsx$1(Avatar,{upn:item.owner.userPrincipalName,size:PersonaSize.size48,text:props.item.owner.displayName,hidePersonaDetails:true},void 0)}),void 0)]},void 0)]}),void 0);function isCurrentUserItemOwner(){return props.item.owner&&props.item.owner.userPrincipalName===user.userPrincipalName;}function getTitle(){var title=props.item.contents[props.language].title;return title==null||title.trim().length===0?"<"+formatMessage({id:'Generic.noTitle'})+">":title;}function toggleSelect(){props.onSelect(props.item,!props.isSelected);}};var EditorItemTitle=_styled.h2.withConfig({displayName:"EditorListItem__EditorItemTitle",componentId:"sc-zoqzrc-0"})(templateObject_1$6$1||(templateObject_1$6$1=__makeTemplateObject(["\n && {\n font-weight: 600;\n margin: 0;\n font-size: 17px;\n text-overflow: ellipsis;\n white-space: nowrap;\n overflow: hidden;\n @media (max-width: 700px) {\n font-size: 15px;\n }\n }\n"],["\n && {\n font-weight: 600;\n margin: 0;\n font-size: 17px;\n text-overflow: ellipsis;\n white-space: nowrap;\n overflow: hidden;\n @media (max-width: 700px) {\n font-size: 15px;\n }\n }\n"])));var SelectedIcon=_styled(IconButton$1).withConfig({displayName:"EditorListItem__SelectedIcon",componentId:"sc-zoqzrc-1"})(templateObject_2$4$1||(templateObject_2$4$1=__makeTemplateObject(["\n padding: 0;\n height: 100%;\n width: auto;\n font-size: inherit;\n\n opacity: ",";\n\n &:focus {\n opacity: 1;\n }\n\n i {\n font-size: inherit;\n line-height: unset;\n height: auto;\n width: auto;\n padding: 0 19px 0 10px;\n }\n"],["\n padding: 0;\n height: 100%;\n width: auto;\n font-size: inherit;\n\n opacity: ",";\n\n &:focus {\n opacity: 1;\n }\n\n i {\n font-size: inherit;\n line-height: unset;\n height: auto;\n width: auto;\n padding: 0 19px 0 10px;\n }\n"])),function(p){return p.isSelected?1:p.isTouch?0.1:0;});var ListItem=_styled.div.withConfig({displayName:"EditorListItem__ListItem",componentId:"sc-zoqzrc-2"})(templateObject_3$1$1||(templateObject_3$1$1=__makeTemplateObject(["\n position: relative;\n font-family: 'Roboto', sans-serif;\n text-decoration: none;\n ",";\n\n display: flex;\n flex-flow: row nowrap;\n text-align: left;\n\n a,\n a:hover,\n a:active,\n a:visited {\n color: ",";\n text-decoration: none;\n }\n\n &.editor-list-item-rejected {\n border-left-width: 10px;\n border-style: solid;\n border-top: 0;\n border-bottom: 0;\n border-right: 0;\n > .editor-list-content {\n margin-left: 6px;\n }\n }\n\n &:hover {\n "," {\n opacity: 1;\n }\n }\n"],["\n position: relative;\n font-family: 'Roboto', sans-serif;\n text-decoration: none;\n ",";\n\n display: flex;\n flex-flow: row nowrap;\n text-align: left;\n\n a,\n a:hover,\n a:active,\n a:visited {\n color: ",";\n text-decoration: none;\n }\n\n &.editor-list-item-rejected {\n border-left-width: 10px;\n border-style: solid;\n border-top: 0;\n border-bottom: 0;\n border-right: 0;\n > .editor-list-content {\n margin-left: 6px;\n }\n }\n\n &:hover {\n "," {\n opacity: 1;\n }\n }\n"])),CardBorderInline(2,2),function(p){return p.theme.textColors.default;},SelectedIcon);var Options=_styled.div.withConfig({displayName:"EditorListItem__Options",componentId:"sc-zoqzrc-3"})(templateObject_4$1$1||(templateObject_4$1$1=__makeTemplateObject(["\n flex: 0 1 auto;\n display: flex;\n flex-flow: row nowrap;\n padding-right: 15px;\n\n @media (max-width: 700px) {\n padding-right: 6px;\n }\n"],["\n flex: 0 1 auto;\n display: flex;\n flex-flow: row nowrap;\n padding-right: 15px;\n\n @media (max-width: 700px) {\n padding-right: 6px;\n }\n"])));var Option=_styled.div.withConfig({displayName:"EditorListItem__Option",componentId:"sc-zoqzrc-4"})(templateObject_5$1$1||(templateObject_5$1$1=__makeTemplateObject(["\n padding: 6px 25px 6px 6px;\n font-size: 24px;\n text-align: center;\n display: flex;\n flex-flow: row nowrap;\n align-items: center;\n justify-content: center;\n\n flex: 0 1 auto;\n\n &.editor-list-persona {\n width: 32px;\n }\n > div {\n height: 24px;\n }\n\n @media (max-width: 700px) {\n padding: 5px;\n i {\n font-size: 0.9em !important;\n padding: 0;\n }\n }\n"],["\n padding: 6px 25px 6px 6px;\n font-size: 24px;\n text-align: center;\n display: flex;\n flex-flow: row nowrap;\n align-items: center;\n justify-content: center;\n\n flex: 0 1 auto;\n\n &.editor-list-persona {\n width: 32px;\n }\n > div {\n height: 24px;\n }\n\n @media (max-width: 700px) {\n padding: 5px;\n i {\n font-size: 0.9em !important;\n padding: 0;\n }\n }\n"])));var SelectedIconOption=_styled(Option).withConfig({displayName:"EditorListItem__SelectedIconOption",componentId:"sc-zoqzrc-5"})(templateObject_6$s||(templateObject_6$s=__makeTemplateObject(["\n padding: 6px;\n"],["\n padding: 6px;\n"])));var LinkStyle=css$2(templateObject_7$m||(templateObject_7$m=__makeTemplateObject(["\n padding: ","px;\n flex: 1 0 auto;\n /* todo: This smells, but it's required to make the ellipsis work. How to avoid it?*/\n width: 100px;\n margin: ","px ","px ","px ","px;\n\n @media (max-width: 700px) {\n margin: ","px;\n }\n"],["\n padding: ","px;\n flex: 1 0 auto;\n /* todo: This smells, but it's required to make the ellipsis work. How to avoid it?*/\n width: 100px;\n margin: ","px ","px ","px ","px;\n\n @media (max-width: 700px) {\n margin: ","px;\n }\n"])),spacingXs,spacingS,spacingS,spacingS,spacingS+6,spacingXs);var Content$9=_styled(Link$4).withConfig({displayName:"EditorListItem__Content",componentId:"sc-zoqzrc-6"})(templateObject_8$k||(templateObject_8$k=__makeTemplateObject(["\n ",";\n"],["\n ",";\n"])),LinkStyle);var ExternalLink=_styled.a.withConfig({displayName:"EditorListItem__ExternalLink",componentId:"sc-zoqzrc-7"})(templateObject_9$f||(templateObject_9$f=__makeTemplateObject(["\n ",";\n"],["\n ",";\n"])),LinkStyle);var StatusOption=function StatusOption(_a){var _b=_a.status,status=_b===void 0?WorkflowStatus.draft:_b,isActive=_a.isActive;if(status===WorkflowStatus.deleted){return null;}return jsx$1(Option,{children:status===WorkflowStatus.approved?jsx$1("img",{style:{width:'20px'},alt:""},void 0):jsx$1(Tooltip,__assign({resourceKey:'EditorList.'+status||WorkflowStatus.draft},{children:jsx$1(StateIcon,{status:status||WorkflowStatus.draft,width:20,isActive:isActive},void 0)}),void 0)},void 0);};var templateObject_1$6$1,templateObject_2$4$1,templateObject_3$1$1,templateObject_4$1$1,templateObject_5$1$1,templateObject_6$s,templateObject_7$m,templateObject_8$k,templateObject_9$f;var NewsEditorItem=function NewsEditorItem(_a){var title=_a.title,item=_a.item,isSelected=_a.isSelected;return jsxs(Fragment,{children:[jsx$1(EditorItemTitle,__assign({className:classNames({'ms-fontColor-onSecondary':isSelected})},{children:title}),void 0),jsx$1(DateInfo,__assign({className:classNames('ms-fontSize-m',{'ms-fontColor-onSecondary':isSelected})},{children:jsx$1(MetaInfo$1,{dateMode:DateMode.Published,item:item,expiryDate:item.expiryDate,channels:item.channels,readOnly:true,showChannels:true,hideAvatar:true,hideDisplayName:true},void 0)}),void 0)]},void 0);};var MetaInfo$1=_styled(ItemMetaInfo).withConfig({displayName:"NewsEditorItem__MetaInfo",componentId:"sc-1kz3wt0-0"})(templateObject_1$5$1||(templateObject_1$5$1=__makeTemplateObject(["\n [data-meta-info-details] {\n padding-left: 0;\n }\n"],["\n [data-meta-info-details] {\n padding-left: 0;\n }\n"])));var DateInfo=_styled.div.withConfig({displayName:"NewsEditorItem__DateInfo",componentId:"sc-1kz3wt0-1"})(templateObject_2$3$1||(templateObject_2$3$1=__makeTemplateObject(["\n padding-top: 8px;\n @media (max-width: 700px) {\n font-size: 12px;\n }\n"],["\n padding-top: 8px;\n @media (max-width: 700px) {\n font-size: 12px;\n }\n"])));var templateObject_1$5$1,templateObject_2$3$1;var EventDates=_styled.div.withConfig({displayName:"EventEditorItem__EventDates",componentId:"sc-1irp2hc-0"})(templateObject_1$4$1||(templateObject_1$4$1=__makeTemplateObject(["\n margin-top: ","px;\n font-size: ","px;\n\n display: flex;\n flex-direction: column;\n"],["\n margin-top: ","px;\n font-size: ","px;\n\n display: flex;\n flex-direction: column;\n"])),spacingS,fontSizeSmall);_styled.div.withConfig({displayName:"EventEditorItem__EmptyEventDates",componentId:"sc-1irp2hc-1"})(templateObject_2$2$1||(templateObject_2$2$1=__makeTemplateObject(["\n font-style: italic;\n"],["\n font-style: italic;\n"])));_styled.div.withConfig({displayName:"EventEditorItem__EventDateAndRecurrenceInfo",componentId:"sc-1irp2hc-2"})(templateObject_3$13||(templateObject_3$13=__makeTemplateObject(["\n display: flex;\n align-items: center;\n"],["\n display: flex;\n align-items: center;\n"])));_styled(EventRecurrenceSeriesInfo).withConfig({displayName:"EventEditorItem__RecurrenceSeriesInfo",componentId:"sc-1irp2hc-3"})(templateObject_4$K||(templateObject_4$K=__makeTemplateObject(["\n margin-top: ","px;\n"],["\n margin-top: ","px;\n"])),spacingS);_styled(EventDates).withConfig({displayName:"EventEditorItem__DatesInfo",componentId:"sc-1irp2hc-4"})(templateObject_5$D||(templateObject_5$D=__makeTemplateObject(["\n margin-right: ","px;\n"],["\n margin-right: ","px;\n"])),spacingM);var templateObject_1$4$1,templateObject_2$2$1,templateObject_3$13,templateObject_4$K,templateObject_5$D;var CreateNewItemButton=function CreateNewItemButton(_a){var type=_a.type,groupId=_a.groupId,onClick=_a.onClick,className=_a.className;var baseRoute=useBaseRoute();var history=useHistory();var buildPath=useSubscriptionHandlePathBuilder().buildPath;var intl=useIntl();var user=useCurrentUser();var hasSelectedGroup=!!groupId;var groups=getGroupItems();if(hasSelectedGroup||groups.length===1){return jsx$1(StyledPrimaryButton,__assign({iconProps:{iconName:'AddTo'},onClick:function(){return handleOnClick(hasSelectedGroup?undefined:groups[0].key);},className:className,"data-button-create":type},{children:jsx$1(FormattedMessage$1,{id:"EditorList."+type+"CreateButton"},void 0)}),void 0);}if(!groups.length){return null;}return jsx$1(MenuButton,__assign({iconProps:{iconName:'AddTo'},menuProps:{items:groups,calloutProps:{calloutMaxWidth:300},className:'lt-reach-callout'},className:className,"data-button-create":type},{children:jsx$1(FormattedMessage$1,{id:"EditorList."+type+"CreateButton"},void 0)}),void 0);function getGroupItems(){return getGroupsWithExplicitMinRole(GroupRoles.Author,user).map(function(g){return {key:g.id,onClick:function(){return handleOnClick(g.id);},text:getGroupName(g,user,intl)};});}function openEditor(id){history.push(buildPath("/editor/"+type+"/groups/"+id+"/new"));}function handleOnClick(id){if(onClick){onClick(groupId||id);}else {hasSelectedGroup?history.push(baseRoute+"/new"):openEditor(id);}}};var MenuButton=_styled(CommandBarButton).withConfig({displayName:"CreateNewItemButton__MenuButton",componentId:"sc-18o74g9-0"})(templateObject_1$3$1||(templateObject_1$3$1=__makeTemplateObject(["\n && {\n background-color: ",";\n &:hover {\n background-color: ",";\n i,\n span {\n color: ",";\n background-color: transparent;\n }\n }\n\n // the ms-fontColor on the button is not applied on the icons\n i,\n span {\n color: ",";\n }\n }\n\n height: 32px;\n padding: 0 ","px;\n\n i:first-child {\n margin: 0 ","px 0 0;\n }\n\n span {\n white-space: pre;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n"],["\n && {\n background-color: ",";\n &:hover {\n background-color: ",";\n i,\n span {\n color: ",";\n background-color: transparent;\n }\n }\n\n // the ms-fontColor on the button is not applied on the icons\n i,\n span {\n color: ",";\n }\n }\n\n height: 32px;\n padding: 0 ","px;\n\n i:first-child {\n margin: 0 ","px 0 0;\n }\n\n span {\n white-space: pre;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n"])),function(p){return p.theme.semanticColors.primaryButtonBackground;},function(p){return p.theme.semanticColors.primaryButtonBackgroundHovered;},function(p){return p.theme.semanticColors.primaryButtonTextHovered;},function(p){return p.theme.semanticColors.primaryButtonText;},spacingS,spacingS);var StyledPrimaryButton=_styled(PrimaryButton).withConfig({displayName:"CreateNewItemButton__StyledPrimaryButton",componentId:"sc-18o74g9-1"})(templateObject_2$1$1||(templateObject_2$1$1=__makeTemplateObject(["\n padding: 0 ","px;\n\n i {\n margin: 0 ","px 0 0;\n }\n\n span {\n white-space: pre;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n"],["\n padding: 0 ","px;\n\n i {\n margin: 0 ","px 0 0;\n }\n\n span {\n white-space: pre;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n"])),spacingS,spacingS);var templateObject_1$3$1,templateObject_2$1$1;function useEditorApi(){var api=useApi();var fetchFromApi=useApiFactory().fetchFromApi;var sendBeacon=useBeaconHandler();var onRequestToken=useContext(AuthenticationContext).onRequestToken;return useMemo(function(){return {cloneItem:cloneItem,getDeletedItems:getDeletedItems,getVersion:getVersion,getVersions:getVersions,deleteDraft:deleteDraft,deleteRange:deleteRange,deletePermanently:deletePermanently,bulkSetStatus:bulkSetStatus,setStatus:setStatus,removeLease:removeLease,keepLeaseAlive:keepLeaseAlive,saveItem:saveItem,updateGroups:updateGroups,translateContent:translateContent};function translateContent(itemId,translateFrom,translateTo){return api.all("editor/news/"+itemId+"/contents/"+translateFrom+"/translations?"+queryString.stringify({languages:translateTo})).getAll().then(function(response){return response.body(false);});}function updateGroups(itemType,itemId,groupIds){return api.custom("editor/"+itemType+"/"+itemId+"/groups").put(groupIds).then(function(response){return response.body().data();});}function cloneItem(itemType,itemId){return api.all("editor/"+itemType+"?"+queryString.stringify({cloneFromItem:itemId})).post({}).then(function(response){return response.body().data();});}function getDeletedItems(type,filter,token){var params=Object.assign({},__assign(__assign(__assign({},filter),getCommaSeparatedChannelsString(filter===null||filter===void 0?void 0:filter.channels)),getCommaSeparatedKeywordsString(filter===null||filter===void 0?void 0:filter.keywords)),{token:token,pageSize:30});return api.all("editor/"+type+"/recyclebin").get('',params).then(function(res){return res.body().data();});}function getVersions(type,itemId){return from(api.all("editor/"+type+"/"+itemId+"/versions").getAll()).pipe(map(function(response){return response.body().map(function(group){return group.data();});}));}function getVersion(type,itemId,versionId){return api.all("editor/"+type+"/"+itemId+"/versions").get(versionId).then(function(response){return response.body().data();});}function deleteDraft(leaseId,itemId,type){var url="editor/"+type+"/"+itemId+"/draft";if(leaseId){url+="?leaseId="+leaseId;}return api.custom(url).delete();}function deleteRange(type,ids){var data=ids.map(function(id){return {id:id,status:WorkflowStatus.deleted};});return api.custom("editor/"+type).patch(data).then(function(response){return response.body().map(function(item){return item.data();});}).catch(function(){// set null as a result in case of error
|
|
131879
131879
|
return null;});}function deletePermanently(type,ids){var itemIds=ids.join(',');return api.custom("editor/"+type+"/recyclebin?"+queryString.stringify({itemIds:itemIds})).delete();}function bulkSetStatus(type,items){return api.custom("editor/"+type).patch(items).then(function(response){return response.body().map(function(item){return item.data();});});}function setStatus(type,itemId,status,leaseId){return __awaiter(this,void 0,void 0,function(){var path,response,ex_1;return __generator(this,function(_a){switch(_a.label){case 0:path="editor/"+type+"/"+itemId+"/status";if(leaseId!=null){path+='?'+queryString.stringify({leaseId:leaseId});}_a.label=1;case 1:_a.trys.push([1,3,,4]);return [4/*yield*/,api.custom(path).put(status)];case 2:response=_a.sent();return [2/*return*/,response.body().data()];case 3:ex_1=_a.sent();throw ex_1.response.statusCode===409?{account:ex_1.response.data}:ex_1;case 4:return [2/*return*/];}});});}function removeLease(itemId,leaseId){return api.custom("editor/"+itemId+"/lease?"+queryString.stringify({leaseId:leaseId})).delete();}function keepLeaseAlive(itemId,leaseId,token,subscriptionId){var _this=this;var expireLeaseToken=token;// every 10 seconds
|
|
131880
131880
|
var timer=setInterval(function(){return __awaiter(_this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:// update the lease
|
|
131881
131881
|
return [4/*yield*/,api.custom("editor/"+itemId+"/lease").put({leaseId:leaseId})];case 1:// update the lease
|
|
131882
131882
|
_a.sent();return [4/*yield*/,onRequestToken()];case 2:// renew the access token
|
|
131883
131883
|
expireLeaseToken=_a.sent();return [2/*return*/];}});});},1000*10);return {cancel:function(){return clearInterval(timer);},destroy:function(){clearInterval(timer);sendBeacon("/editor/"+itemId+"/lease/delete",expireLeaseToken,subscriptionId,{leaseId:leaseId});}};}function saveItem(subscriptionId,type,item,createLease){if(createLease===void 0){createLease=true;}return from(onRequestToken()).pipe(switchMap(function(token){var config={method:item.id==null?'POST':'PUT',body:JSON.stringify(item),headers:{authorization:'Bearer '+token,'subscription-id':subscriptionId,'Content-Type':'application/json'}};var basePath=type?'/editor/'+type:'/editor';var path=item.id==null?basePath:basePath+"/"+item.id;// note (sl): use custom fetch, since post/put with query string is annoying to build with restful.js
|
|
131884
|
-
return fetchFromApi(path+"?createLease="+createLease.toString(),config);}),switchMap(function(response){if(response.status===409){return new Promise(function(_,reject){return response.json().then(function(account){if(account.userPrincipalName!=null){reject({account:account});}else {reject({status:response.status,error:response.statusText});}});});}else if(response.ok){return from(response.json());}else {return throwError({status:response.status,error:response.statusText});}}));}},[onRequestToken,api,fetchFromApi,sendBeacon]);}function useNewsEditorApi(){var api=useApi();var saveItem=useEditorApi().saveItem;return useMemo(function(){return {getNews:getNews,unpublish:unpublish,save:save};function getNews(newsId){return __awaiter(this,void 0,void 0,function(){var response,error_1;return __generator(this,function(_a){switch(_a.label){case 0:_a.trys.push([0,3,,4]);return [4/*yield*/,api.all('editor/news').get(newsId)];case 1:response=_a.sent();return [4/*yield*/,response.body().data()];case 2:return [2/*return*/,_a.sent()];case 3:error_1=_a.sent();if(error_1.response&&error_1.response.statusCode===404){return [2/*return*/,null];}else {throw error_1;}case 4:return [2/*return*/];}});});}function unpublish(id,leaseId){var path=leaseId?"news/"+id+"?"+queryString.stringify({leaseId:leaseId}):"news/"+id;return from(api.custom(path).delete());}function save(item,subscriptionId){if(item.id==null){item.source='Condense';}return saveItem(subscriptionId,ItemResourceTypes.News,item);}},[api,saveItem]);}_styled.div.withConfig({displayName:"GlobalSearchButton__Host",componentId:"sc-1c5dmlm-0"})(templateObject_1$2$1||(templateObject_1$2$1=__makeTemplateObject(["\n display: flex;\n margin-top: ","px;\n justify-content: center;\n"],["\n display: flex;\n margin-top: ","px;\n justify-content: center;\n"])),spacingM);var templateObject_1$2$1;_styled.article.withConfig({displayName:"StreamList__Host",componentId:"sc-1rdkc01-0"})(templateObject_2$1A||(templateObject_2$1A=__makeTemplateObject(["\n position: relative;\n margin-bottom: ","px;\n\n ",";\n"],["\n position: relative;\n margin-bottom: ","px;\n\n ",";\n"])),spacingM,function(p){return p.highlight&&css$2(templateObject_1$1$1||(templateObject_1$1$1=__makeTemplateObject(["\n &::after {\n content: '';\n border-right-width: ","px;\n border-right-color: ",";\n border-right-style: solid;\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n }\n "],["\n &::after {\n content: '';\n border-right-width: ","px;\n border-right-color: ",";\n border-right-style: solid;\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n }\n "])),spacingXs,p.theme.palette.accent);});var templateObject_1$1$1,templateObject_2$1A;function useNewsStreamDataLoader(filter){var _this=this;var client=useApolloClient();var user=useCurrentUser();var channels=useContext(LazySubscriptionContext).channels;return function(take,skip){return __awaiter(_this,void 0,void 0,function(){var variables,result,stream;var _a,_b,_c,_d
|
|
131884
|
+
return fetchFromApi(path+"?createLease="+createLease.toString(),config);}),switchMap(function(response){if(response.status===409){return new Promise(function(_,reject){return response.json().then(function(account){if(account.userPrincipalName!=null){reject({account:account});}else {reject({status:response.status,error:response.statusText});}});});}else if(response.ok){return from(response.json());}else {return throwError({status:response.status,error:response.statusText});}}));}},[onRequestToken,api,fetchFromApi,sendBeacon]);}function useNewsEditorApi(){var api=useApi();var saveItem=useEditorApi().saveItem;return useMemo(function(){return {getNews:getNews,unpublish:unpublish,save:save};function getNews(newsId){return __awaiter(this,void 0,void 0,function(){var response,error_1;return __generator(this,function(_a){switch(_a.label){case 0:_a.trys.push([0,3,,4]);return [4/*yield*/,api.all('editor/news').get(newsId)];case 1:response=_a.sent();return [4/*yield*/,response.body().data()];case 2:return [2/*return*/,_a.sent()];case 3:error_1=_a.sent();if(error_1.response&&error_1.response.statusCode===404){return [2/*return*/,null];}else {throw error_1;}case 4:return [2/*return*/];}});});}function unpublish(id,leaseId){var path=leaseId?"news/"+id+"?"+queryString.stringify({leaseId:leaseId}):"news/"+id;return from(api.custom(path).delete());}function save(item,subscriptionId){if(item.id==null){item.source='Condense';}return saveItem(subscriptionId,ItemResourceTypes.News,item);}},[api,saveItem]);}_styled.div.withConfig({displayName:"GlobalSearchButton__Host",componentId:"sc-1c5dmlm-0"})(templateObject_1$2$1||(templateObject_1$2$1=__makeTemplateObject(["\n display: flex;\n margin-top: ","px;\n justify-content: center;\n"],["\n display: flex;\n margin-top: ","px;\n justify-content: center;\n"])),spacingM);var templateObject_1$2$1;_styled.article.withConfig({displayName:"StreamList__Host",componentId:"sc-1rdkc01-0"})(templateObject_2$1A||(templateObject_2$1A=__makeTemplateObject(["\n position: relative;\n margin-bottom: ","px;\n\n ",";\n"],["\n position: relative;\n margin-bottom: ","px;\n\n ",";\n"])),spacingM,function(p){return p.highlight&&css$2(templateObject_1$1$1||(templateObject_1$1$1=__makeTemplateObject(["\n &::after {\n content: '';\n border-right-width: ","px;\n border-right-color: ",";\n border-right-style: solid;\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n }\n "],["\n &::after {\n content: '';\n border-right-width: ","px;\n border-right-color: ",";\n border-right-style: solid;\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n }\n "])),spacingXs,p.theme.palette.accent);});var templateObject_1$1$1,templateObject_2$1A;function useNewsStreamDataLoader(filter){var _this=this;var client=useApolloClient();var user=useCurrentUser();var channels=useContext(LazySubscriptionContext).channels;return function(take,skip){return __awaiter(_this,void 0,void 0,function(){var variables,result,stream;var _a,_b,_c,_d;return __generator(this,function(_e){switch(_e.label){case 0:variables={take:take,skip:skip!==null&&skip!==void 0?skip:0};return [4/*yield*/,client.query({query:NEWS_QUERY(false,"\n "+CHANNELS_CONDITION(filter===null||filter===void 0?void 0:filter.channels,channels)+"\n "+KEYWORDS_OR_CONDITION(filter===null||filter===void 0?void 0:filter.keywords)+"\n "+OWNER_CONDITION(filter===null||filter===void 0?void 0:filter.owner)+"\n "+PUBLISHING_DATE_CONDITION(filter===null||filter===void 0?void 0:filter.beforeDate,filter===null||filter===void 0?void 0:filter.afterDate)+"\n "+AUTHORS_CONDITION(filter===null||filter===void 0?void 0:filter.authors)+"\n "),fetchPolicy:'no-cache',variables:variables})];case 1:result=_e.sent();if(((_a=result===null||result===void 0?void 0:result.errors)===null||_a===void 0?void 0:_a.length)>0){logger.error(result.errors[0]);throw result.errors[0];}stream=(_b=result===null||result===void 0?void 0:result.data)===null||_b===void 0?void 0:_b.stream;return [2/*return*/,{items:convertProperties((_c=stream===null||stream===void 0?void 0:stream.items)!==null&&_c!==void 0?_c:[],user,channels),hasNextPage:(_d=stream===null||stream===void 0?void 0:stream.pageInfo)===null||_d===void 0?void 0:_d.hasNextPage,paginationToken:(skip!==null&&skip!==void 0?skip:0)+take}];}});});};}var NEWS_QUERY=function NEWS_QUERY(includeAllItems,whereConditions){if(whereConditions===void 0){whereConditions='';}return gql(templateObject_1$2o||(templateObject_1$2o=__makeTemplateObject(["\n query GetStream(\n $skip: Int!\n $take: Int!\n $searchText: String\n $unreadOnly: Boolean\n ) {\n stream(\n searchText: $searchText\n unreadOnly: $unreadOnly\n order: [{ publishingDate: DESC }]\n skip: $skip\n take: $take\n includeAllItems: ","\n where: {\n type: { eq: NEWS }\n ","\n }\n ) {\n items {\n id: itemId\n knownNewsState\n type\n contentsList: contents {\n language\n intro\n headline\n title\n externalUrl\n active\n }\n modified\n publishingDate\n permalink\n channelsList: channels\n author {\n userPrincipalName\n displayName\n id: userId\n }\n owner {\n userPrincipalName\n displayName\n id: userId\n }\n onBehalfOf {\n userPrincipalName\n displayName\n id: userId\n }\n statistics {\n commentCount\n likeCount\n }\n metadata {\n feedbackSettings {\n feedbackOptions\n }\n }\n bannerInfo {\n type\n imageId\n videoId\n videoUrl\n videoSource\n isDirectVideoUrl\n }\n fileAccessToken\n keywordsList: keywords {\n id\n name\n groupId\n translations {\n key\n value\n }\n }\n isUnread\n hasNewComments\n groupIds\n useExternalContent\n }\n pageInfo {\n hasNextPage\n }\n }\n }\n "],["\n query GetStream(\n $skip: Int!\n $take: Int!\n $searchText: String\n $unreadOnly: Boolean\n ) {\n stream(\n searchText: $searchText\n unreadOnly: $unreadOnly\n order: [{ publishingDate: DESC }]\n skip: $skip\n take: $take\n includeAllItems: ","\n where: {\n type: { eq: NEWS }\n ","\n }\n ) {\n items {\n id: itemId\n knownNewsState\n type\n contentsList: contents {\n language\n intro\n headline\n title\n externalUrl\n active\n }\n modified\n publishingDate\n permalink\n channelsList: channels\n author {\n userPrincipalName\n displayName\n id: userId\n }\n owner {\n userPrincipalName\n displayName\n id: userId\n }\n onBehalfOf {\n userPrincipalName\n displayName\n id: userId\n }\n statistics {\n commentCount\n likeCount\n }\n metadata {\n feedbackSettings {\n feedbackOptions\n }\n }\n bannerInfo {\n type\n imageId\n videoId\n videoUrl\n videoSource\n isDirectVideoUrl\n }\n fileAccessToken\n keywordsList: keywords {\n id\n name\n groupId\n translations {\n key\n value\n }\n }\n isUnread\n hasNewComments\n groupIds\n useExternalContent\n }\n pageInfo {\n hasNextPage\n }\n }\n }\n "])),includeAllItems,whereConditions);};var templateObject_1$2o;
|
|
131885
131885
|
|
|
131886
131886
|
var PublishableItemDetailViewContainer = function PublishableItemDetailViewContainer(_a) {
|
|
131887
131887
|
var preventExternalContentAutoRedirect = _a.preventExternalContentAutoRedirect,
|
|
@@ -132746,7 +132746,7 @@ function useNewsItemClickHandler() {
|
|
|
132746
132746
|
}
|
|
132747
132747
|
}
|
|
132748
132748
|
function useNewsLoaderWithFiltersAndPagination(pageSize, filter) {
|
|
132749
|
-
var dataLoader = useNewsStreamDataLoader(
|
|
132749
|
+
var dataLoader = useNewsStreamDataLoader(getNewsFilterDefinition());
|
|
132750
132750
|
|
|
132751
132751
|
var _a = useItemLoaderWithPreFetch(pageSize, dataLoader, [filter]),
|
|
132752
132752
|
items = _a.items,
|
|
@@ -132772,6 +132772,24 @@ function useNewsLoaderWithFiltersAndPagination(pageSize, filter) {
|
|
|
132772
132772
|
isLastPage: isLastPage,
|
|
132773
132773
|
isEmpty: isEmpty
|
|
132774
132774
|
};
|
|
132775
|
+
|
|
132776
|
+
function getNewsFilterDefinition() {
|
|
132777
|
+
if (!filter) {
|
|
132778
|
+
return null;
|
|
132779
|
+
}
|
|
132780
|
+
|
|
132781
|
+
var newsFilter = __assign$g({}, filter);
|
|
132782
|
+
|
|
132783
|
+
if (filter.channels) {
|
|
132784
|
+
newsFilter.channels = typeof filter.channels === 'string' ? converToChannelsFilterWithLogicalOperator(filter.channels) : filter.channels;
|
|
132785
|
+
}
|
|
132786
|
+
|
|
132787
|
+
if (filter.keywords) {
|
|
132788
|
+
newsFilter.keywords = typeof filter.keywords === 'string' ? convertToKeywordsArray(filter.keywords) : filter.keywords;
|
|
132789
|
+
}
|
|
132790
|
+
|
|
132791
|
+
return newsFilter;
|
|
132792
|
+
}
|
|
132775
132793
|
}
|
|
132776
132794
|
function useEditorNewsLoaderWithFiltersAndPagination(pageSize, filter) {
|
|
132777
132795
|
var list = useCommonEditorApi().list;
|
|
@@ -134204,8 +134222,6 @@ var StyledCarousel = _styled(Carousel).withConfig({
|
|
|
134204
134222
|
var templateObject_1$f;
|
|
134205
134223
|
|
|
134206
134224
|
var NewsHero = function NewsHero(_a) {
|
|
134207
|
-
var _b;
|
|
134208
|
-
|
|
134209
134225
|
var filter = _a.filter,
|
|
134210
134226
|
disableAutoplay = _a.disableAutoplay,
|
|
134211
134227
|
autoplayInterval = _a.autoplayInterval,
|
|
@@ -134215,21 +134231,15 @@ var NewsHero = function NewsHero(_a) {
|
|
|
134215
134231
|
var defaultPageSize = 5;
|
|
134216
134232
|
var webAppUrl = useSubscriptionWebAppUrl();
|
|
134217
134233
|
var buildPath = useSubscriptionHandlePathBuilder().buildPath;
|
|
134218
|
-
var dataLoader = useNewsStreamDataLoader(
|
|
134219
|
-
channels: {
|
|
134220
|
-
items: filter.channels
|
|
134221
|
-
},
|
|
134222
|
-
keywords: filter.keywords,
|
|
134223
|
-
pageSize: (_b = filter.pageSize) !== null && _b !== void 0 ? _b : defaultPageSize
|
|
134224
|
-
});
|
|
134234
|
+
var dataLoader = useNewsStreamDataLoader(getFilterDefinition());
|
|
134225
134235
|
|
|
134226
|
-
var
|
|
134227
|
-
items =
|
|
134228
|
-
isLoading =
|
|
134236
|
+
var _b = usePromise$2(loadNewsItems),
|
|
134237
|
+
items = _b[0],
|
|
134238
|
+
isLoading = _b[1];
|
|
134229
134239
|
|
|
134230
|
-
var
|
|
134231
|
-
palette =
|
|
134232
|
-
textColors =
|
|
134240
|
+
var _c = useContext(ThemeContext$1).theme,
|
|
134241
|
+
palette = _c.palette,
|
|
134242
|
+
textColors = _c.textColors;
|
|
134233
134243
|
var user = useCurrentUserContext().user;
|
|
134234
134244
|
var userLanguage = getPreferredContentLanguage(user);
|
|
134235
134245
|
var formatMessage = useIntl().formatMessage;
|
|
@@ -134251,6 +134261,27 @@ var NewsHero = function NewsHero(_a) {
|
|
|
134251
134261
|
height: height
|
|
134252
134262
|
}, void 0);
|
|
134253
134263
|
|
|
134264
|
+
function getFilterDefinition() {
|
|
134265
|
+
var _a;
|
|
134266
|
+
|
|
134267
|
+
if (!filter) {
|
|
134268
|
+
return null;
|
|
134269
|
+
}
|
|
134270
|
+
|
|
134271
|
+
var filterDefinition = {};
|
|
134272
|
+
filterDefinition.pageSize = (_a = filter.pageSize) !== null && _a !== void 0 ? _a : defaultPageSize;
|
|
134273
|
+
|
|
134274
|
+
if (filter.channels) {
|
|
134275
|
+
filterDefinition.channels = typeof filter.channels === 'string' ? converToChannelsFilterWithLogicalOperator(filter.channels) : filter.channels;
|
|
134276
|
+
}
|
|
134277
|
+
|
|
134278
|
+
if (filter.keywords) {
|
|
134279
|
+
filterDefinition.keywords = typeof filter.keywords === 'string' ? convertToKeywordsArray(filter.keywords) : filter.keywords;
|
|
134280
|
+
}
|
|
134281
|
+
|
|
134282
|
+
return filterDefinition;
|
|
134283
|
+
}
|
|
134284
|
+
|
|
134254
134285
|
function loadNewsItems() {
|
|
134255
134286
|
var _a;
|
|
134256
134287
|
|