@livetiles/reach-components-react 0.3.70 → 0.3.75

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.
@@ -1037,7 +1037,7 @@ var de = {
1037
1037
  "Themes.selectorDescription": "Wählen Sie ein Farbschema für LiveTiles Reach.",
1038
1038
  "Themes.colorPickerDescription": "Sie können die Farben in der untenstehenden Farbpalette ändern.",
1039
1039
  "Themes.contrast.info": "Diese Bewertungen basieren auf WCAG Richtlinien. <a>Hier</a> mehr erfahren.",
1040
- "Themes.contrast.number": "Kontrastverhältnis: {number}",
1040
+ "Themes.contrast.ratio": "Contrast Ratio: {ratio}",
1041
1041
  "Themes.contrast.rating": "Kontrastbewertung: {rating}",
1042
1042
  "Themes.contrast.pass": "gut",
1043
1043
  "Themes.contrast.fail": "fehlgeschlagen",
@@ -1606,7 +1606,6 @@ var en = {
1606
1606
  "Events.numberOfComments": "This event has {count, plural, =0 {0 comments} one {1 comment} other {{count} comments}}",
1607
1607
  "Events.readersTooltip": "{count, plural, =0 {No users have} one {1 user has} other {{count} users have}} seen this event",
1608
1608
  "Events.emptyList": "There are no events yet.",
1609
- "Events.latest": "Latest events",
1610
1609
  "Events.upcoming": "Upcoming events",
1611
1610
  "Events.myEvents": "My Booked events",
1612
1611
  "Events.pastEvents": "Past events",
@@ -1037,7 +1037,7 @@ var es = {
1037
1037
  "Themes.selectorDescription": "Seleccione un color del tema para LiveTiles Reach",
1038
1038
  "Themes.colorPickerDescription": "Puede personalizar los colores al hacer clic en las muestras de color debajo.",
1039
1039
  "Themes.contrast.info": "These ratings are based off the WCAG guidelines on contrast. Learn more <a>here</a>.",
1040
- "Themes.contrast.number": "Contrast Number: {number}",
1040
+ "Themes.contrast.ratio": "Contrast Ratio: {ratio}",
1041
1041
  "Themes.contrast.rating": "Contrast Rating: {rating}",
1042
1042
  "Themes.contrast.pass": "good",
1043
1043
  "Themes.contrast.fail": "fail",
@@ -1037,7 +1037,7 @@ var fr = {
1037
1037
  "Themes.selectorDescription": "Sélectionnez une couleur pour le thème de LiveTiles Reach.",
1038
1038
  "Themes.colorPickerDescription": "Vous pouvez sélectionner une couleur personnalisée en cliquant ci-dessous.",
1039
1039
  "Themes.contrast.info": "These ratings are based off the WCAG guidelines on contrast. Learn more <a>here</a>.",
1040
- "Themes.contrast.number": "Contrast Number: {number}",
1040
+ "Themes.contrast.ratio": "Contrast Ratio: {ratio}",
1041
1041
  "Themes.contrast.rating": "Contrast Rating: {rating}",
1042
1042
  "Themes.contrast.pass": "good",
1043
1043
  "Themes.contrast.fail": "fail",
package/index.esm2.js CHANGED
@@ -87976,9 +87976,9 @@ var AuthenticationContextProvider = function AuthenticationContextProvider(_a) {
87976
87976
  }), void 0);
87977
87977
  };
87978
87978
 
87979
- var version$1 = "0.3.70";
87980
- var buildId = "101606";
87981
- var commitId = "6112df41ab4f2961a2ca438bf959528e69d63a8d";
87979
+ var version$1 = "0.3.75";
87980
+ var buildId = "101837";
87981
+ var commitId = "1ff94f93a1dbcb8e5d53e887f46440be41e27df9";
87982
87982
  var isCustomerBuild = false;
87983
87983
  var buildInfo = {
87984
87984
  version: version$1,
@@ -132091,8 +132091,8 @@ if(inputBox.top<500){suggestionsContainer.style.top=inputBox.height-10+"px";}els
132091
132091
  // here we detect this (if the post is getting edited) and update the keywords accordingly
132092
132092
  if(filteredKeywords.length!==flatDefaultKeywords.length){onChangeKeywords(filteredKeywords);}setSelectedItems(filteredKeywords.map(function(k){return {name:getKeywordDisplayValue(selectedKeywordGroups,user,k.groupId,k.name),key:k.id,isMandatory:mandatoryKeywordIds.includes(k.id)};}));}function getAllSuggestions(selectedItems){return availableKeywords===null||availableKeywords===void 0?void 0:availableKeywords.filter(function(k){return (selectedItems||[]).every(function(i){return i.key!==k.id;});}).map(function(k){return {key:k.id,name:getKeywordDisplayValue(selectedKeywordGroups,user,k.groupId,k.name)};});}function handleOnChange(items){var itemKeys=items.map(function(i){return i.key;});// this prevents the user from removing a mandatory keyword by using the backspace button
132093
132093
  if(!mandatoryKeywordIds.every(function(id){return itemKeys.includes(id);})){return;}updateKeywords(items);}function removeItem(item){var filteredSelectedItems=selectedItems.filter(function(i){return i.key!==item.key;});updateKeywords(filteredSelectedItems);}function updateKeywords(items){setSelectedItems(items);var selectedItemIds=items.map(function(i){return i.key;});onChangeKeywords(availableKeywords.filter(function(k){return selectedItemIds.includes(k.id);}));}};var MandatoryKeywordsInfoIcon=function MandatoryKeywordsInfoIcon(){var formatMessage=useIntl().formatMessage;var _a=useState$2(false),showCallout=_a[0],setShowCallout=_a[1];var infoButtonRef=useRef$1();return jsxs("div",__assign({ref:infoButtonRef},{children:[jsx$1(StyledIconButton$7,{iconProps:{iconName:'Info'},onClick:function(){return setShowCallout(!showCallout);},ariaLabel:formatMessage({id:'Keywords.picker.tooltipAriaLabel'})},void 0),showCallout&&jsx$1(StyledCallout$1,__assign({onDismiss:function(){return setShowCallout(false);},target:infoButtonRef.current},{children:jsx$1(FormattedMessage$1,{id:"Keywords.picker.tooltip"},void 0)}),void 0)]}),void 0);};var Tag=function Tag(_a){var item=_a.item,onRemoveItem=_a.onRemoveItem;var formatMessage=useIntl().formatMessage;var canBeRemoved=!item.isMandatory;return jsxs(TagWrapper,__assign({"data-keyword-tag":item.name},{children:[jsx$1(KeywordName,{children:item.name},void 0),canBeRemoved&&jsx$1(RemoveTagButton,{iconProps:{iconName:'Cancel'},onClick:function(){return onRemoveItem(item);},ariaLabel:formatMessage({id:'AriaLabel.removeKeywordButton'}),"data-remove-keyword-button":true},void 0)]}),void 0);};var Host$V=_styled.div.withConfig({displayName:"KeywordsPicker__Host",componentId:"sc-5ec8mr-0"})(templateObject_1$2i||(templateObject_1$2i=__makeTemplateObject(["\n margin-top: ","px;\n padding: ","px;\n background-color: ",";\n"],["\n margin-top: ","px;\n padding: ","px;\n background-color: ",";\n"])),spacingS,spacingS,function(p){return p.theme.palette.white;});var LabelHost=_styled.div.withConfig({displayName:"KeywordsPicker__LabelHost",componentId:"sc-5ec8mr-1"})(templateObject_2$1v||(templateObject_2$1v=__makeTemplateObject(["\n display: flex;\n"],["\n display: flex;\n"])));var StyledIconButton$7=_styled(IconButton).withConfig({displayName:"KeywordsPicker__StyledIconButton",componentId:"sc-5ec8mr-2"})(templateObject_3$$||(templateObject_3$$=__makeTemplateObject(["\n height: 100%;\n"],["\n height: 100%;\n"])));var StyledCallout$1=_styled(Callout).withConfig({displayName:"KeywordsPicker__StyledCallout",componentId:"sc-5ec8mr-3"})(templateObject_4$J||(templateObject_4$J=__makeTemplateObject(["\n padding: ","px;\n"],["\n padding: ","px;\n"])),spacingS);var TagWrapper=_styled.div.withConfig({displayName:"KeywordsPicker__TagWrapper",componentId:"sc-5ec8mr-4"})(templateObject_5$D||(templateObject_5$D=__makeTemplateObject(["\n background-color: ",";\n line-height: 26px;\n margin-right: ","px;\n display: flex;\n font-size: ","px;\n"],["\n background-color: ",";\n line-height: 26px;\n margin-right: ","px;\n display: flex;\n font-size: ","px;\n"])),function(p){return p.theme.palette.neutralLight;},spacingXxs+1,fontSizeSmall);var KeywordName=_styled.span.withConfig({displayName:"KeywordsPicker__KeywordName",componentId:"sc-5ec8mr-5"})(templateObject_6$s||(templateObject_6$s=__makeTemplateObject(["\n text-overflow: ellipsis;\n overflow: hidden;\n white-space: nowrap;\n min-width: ","px;\n margin: 0 ","px;\n"],["\n text-overflow: ellipsis;\n overflow: hidden;\n white-space: nowrap;\n min-width: ","px;\n margin: 0 ","px;\n"])),spacingL,spacingXs+2);var RemoveTagButton=_styled(IconButton).withConfig({displayName:"KeywordsPicker__RemoveTagButton",componentId:"sc-5ec8mr-6"})(templateObject_7$m||(templateObject_7$m=__makeTemplateObject(["\n padding: 0 ","px;\n border-radius: 0 ","px ","px 0;\n width: ","px;\n height: auto;\n i {\n font-size: ","px;\n }\n"],["\n padding: 0 ","px;\n border-radius: 0 ","px ","px 0;\n width: ","px;\n height: auto;\n i {\n font-size: ","px;\n }\n"])),spacingXxs+1,spacingXxs-1,spacingXxs-1,spacingL,fontSizeSmaller);var StyledTagPicker=_styled(TagPicker).withConfig({displayName:"KeywordsPicker__StyledTagPicker",componentId:"sc-5ec8mr-7"})(templateObject_8$k||(templateObject_8$k=__makeTemplateObject(["\n margin-top: ","px;\n"],["\n margin-top: ","px;\n"])),spacingS);var templateObject_1$2i,templateObject_2$1v,templateObject_3$$,templateObject_4$J,templateObject_5$D,templateObject_6$s,templateObject_7$m,templateObject_8$k;var hasValidGenericUrlVideoSourcePrefix=function hasValidGenericUrlVideoSourcePrefix(url){return url&&getAdditionalVideoSources().filter(function(s){return url.startsWith(s.prefix);}).length>0;};var VideoUrlParser=/** @class */function(){function VideoUrlParser(url){this.url=url;this.source=null;this.id=null;this.isDirectVideoUrl=false;this.videoProperties=null;this.thumbnailUrl=null;if(hasValidGenericUrlVideoSourcePrefix(this.url)){this.source=VideoSource.GenericUrl;this.id=url;}else if(VideoUrlParser.microsoftStreamRegex.test(this.url)){this.source=VideoSource.MicrosoftStream;this.id=VideoUrlParser.microsoftStreamRegex.exec(this.url)[1];}else if(VideoUrlParser.ytRegex.test(this.url)){this.source=VideoSource.YouTube;this.id=VideoUrlParser.ytRegex.exec(this.url)[1];}else if(VideoUrlParser.vimeoRegex.test(this.url)){this.source=VideoSource.Vimeo;this.id=VideoUrlParser.vimeoRegex.exec(this.url)[1];}else if(VideoUrlParser.vimeoDirectLinkRegex.test(this.url)){this.source=VideoSource.Vimeo;this.id=VideoUrlParser.vimeoDirectLinkRegex.exec(this.url)[1];this.isDirectVideoUrl=true;}else if(VideoUrlParser.vimeoRedirectLinkRegex.test(this.url)){this.source=VideoSource.Vimeo;this.id=VideoUrlParser.vimeoRedirectLinkRegex.exec(this.url)[1];}else if(VideoUrlParser.kalturaRegex.test(this.url)){var regexMatches=VideoUrlParser.kalturaRegex.exec(this.url);this.source=VideoSource.Kaltura;this.id=regexMatches[1];this.videoProperties={sp:regexMatches[2],uiconfId:regexMatches[3],partnerId:regexMatches[4],entryId:regexMatches[5]};this.thumbnailUrl="https://cdnsecakmi.kaltura.com/p/"+this.id+"/thumbnail/entry_id/"+this.videoProperties.entryId+"/width/1000";}}//TODO handle the different error messages for cloud and onprem versions, i.e. what sources are permitted (see task 23570)
132094
- VideoUrlParser.prototype.isValid=function(features){var _this=this;if(this.source==null||this.id==null){return false;}if(features){var sources=getVideoSources(features);return sources.findIndex(function(s){return s.type===_this.source;})>=0;}return true;};VideoUrlParser.ytRegex=/^.*(?:(?:youtu.be\/)|(?:v\/)|(?:\/u\/\w\/)|(?:embed\/)|(?:watch\?))\??v?=?([^#&?]*).*$/;VideoUrlParser.vimeoRegex=/.*?(?:vimeo.com\/){1}(?:video\/)?(\d+)/;// match first GUID after domain
132095
- VideoUrlParser.microsoftStreamRegex=/.*web\.microsoftstream\.com.+?([0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12})/i;VideoUrlParser.vimeoDirectLinkRegex=/.*?(?:player\.vimeo\.com\/external\/){1}(\d+)/;VideoUrlParser.vimeoRedirectLinkRegex=/.*?(?:player\.vimeo\.com\/progressive_redirect\/playback\/){1}(\d+)(?:\/.*)/;VideoUrlParser.kalturaRegex=/.+cdnapisec\.kaltura\.com\/p\/([0-9]+)\/sp\/([0-9]+)\/embedIframeJs\/uiconf_id\/([0-9]+)\/partner_id\/([0-9]+)(?:.*entry_id=(.+?(?=&|$)))/;return VideoUrlParser;}();function getVideoSources(features){var sources=[];if(features.editorYouTubeVideos){sources.push({type:VideoSource.YouTube,name:'YouTube'});}if(features.editorVimeoVideos){sources.push({type:VideoSource.Vimeo,name:'Vimeo'});}if(features.editorMicrosoftVideos){sources.push({type:VideoSource.MicrosoftStream,name:'Microsoft Stream'});}if(features.editorKalturaVideos){sources.push({type:VideoSource.Kaltura,name:'Kaltura'});}return sources;}// this is wrapped, because the "appconfig" does not exist in the component library
132094
+ VideoUrlParser.prototype.isValid=function(features){var _this=this;if(this.source==null||this.id==null){return false;}var sources=getVideoSources(features);return sources.findIndex(function(s){return s.type===_this.source;})>=0;};VideoUrlParser.ytRegex=/^.*(?:(?:youtu.be\/)|(?:v\/)|(?:\/u\/\w\/)|(?:embed\/)|(?:watch\?))\??v?=?([^#&?]*).*$/;VideoUrlParser.vimeoRegex=/.*?(?:vimeo.com\/){1}(?:video\/)?(\d+)/;// match first GUID after domain
132095
+ VideoUrlParser.microsoftStreamRegex=/.*web\.microsoftstream\.com.+?([0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12})/i;VideoUrlParser.vimeoDirectLinkRegex=/.*?(?:player\.vimeo\.com\/external\/){1}(\d+)/;VideoUrlParser.vimeoRedirectLinkRegex=/.*?(?:player\.vimeo\.com\/progressive_redirect\/playback\/){1}(\d+)(?:\/.*)/;VideoUrlParser.kalturaRegex=/.+cdnapisec\.kaltura\.com\/p\/([0-9]+)\/sp\/([0-9]+)\/embedIframeJs\/uiconf_id\/([0-9]+)\/partner_id\/([0-9]+)(?:.*entry_id=(.+?(?=&|$)))/;return VideoUrlParser;}();function getVideoSources(features){var sources=[];if(features.editorYouTubeVideos){sources.push({type:VideoSource.YouTube,name:'YouTube'});}if(features.editorVimeoVideos){sources.push({type:VideoSource.Vimeo,name:'Vimeo'});}if(features.editorMicrosoftVideos){sources.push({type:VideoSource.MicrosoftStream,name:'Microsoft Stream'});}if(features.editorKalturaVideos){sources.push({type:VideoSource.Kaltura,name:'Kaltura'});}getAdditionalVideoSources().forEach(function(customSource){sources.push({type:VideoSource.GenericUrl,name:customSource.name});});return sources;}// this is wrapped, because the "appconfig" does not exist in the component library
132096
132096
  // we should probably provide a better fix for this => #38316
132097
132097
  function getAdditionalVideoSources(){return [];}var isObject$4=isObject$c;var setPrototypeOf=objectSetPrototypeOf;// makes subclassing work correct for wrapped built-ins
132098
132098
  var inheritIfRequired$1=function($this,dummy,Wrapper){var NewTarget,NewTargetPrototype;if(// it can work only with native `setPrototypeOf`
@@ -132172,7 +132172,7 @@ var FAILS_ON_UNDEFINED=fails$1$1(function(){test$1.sort(undefined);});// V8 bug
132172
132172
  var FAILS_ON_NULL=fails$1$1(function(){test$1.sort(null);});// Old WebKit
132173
132173
  var STRICT_METHOD$1=arrayMethodIsStrict$1('sort');var FORCED$1=FAILS_ON_UNDEFINED||!FAILS_ON_NULL||!STRICT_METHOD$1;// `Array.prototype.sort` method
132174
132174
  // https://tc39.github.io/ecma262/#sec-array.prototype.sort
132175
- $$7({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
132175
+ $$7({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);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
132176
132176
  // https://tc39.github.io/ecma262/#sec-samevalue
132177
132177
  var sameValue$1$1=Object.is||function is(x,y){// eslint-disable-next-line no-self-compare
132178
132178
  return x===y?x!==0||1/x===1/y:x!=x&&y!=y;};var fixRegExpWellKnownSymbolLogic$1$1=fixRegexpWellKnownSymbolLogic$1;var anObject$1$1=anObject$h;var requireObjectCoercible$2$1=requireObjectCoercible$b;var sameValue$2=sameValue$1$1;var regExpExec$1$1=regexpExecAbstract$1;// @@search logic
@@ -132286,7 +132286,7 @@ var handleAttachmentCallback=useCallback(handleAttachmentsAdded,[attachments,set
132286
132286
  // => we should display a retry button on the attachment preview
132287
132287
  .then(function(){if(ignoreRef.current){return;}setAttachments(function(attachments){return attachments.map(function(a){return a.id!==newAttachment.id?a:__assign(__assign({},a),{isUploadInProgress:false});});});},function(error){logger.error(error);if(!warningToastHandle.current){warningToastHandle.current=showToastWarning('Attachments.uploadError',undefined,function(){return warningToastHandle.current=null;});}if(ignoreRef.current){return;}setAttachments(function(attachments){return attachments.map(function(a){return a.id!==newAttachment.id?a:__assign(__assign({},a),{hasError:true,isUploadInProgress:false});});});});};for(_i=0,newAttachments_1=newAttachments;_i<newAttachments_1.length;_i++){newAttachment=newAttachments_1[_i];_loop_1(newAttachment);}return [2/*return*/];});});}function clearAttachments(){if(!ignoreRef.current){setAttachments([]);setDeletedAttachmentUrls([]);}}function deleteAttachment(attachment){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:return [4/*yield*/,handleAttachmentsAdded(attachments.filter(function(f){return f.id!==attachment.id;}))];case 1:_a.sent();setDeletedAttachmentUrls(__spreadArray(__spreadArray([],deletedAttachmentUrls),[attachment.url]));return [2/*return*/];}});});}function uploadAttachment(basePath,attachment){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){if(attachment.type===AttachmentType.Image){return [2/*return*/,uploadImage(basePath,user.subscription.id,attachment.id,containerId,attachment.file)];}else {return [2/*return*/,uploadFile(basePath,user.subscription.id,attachment.id,containerId,attachment.file)];}});});}}var EditCommentWithAttachments=function EditCommentWithAttachments(props){var user=useCurrentUser();var getImageUrl=useAttachmentsApi().getImageUrl;var _a=useAttachmentUploader(props.item.attachments,props.item.attachmentContainerId,props.basePath),attachments=_a[0],handleAttachmentsAdded=_a[1],deletedAttachmentUrls=_a[3],onDeleteAttachment=_a[4];return jsx$1(EditComment,__assign({},props,{allowSaveWithoutContent:props.allowSaveWithoutContent,saveOnEnter:props.saveOnEnter,saveOnCtrlEnter:props.saveOnCtrlEnter,files:attachments.map(function(a){return __assign(__assign({},a),!isClientAttachment(a)&&{previewUrl:getImageUrl(props.basePath,user.subscription.id,props.item,a.id)});}),allowAttachments:!!props.basePath,onSave:handlePost,onAttachmentAdded:handleAttachmentsAdded,allowKeywords:props.allowKeywords,availableKeywords:props.availableKeywords,mandatoryKeywords:props.mandatoryKeywords,keywords:props.keywords,deletedFileUrls:deletedAttachmentUrls,onDeleteAttachment:onDeleteAttachment}),void 0);function handlePost(newContent,keywords){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:return [4/*yield*/,props.onSave(newContent,attachments,keywords)];case 1:_a.sent();return [2/*return*/];}});});}};function isClientAttachment(value){return value.file!=null;}var CommentDisplay=function CommentDisplay(_a){var _b;var type=_a.type,baseAttachmentPath=_a.baseAttachmentPath,message=_a.message,onDelete=_a.onDelete,showDelete=_a.showDelete,showAutoTranslate=_a.showAutoTranslate,showEdit=_a.showEdit,scope=_a.scope,mentionSearchHandler=_a.mentionSearchHandler,getHashtagFilterRoute=_a.getHashtagFilterRoute,highlight=_a.highlight,isInitialLiked=_a.isInitialLiked,onReplyIconClick=_a.onReplyIconClick,onReply=_a.onReply,replyCount=_a.replyCount,readOnly=_a.readOnly,className=_a.className;var _c=useCommentApi(),toggleCommentLike=_c.toggleCommentLike,translateComment=_c.translateComment,updateComment=_c.updateComment;var formatMessage=useIntl().formatMessage;var _d=useNotificationContext(),showToast=_d.showToast,showError=_d.showError;var _e=useState$2(false),isEditMode=_e[0],setIsEditMode=_e[1];var _f=useState$2(message.content),content=_f[0],setContent=_f[1];var _g=useState$2(message.attachments),attachments=_g[0],setAttachments=_g[1];var _h=useState$2(message.modified),modifiedTime=_h[0],setModifiedTime=_h[1];var _j=useState$2(message.content),originalContent=_j[0],setOriginalContent=_j[1];var _k=useState$2(isInitialLiked),isLiked=_k[0],setIsLiked=_k[1];var _l=useState$2(((_b=message.statistics)===null||_b===void 0?void 0:_b.likeCount)||0),likeCounter=_l[0],setLikeCounter=_l[1];var features=useFeatures();var palette=useContext(ThemeContext$1).theme.palette;var hasContent=content.length>0;message=__assign(__assign({},message),{attachments:attachments});return jsxs(Container$1,__assign({className:className,"data-comment-id":message.id,"data-has-auto-translate":showAutoTranslate,"data-can-edit":showEdit,"data-can-delete":showDelete,"data-show-highlight":highlight,highlight:highlight,id:"Comment-"+message.id},{children:[jsxs(Header$1,{children:[jsx$1(CommentUser,__assign({upn:message.sender.userPrincipalName,domIdentifier:"avatar"},{children:jsx$1(Avatar,{upn:message.sender.userPrincipalName,text:message.sender.displayName,size:PersonaSize.small,hidePersonaDetails:true},void 0)}),void 0),jsxs(HeaderMetadata$1,{children:[jsx$1(CommentDisplayName,{children:jsx$1(StyledPersonaCard$1,__assign({upn:message.sender.userPrincipalName},{children:message.sender.displayName}),void 0)},void 0),jsx$1(CommentDateTime,{className:"ms-fontColor-neutralTertiary",value:message.receivedDateTime},void 0),jsx$1(Modified,{modified:modifiedTime},void 0)]},void 0),message.id&&jsxs(Buttons$1,{children:[features.replyToComments&&replyCount>0&&jsx$1(ReplyCountButton,{tooltipResourceKey:"Comment.numberOfReplies",tooltipResourceKeyValues:{count:replyCount},ariaLabel:formatMessage({id:onReplyIconClick?'AriaLabel.commentsButton':'AriaLabel.repliesButton'}),iconName:"Chat",count:replyCount,feedbackType:"comment",onClick:onReplyIconClick!==null&&onReplyIconClick!==void 0?onReplyIconClick:onReply?function(){return onReply(message.id);}:null,highlight:message.hasUnreadReplies,readOnly:readOnly},void 0),jsx$1(StyledLikeButton$1,{itemId:message.id,itemType:ItemResourceTypes.Comments,count:likeCounter,isActive:isLiked,onClick:function(){return handleLike(!isLiked);},doNotRenderZeroCount:true,isDemoContent:message.isDemoContent,readOnly:readOnly},void 0),jsx$1(CommentActionMenu,{comment:message,showEdit:showEdit,onDelete:onDelete,showDelete:showDelete,isEditMode:isEditMode,toggleEditMode:setIsEditMode,originalContent:originalContent,currentContent:content,setContent:setContent,handleTranslate:handleTranslate,showAutoTranslate:showAutoTranslate,onReply:onReply,disabled:readOnly},void 0)]},void 0)]},void 0),jsxs(Body,{children:[isEditMode&&jsx$1(StyledEditCommentWithAttachments,{content:content,mentionSearchHandler:mentionSearchHandler,onSave:handleSaveComment,onCancel:function(){return setIsEditMode(false);},basePath:baseAttachmentPath,item:message,allowSaveWithoutContent:true,saveOnCtrlEnter:true},void 0),!isEditMode&&hasContent&&jsx$1(Fragment,{children:jsx$1(Content$4,__assign({"data-comment-content":message.id},{children:jsx$1(ContentDisplay,{content:content,handlers:[ContentDisplayHandler.LineBreak,ContentDisplayHandler.Link,ContentDisplayHandler.Mention,ContentDisplayHandler.Hashtag],getHashtagRoute:getHashtagFilterRoute},void 0)}),void 0)},void 0)]},void 0),!isEditMode&&(attachments===null||attachments===void 0?void 0:attachments.length)>0&&jsxs("div",__assign({"data-mixed-attachment-list":true},{children:[jsx$1(GifList,{attachments:message.attachments},void 0),jsx$1(StyledImagesAndFilesList$1,{item:message,basePath:baseAttachmentPath,imagesGridBackgroundColor:palette.white},void 0),jsx$1(VideoList,{attachments:message.attachments},void 0),jsx$1(EmbeddedObjectList,{attachments:message.attachments},void 0)]}),void 0)]}),void 0);function handleLike(newIsLiked){return __awaiter(this,void 0,void 0,function(){var oldCounter,error_1;return __generator(this,function(_a){switch(_a.label){case 0:oldCounter=likeCounter;_a.label=1;case 1:_a.trys.push([1,3,,4]);setIsLiked(newIsLiked);setLikeCounter(newIsLiked?oldCounter+1:oldCounter-1);return [4/*yield*/,toggleCommentLike(message.id,newIsLiked)];case 2:_a.sent();return [3/*break*/,4];case 3:error_1=_a.sent();setIsLiked(!newIsLiked);setLikeCounter(oldCounter);logger.error(error_1);showError('Generic.error');return [3/*break*/,4];case 4:return [2/*return*/];}});});}function handleSaveComment(newContent,newAttachments){return __awaiter(this,void 0,void 0,function(){var error_2;return __generator(this,function(_a){switch(_a.label){case 0:setContent(newContent);setAttachments(newAttachments);setIsEditMode(false);setModifiedTime(new Date().toISOString());setOriginalContent(newContent);_a.label=1;case 1:_a.trys.push([1,3,,4]);return [4/*yield*/,updateComment(scope,message.parentItemId,message.id,newContent,newAttachments,type)];case 2:_a.sent();showToast('Comment.successfullyUpdated');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*/];}});});}function handleTranslate(preferredContentLanguageCode){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_b){switch(_b.label){case 0:_b.trys.push([0,2,,3]);return [4/*yield*/,translateComment(type,scope,message.parentItemId,message.id,preferredContentLanguageCode)];case 1:return [2/*return*/,_b.sent()];case 2:_b.sent();showError('Generic.error');return [2/*return*/,null];case 3:return [2/*return*/];}});});}};var Header$1=_styled.div.withConfig({displayName:"CommentDisplay__Header",componentId:"sc-el7c23-0"})(templateObject_1$1I||(templateObject_1$1I=__makeTemplateObject(["\n display: flex;\n align-items: center;\n"],["\n display: flex;\n align-items: center;\n"])));var avatarWidth$1=40;var maxButtonsWidth$1=125;// max 3 buttons (menu button, replies, like)
132288
132288
  var paddingLeft$1=spacingS;var HeaderMetadata$1=_styled.div.withConfig({displayName:"CommentDisplay__HeaderMetadata",componentId:"sc-el7c23-1"})(templateObject_2$11||(templateObject_2$11=__makeTemplateObject(["\n flex: 1;\n box-sizing: border-box;\n font-size: ","px;\n padding-left: ","px;\n max-width: calc(100% - ","px - ","px);\n"],["\n flex: 1;\n box-sizing: border-box;\n font-size: ","px;\n padding-left: ","px;\n max-width: calc(100% - ","px - ","px);\n"])),fontSizeSmall,paddingLeft$1,avatarWidth$1,maxButtonsWidth$1);var CommentDisplayName=_styled.div.withConfig({displayName:"CommentDisplay__CommentDisplayName",componentId:"sc-el7c23-2"})(templateObject_3$I||(templateObject_3$I=__makeTemplateObject(["\n font-weight: bold;\n"],["\n font-weight: bold;\n"])));var StyledPersonaCard$1=_styled(PersonaCard).withConfig({displayName:"CommentDisplay__StyledPersonaCard",componentId:"sc-el7c23-3"})(templateObject_4$t||(templateObject_4$t=__makeTemplateObject(["\n && {\n max-width: 100%;\n .ms-Button {\n width: 100%;\n }\n .ms-Button-textContainer {\n width: 100%;\n }\n\n .ms-Button-label {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n }\n"],["\n && {\n max-width: 100%;\n .ms-Button {\n width: 100%;\n }\n .ms-Button-textContainer {\n width: 100%;\n }\n\n .ms-Button-label {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n }\n"])));var CommentDateTime=_styled(DateTime).withConfig({displayName:"CommentDisplay__CommentDateTime",componentId:"sc-el7c23-4"})(templateObject_5$q||(templateObject_5$q=__makeTemplateObject(["\n font-size: 12px;\n"],["\n font-size: 12px;\n"])));var Buttons$1=_styled.div.withConfig({displayName:"CommentDisplay__Buttons",componentId:"sc-el7c23-5"})(templateObject_6$g||(templateObject_6$g=__makeTemplateObject(["\n display: flex;\n align-items: center;\n margin-left: auto;\n\n button {\n height: auto;\n min-height: ","px; /* icons have a font-size of 20px */\n }\n"],["\n display: flex;\n align-items: center;\n margin-left: auto;\n\n button {\n height: auto;\n min-height: ","px; /* icons have a font-size of 20px */\n }\n"])),fontSizeLarge);var Body=_styled.div.withConfig({displayName:"CommentDisplay__Body",componentId:"sc-el7c23-6"})(templateObject_7$b||(templateObject_7$b=__makeTemplateObject(["\n display: flex;\n flex-direction: column;\n margin-top: 5px;\n"],["\n display: flex;\n flex-direction: column;\n margin-top: 5px;\n"])));var Content$4=_styled.div.withConfig({displayName:"CommentDisplay__Content",componentId:"sc-el7c23-7"})(templateObject_8$a||(templateObject_8$a=__makeTemplateObject(["\n padding-top: ","px;\n flex: 1 1 auto;\n a {\n font-weight: bold;\n &:hover,\n &:active {\n text-decoration: underline;\n }\n }\n"],["\n padding-top: ","px;\n flex: 1 1 auto;\n a {\n font-weight: bold;\n &:hover,\n &:active {\n text-decoration: underline;\n }\n }\n"])),spacingXs);var Container$1=_styled.div.withConfig({displayName:"CommentDisplay__Container",componentId:"sc-el7c23-8"})(templateObject_10$7||(templateObject_10$7=__makeTemplateObject(["\n padding-bottom: 15px;\n font-size: ","px;\n line-height: ","px;\n\n ","\n"],["\n padding-bottom: 15px;\n font-size: ","px;\n line-height: ","px;\n\n ","\n"])),fontSizeSmall,spacingM,function(p){return p.highlight&&css$2(templateObject_9$8||(templateObject_9$8=__makeTemplateObject(["\n position: relative;\n\n &::after {\n content: '';\n position: absolute;\n top: -","px;\n bottom: 0;\n right: -","px;\n width: ","px;\n display: block;\n background-color: ",";\n }\n "],["\n position: relative;\n\n &::after {\n content: '';\n position: absolute;\n top: -","px;\n bottom: 0;\n right: -","px;\n width: ","px;\n display: block;\n background-color: ",";\n }\n "])),postsSectionPadding,postsSectionPadding,spacingXs,function(p){return p.theme.palette.accent;});});var CommentUser=_styled(PersonaCard).withConfig({displayName:"CommentDisplay__CommentUser",componentId:"sc-el7c23-9"})(templateObject_11$3||(templateObject_11$3=__makeTemplateObject(["\n align-self: flex-start;\n"],["\n align-self: flex-start;\n"])));var StyledEditCommentWithAttachments=_styled(EditCommentWithAttachments).withConfig({displayName:"CommentDisplay__StyledEditCommentWithAttachments",componentId:"sc-el7c23-10"})(templateObject_12$2$1||(templateObject_12$2$1=__makeTemplateObject(["\n width: 100%;\n position: relative;\n"],["\n width: 100%;\n position: relative;\n"])));var StyledImagesAndFilesList$1=_styled(ImagesAndFilesList).withConfig({displayName:"CommentDisplay__StyledImagesAndFilesList",componentId:"sc-el7c23-11"})(templateObject_13$2$1||(templateObject_13$2$1=__makeTemplateObject(["\n margin-top: ","px;\n\n && [data-preload-video='true'] video {\n background-color: ",";\n }\n"],["\n margin-top: ","px;\n\n && [data-preload-video='true'] video {\n background-color: ",";\n }\n"])),spacingM,function(p){return p.theme.palette.white;});var FeedbackButtonStyle=css$2(templateObject_14$2$1||(templateObject_14$2$1=__makeTemplateObject(["\n min-width: auto;\n padding: 0 4px;\n\n && {\n margin-right: 0;\n }\n\n i {\n font-size: ","px;\n height: ","px;\n line-height: ","px;\n }\n"],["\n min-width: auto;\n padding: 0 4px;\n\n && {\n margin-right: 0;\n }\n\n i {\n font-size: ","px;\n height: ","px;\n line-height: ","px;\n }\n"])),fontSizeMedium+2,fontSizeMedium+2,fontSizeMedium+2);var StyledLikeButton$1=_styled(LikeButton).withConfig({displayName:"CommentDisplay__StyledLikeButton",componentId:"sc-el7c23-12"})(templateObject_15$2$1||(templateObject_15$2$1=__makeTemplateObject(["\n ","\n"],["\n ","\n"])),FeedbackButtonStyle);var ReplyCountButton=_styled(FeedbackCountButton).withConfig({displayName:"CommentDisplay__ReplyCountButton",componentId:"sc-el7c23-13"})(templateObject_16$2||(templateObject_16$2=__makeTemplateObject(["\n &&& {\n margin-right: ","px;\n }\n ","\n"],["\n &&& {\n margin-right: ","px;\n }\n ","\n"])),spacingS,FeedbackButtonStyle);var templateObject_1$1I,templateObject_2$11,templateObject_3$I,templateObject_4$t,templateObject_5$q,templateObject_6$g,templateObject_7$b,templateObject_8$a,templateObject_9$8,templateObject_10$7,templateObject_11$3,templateObject_12$2$1,templateObject_13$2$1,templateObject_14$2$1,templateObject_15$2$1,templateObject_16$2;var CardStatisticItem=function CardStatisticItem(_a){var count=_a.count,tooltipResourceKey=_a.tooltipResourceKey,icon=_a.icon,ariaLabel=_a.ariaLabel,targetRoute=_a.targetRoute,highlight=_a.highlight,onClick=_a.onClick,className=_a.className,domIdentifier=_a.domIdentifier;var formatMessage=useIntl().formatMessage;return jsx$1(Tooltip,__assign({resourceKey:tooltipResourceKey,values:{count:count},className:className},{children:onClick?jsx$1(StatisticButton,__assign({"data-statistic-button":domIdentifier,iconProps:{iconName:icon},onClick:onClick,"aria-label":formatMessage({id:ariaLabel})},{children:count>0&&jsx$1(StatisticCount,__assign({"aria-hidden":"true"},{children:count}),void 0)}),void 0):jsxs(StatisticLink,__assign({to:targetRoute,"aria-label":formatMessage({id:ariaLabel})},{children:[jsx$1(StatisticIcon,{iconName:icon,highlight:highlight},void 0),count>0&&jsx$1(StatisticCount,__assign({"aria-hidden":"true"},{children:count}),void 0)]}),void 0)}),void 0);};var StatisticLink=_styled(NavLink).withConfig({displayName:"CardStatisticItem__StatisticLink",componentId:"sc-1ll8iv5-0"})(templateObject_1$1H||(templateObject_1$1H=__makeTemplateObject(["\n display: inline-flex;\n align-items: center;\n color: ",";\n height: ","px;\n"],["\n display: inline-flex;\n align-items: center;\n color: ",";\n height: ","px;\n"])),function(p){return p.theme.textColors.default;},feedbackButtonHeight);var StatisticButton=_styled(IconButton).withConfig({displayName:"CardStatisticItem__StatisticButton",componentId:"sc-1ll8iv5-1"})(templateObject_2$10||(templateObject_2$10=__makeTemplateObject(["\n && {\n width: auto;\n margin: 0;\n padding: 0;\n\n i {\n font-size: ","px;\n }\n }\n"],["\n && {\n width: auto;\n margin: 0;\n padding: 0;\n\n i {\n font-size: ","px;\n }\n }\n"])),fontSizeLarge-3);var StatisticIcon=_styled(Icon).withConfig({displayName:"CardStatisticItem__StatisticIcon",componentId:"sc-1ll8iv5-2"})(templateObject_3$H||(templateObject_3$H=__makeTemplateObject(["\n ","\n"],["\n ","\n"])),function(p){return p.highlight&&unreadCommentHighlight;});var StatisticCount=_styled.span.withConfig({displayName:"CardStatisticItem__StatisticCount",componentId:"sc-1ll8iv5-3"})(templateObject_4$s||(templateObject_4$s=__makeTemplateObject(["\n flex: 1 0 auto;\n padding-left: 5px;\n font-size: 0.9rem;\n"],["\n flex: 1 0 auto;\n padding-left: 5px;\n font-size: 0.9rem;\n"])));var templateObject_1$1H,templateObject_2$10,templateObject_3$H,templateObject_4$s;var BookmarkButton=function BookmarkButton(_a){var item=_a.item,isReadOnly=_a.isReadOnly,className=_a.className;var formatMessage=useIntl().formatMessage;var refreshStatistics=useNewsApi().refreshStatistics;var toggleBookmark=useManageCurrentUserApi().toggleBookmark;var user=useCurrentUser();var showError=useNotificationContext().showError;var _b=useState$2(isUserBookmarked),isBookmarked=_b[0],setIsBookmarked=_b[1];var _c=useState$2(false),isSaving=_c[0],setIsSaving=_c[1];var itemId=item===null||item===void 0?void 0:item.id;var resourceKey="BookmarkButton."+(isBookmarked?'remove':'add')+"Tooltip";useEffect$1(function(){setIsBookmarked(isUserBookmarked());// eslint-disable-next-line react-hooks/exhaustive-deps
132289
- },[itemId]);return jsx$1(Tooltip,__assign({className:className,resourceKey:resourceKey},{children:jsx$1(StyledIconButton$5,{iconProps:{iconName:isBookmarked?'SingleBookmarkSolid':'SingleBookmark'},"data-bookmark-button":itemId,onClick:toggle,"aria-label":formatMessage({id:resourceKey}),disabled:isReadOnly},void 0)}),void 0);function isUserBookmarked(){var _a;return (_a=user.bookmarks)===null||_a===void 0?void 0:_a.some(function(id){return id===(item===null||item===void 0?void 0:item.id);});}function toggle(e){return __awaiter(this,void 0,void 0,function(){var isNowBookmarked;return __generator(this,function(_a){switch(_a.label){case 0:e.preventDefault();e.stopPropagation();if(isSaving){return [2/*return*/];}setIsSaving(true);isNowBookmarked=!isBookmarked;setIsBookmarked(isNowBookmarked);_a.label=1;case 1:_a.trys.push([1,4,5,6]);return [4/*yield*/,toggleBookmark(itemId,user)];case 2:_a.sent();return [4/*yield*/,refreshStatistics(itemId,{bookmarkCount:isNowBookmarked?1:-1})];case 3:_a.sent();return [3/*break*/,6];case 4:_a.sent();setIsBookmarked(!isNowBookmarked);showError('Profile.bookmarkError');return [3/*break*/,6];case 5:setIsSaving(false);return [7/*endfinally*/];case 6:return [2/*return*/];}});});}};var StyledIconButton$5=_styled(IconButton).withConfig({displayName:"BookmarkButton__StyledIconButton",componentId:"sc-1ni4s3y-0"})(templateObject_1$1G||(templateObject_1$1G=__makeTemplateObject(["\n padding-left: 0;\n padding-right: 0;\n margin-left: -3px;\n\n i {\n font-size: 22px;\n }\n\n &[disabled] {\n background: transparent;\n }\n"],["\n padding-left: 0;\n padding-right: 0;\n margin-left: -3px;\n\n i {\n font-size: 22px;\n }\n\n &[disabled] {\n background: transparent;\n }\n"])));var templateObject_1$1G;var CardFooter=function CardFooter(_a){var item=_a.item,showComments=_a.showComments,targetRoute=_a.targetRoute;var metadata=item.metadata||{};var user=useCurrentUser();var showCommentsIcon=showComments&&item.statistics&&item.statistics.commentCount>0&&hasFeedbackType(metadata.feedbackSettings,'comment');return jsx$1(CardFooterHost,{children:jsxs(FooterRightSection,{children:[!item.useExternalContent&&jsx$1(CardLikeButton,{item:item,itemResourceType:ItemResourceTypes.News},void 0),!user.isPublicUser&&!item.useExternalContent&&showCommentsIcon&&jsx$1(CardStatisticItem,{count:item.statistics.commentCount,tooltipResourceKey:"NewsArticle.numberOfComments",icon:"Chat",targetRoute:targetRoute+"#comments",highlight:item.hasNewComments,ariaLabel:"AriaLabel.commentsButton"},void 0),jsx$1(BookmarkButton,{item:item},void 0)]},void 0)},void 0);};var CardFooterHost=_styled.footer.withConfig({displayName:"CardFooter__CardFooterHost",componentId:"sc-8sbpem-0"})(templateObject_1$1F||(templateObject_1$1F=__makeTemplateObject(["\n display: flex;\n margin-top: auto;\n margin-bottom: -4px;\n flex-direction: row;\n justify-content: space-between;\n\n padding-top: ","px;\n\n font-size: ","px;\n\n > div {\n display: flex;\n }\n\n a,\n button {\n position: relative;\n z-index: 1;\n }\n"],["\n display: flex;\n margin-top: auto;\n margin-bottom: -4px;\n flex-direction: row;\n justify-content: space-between;\n\n padding-top: ","px;\n\n font-size: ","px;\n\n > div {\n display: flex;\n }\n\n a,\n button {\n position: relative;\n z-index: 1;\n }\n"])),spacingM,fontSizeMedium+4);var FooterRightSection=_styled.div.withConfig({displayName:"CardFooter__FooterRightSection",componentId:"sc-8sbpem-1"})(templateObject_2$$||(templateObject_2$$=__makeTemplateObject(["\n .ms-TooltipHost {\n display: flex;\n align-items: center;\n }\n\n flex: 1 0 ","px;\n justify-content: flex-end;\n > * {\n margin-left: ","px;\n }\n"],["\n .ms-TooltipHost {\n display: flex;\n align-items: center;\n }\n\n flex: 1 0 ","px;\n justify-content: flex-end;\n > * {\n margin-left: ","px;\n }\n"])),spacingXl,spacingS+5);var templateObject_1$1F,templateObject_2$$;var DetailViewContextProvider=function DetailViewContextProvider(_a){var itemId=_a.itemId,type=_a.type,loadItemFunc=_a.loadItemFunc,isEditorPreview=_a.isEditorPreview,children=_a.children;var user=useCurrentUserContext().user;var handleFatalError=useContext(ErrorContext).handleFatalError;var translateContents=useTranslateApi().translateContents;var _b=useState$2(),item=_b[0],setItem=_b[1];var _c=useState$2(),originalItem=_c[0],setOriginalItem=_c[1];var _d=useState$2(),selectedLanguage=_d[0],setSelectedLanguage=_d[1];var _e=useState$2(false),hasError=_e[0],setHasError=_e[1];var _f=useState$2(true),isLoading=_f[0],setIsLoading=_f[1];var _g=useState$2(false),showAccessDenied=_g[0],setShowAccessDenied=_g[1];var handleAccessDeniedError=useContext(ErrorContext).handleAccessDeniedError;var isValid=true;useEffect$1(function(){refreshItem();return function(){// eslint-disable-next-line react-hooks/exhaustive-deps
132289
+ },[itemId]);return jsx$1(Tooltip,__assign({className:className,resourceKey:resourceKey},{children:jsx$1(StyledIconButton$5,{iconProps:{iconName:isBookmarked?'SingleBookmarkSolid':'SingleBookmark'},"data-bookmark-button":itemId,onClick:toggle,"aria-label":formatMessage({id:resourceKey}),disabled:isReadOnly},void 0)}),void 0);function isUserBookmarked(){var _a;return (_a=user.bookmarks)===null||_a===void 0?void 0:_a.some(function(id){return id===(item===null||item===void 0?void 0:item.id);});}function toggle(e){return __awaiter(this,void 0,void 0,function(){var isNowBookmarked;return __generator(this,function(_a){switch(_a.label){case 0:e.preventDefault();e.stopPropagation();if(isSaving){return [2/*return*/];}setIsSaving(true);isNowBookmarked=!isBookmarked;setIsBookmarked(isNowBookmarked);_a.label=1;case 1:_a.trys.push([1,4,5,6]);return [4/*yield*/,toggleBookmark(itemId,user)];case 2:_a.sent();return [4/*yield*/,refreshStatistics(itemId,{bookmarkCount:isNowBookmarked?1:-1})];case 3:_a.sent();return [3/*break*/,6];case 4:_a.sent();setIsBookmarked(!isNowBookmarked);showError('Profile.bookmarkError');return [3/*break*/,6];case 5:setIsSaving(false);return [7/*endfinally*/];case 6:return [2/*return*/];}});});}};var StyledIconButton$5=_styled(IconButton).withConfig({displayName:"BookmarkButton__StyledIconButton",componentId:"sc-1ni4s3y-0"})(templateObject_1$1G||(templateObject_1$1G=__makeTemplateObject(["\n padding-left: 0;\n padding-right: 0;\n margin-left: -3px;\n\n i {\n font-size: 22px;\n }\n\n &[disabled] {\n background: transparent;\n }\n"],["\n padding-left: 0;\n padding-right: 0;\n margin-left: -3px;\n\n i {\n font-size: 22px;\n }\n\n &[disabled] {\n background: transparent;\n }\n"])));var templateObject_1$1G;var CardFooter=function CardFooter(_a){var item=_a.item,showComments=_a.showComments,targetRoute=_a.targetRoute;var metadata=item.metadata||{};var user=useCurrentUser();var showCommentsIcon=showComments&&item.statistics&&item.statistics.commentCount>0&&hasFeedbackType(metadata.feedbackSettings,'comment');return jsx$1(CardFooterHost,{children:jsxs(FooterRightSection,{children:[jsx$1(CardLikeButton,{item:item,itemResourceType:ItemResourceTypes.News},void 0),!user.isPublicUser&&showCommentsIcon&&jsx$1(CardStatisticItem,{count:item.statistics.commentCount,tooltipResourceKey:"NewsArticle.numberOfComments",icon:"Chat",targetRoute:targetRoute+"#comments",highlight:item.hasNewComments,ariaLabel:"AriaLabel.commentsButton"},void 0),jsx$1(BookmarkButton,{item:item},void 0)]},void 0)},void 0);};var CardFooterHost=_styled.footer.withConfig({displayName:"CardFooter__CardFooterHost",componentId:"sc-8sbpem-0"})(templateObject_1$1F||(templateObject_1$1F=__makeTemplateObject(["\n display: flex;\n margin-top: auto;\n margin-bottom: -4px;\n flex-direction: row;\n justify-content: space-between;\n\n padding-top: ","px;\n\n font-size: ","px;\n\n > div {\n display: flex;\n }\n\n a,\n button {\n position: relative;\n z-index: 1;\n }\n"],["\n display: flex;\n margin-top: auto;\n margin-bottom: -4px;\n flex-direction: row;\n justify-content: space-between;\n\n padding-top: ","px;\n\n font-size: ","px;\n\n > div {\n display: flex;\n }\n\n a,\n button {\n position: relative;\n z-index: 1;\n }\n"])),spacingM,fontSizeMedium+4);var FooterRightSection=_styled.div.withConfig({displayName:"CardFooter__FooterRightSection",componentId:"sc-8sbpem-1"})(templateObject_2$$||(templateObject_2$$=__makeTemplateObject(["\n .ms-TooltipHost {\n display: flex;\n align-items: center;\n }\n\n flex: 1 0 ","px;\n justify-content: flex-end;\n > * {\n margin-left: ","px;\n }\n"],["\n .ms-TooltipHost {\n display: flex;\n align-items: center;\n }\n\n flex: 1 0 ","px;\n justify-content: flex-end;\n > * {\n margin-left: ","px;\n }\n"])),spacingXl,spacingS+5);var templateObject_1$1F,templateObject_2$$;var DetailViewContextProvider=function DetailViewContextProvider(_a){var itemId=_a.itemId,type=_a.type,loadItemFunc=_a.loadItemFunc,isEditorPreview=_a.isEditorPreview,children=_a.children;var user=useCurrentUserContext().user;var handleFatalError=useContext(ErrorContext).handleFatalError;var translateContents=useTranslateApi().translateContents;var _b=useState$2(),item=_b[0],setItem=_b[1];var _c=useState$2(),originalItem=_c[0],setOriginalItem=_c[1];var _d=useState$2(),selectedLanguage=_d[0],setSelectedLanguage=_d[1];var _e=useState$2(false),hasError=_e[0],setHasError=_e[1];var _f=useState$2(true),isLoading=_f[0],setIsLoading=_f[1];var _g=useState$2(false),showAccessDenied=_g[0],setShowAccessDenied=_g[1];var handleAccessDeniedError=useContext(ErrorContext).handleAccessDeniedError;var isValid=true;useEffect$1(function(){refreshItem();return function(){// eslint-disable-next-line react-hooks/exhaustive-deps
132290
132290
  isValid=false;};},[itemId]);if(showAccessDenied){handleAccessDeniedError({});return null;}var activeLanguages=NewsService.getItemContentLanguages(originalItem,user.subscription.languages);return jsx$1(DetailViewContext.Provider,__assign({value:getContextValues()},{children:children}),void 0);function getContextValues(){return {isLoading:isLoading,hasError:hasError,resourceType:type,item:item,itemId:itemId,contentLanguage:selectedLanguage===null||selectedLanguage===void 0?void 0:selectedLanguage.lang,userPreferredLanguage:(selectedLanguage===null||selectedLanguage===void 0?void 0:selectedLanguage.isUserSet)?selectedLanguage.lang:getPreferredContentLanguage(user),activeLanguages:activeLanguages,content:item&&selectedLanguage?item.contents[selectedLanguage.lang]:null,updateSelectedLanguage:function(l){return setSelectedLanguage({lang:l,isUserSet:true});},handleRefresh:handleRefresh,handleLanguageChange:handleLanguageChange,isEditorPreview:isEditorPreview};}function handleRefresh(onFinished){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:return [4/*yield*/,refreshItem()];case 1:_a.sent();onFinished&&onFinished();return [2/*return*/];}});});}function refreshItem(){return __awaiter(this,void 0,void 0,function(){var p,selectedLanguage_1,err_1;return __generator(this,function(_a){switch(_a.label){case 0:_a.trys.push([0,2,3,4]);return [4/*yield*/,loadItemFunc(itemId)];case 1:p=_a.sent();selectedLanguage_1=NewsService.getLanguageForPublishableItem(p,user);if(isValid){setItem(p);setOriginalItem(p);setSelectedLanguage({isUserSet:false,lang:selectedLanguage_1});setHasError(false);}return [3/*break*/,4];case 2:err_1=_a.sent();if(err_1&&err_1.response&&err_1.response.statusCode===404){if(isValid){setItem(null);setSelectedLanguage(null);setHasError(true);}}else if(err_1&&err_1.response&&err_1.response.statusCode===403){setShowAccessDenied(true);}else {logger.error(err_1);handleFatalError({error:err_1,messageId:'Generic.error'});}return [3/*break*/,4];case 3:isValid&&setIsLoading(false);return [7/*endfinally*/];case 4:return [2/*return*/];}});});}function handleLanguageChange(language){return __awaiter(this,void 0,void 0,function(){var content;var _a;return __generator(this,function(_b){switch(_b.label){case 0:if(item.contents[language]){setSelectedLanguage({isUserSet:true,lang:language});return [2/*return*/];}return [4/*yield*/,translateContents(type,itemId,language)];case 1:content=_b.sent();setItem(__assign(__assign({},item),{contents:__assign(__assign({},item.contents),(_a={},_a[language]=content,_a))}));setSelectedLanguage({isUserSet:true,lang:language});return [2/*return*/];}});});}};var EntityType;(function(EntityType){EntityType["Video"]="video";EntityType["Image"]="image";EntityType["File"]="file";EntityType["Quote"]="quote";EntityType["InlineCode"]="inline-code";EntityType["Gallery"]="gallery";EntityType["Table"]="table";EntityType["Contact"]="contact";EntityType["InlinePageList"]="inline-page-list";EntityType["UrlPreview"]="url-preview";})(EntityType||(EntityType={}));var TextViewer=function TextViewer(_a){var html=_a.html,componentMappers=_a.componentMappers;var _b=useState$2(null),editorState=_b[0],setEditorState=_b[1];useEffect$1(function(){setEditorState(getInitialEditorState());// eslint-disable-next-line react-hooks/exhaustive-deps
132291
132291
  },[html]);if(!editorState){return null;}var currentContent=editorState.getCurrentContent();return jsx$1(Draft$1.Editor,{readOnly:true,editorState:editorState,onChange:function(){return null;},blockRendererFn:blockRenderer,blockStyleFn:blockStyle,blockRenderMap:headingRenderMap},void 0);function blockStyle(block){var type=block.getType();if(type==='unstyled'){return 'paragraph';}return null;}function blockRenderer(block){if(block.getType()!=='atomic'){return null;}var entityKey=block.getEntityAt(0);if(entityKey==null){return null;}var entity=currentContent.getEntity(entityKey);var handler=componentMappers.find(function(h){return h.type===entity.getType();});if(handler!=null){return {component:handler.component,editable:false,props:__assign({},entity.getData())};}return null;}function getInitialEditorState(){var contentState=convertFromHTML$1({htmlToEntity:convertHtmlToEntity,htmlToBlock:createHtmlToBlockConverter(componentMappers)})(html||'');return Draft$1.EditorState.createWithContent(contentState,decorator);}function convertHtmlToEntity(nodeName,node,createEntity){for(var _i=0,componentMappers_1=componentMappers;_i<componentMappers_1.length;_i++){var handler=componentMappers_1[_i];var match=handler.getPropsFromHtml(nodeName,node);if(match){return createEntity(handler.type,'IMMUTABLE',match);}}if(nodeName==='a'){return createEntity('LINK','MUTABLE',{url:node.getAttribute('href')});}return null;}};var Link$2=function Link(_a){var contentState=_a.contentState,entityKey=_a.entityKey,children=_a.children;var url=contentState.getEntity(entityKey).getData().url;return jsx$1(TextLink,__assign({url:url},{children:children}),void 0);};function findLinkEntities(contentBlock,callback,contentState){contentBlock.findEntityRanges(function(character){var entityKey=character.getEntity();return entityKey!==null&&contentState.getEntity(entityKey).getType()==='LINK';},callback);}var decorator=new Draft$1.CompositeDecorator([{strategy:findLinkEntities,component:Link$2}]);function createHtmlToBlockConverter(componentMappers){var componentMapperParentNodes=[];return function(nodeName,node){// note (sl): draftJS does call this for all root elements AND
132292
132292
  // their children. We only want to handle an element,
@@ -132522,18 +132522,11 @@ var NewsDetailMainContent = function NewsDetailMainContent(_a) {
132522
132522
  var hideComments = _a.hideComments,
132523
132523
  hideLikes = _a.hideLikes;
132524
132524
  var item = useDetailViewContext().item;
132525
-
132526
- if (item === null || item === void 0 ? void 0 : item.useExternalContent) {
132527
- return jsxs(DetailMainSection, {
132528
- children: [jsx$1(DetailViewHeadline, {}, void 0), jsx$1(DetailViewTitle, {}, void 0), jsx$1(DetailViewIntro, {}, void 0), jsx$1(NewsDetailViewMetaInfo, {}, void 0), jsx$1(DetailViewBodyExternalContent, {
132529
- itemType: ItemResourceTypes.News
132530
- }, void 0)]
132531
- }, void 0);
132532
- }
132533
-
132534
132525
  return jsxs(Fragment, {
132535
132526
  children: [jsxs(DetailMainSection, {
132536
- children: [jsx$1(DetailViewHeadline, {}, void 0), jsx$1(DetailViewTitle, {}, void 0), jsx$1(DetailViewIntro, {}, void 0), jsx$1(NewsDetailViewMetaInfo, {}, void 0), jsx$1(DetailViewBody, {}, void 0), jsx$1(DetailViewKeywords, {
132527
+ children: [jsx$1(DetailViewHeadline, {}, void 0), jsx$1(DetailViewTitle, {}, void 0), jsx$1(DetailViewIntro, {}, void 0), jsx$1(NewsDetailViewMetaInfo, {}, void 0), (item === null || item === void 0 ? void 0 : item.useExternalContent) ? jsx$1(DetailViewBodyExternalContent, {
132528
+ itemType: ItemResourceTypes.News
132529
+ }, void 0) : jsx$1(DetailViewBody, {}, void 0), jsx$1(DetailViewKeywords, {
132537
132530
  filterBaseUrl: null
132538
132531
  }, void 0)]
132539
132532
  }, void 0), jsx$1(DetailViewPoll, {}, void 0), jsx$1(DetailViewConfirmations, {}, void 0), jsx$1(NewsDetailViewFeedbackSection, {
@@ -133019,20 +133012,12 @@ var PageDetailInternal = function PageDetailInternal(_a) {
133019
133012
  }, void 0), jsx$1(DetailViewTitle, {}, void 0), jsx$1(DetailViewIntro, {}, void 0), jsx$1(PageDetailViewMetaInfo, {}, void 0)]
133020
133013
  }, void 0);
133021
133014
 
133022
- if (item === null || item === void 0 ? void 0 : item.useExternalContent) {
133023
- return jsxs(Fragment, {
133024
- children: [jsxs(DetailMainSection, {
133025
- children: [Header, jsx$1(DetailViewBodyExternalContent, {
133026
- itemType: ItemResourceTypes.Pages
133027
- }, void 0), jsx$1(PagesDetailViewNavigationWrapper, {}, void 0)]
133028
- }, void 0), jsx$1(DetailViewPoll, {}, void 0), jsx$1(DetailViewConfirmations, {}, void 0)]
133029
- }, void 0);
133030
- }
133031
-
133032
133015
  var isDocument = (item === null || item === void 0 ? void 0 : item.pageType) === PageType.Document;
133033
133016
  return jsxs(Fragment, {
133034
133017
  children: [jsxs(DetailMainSection, {
133035
- children: [Header, !isDocument && jsx$1(DetailViewBody, {}, void 0), isDocument && jsx$1(DetailViewPageDocumentDownload, {}, void 0), jsx$1(InlinePageListWrapper, {}, void 0), jsx$1(PagesDetailViewNavigationWrapper, {}, void 0), jsx$1(DetailViewKeywords, {
133018
+ children: [Header, isDocument ? jsx$1(DetailViewPageDocumentDownload, {}, void 0) : (item === null || item === void 0 ? void 0 : item.useExternalContent) ? jsx$1(DetailViewBodyExternalContent, {
133019
+ itemType: ItemResourceTypes.Pages
133020
+ }, void 0) : jsx$1(DetailViewBody, {}, void 0), jsx$1(InlinePageListWrapper, {}, void 0), jsx$1(PagesDetailViewNavigationWrapper, {}, void 0), jsx$1(DetailViewKeywords, {
133036
133021
  filterBaseUrl: null
133037
133022
  }, void 0)]
133038
133023
  }, void 0), jsx$1(DetailViewPoll, {}, void 0), jsx$1(DetailViewConfirmations, {}, void 0), jsx$1(PageDetailViewFeedbackSection, {
@@ -133681,34 +133666,32 @@ var NewsListInternal = function NewsListInternal(_a) {
133681
133666
  onChannelClick: onChannelClick,
133682
133667
  onKeywordClick: onKeywordClick,
133683
133668
  buttons: jsxs(Fragment, {
133684
- children: [!item.useExternalContent && jsxs(Fragment, {
133685
- children: [jsx$1(CardLikeButton, {
133686
- item: item,
133687
- itemResourceType: ItemResourceTypes.News
133688
- }, void 0), showComments && jsx$1(Tooltip, __assign$g({
133689
- resourceKey: "NewsArticle.numberOfComments",
133690
- values: {
133691
- count: commentsCount
133692
- },
133693
- className: className
133669
+ children: [jsx$1(CardLikeButton, {
133670
+ item: item,
133671
+ itemResourceType: ItemResourceTypes.News
133672
+ }, void 0), showComments && jsx$1(Tooltip, __assign$g({
133673
+ resourceKey: "NewsArticle.numberOfComments",
133674
+ values: {
133675
+ count: commentsCount
133676
+ },
133677
+ className: className
133678
+ }, {
133679
+ children: jsxs(Comments, __assign$g({
133680
+ href: "" + webAppUrl + targetRoute,
133681
+ target: "_blank",
133682
+ rel: "noopener noreferrer",
133683
+ onClick: function (e) {
133684
+ return handleClick(e, item, false, onItemClick, true);
133685
+ }
133694
133686
  }, {
133695
- children: jsxs(Comments, __assign$g({
133696
- href: "" + webAppUrl + targetRoute,
133697
- target: "_blank",
133698
- rel: "noopener noreferrer",
133699
- onClick: function (e) {
133700
- return handleClick(e, item, false, onItemClick, true);
133701
- }
133702
- }, {
133703
- children: [jsx$1(StyledIcon$2, {
133704
- iconName: "Chat",
133705
- highlight: item.hasNewComments
133706
- }, void 0), commentsCount > 0 && jsx$1(CommentsCount, {
133707
- children: commentsCount
133708
- }, void 0)]
133709
- }), void 0)
133710
- }), void 0)]
133711
- }, void 0), jsx$1(BookmarkButton, {
133687
+ children: [jsx$1(StyledIcon$2, {
133688
+ iconName: "Chat",
133689
+ highlight: item.hasNewComments
133690
+ }, void 0), commentsCount > 0 && jsx$1(CommentsCount, {
133691
+ children: commentsCount
133692
+ }, void 0)]
133693
+ }), void 0)
133694
+ }), void 0), jsx$1(BookmarkButton, {
133712
133695
  item: item
133713
133696
  }, void 0)]
133714
133697
  }, void 0)
package/index.umd.js CHANGED
@@ -87834,9 +87834,9 @@
87834
87834
  }), void 0);
87835
87835
  };
87836
87836
 
87837
- var version$1 = "0.3.70";
87838
- var buildId = "101606";
87839
- var commitId = "6112df41ab4f2961a2ca438bf959528e69d63a8d";
87837
+ var version$1 = "0.3.75";
87838
+ var buildId = "101837";
87839
+ var commitId = "1ff94f93a1dbcb8e5d53e887f46440be41e27df9";
87840
87840
  var isCustomerBuild = false;
87841
87841
  var buildInfo = {
87842
87842
  version: version$1,
@@ -131965,8 +131965,8 @@
131965
131965
  // here we detect this (if the post is getting edited) and update the keywords accordingly
131966
131966
  if(filteredKeywords.length!==flatDefaultKeywords.length){onChangeKeywords(filteredKeywords);}setSelectedItems(filteredKeywords.map(function(k){return {name:getKeywordDisplayValue(selectedKeywordGroups,user,k.groupId,k.name),key:k.id,isMandatory:mandatoryKeywordIds.includes(k.id)};}));}function getAllSuggestions(selectedItems){return availableKeywords===null||availableKeywords===void 0?void 0:availableKeywords.filter(function(k){return (selectedItems||[]).every(function(i){return i.key!==k.id;});}).map(function(k){return {key:k.id,name:getKeywordDisplayValue(selectedKeywordGroups,user,k.groupId,k.name)};});}function handleOnChange(items){var itemKeys=items.map(function(i){return i.key;});// this prevents the user from removing a mandatory keyword by using the backspace button
131967
131967
  if(!mandatoryKeywordIds.every(function(id){return itemKeys.includes(id);})){return;}updateKeywords(items);}function removeItem(item){var filteredSelectedItems=selectedItems.filter(function(i){return i.key!==item.key;});updateKeywords(filteredSelectedItems);}function updateKeywords(items){setSelectedItems(items);var selectedItemIds=items.map(function(i){return i.key;});onChangeKeywords(availableKeywords.filter(function(k){return selectedItemIds.includes(k.id);}));}};var MandatoryKeywordsInfoIcon=function MandatoryKeywordsInfoIcon(){var formatMessage=useIntl().formatMessage;var _a=React$d.useState(false),showCallout=_a[0],setShowCallout=_a[1];var infoButtonRef=React$d.useRef();return jsxRuntime.jsxs("div",__assign({ref:infoButtonRef},{children:[jsxRuntime.jsx(StyledIconButton$7,{iconProps:{iconName:'Info'},onClick:function(){return setShowCallout(!showCallout);},ariaLabel:formatMessage({id:'Keywords.picker.tooltipAriaLabel'})},void 0),showCallout&&jsxRuntime.jsx(StyledCallout$1,__assign({onDismiss:function(){return setShowCallout(false);},target:infoButtonRef.current},{children:jsxRuntime.jsx(FormattedMessage$1,{id:"Keywords.picker.tooltip"},void 0)}),void 0)]}),void 0);};var Tag=function Tag(_a){var item=_a.item,onRemoveItem=_a.onRemoveItem;var formatMessage=useIntl().formatMessage;var canBeRemoved=!item.isMandatory;return jsxRuntime.jsxs(TagWrapper,__assign({"data-keyword-tag":item.name},{children:[jsxRuntime.jsx(KeywordName,{children:item.name},void 0),canBeRemoved&&jsxRuntime.jsx(RemoveTagButton,{iconProps:{iconName:'Cancel'},onClick:function(){return onRemoveItem(item);},ariaLabel:formatMessage({id:'AriaLabel.removeKeywordButton'}),"data-remove-keyword-button":true},void 0)]}),void 0);};var Host$V=_styled__default["default"].div.withConfig({displayName:"KeywordsPicker__Host",componentId:"sc-5ec8mr-0"})(templateObject_1$2i||(templateObject_1$2i=__makeTemplateObject(["\n margin-top: ","px;\n padding: ","px;\n background-color: ",";\n"],["\n margin-top: ","px;\n padding: ","px;\n background-color: ",";\n"])),spacingS,spacingS,function(p){return p.theme.palette.white;});var LabelHost=_styled__default["default"].div.withConfig({displayName:"KeywordsPicker__LabelHost",componentId:"sc-5ec8mr-1"})(templateObject_2$1v||(templateObject_2$1v=__makeTemplateObject(["\n display: flex;\n"],["\n display: flex;\n"])));var StyledIconButton$7=_styled__default["default"](IconButton).withConfig({displayName:"KeywordsPicker__StyledIconButton",componentId:"sc-5ec8mr-2"})(templateObject_3$$||(templateObject_3$$=__makeTemplateObject(["\n height: 100%;\n"],["\n height: 100%;\n"])));var StyledCallout$1=_styled__default["default"](Callout).withConfig({displayName:"KeywordsPicker__StyledCallout",componentId:"sc-5ec8mr-3"})(templateObject_4$J||(templateObject_4$J=__makeTemplateObject(["\n padding: ","px;\n"],["\n padding: ","px;\n"])),spacingS);var TagWrapper=_styled__default["default"].div.withConfig({displayName:"KeywordsPicker__TagWrapper",componentId:"sc-5ec8mr-4"})(templateObject_5$D||(templateObject_5$D=__makeTemplateObject(["\n background-color: ",";\n line-height: 26px;\n margin-right: ","px;\n display: flex;\n font-size: ","px;\n"],["\n background-color: ",";\n line-height: 26px;\n margin-right: ","px;\n display: flex;\n font-size: ","px;\n"])),function(p){return p.theme.palette.neutralLight;},spacingXxs+1,fontSizeSmall);var KeywordName=_styled__default["default"].span.withConfig({displayName:"KeywordsPicker__KeywordName",componentId:"sc-5ec8mr-5"})(templateObject_6$s||(templateObject_6$s=__makeTemplateObject(["\n text-overflow: ellipsis;\n overflow: hidden;\n white-space: nowrap;\n min-width: ","px;\n margin: 0 ","px;\n"],["\n text-overflow: ellipsis;\n overflow: hidden;\n white-space: nowrap;\n min-width: ","px;\n margin: 0 ","px;\n"])),spacingL,spacingXs+2);var RemoveTagButton=_styled__default["default"](IconButton).withConfig({displayName:"KeywordsPicker__RemoveTagButton",componentId:"sc-5ec8mr-6"})(templateObject_7$m||(templateObject_7$m=__makeTemplateObject(["\n padding: 0 ","px;\n border-radius: 0 ","px ","px 0;\n width: ","px;\n height: auto;\n i {\n font-size: ","px;\n }\n"],["\n padding: 0 ","px;\n border-radius: 0 ","px ","px 0;\n width: ","px;\n height: auto;\n i {\n font-size: ","px;\n }\n"])),spacingXxs+1,spacingXxs-1,spacingXxs-1,spacingL,fontSizeSmaller);var StyledTagPicker=_styled__default["default"](officeUiFabricReact.TagPicker).withConfig({displayName:"KeywordsPicker__StyledTagPicker",componentId:"sc-5ec8mr-7"})(templateObject_8$k||(templateObject_8$k=__makeTemplateObject(["\n margin-top: ","px;\n"],["\n margin-top: ","px;\n"])),spacingS);var templateObject_1$2i,templateObject_2$1v,templateObject_3$$,templateObject_4$J,templateObject_5$D,templateObject_6$s,templateObject_7$m,templateObject_8$k;var hasValidGenericUrlVideoSourcePrefix=function hasValidGenericUrlVideoSourcePrefix(url){return url&&getAdditionalVideoSources().filter(function(s){return url.startsWith(s.prefix);}).length>0;};var VideoUrlParser=/** @class */function(){function VideoUrlParser(url){this.url=url;this.source=null;this.id=null;this.isDirectVideoUrl=false;this.videoProperties=null;this.thumbnailUrl=null;if(hasValidGenericUrlVideoSourcePrefix(this.url)){this.source=VideoSource.GenericUrl;this.id=url;}else if(VideoUrlParser.microsoftStreamRegex.test(this.url)){this.source=VideoSource.MicrosoftStream;this.id=VideoUrlParser.microsoftStreamRegex.exec(this.url)[1];}else if(VideoUrlParser.ytRegex.test(this.url)){this.source=VideoSource.YouTube;this.id=VideoUrlParser.ytRegex.exec(this.url)[1];}else if(VideoUrlParser.vimeoRegex.test(this.url)){this.source=VideoSource.Vimeo;this.id=VideoUrlParser.vimeoRegex.exec(this.url)[1];}else if(VideoUrlParser.vimeoDirectLinkRegex.test(this.url)){this.source=VideoSource.Vimeo;this.id=VideoUrlParser.vimeoDirectLinkRegex.exec(this.url)[1];this.isDirectVideoUrl=true;}else if(VideoUrlParser.vimeoRedirectLinkRegex.test(this.url)){this.source=VideoSource.Vimeo;this.id=VideoUrlParser.vimeoRedirectLinkRegex.exec(this.url)[1];}else if(VideoUrlParser.kalturaRegex.test(this.url)){var regexMatches=VideoUrlParser.kalturaRegex.exec(this.url);this.source=VideoSource.Kaltura;this.id=regexMatches[1];this.videoProperties={sp:regexMatches[2],uiconfId:regexMatches[3],partnerId:regexMatches[4],entryId:regexMatches[5]};this.thumbnailUrl="https://cdnsecakmi.kaltura.com/p/"+this.id+"/thumbnail/entry_id/"+this.videoProperties.entryId+"/width/1000";}}//TODO handle the different error messages for cloud and onprem versions, i.e. what sources are permitted (see task 23570)
131968
- VideoUrlParser.prototype.isValid=function(features){var _this=this;if(this.source==null||this.id==null){return false;}if(features){var sources=getVideoSources(features);return sources.findIndex(function(s){return s.type===_this.source;})>=0;}return true;};VideoUrlParser.ytRegex=/^.*(?:(?:youtu.be\/)|(?:v\/)|(?:\/u\/\w\/)|(?:embed\/)|(?:watch\?))\??v?=?([^#&?]*).*$/;VideoUrlParser.vimeoRegex=/.*?(?:vimeo.com\/){1}(?:video\/)?(\d+)/;// match first GUID after domain
131969
- VideoUrlParser.microsoftStreamRegex=/.*web\.microsoftstream\.com.+?([0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12})/i;VideoUrlParser.vimeoDirectLinkRegex=/.*?(?:player\.vimeo\.com\/external\/){1}(\d+)/;VideoUrlParser.vimeoRedirectLinkRegex=/.*?(?:player\.vimeo\.com\/progressive_redirect\/playback\/){1}(\d+)(?:\/.*)/;VideoUrlParser.kalturaRegex=/.+cdnapisec\.kaltura\.com\/p\/([0-9]+)\/sp\/([0-9]+)\/embedIframeJs\/uiconf_id\/([0-9]+)\/partner_id\/([0-9]+)(?:.*entry_id=(.+?(?=&|$)))/;return VideoUrlParser;}();function getVideoSources(features){var sources=[];if(features.editorYouTubeVideos){sources.push({type:VideoSource.YouTube,name:'YouTube'});}if(features.editorVimeoVideos){sources.push({type:VideoSource.Vimeo,name:'Vimeo'});}if(features.editorMicrosoftVideos){sources.push({type:VideoSource.MicrosoftStream,name:'Microsoft Stream'});}if(features.editorKalturaVideos){sources.push({type:VideoSource.Kaltura,name:'Kaltura'});}return sources;}// this is wrapped, because the "appconfig" does not exist in the component library
131968
+ VideoUrlParser.prototype.isValid=function(features){var _this=this;if(this.source==null||this.id==null){return false;}var sources=getVideoSources(features);return sources.findIndex(function(s){return s.type===_this.source;})>=0;};VideoUrlParser.ytRegex=/^.*(?:(?:youtu.be\/)|(?:v\/)|(?:\/u\/\w\/)|(?:embed\/)|(?:watch\?))\??v?=?([^#&?]*).*$/;VideoUrlParser.vimeoRegex=/.*?(?:vimeo.com\/){1}(?:video\/)?(\d+)/;// match first GUID after domain
131969
+ VideoUrlParser.microsoftStreamRegex=/.*web\.microsoftstream\.com.+?([0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12})/i;VideoUrlParser.vimeoDirectLinkRegex=/.*?(?:player\.vimeo\.com\/external\/){1}(\d+)/;VideoUrlParser.vimeoRedirectLinkRegex=/.*?(?:player\.vimeo\.com\/progressive_redirect\/playback\/){1}(\d+)(?:\/.*)/;VideoUrlParser.kalturaRegex=/.+cdnapisec\.kaltura\.com\/p\/([0-9]+)\/sp\/([0-9]+)\/embedIframeJs\/uiconf_id\/([0-9]+)\/partner_id\/([0-9]+)(?:.*entry_id=(.+?(?=&|$)))/;return VideoUrlParser;}();function getVideoSources(features){var sources=[];if(features.editorYouTubeVideos){sources.push({type:VideoSource.YouTube,name:'YouTube'});}if(features.editorVimeoVideos){sources.push({type:VideoSource.Vimeo,name:'Vimeo'});}if(features.editorMicrosoftVideos){sources.push({type:VideoSource.MicrosoftStream,name:'Microsoft Stream'});}if(features.editorKalturaVideos){sources.push({type:VideoSource.Kaltura,name:'Kaltura'});}getAdditionalVideoSources().forEach(function(customSource){sources.push({type:VideoSource.GenericUrl,name:customSource.name});});return sources;}// this is wrapped, because the "appconfig" does not exist in the component library
131970
131970
  // we should probably provide a better fix for this => #38316
131971
131971
  function getAdditionalVideoSources(){return [];}var isObject$4=isObject$c;var setPrototypeOf=objectSetPrototypeOf;// makes subclassing work correct for wrapped built-ins
131972
131972
  var inheritIfRequired$1=function($this,dummy,Wrapper){var NewTarget,NewTargetPrototype;if(// it can work only with native `setPrototypeOf`
@@ -132046,7 +132046,7 @@
132046
132046
  var FAILS_ON_NULL=fails$1$1(function(){test$1.sort(null);});// Old WebKit
132047
132047
  var STRICT_METHOD$1=arrayMethodIsStrict$1('sort');var FORCED$1=FAILS_ON_UNDEFINED||!FAILS_ON_NULL||!STRICT_METHOD$1;// `Array.prototype.sort` method
132048
132048
  // https://tc39.github.io/ecma262/#sec-array.prototype.sort
132049
- $$7({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
132049
+ $$7({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);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
132050
132050
  // https://tc39.github.io/ecma262/#sec-samevalue
132051
132051
  var sameValue$1$1=Object.is||function is(x,y){// eslint-disable-next-line no-self-compare
132052
132052
  return x===y?x!==0||1/x===1/y:x!=x&&y!=y;};var fixRegExpWellKnownSymbolLogic$1$1=fixRegexpWellKnownSymbolLogic$1;var anObject$1$1=anObject$h;var requireObjectCoercible$2$1=requireObjectCoercible$b;var sameValue$2=sameValue$1$1;var regExpExec$1$1=regexpExecAbstract$1;// @@search logic
@@ -132160,7 +132160,7 @@
132160
132160
  // => we should display a retry button on the attachment preview
132161
132161
  .then(function(){if(ignoreRef.current){return;}setAttachments(function(attachments){return attachments.map(function(a){return a.id!==newAttachment.id?a:__assign(__assign({},a),{isUploadInProgress:false});});});},function(error){logger.error(error);if(!warningToastHandle.current){warningToastHandle.current=showToastWarning('Attachments.uploadError',undefined,function(){return warningToastHandle.current=null;});}if(ignoreRef.current){return;}setAttachments(function(attachments){return attachments.map(function(a){return a.id!==newAttachment.id?a:__assign(__assign({},a),{hasError:true,isUploadInProgress:false});});});});};for(_i=0,newAttachments_1=newAttachments;_i<newAttachments_1.length;_i++){newAttachment=newAttachments_1[_i];_loop_1(newAttachment);}return [2/*return*/];});});}function clearAttachments(){if(!ignoreRef.current){setAttachments([]);setDeletedAttachmentUrls([]);}}function deleteAttachment(attachment){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:return [4/*yield*/,handleAttachmentsAdded(attachments.filter(function(f){return f.id!==attachment.id;}))];case 1:_a.sent();setDeletedAttachmentUrls(__spreadArray(__spreadArray([],deletedAttachmentUrls),[attachment.url]));return [2/*return*/];}});});}function uploadAttachment(basePath,attachment){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){if(attachment.type===AttachmentType.Image){return [2/*return*/,uploadImage(basePath,user.subscription.id,attachment.id,containerId,attachment.file)];}else {return [2/*return*/,uploadFile(basePath,user.subscription.id,attachment.id,containerId,attachment.file)];}});});}}var EditCommentWithAttachments=function EditCommentWithAttachments(props){var user=useCurrentUser();var getImageUrl=useAttachmentsApi().getImageUrl;var _a=useAttachmentUploader(props.item.attachments,props.item.attachmentContainerId,props.basePath),attachments=_a[0],handleAttachmentsAdded=_a[1],deletedAttachmentUrls=_a[3],onDeleteAttachment=_a[4];return jsxRuntime.jsx(EditComment,__assign({},props,{allowSaveWithoutContent:props.allowSaveWithoutContent,saveOnEnter:props.saveOnEnter,saveOnCtrlEnter:props.saveOnCtrlEnter,files:attachments.map(function(a){return __assign(__assign({},a),!isClientAttachment(a)&&{previewUrl:getImageUrl(props.basePath,user.subscription.id,props.item,a.id)});}),allowAttachments:!!props.basePath,onSave:handlePost,onAttachmentAdded:handleAttachmentsAdded,allowKeywords:props.allowKeywords,availableKeywords:props.availableKeywords,mandatoryKeywords:props.mandatoryKeywords,keywords:props.keywords,deletedFileUrls:deletedAttachmentUrls,onDeleteAttachment:onDeleteAttachment}),void 0);function handlePost(newContent,keywords){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:return [4/*yield*/,props.onSave(newContent,attachments,keywords)];case 1:_a.sent();return [2/*return*/];}});});}};function isClientAttachment(value){return value.file!=null;}var CommentDisplay=function CommentDisplay(_a){var _b;var type=_a.type,baseAttachmentPath=_a.baseAttachmentPath,message=_a.message,onDelete=_a.onDelete,showDelete=_a.showDelete,showAutoTranslate=_a.showAutoTranslate,showEdit=_a.showEdit,scope=_a.scope,mentionSearchHandler=_a.mentionSearchHandler,getHashtagFilterRoute=_a.getHashtagFilterRoute,highlight=_a.highlight,isInitialLiked=_a.isInitialLiked,onReplyIconClick=_a.onReplyIconClick,onReply=_a.onReply,replyCount=_a.replyCount,readOnly=_a.readOnly,className=_a.className;var _c=useCommentApi(),toggleCommentLike=_c.toggleCommentLike,translateComment=_c.translateComment,updateComment=_c.updateComment;var formatMessage=useIntl().formatMessage;var _d=useNotificationContext(),showToast=_d.showToast,showError=_d.showError;var _e=React$d.useState(false),isEditMode=_e[0],setIsEditMode=_e[1];var _f=React$d.useState(message.content),content=_f[0],setContent=_f[1];var _g=React$d.useState(message.attachments),attachments=_g[0],setAttachments=_g[1];var _h=React$d.useState(message.modified),modifiedTime=_h[0],setModifiedTime=_h[1];var _j=React$d.useState(message.content),originalContent=_j[0],setOriginalContent=_j[1];var _k=React$d.useState(isInitialLiked),isLiked=_k[0],setIsLiked=_k[1];var _l=React$d.useState(((_b=message.statistics)===null||_b===void 0?void 0:_b.likeCount)||0),likeCounter=_l[0],setLikeCounter=_l[1];var features=useFeatures();var palette=React$d.useContext(ThemeContext$1).theme.palette;var hasContent=content.length>0;message=__assign(__assign({},message),{attachments:attachments});return jsxRuntime.jsxs(Container$1,__assign({className:className,"data-comment-id":message.id,"data-has-auto-translate":showAutoTranslate,"data-can-edit":showEdit,"data-can-delete":showDelete,"data-show-highlight":highlight,highlight:highlight,id:"Comment-"+message.id},{children:[jsxRuntime.jsxs(Header$1,{children:[jsxRuntime.jsx(CommentUser,__assign({upn:message.sender.userPrincipalName,domIdentifier:"avatar"},{children:jsxRuntime.jsx(Avatar,{upn:message.sender.userPrincipalName,text:message.sender.displayName,size:officeUiFabricReact.PersonaSize.small,hidePersonaDetails:true},void 0)}),void 0),jsxRuntime.jsxs(HeaderMetadata$1,{children:[jsxRuntime.jsx(CommentDisplayName,{children:jsxRuntime.jsx(StyledPersonaCard$1,__assign({upn:message.sender.userPrincipalName},{children:message.sender.displayName}),void 0)},void 0),jsxRuntime.jsx(CommentDateTime,{className:"ms-fontColor-neutralTertiary",value:message.receivedDateTime},void 0),jsxRuntime.jsx(Modified,{modified:modifiedTime},void 0)]},void 0),message.id&&jsxRuntime.jsxs(Buttons$1,{children:[features.replyToComments&&replyCount>0&&jsxRuntime.jsx(ReplyCountButton,{tooltipResourceKey:"Comment.numberOfReplies",tooltipResourceKeyValues:{count:replyCount},ariaLabel:formatMessage({id:onReplyIconClick?'AriaLabel.commentsButton':'AriaLabel.repliesButton'}),iconName:"Chat",count:replyCount,feedbackType:"comment",onClick:onReplyIconClick!==null&&onReplyIconClick!==void 0?onReplyIconClick:onReply?function(){return onReply(message.id);}:null,highlight:message.hasUnreadReplies,readOnly:readOnly},void 0),jsxRuntime.jsx(StyledLikeButton$1,{itemId:message.id,itemType:ItemResourceTypes.Comments,count:likeCounter,isActive:isLiked,onClick:function(){return handleLike(!isLiked);},doNotRenderZeroCount:true,isDemoContent:message.isDemoContent,readOnly:readOnly},void 0),jsxRuntime.jsx(CommentActionMenu,{comment:message,showEdit:showEdit,onDelete:onDelete,showDelete:showDelete,isEditMode:isEditMode,toggleEditMode:setIsEditMode,originalContent:originalContent,currentContent:content,setContent:setContent,handleTranslate:handleTranslate,showAutoTranslate:showAutoTranslate,onReply:onReply,disabled:readOnly},void 0)]},void 0)]},void 0),jsxRuntime.jsxs(Body,{children:[isEditMode&&jsxRuntime.jsx(StyledEditCommentWithAttachments,{content:content,mentionSearchHandler:mentionSearchHandler,onSave:handleSaveComment,onCancel:function(){return setIsEditMode(false);},basePath:baseAttachmentPath,item:message,allowSaveWithoutContent:true,saveOnCtrlEnter:true},void 0),!isEditMode&&hasContent&&jsxRuntime.jsx(jsxRuntime.Fragment,{children:jsxRuntime.jsx(Content$4,__assign({"data-comment-content":message.id},{children:jsxRuntime.jsx(ContentDisplay,{content:content,handlers:[ContentDisplayHandler.LineBreak,ContentDisplayHandler.Link,ContentDisplayHandler.Mention,ContentDisplayHandler.Hashtag],getHashtagRoute:getHashtagFilterRoute},void 0)}),void 0)},void 0)]},void 0),!isEditMode&&(attachments===null||attachments===void 0?void 0:attachments.length)>0&&jsxRuntime.jsxs("div",__assign({"data-mixed-attachment-list":true},{children:[jsxRuntime.jsx(GifList,{attachments:message.attachments},void 0),jsxRuntime.jsx(StyledImagesAndFilesList$1,{item:message,basePath:baseAttachmentPath,imagesGridBackgroundColor:palette.white},void 0),jsxRuntime.jsx(VideoList,{attachments:message.attachments},void 0),jsxRuntime.jsx(EmbeddedObjectList,{attachments:message.attachments},void 0)]}),void 0)]}),void 0);function handleLike(newIsLiked){return __awaiter(this,void 0,void 0,function(){var oldCounter,error_1;return __generator(this,function(_a){switch(_a.label){case 0:oldCounter=likeCounter;_a.label=1;case 1:_a.trys.push([1,3,,4]);setIsLiked(newIsLiked);setLikeCounter(newIsLiked?oldCounter+1:oldCounter-1);return [4/*yield*/,toggleCommentLike(message.id,newIsLiked)];case 2:_a.sent();return [3/*break*/,4];case 3:error_1=_a.sent();setIsLiked(!newIsLiked);setLikeCounter(oldCounter);logger.error(error_1);showError('Generic.error');return [3/*break*/,4];case 4:return [2/*return*/];}});});}function handleSaveComment(newContent,newAttachments){return __awaiter(this,void 0,void 0,function(){var error_2;return __generator(this,function(_a){switch(_a.label){case 0:setContent(newContent);setAttachments(newAttachments);setIsEditMode(false);setModifiedTime(new Date().toISOString());setOriginalContent(newContent);_a.label=1;case 1:_a.trys.push([1,3,,4]);return [4/*yield*/,updateComment(scope,message.parentItemId,message.id,newContent,newAttachments,type)];case 2:_a.sent();showToast('Comment.successfullyUpdated');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*/];}});});}function handleTranslate(preferredContentLanguageCode){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_b){switch(_b.label){case 0:_b.trys.push([0,2,,3]);return [4/*yield*/,translateComment(type,scope,message.parentItemId,message.id,preferredContentLanguageCode)];case 1:return [2/*return*/,_b.sent()];case 2:_b.sent();showError('Generic.error');return [2/*return*/,null];case 3:return [2/*return*/];}});});}};var Header$1=_styled__default["default"].div.withConfig({displayName:"CommentDisplay__Header",componentId:"sc-el7c23-0"})(templateObject_1$1I||(templateObject_1$1I=__makeTemplateObject(["\n display: flex;\n align-items: center;\n"],["\n display: flex;\n align-items: center;\n"])));var avatarWidth$1=40;var maxButtonsWidth$1=125;// max 3 buttons (menu button, replies, like)
132162
132162
  var paddingLeft$1=spacingS;var HeaderMetadata$1=_styled__default["default"].div.withConfig({displayName:"CommentDisplay__HeaderMetadata",componentId:"sc-el7c23-1"})(templateObject_2$11||(templateObject_2$11=__makeTemplateObject(["\n flex: 1;\n box-sizing: border-box;\n font-size: ","px;\n padding-left: ","px;\n max-width: calc(100% - ","px - ","px);\n"],["\n flex: 1;\n box-sizing: border-box;\n font-size: ","px;\n padding-left: ","px;\n max-width: calc(100% - ","px - ","px);\n"])),fontSizeSmall,paddingLeft$1,avatarWidth$1,maxButtonsWidth$1);var CommentDisplayName=_styled__default["default"].div.withConfig({displayName:"CommentDisplay__CommentDisplayName",componentId:"sc-el7c23-2"})(templateObject_3$I||(templateObject_3$I=__makeTemplateObject(["\n font-weight: bold;\n"],["\n font-weight: bold;\n"])));var StyledPersonaCard$1=_styled__default["default"](PersonaCard).withConfig({displayName:"CommentDisplay__StyledPersonaCard",componentId:"sc-el7c23-3"})(templateObject_4$t||(templateObject_4$t=__makeTemplateObject(["\n && {\n max-width: 100%;\n .ms-Button {\n width: 100%;\n }\n .ms-Button-textContainer {\n width: 100%;\n }\n\n .ms-Button-label {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n }\n"],["\n && {\n max-width: 100%;\n .ms-Button {\n width: 100%;\n }\n .ms-Button-textContainer {\n width: 100%;\n }\n\n .ms-Button-label {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n }\n"])));var CommentDateTime=_styled__default["default"](DateTime).withConfig({displayName:"CommentDisplay__CommentDateTime",componentId:"sc-el7c23-4"})(templateObject_5$q||(templateObject_5$q=__makeTemplateObject(["\n font-size: 12px;\n"],["\n font-size: 12px;\n"])));var Buttons$1=_styled__default["default"].div.withConfig({displayName:"CommentDisplay__Buttons",componentId:"sc-el7c23-5"})(templateObject_6$g||(templateObject_6$g=__makeTemplateObject(["\n display: flex;\n align-items: center;\n margin-left: auto;\n\n button {\n height: auto;\n min-height: ","px; /* icons have a font-size of 20px */\n }\n"],["\n display: flex;\n align-items: center;\n margin-left: auto;\n\n button {\n height: auto;\n min-height: ","px; /* icons have a font-size of 20px */\n }\n"])),fontSizeLarge);var Body=_styled__default["default"].div.withConfig({displayName:"CommentDisplay__Body",componentId:"sc-el7c23-6"})(templateObject_7$b||(templateObject_7$b=__makeTemplateObject(["\n display: flex;\n flex-direction: column;\n margin-top: 5px;\n"],["\n display: flex;\n flex-direction: column;\n margin-top: 5px;\n"])));var Content$4=_styled__default["default"].div.withConfig({displayName:"CommentDisplay__Content",componentId:"sc-el7c23-7"})(templateObject_8$a||(templateObject_8$a=__makeTemplateObject(["\n padding-top: ","px;\n flex: 1 1 auto;\n a {\n font-weight: bold;\n &:hover,\n &:active {\n text-decoration: underline;\n }\n }\n"],["\n padding-top: ","px;\n flex: 1 1 auto;\n a {\n font-weight: bold;\n &:hover,\n &:active {\n text-decoration: underline;\n }\n }\n"])),spacingXs);var Container$1=_styled__default["default"].div.withConfig({displayName:"CommentDisplay__Container",componentId:"sc-el7c23-8"})(templateObject_10$7||(templateObject_10$7=__makeTemplateObject(["\n padding-bottom: 15px;\n font-size: ","px;\n line-height: ","px;\n\n ","\n"],["\n padding-bottom: 15px;\n font-size: ","px;\n line-height: ","px;\n\n ","\n"])),fontSizeSmall,spacingM,function(p){return p.highlight&&_styled.css(templateObject_9$8||(templateObject_9$8=__makeTemplateObject(["\n position: relative;\n\n &::after {\n content: '';\n position: absolute;\n top: -","px;\n bottom: 0;\n right: -","px;\n width: ","px;\n display: block;\n background-color: ",";\n }\n "],["\n position: relative;\n\n &::after {\n content: '';\n position: absolute;\n top: -","px;\n bottom: 0;\n right: -","px;\n width: ","px;\n display: block;\n background-color: ",";\n }\n "])),postsSectionPadding,postsSectionPadding,spacingXs,function(p){return p.theme.palette.accent;});});var CommentUser=_styled__default["default"](PersonaCard).withConfig({displayName:"CommentDisplay__CommentUser",componentId:"sc-el7c23-9"})(templateObject_11$3||(templateObject_11$3=__makeTemplateObject(["\n align-self: flex-start;\n"],["\n align-self: flex-start;\n"])));var StyledEditCommentWithAttachments=_styled__default["default"](EditCommentWithAttachments).withConfig({displayName:"CommentDisplay__StyledEditCommentWithAttachments",componentId:"sc-el7c23-10"})(templateObject_12$2$1||(templateObject_12$2$1=__makeTemplateObject(["\n width: 100%;\n position: relative;\n"],["\n width: 100%;\n position: relative;\n"])));var StyledImagesAndFilesList$1=_styled__default["default"](ImagesAndFilesList).withConfig({displayName:"CommentDisplay__StyledImagesAndFilesList",componentId:"sc-el7c23-11"})(templateObject_13$2$1||(templateObject_13$2$1=__makeTemplateObject(["\n margin-top: ","px;\n\n && [data-preload-video='true'] video {\n background-color: ",";\n }\n"],["\n margin-top: ","px;\n\n && [data-preload-video='true'] video {\n background-color: ",";\n }\n"])),spacingM,function(p){return p.theme.palette.white;});var FeedbackButtonStyle=_styled.css(templateObject_14$2$1||(templateObject_14$2$1=__makeTemplateObject(["\n min-width: auto;\n padding: 0 4px;\n\n && {\n margin-right: 0;\n }\n\n i {\n font-size: ","px;\n height: ","px;\n line-height: ","px;\n }\n"],["\n min-width: auto;\n padding: 0 4px;\n\n && {\n margin-right: 0;\n }\n\n i {\n font-size: ","px;\n height: ","px;\n line-height: ","px;\n }\n"])),fontSizeMedium+2,fontSizeMedium+2,fontSizeMedium+2);var StyledLikeButton$1=_styled__default["default"](LikeButton).withConfig({displayName:"CommentDisplay__StyledLikeButton",componentId:"sc-el7c23-12"})(templateObject_15$2$1||(templateObject_15$2$1=__makeTemplateObject(["\n ","\n"],["\n ","\n"])),FeedbackButtonStyle);var ReplyCountButton=_styled__default["default"](FeedbackCountButton).withConfig({displayName:"CommentDisplay__ReplyCountButton",componentId:"sc-el7c23-13"})(templateObject_16$2||(templateObject_16$2=__makeTemplateObject(["\n &&& {\n margin-right: ","px;\n }\n ","\n"],["\n &&& {\n margin-right: ","px;\n }\n ","\n"])),spacingS,FeedbackButtonStyle);var templateObject_1$1I,templateObject_2$11,templateObject_3$I,templateObject_4$t,templateObject_5$q,templateObject_6$g,templateObject_7$b,templateObject_8$a,templateObject_9$8,templateObject_10$7,templateObject_11$3,templateObject_12$2$1,templateObject_13$2$1,templateObject_14$2$1,templateObject_15$2$1,templateObject_16$2;var CardStatisticItem=function CardStatisticItem(_a){var count=_a.count,tooltipResourceKey=_a.tooltipResourceKey,icon=_a.icon,ariaLabel=_a.ariaLabel,targetRoute=_a.targetRoute,highlight=_a.highlight,onClick=_a.onClick,className=_a.className,domIdentifier=_a.domIdentifier;var formatMessage=useIntl().formatMessage;return jsxRuntime.jsx(Tooltip,__assign({resourceKey:tooltipResourceKey,values:{count:count},className:className},{children:onClick?jsxRuntime.jsx(StatisticButton,__assign({"data-statistic-button":domIdentifier,iconProps:{iconName:icon},onClick:onClick,"aria-label":formatMessage({id:ariaLabel})},{children:count>0&&jsxRuntime.jsx(StatisticCount,__assign({"aria-hidden":"true"},{children:count}),void 0)}),void 0):jsxRuntime.jsxs(StatisticLink,__assign({to:targetRoute,"aria-label":formatMessage({id:ariaLabel})},{children:[jsxRuntime.jsx(StatisticIcon,{iconName:icon,highlight:highlight},void 0),count>0&&jsxRuntime.jsx(StatisticCount,__assign({"aria-hidden":"true"},{children:count}),void 0)]}),void 0)}),void 0);};var StatisticLink=_styled__default["default"](ReactRouterDom.NavLink).withConfig({displayName:"CardStatisticItem__StatisticLink",componentId:"sc-1ll8iv5-0"})(templateObject_1$1H||(templateObject_1$1H=__makeTemplateObject(["\n display: inline-flex;\n align-items: center;\n color: ",";\n height: ","px;\n"],["\n display: inline-flex;\n align-items: center;\n color: ",";\n height: ","px;\n"])),function(p){return p.theme.textColors.default;},feedbackButtonHeight);var StatisticButton=_styled__default["default"](IconButton).withConfig({displayName:"CardStatisticItem__StatisticButton",componentId:"sc-1ll8iv5-1"})(templateObject_2$10||(templateObject_2$10=__makeTemplateObject(["\n && {\n width: auto;\n margin: 0;\n padding: 0;\n\n i {\n font-size: ","px;\n }\n }\n"],["\n && {\n width: auto;\n margin: 0;\n padding: 0;\n\n i {\n font-size: ","px;\n }\n }\n"])),fontSizeLarge-3);var StatisticIcon=_styled__default["default"](officeUiFabricReact.Icon).withConfig({displayName:"CardStatisticItem__StatisticIcon",componentId:"sc-1ll8iv5-2"})(templateObject_3$H||(templateObject_3$H=__makeTemplateObject(["\n ","\n"],["\n ","\n"])),function(p){return p.highlight&&unreadCommentHighlight;});var StatisticCount=_styled__default["default"].span.withConfig({displayName:"CardStatisticItem__StatisticCount",componentId:"sc-1ll8iv5-3"})(templateObject_4$s||(templateObject_4$s=__makeTemplateObject(["\n flex: 1 0 auto;\n padding-left: 5px;\n font-size: 0.9rem;\n"],["\n flex: 1 0 auto;\n padding-left: 5px;\n font-size: 0.9rem;\n"])));var templateObject_1$1H,templateObject_2$10,templateObject_3$H,templateObject_4$s;var BookmarkButton=function BookmarkButton(_a){var item=_a.item,isReadOnly=_a.isReadOnly,className=_a.className;var formatMessage=useIntl().formatMessage;var refreshStatistics=useNewsApi().refreshStatistics;var toggleBookmark=useManageCurrentUserApi().toggleBookmark;var user=useCurrentUser();var showError=useNotificationContext().showError;var _b=React$d.useState(isUserBookmarked),isBookmarked=_b[0],setIsBookmarked=_b[1];var _c=React$d.useState(false),isSaving=_c[0],setIsSaving=_c[1];var itemId=item===null||item===void 0?void 0:item.id;var resourceKey="BookmarkButton."+(isBookmarked?'remove':'add')+"Tooltip";React$d.useEffect(function(){setIsBookmarked(isUserBookmarked());// eslint-disable-next-line react-hooks/exhaustive-deps
132163
- },[itemId]);return jsxRuntime.jsx(Tooltip,__assign({className:className,resourceKey:resourceKey},{children:jsxRuntime.jsx(StyledIconButton$5,{iconProps:{iconName:isBookmarked?'SingleBookmarkSolid':'SingleBookmark'},"data-bookmark-button":itemId,onClick:toggle,"aria-label":formatMessage({id:resourceKey}),disabled:isReadOnly},void 0)}),void 0);function isUserBookmarked(){var _a;return (_a=user.bookmarks)===null||_a===void 0?void 0:_a.some(function(id){return id===(item===null||item===void 0?void 0:item.id);});}function toggle(e){return __awaiter(this,void 0,void 0,function(){var isNowBookmarked;return __generator(this,function(_a){switch(_a.label){case 0:e.preventDefault();e.stopPropagation();if(isSaving){return [2/*return*/];}setIsSaving(true);isNowBookmarked=!isBookmarked;setIsBookmarked(isNowBookmarked);_a.label=1;case 1:_a.trys.push([1,4,5,6]);return [4/*yield*/,toggleBookmark(itemId,user)];case 2:_a.sent();return [4/*yield*/,refreshStatistics(itemId,{bookmarkCount:isNowBookmarked?1:-1})];case 3:_a.sent();return [3/*break*/,6];case 4:_a.sent();setIsBookmarked(!isNowBookmarked);showError('Profile.bookmarkError');return [3/*break*/,6];case 5:setIsSaving(false);return [7/*endfinally*/];case 6:return [2/*return*/];}});});}};var StyledIconButton$5=_styled__default["default"](IconButton).withConfig({displayName:"BookmarkButton__StyledIconButton",componentId:"sc-1ni4s3y-0"})(templateObject_1$1G||(templateObject_1$1G=__makeTemplateObject(["\n padding-left: 0;\n padding-right: 0;\n margin-left: -3px;\n\n i {\n font-size: 22px;\n }\n\n &[disabled] {\n background: transparent;\n }\n"],["\n padding-left: 0;\n padding-right: 0;\n margin-left: -3px;\n\n i {\n font-size: 22px;\n }\n\n &[disabled] {\n background: transparent;\n }\n"])));var templateObject_1$1G;var CardFooter=function CardFooter(_a){var item=_a.item,showComments=_a.showComments,targetRoute=_a.targetRoute;var metadata=item.metadata||{};var user=useCurrentUser();var showCommentsIcon=showComments&&item.statistics&&item.statistics.commentCount>0&&hasFeedbackType(metadata.feedbackSettings,'comment');return jsxRuntime.jsx(CardFooterHost,{children:jsxRuntime.jsxs(FooterRightSection,{children:[!item.useExternalContent&&jsxRuntime.jsx(CardLikeButton,{item:item,itemResourceType:ItemResourceTypes.News},void 0),!user.isPublicUser&&!item.useExternalContent&&showCommentsIcon&&jsxRuntime.jsx(CardStatisticItem,{count:item.statistics.commentCount,tooltipResourceKey:"NewsArticle.numberOfComments",icon:"Chat",targetRoute:targetRoute+"#comments",highlight:item.hasNewComments,ariaLabel:"AriaLabel.commentsButton"},void 0),jsxRuntime.jsx(BookmarkButton,{item:item},void 0)]},void 0)},void 0);};var CardFooterHost=_styled__default["default"].footer.withConfig({displayName:"CardFooter__CardFooterHost",componentId:"sc-8sbpem-0"})(templateObject_1$1F||(templateObject_1$1F=__makeTemplateObject(["\n display: flex;\n margin-top: auto;\n margin-bottom: -4px;\n flex-direction: row;\n justify-content: space-between;\n\n padding-top: ","px;\n\n font-size: ","px;\n\n > div {\n display: flex;\n }\n\n a,\n button {\n position: relative;\n z-index: 1;\n }\n"],["\n display: flex;\n margin-top: auto;\n margin-bottom: -4px;\n flex-direction: row;\n justify-content: space-between;\n\n padding-top: ","px;\n\n font-size: ","px;\n\n > div {\n display: flex;\n }\n\n a,\n button {\n position: relative;\n z-index: 1;\n }\n"])),spacingM,fontSizeMedium+4);var FooterRightSection=_styled__default["default"].div.withConfig({displayName:"CardFooter__FooterRightSection",componentId:"sc-8sbpem-1"})(templateObject_2$$||(templateObject_2$$=__makeTemplateObject(["\n .ms-TooltipHost {\n display: flex;\n align-items: center;\n }\n\n flex: 1 0 ","px;\n justify-content: flex-end;\n > * {\n margin-left: ","px;\n }\n"],["\n .ms-TooltipHost {\n display: flex;\n align-items: center;\n }\n\n flex: 1 0 ","px;\n justify-content: flex-end;\n > * {\n margin-left: ","px;\n }\n"])),spacingXl,spacingS+5);var templateObject_1$1F,templateObject_2$$;var DetailViewContextProvider=function DetailViewContextProvider(_a){var itemId=_a.itemId,type=_a.type,loadItemFunc=_a.loadItemFunc,isEditorPreview=_a.isEditorPreview,children=_a.children;var user=useCurrentUserContext().user;var handleFatalError=React$d.useContext(ErrorContext).handleFatalError;var translateContents=useTranslateApi().translateContents;var _b=React$d.useState(),item=_b[0],setItem=_b[1];var _c=React$d.useState(),originalItem=_c[0],setOriginalItem=_c[1];var _d=React$d.useState(),selectedLanguage=_d[0],setSelectedLanguage=_d[1];var _e=React$d.useState(false),hasError=_e[0],setHasError=_e[1];var _f=React$d.useState(true),isLoading=_f[0],setIsLoading=_f[1];var _g=React$d.useState(false),showAccessDenied=_g[0],setShowAccessDenied=_g[1];var handleAccessDeniedError=React$d.useContext(ErrorContext).handleAccessDeniedError;var isValid=true;React$d.useEffect(function(){refreshItem();return function(){// eslint-disable-next-line react-hooks/exhaustive-deps
132163
+ },[itemId]);return jsxRuntime.jsx(Tooltip,__assign({className:className,resourceKey:resourceKey},{children:jsxRuntime.jsx(StyledIconButton$5,{iconProps:{iconName:isBookmarked?'SingleBookmarkSolid':'SingleBookmark'},"data-bookmark-button":itemId,onClick:toggle,"aria-label":formatMessage({id:resourceKey}),disabled:isReadOnly},void 0)}),void 0);function isUserBookmarked(){var _a;return (_a=user.bookmarks)===null||_a===void 0?void 0:_a.some(function(id){return id===(item===null||item===void 0?void 0:item.id);});}function toggle(e){return __awaiter(this,void 0,void 0,function(){var isNowBookmarked;return __generator(this,function(_a){switch(_a.label){case 0:e.preventDefault();e.stopPropagation();if(isSaving){return [2/*return*/];}setIsSaving(true);isNowBookmarked=!isBookmarked;setIsBookmarked(isNowBookmarked);_a.label=1;case 1:_a.trys.push([1,4,5,6]);return [4/*yield*/,toggleBookmark(itemId,user)];case 2:_a.sent();return [4/*yield*/,refreshStatistics(itemId,{bookmarkCount:isNowBookmarked?1:-1})];case 3:_a.sent();return [3/*break*/,6];case 4:_a.sent();setIsBookmarked(!isNowBookmarked);showError('Profile.bookmarkError');return [3/*break*/,6];case 5:setIsSaving(false);return [7/*endfinally*/];case 6:return [2/*return*/];}});});}};var StyledIconButton$5=_styled__default["default"](IconButton).withConfig({displayName:"BookmarkButton__StyledIconButton",componentId:"sc-1ni4s3y-0"})(templateObject_1$1G||(templateObject_1$1G=__makeTemplateObject(["\n padding-left: 0;\n padding-right: 0;\n margin-left: -3px;\n\n i {\n font-size: 22px;\n }\n\n &[disabled] {\n background: transparent;\n }\n"],["\n padding-left: 0;\n padding-right: 0;\n margin-left: -3px;\n\n i {\n font-size: 22px;\n }\n\n &[disabled] {\n background: transparent;\n }\n"])));var templateObject_1$1G;var CardFooter=function CardFooter(_a){var item=_a.item,showComments=_a.showComments,targetRoute=_a.targetRoute;var metadata=item.metadata||{};var user=useCurrentUser();var showCommentsIcon=showComments&&item.statistics&&item.statistics.commentCount>0&&hasFeedbackType(metadata.feedbackSettings,'comment');return jsxRuntime.jsx(CardFooterHost,{children:jsxRuntime.jsxs(FooterRightSection,{children:[jsxRuntime.jsx(CardLikeButton,{item:item,itemResourceType:ItemResourceTypes.News},void 0),!user.isPublicUser&&showCommentsIcon&&jsxRuntime.jsx(CardStatisticItem,{count:item.statistics.commentCount,tooltipResourceKey:"NewsArticle.numberOfComments",icon:"Chat",targetRoute:targetRoute+"#comments",highlight:item.hasNewComments,ariaLabel:"AriaLabel.commentsButton"},void 0),jsxRuntime.jsx(BookmarkButton,{item:item},void 0)]},void 0)},void 0);};var CardFooterHost=_styled__default["default"].footer.withConfig({displayName:"CardFooter__CardFooterHost",componentId:"sc-8sbpem-0"})(templateObject_1$1F||(templateObject_1$1F=__makeTemplateObject(["\n display: flex;\n margin-top: auto;\n margin-bottom: -4px;\n flex-direction: row;\n justify-content: space-between;\n\n padding-top: ","px;\n\n font-size: ","px;\n\n > div {\n display: flex;\n }\n\n a,\n button {\n position: relative;\n z-index: 1;\n }\n"],["\n display: flex;\n margin-top: auto;\n margin-bottom: -4px;\n flex-direction: row;\n justify-content: space-between;\n\n padding-top: ","px;\n\n font-size: ","px;\n\n > div {\n display: flex;\n }\n\n a,\n button {\n position: relative;\n z-index: 1;\n }\n"])),spacingM,fontSizeMedium+4);var FooterRightSection=_styled__default["default"].div.withConfig({displayName:"CardFooter__FooterRightSection",componentId:"sc-8sbpem-1"})(templateObject_2$$||(templateObject_2$$=__makeTemplateObject(["\n .ms-TooltipHost {\n display: flex;\n align-items: center;\n }\n\n flex: 1 0 ","px;\n justify-content: flex-end;\n > * {\n margin-left: ","px;\n }\n"],["\n .ms-TooltipHost {\n display: flex;\n align-items: center;\n }\n\n flex: 1 0 ","px;\n justify-content: flex-end;\n > * {\n margin-left: ","px;\n }\n"])),spacingXl,spacingS+5);var templateObject_1$1F,templateObject_2$$;var DetailViewContextProvider=function DetailViewContextProvider(_a){var itemId=_a.itemId,type=_a.type,loadItemFunc=_a.loadItemFunc,isEditorPreview=_a.isEditorPreview,children=_a.children;var user=useCurrentUserContext().user;var handleFatalError=React$d.useContext(ErrorContext).handleFatalError;var translateContents=useTranslateApi().translateContents;var _b=React$d.useState(),item=_b[0],setItem=_b[1];var _c=React$d.useState(),originalItem=_c[0],setOriginalItem=_c[1];var _d=React$d.useState(),selectedLanguage=_d[0],setSelectedLanguage=_d[1];var _e=React$d.useState(false),hasError=_e[0],setHasError=_e[1];var _f=React$d.useState(true),isLoading=_f[0],setIsLoading=_f[1];var _g=React$d.useState(false),showAccessDenied=_g[0],setShowAccessDenied=_g[1];var handleAccessDeniedError=React$d.useContext(ErrorContext).handleAccessDeniedError;var isValid=true;React$d.useEffect(function(){refreshItem();return function(){// eslint-disable-next-line react-hooks/exhaustive-deps
132164
132164
  isValid=false;};},[itemId]);if(showAccessDenied){handleAccessDeniedError({});return null;}var activeLanguages=NewsService.getItemContentLanguages(originalItem,user.subscription.languages);return jsxRuntime.jsx(DetailViewContext.Provider,__assign({value:getContextValues()},{children:children}),void 0);function getContextValues(){return {isLoading:isLoading,hasError:hasError,resourceType:type,item:item,itemId:itemId,contentLanguage:selectedLanguage===null||selectedLanguage===void 0?void 0:selectedLanguage.lang,userPreferredLanguage:(selectedLanguage===null||selectedLanguage===void 0?void 0:selectedLanguage.isUserSet)?selectedLanguage.lang:getPreferredContentLanguage(user),activeLanguages:activeLanguages,content:item&&selectedLanguage?item.contents[selectedLanguage.lang]:null,updateSelectedLanguage:function(l){return setSelectedLanguage({lang:l,isUserSet:true});},handleRefresh:handleRefresh,handleLanguageChange:handleLanguageChange,isEditorPreview:isEditorPreview};}function handleRefresh(onFinished){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:return [4/*yield*/,refreshItem()];case 1:_a.sent();onFinished&&onFinished();return [2/*return*/];}});});}function refreshItem(){return __awaiter(this,void 0,void 0,function(){var p,selectedLanguage_1,err_1;return __generator(this,function(_a){switch(_a.label){case 0:_a.trys.push([0,2,3,4]);return [4/*yield*/,loadItemFunc(itemId)];case 1:p=_a.sent();selectedLanguage_1=NewsService.getLanguageForPublishableItem(p,user);if(isValid){setItem(p);setOriginalItem(p);setSelectedLanguage({isUserSet:false,lang:selectedLanguage_1});setHasError(false);}return [3/*break*/,4];case 2:err_1=_a.sent();if(err_1&&err_1.response&&err_1.response.statusCode===404){if(isValid){setItem(null);setSelectedLanguage(null);setHasError(true);}}else if(err_1&&err_1.response&&err_1.response.statusCode===403){setShowAccessDenied(true);}else {logger.error(err_1);handleFatalError({error:err_1,messageId:'Generic.error'});}return [3/*break*/,4];case 3:isValid&&setIsLoading(false);return [7/*endfinally*/];case 4:return [2/*return*/];}});});}function handleLanguageChange(language){return __awaiter(this,void 0,void 0,function(){var content;var _a;return __generator(this,function(_b){switch(_b.label){case 0:if(item.contents[language]){setSelectedLanguage({isUserSet:true,lang:language});return [2/*return*/];}return [4/*yield*/,translateContents(type,itemId,language)];case 1:content=_b.sent();setItem(__assign(__assign({},item),{contents:__assign(__assign({},item.contents),(_a={},_a[language]=content,_a))}));setSelectedLanguage({isUserSet:true,lang:language});return [2/*return*/];}});});}};var EntityType;(function(EntityType){EntityType["Video"]="video";EntityType["Image"]="image";EntityType["File"]="file";EntityType["Quote"]="quote";EntityType["InlineCode"]="inline-code";EntityType["Gallery"]="gallery";EntityType["Table"]="table";EntityType["Contact"]="contact";EntityType["InlinePageList"]="inline-page-list";EntityType["UrlPreview"]="url-preview";})(EntityType||(EntityType={}));var TextViewer=function TextViewer(_a){var html=_a.html,componentMappers=_a.componentMappers;var _b=React$d.useState(null),editorState=_b[0],setEditorState=_b[1];React$d.useEffect(function(){setEditorState(getInitialEditorState());// eslint-disable-next-line react-hooks/exhaustive-deps
132165
132165
  },[html]);if(!editorState){return null;}var currentContent=editorState.getCurrentContent();return jsxRuntime.jsx(Draft$1.Editor,{readOnly:true,editorState:editorState,onChange:function(){return null;},blockRendererFn:blockRenderer,blockStyleFn:blockStyle,blockRenderMap:headingRenderMap},void 0);function blockStyle(block){var type=block.getType();if(type==='unstyled'){return 'paragraph';}return null;}function blockRenderer(block){if(block.getType()!=='atomic'){return null;}var entityKey=block.getEntityAt(0);if(entityKey==null){return null;}var entity=currentContent.getEntity(entityKey);var handler=componentMappers.find(function(h){return h.type===entity.getType();});if(handler!=null){return {component:handler.component,editable:false,props:__assign({},entity.getData())};}return null;}function getInitialEditorState(){var contentState=convertFromHTML$1({htmlToEntity:convertHtmlToEntity,htmlToBlock:createHtmlToBlockConverter(componentMappers)})(html||'');return Draft$1.EditorState.createWithContent(contentState,decorator);}function convertHtmlToEntity(nodeName,node,createEntity){for(var _i=0,componentMappers_1=componentMappers;_i<componentMappers_1.length;_i++){var handler=componentMappers_1[_i];var match=handler.getPropsFromHtml(nodeName,node);if(match){return createEntity(handler.type,'IMMUTABLE',match);}}if(nodeName==='a'){return createEntity('LINK','MUTABLE',{url:node.getAttribute('href')});}return null;}};var Link$2=function Link(_a){var contentState=_a.contentState,entityKey=_a.entityKey,children=_a.children;var url=contentState.getEntity(entityKey).getData().url;return jsxRuntime.jsx(TextLink,__assign({url:url},{children:children}),void 0);};function findLinkEntities(contentBlock,callback,contentState){contentBlock.findEntityRanges(function(character){var entityKey=character.getEntity();return entityKey!==null&&contentState.getEntity(entityKey).getType()==='LINK';},callback);}var decorator=new Draft$1.CompositeDecorator([{strategy:findLinkEntities,component:Link$2}]);function createHtmlToBlockConverter(componentMappers){var componentMapperParentNodes=[];return function(nodeName,node){// note (sl): draftJS does call this for all root elements AND
132166
132166
  // their children. We only want to handle an element,
@@ -132396,18 +132396,11 @@
132396
132396
  var hideComments = _a.hideComments,
132397
132397
  hideLikes = _a.hideLikes;
132398
132398
  var item = useDetailViewContext().item;
132399
-
132400
- if (item === null || item === void 0 ? void 0 : item.useExternalContent) {
132401
- return jsxRuntime.jsxs(DetailMainSection, {
132402
- children: [jsxRuntime.jsx(DetailViewHeadline, {}, void 0), jsxRuntime.jsx(DetailViewTitle, {}, void 0), jsxRuntime.jsx(DetailViewIntro, {}, void 0), jsxRuntime.jsx(NewsDetailViewMetaInfo, {}, void 0), jsxRuntime.jsx(DetailViewBodyExternalContent, {
132403
- itemType: ItemResourceTypes.News
132404
- }, void 0)]
132405
- }, void 0);
132406
- }
132407
-
132408
132399
  return jsxRuntime.jsxs(jsxRuntime.Fragment, {
132409
132400
  children: [jsxRuntime.jsxs(DetailMainSection, {
132410
- children: [jsxRuntime.jsx(DetailViewHeadline, {}, void 0), jsxRuntime.jsx(DetailViewTitle, {}, void 0), jsxRuntime.jsx(DetailViewIntro, {}, void 0), jsxRuntime.jsx(NewsDetailViewMetaInfo, {}, void 0), jsxRuntime.jsx(DetailViewBody, {}, void 0), jsxRuntime.jsx(DetailViewKeywords, {
132401
+ children: [jsxRuntime.jsx(DetailViewHeadline, {}, void 0), jsxRuntime.jsx(DetailViewTitle, {}, void 0), jsxRuntime.jsx(DetailViewIntro, {}, void 0), jsxRuntime.jsx(NewsDetailViewMetaInfo, {}, void 0), (item === null || item === void 0 ? void 0 : item.useExternalContent) ? jsxRuntime.jsx(DetailViewBodyExternalContent, {
132402
+ itemType: ItemResourceTypes.News
132403
+ }, void 0) : jsxRuntime.jsx(DetailViewBody, {}, void 0), jsxRuntime.jsx(DetailViewKeywords, {
132411
132404
  filterBaseUrl: null
132412
132405
  }, void 0)]
132413
132406
  }, void 0), jsxRuntime.jsx(DetailViewPoll, {}, void 0), jsxRuntime.jsx(DetailViewConfirmations, {}, void 0), jsxRuntime.jsx(NewsDetailViewFeedbackSection, {
@@ -132893,20 +132886,12 @@
132893
132886
  }, void 0), jsxRuntime.jsx(DetailViewTitle, {}, void 0), jsxRuntime.jsx(DetailViewIntro, {}, void 0), jsxRuntime.jsx(PageDetailViewMetaInfo, {}, void 0)]
132894
132887
  }, void 0);
132895
132888
 
132896
- if (item === null || item === void 0 ? void 0 : item.useExternalContent) {
132897
- return jsxRuntime.jsxs(jsxRuntime.Fragment, {
132898
- children: [jsxRuntime.jsxs(DetailMainSection, {
132899
- children: [Header, jsxRuntime.jsx(DetailViewBodyExternalContent, {
132900
- itemType: ItemResourceTypes.Pages
132901
- }, void 0), jsxRuntime.jsx(PagesDetailViewNavigationWrapper, {}, void 0)]
132902
- }, void 0), jsxRuntime.jsx(DetailViewPoll, {}, void 0), jsxRuntime.jsx(DetailViewConfirmations, {}, void 0)]
132903
- }, void 0);
132904
- }
132905
-
132906
132889
  var isDocument = (item === null || item === void 0 ? void 0 : item.pageType) === PageType.Document;
132907
132890
  return jsxRuntime.jsxs(jsxRuntime.Fragment, {
132908
132891
  children: [jsxRuntime.jsxs(DetailMainSection, {
132909
- children: [Header, !isDocument && jsxRuntime.jsx(DetailViewBody, {}, void 0), isDocument && jsxRuntime.jsx(DetailViewPageDocumentDownload, {}, void 0), jsxRuntime.jsx(InlinePageListWrapper, {}, void 0), jsxRuntime.jsx(PagesDetailViewNavigationWrapper, {}, void 0), jsxRuntime.jsx(DetailViewKeywords, {
132892
+ children: [Header, isDocument ? jsxRuntime.jsx(DetailViewPageDocumentDownload, {}, void 0) : (item === null || item === void 0 ? void 0 : item.useExternalContent) ? jsxRuntime.jsx(DetailViewBodyExternalContent, {
132893
+ itemType: ItemResourceTypes.Pages
132894
+ }, void 0) : jsxRuntime.jsx(DetailViewBody, {}, void 0), jsxRuntime.jsx(InlinePageListWrapper, {}, void 0), jsxRuntime.jsx(PagesDetailViewNavigationWrapper, {}, void 0), jsxRuntime.jsx(DetailViewKeywords, {
132910
132895
  filterBaseUrl: null
132911
132896
  }, void 0)]
132912
132897
  }, void 0), jsxRuntime.jsx(DetailViewPoll, {}, void 0), jsxRuntime.jsx(DetailViewConfirmations, {}, void 0), jsxRuntime.jsx(PageDetailViewFeedbackSection, {
@@ -133555,34 +133540,32 @@
133555
133540
  onChannelClick: onChannelClick,
133556
133541
  onKeywordClick: onKeywordClick,
133557
133542
  buttons: jsxRuntime.jsxs(jsxRuntime.Fragment, {
133558
- children: [!item.useExternalContent && jsxRuntime.jsxs(jsxRuntime.Fragment, {
133559
- children: [jsxRuntime.jsx(CardLikeButton, {
133560
- item: item,
133561
- itemResourceType: ItemResourceTypes.News
133562
- }, void 0), showComments && jsxRuntime.jsx(Tooltip, __assign$g({
133563
- resourceKey: "NewsArticle.numberOfComments",
133564
- values: {
133565
- count: commentsCount
133566
- },
133567
- className: className
133543
+ children: [jsxRuntime.jsx(CardLikeButton, {
133544
+ item: item,
133545
+ itemResourceType: ItemResourceTypes.News
133546
+ }, void 0), showComments && jsxRuntime.jsx(Tooltip, __assign$g({
133547
+ resourceKey: "NewsArticle.numberOfComments",
133548
+ values: {
133549
+ count: commentsCount
133550
+ },
133551
+ className: className
133552
+ }, {
133553
+ children: jsxRuntime.jsxs(Comments, __assign$g({
133554
+ href: "" + webAppUrl + targetRoute,
133555
+ target: "_blank",
133556
+ rel: "noopener noreferrer",
133557
+ onClick: function (e) {
133558
+ return handleClick(e, item, false, onItemClick, true);
133559
+ }
133568
133560
  }, {
133569
- children: jsxRuntime.jsxs(Comments, __assign$g({
133570
- href: "" + webAppUrl + targetRoute,
133571
- target: "_blank",
133572
- rel: "noopener noreferrer",
133573
- onClick: function (e) {
133574
- return handleClick(e, item, false, onItemClick, true);
133575
- }
133576
- }, {
133577
- children: [jsxRuntime.jsx(StyledIcon$2, {
133578
- iconName: "Chat",
133579
- highlight: item.hasNewComments
133580
- }, void 0), commentsCount > 0 && jsxRuntime.jsx(CommentsCount, {
133581
- children: commentsCount
133582
- }, void 0)]
133583
- }), void 0)
133584
- }), void 0)]
133585
- }, void 0), jsxRuntime.jsx(BookmarkButton, {
133561
+ children: [jsxRuntime.jsx(StyledIcon$2, {
133562
+ iconName: "Chat",
133563
+ highlight: item.hasNewComments
133564
+ }, void 0), commentsCount > 0 && jsxRuntime.jsx(CommentsCount, {
133565
+ children: commentsCount
133566
+ }, void 0)]
133567
+ }), void 0)
133568
+ }), void 0), jsxRuntime.jsx(BookmarkButton, {
133586
133569
  item: item
133587
133570
  }, void 0)]
133588
133571
  }, void 0)
@@ -140872,7 +140855,7 @@
140872
140855
  "Themes.selectorDescription": "Wählen Sie ein Farbschema für LiveTiles Reach.",
140873
140856
  "Themes.colorPickerDescription": "Sie können die Farben in der untenstehenden Farbpalette ändern.",
140874
140857
  "Themes.contrast.info": "Diese Bewertungen basieren auf WCAG Richtlinien. <a>Hier</a> mehr erfahren.",
140875
- "Themes.contrast.number": "Kontrastverhältnis: {number}",
140858
+ "Themes.contrast.ratio": "Contrast Ratio: {ratio}",
140876
140859
  "Themes.contrast.rating": "Kontrastbewertung: {rating}",
140877
140860
  "Themes.contrast.pass": "gut",
140878
140861
  "Themes.contrast.fail": "fehlgeschlagen",
@@ -142954,7 +142937,7 @@
142954
142937
  "Themes.selectorDescription": "Sélectionnez une couleur pour le thème de LiveTiles Reach.",
142955
142938
  "Themes.colorPickerDescription": "Vous pouvez sélectionner une couleur personnalisée en cliquant ci-dessous.",
142956
142939
  "Themes.contrast.info": "These ratings are based off the WCAG guidelines on contrast. Learn more <a>here</a>.",
142957
- "Themes.contrast.number": "Contrast Number: {number}",
142940
+ "Themes.contrast.ratio": "Contrast Ratio: {ratio}",
142958
142941
  "Themes.contrast.rating": "Contrast Rating: {rating}",
142959
142942
  "Themes.contrast.pass": "good",
142960
142943
  "Themes.contrast.fail": "fail",
@@ -145036,7 +145019,7 @@
145036
145019
  "Themes.selectorDescription": "Seleccione un color del tema para LiveTiles Reach",
145037
145020
  "Themes.colorPickerDescription": "Puede personalizar los colores al hacer clic en las muestras de color debajo.",
145038
145021
  "Themes.contrast.info": "These ratings are based off the WCAG guidelines on contrast. Learn more <a>here</a>.",
145039
- "Themes.contrast.number": "Contrast Number: {number}",
145022
+ "Themes.contrast.ratio": "Contrast Ratio: {ratio}",
145040
145023
  "Themes.contrast.rating": "Contrast Rating: {rating}",
145041
145024
  "Themes.contrast.pass": "good",
145042
145025
  "Themes.contrast.fail": "fail",
@@ -147117,7 +147100,7 @@
147117
147100
  "Themes.selectorDescription": "為LiveTiles Reach選擇顏色主題。",
147118
147101
  "Themes.colorPickerDescription": "您可以通過按下方色板來自訂顏色。",
147119
147102
  "Themes.contrast.info": "These ratings are based off the WCAG guidelines on contrast. Learn more <a>here</a>.",
147120
- "Themes.contrast.number": "Contrast Number: {number}",
147103
+ "Themes.contrast.ratio": "Contrast Ratio: {ratio}",
147121
147104
  "Themes.contrast.rating": "Contrast Rating: {rating}",
147122
147105
  "Themes.contrast.pass": "good",
147123
147106
  "Themes.contrast.fail": "fail",
@@ -149184,7 +149167,7 @@
149184
149167
  "Themes.selectorDescription": "为 LiveTiles Reach选择一个颜色主题。",
149185
149168
  "Themes.colorPickerDescription": "您可以通过单击下面的色板来自定义颜色。",
149186
149169
  "Themes.contrast.info": "These ratings are based off the WCAG guidelines on contrast. Learn more <a>here</a>.",
149187
- "Themes.contrast.number": "Contrast Number: {number}",
149170
+ "Themes.contrast.ratio": "Contrast Ratio: {ratio}",
149188
149171
  "Themes.contrast.rating": "Contrast Rating: {rating}",
149189
149172
  "Themes.contrast.pass": "good",
149190
149173
  "Themes.contrast.fail": "fail",
@@ -151265,7 +151248,7 @@
151265
151248
  "Themes.selectorDescription": "LiveTiles Reach用の配色を選択する。",
151266
151249
  "Themes.colorPickerDescription": "以下の色見本をクリックして、色をカスタマイズできます。",
151267
151250
  "Themes.contrast.info": "These ratings are based off the WCAG guidelines on contrast. Learn more <a>here</a>.",
151268
- "Themes.contrast.number": "Contrast Number: {number}",
151251
+ "Themes.contrast.ratio": "Contrast Ratio: {ratio}",
151269
151252
  "Themes.contrast.rating": "Contrast Rating: {rating}",
151270
151253
  "Themes.contrast.pass": "good",
151271
151254
  "Themes.contrast.fail": "fail",
@@ -153347,7 +153330,7 @@
153347
153330
  "Themes.selectorDescription": "LiveTiles Reach için tema rengi seçin",
153348
153331
  "Themes.colorPickerDescription": "Renkleri aşağıdaki renk örneklerine tıklayarak özelleştirebilirsiniz.",
153349
153332
  "Themes.contrast.info": "These ratings are based off the WCAG guidelines on contrast. Learn more <a>here</a>.",
153350
- "Themes.contrast.number": "Contrast Number: {number}",
153333
+ "Themes.contrast.ratio": "Contrast Ratio: {ratio}",
153351
153334
  "Themes.contrast.rating": "Contrast Rating: {rating}",
153352
153335
  "Themes.contrast.pass": "good",
153353
153336
  "Themes.contrast.fail": "fail",
@@ -155430,7 +155413,7 @@
155430
155413
  "Themes.selectorDescription": "Seleziona il colore del tema per LiveTiles Reach.",
155431
155414
  "Themes.colorPickerDescription": "Puoi personalizzare i colori cliccando sui campioni di colore qui sotto.",
155432
155415
  "Themes.contrast.info": "These ratings are based off the WCAG guidelines on contrast. Learn more <a>here</a>.",
155433
- "Themes.contrast.number": "Contrast Number: {number}",
155416
+ "Themes.contrast.ratio": "Contrast Ratio: {ratio}",
155434
155417
  "Themes.contrast.rating": "Contrast Rating: {rating}",
155435
155418
  "Themes.contrast.pass": "good",
155436
155419
  "Themes.contrast.fail": "fail",
@@ -158085,7 +158068,6 @@
158085
158068
  "Events.numberOfComments": "This event has {count, plural, =0 {0 comments} one {1 comment} other {{count} comments}}",
158086
158069
  "Events.readersTooltip": "{count, plural, =0 {No users have} one {1 user has} other {{count} users have}} seen this event",
158087
158070
  "Events.emptyList": "There are no events yet.",
158088
- "Events.latest": "Latest events",
158089
158071
  "Events.upcoming": "Upcoming events",
158090
158072
  "Events.myEvents": "My Booked events",
158091
158073
  "Events.pastEvents": "Past events",
@@ -1037,7 +1037,7 @@ var it = {
1037
1037
  "Themes.selectorDescription": "Seleziona il colore del tema per LiveTiles Reach.",
1038
1038
  "Themes.colorPickerDescription": "Puoi personalizzare i colori cliccando sui campioni di colore qui sotto.",
1039
1039
  "Themes.contrast.info": "These ratings are based off the WCAG guidelines on contrast. Learn more <a>here</a>.",
1040
- "Themes.contrast.number": "Contrast Number: {number}",
1040
+ "Themes.contrast.ratio": "Contrast Ratio: {ratio}",
1041
1041
  "Themes.contrast.rating": "Contrast Rating: {rating}",
1042
1042
  "Themes.contrast.pass": "good",
1043
1043
  "Themes.contrast.fail": "fail",
@@ -1037,7 +1037,7 @@ var ja = {
1037
1037
  "Themes.selectorDescription": "LiveTiles Reach用の配色を選択する。",
1038
1038
  "Themes.colorPickerDescription": "以下の色見本をクリックして、色をカスタマイズできます。",
1039
1039
  "Themes.contrast.info": "These ratings are based off the WCAG guidelines on contrast. Learn more <a>here</a>.",
1040
- "Themes.contrast.number": "Contrast Number: {number}",
1040
+ "Themes.contrast.ratio": "Contrast Ratio: {ratio}",
1041
1041
  "Themes.contrast.rating": "Contrast Rating: {rating}",
1042
1042
  "Themes.contrast.pass": "good",
1043
1043
  "Themes.contrast.fail": "fail",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@livetiles/reach-components-react",
3
3
  "description": "Provides React components to consume LiveTiles Reach data",
4
- "version": "0.3.70",
4
+ "version": "0.3.75",
5
5
  "peerDependencies": {
6
6
  "react": "^16.14.0 || ^17",
7
7
  "react-dom": "^16.14.0 || ^17",
@@ -1037,7 +1037,7 @@ var tr = {
1037
1037
  "Themes.selectorDescription": "LiveTiles Reach için tema rengi seçin",
1038
1038
  "Themes.colorPickerDescription": "Renkleri aşağıdaki renk örneklerine tıklayarak özelleştirebilirsiniz.",
1039
1039
  "Themes.contrast.info": "These ratings are based off the WCAG guidelines on contrast. Learn more <a>here</a>.",
1040
- "Themes.contrast.number": "Contrast Number: {number}",
1040
+ "Themes.contrast.ratio": "Contrast Ratio: {ratio}",
1041
1041
  "Themes.contrast.rating": "Contrast Rating: {rating}",
1042
1042
  "Themes.contrast.pass": "good",
1043
1043
  "Themes.contrast.fail": "fail",
@@ -1037,7 +1037,7 @@ var zh = {
1037
1037
  "Themes.selectorDescription": "为 LiveTiles Reach选择一个颜色主题。",
1038
1038
  "Themes.colorPickerDescription": "您可以通过单击下面的色板来自定义颜色。",
1039
1039
  "Themes.contrast.info": "These ratings are based off the WCAG guidelines on contrast. Learn more <a>here</a>.",
1040
- "Themes.contrast.number": "Contrast Number: {number}",
1040
+ "Themes.contrast.ratio": "Contrast Ratio: {ratio}",
1041
1041
  "Themes.contrast.rating": "Contrast Rating: {rating}",
1042
1042
  "Themes.contrast.pass": "good",
1043
1043
  "Themes.contrast.fail": "fail",
@@ -1037,7 +1037,7 @@ var zh = {
1037
1037
  "Themes.selectorDescription": "為LiveTiles Reach選擇顏色主題。",
1038
1038
  "Themes.colorPickerDescription": "您可以通過按下方色板來自訂顏色。",
1039
1039
  "Themes.contrast.info": "These ratings are based off the WCAG guidelines on contrast. Learn more <a>here</a>.",
1040
- "Themes.contrast.number": "Contrast Number: {number}",
1040
+ "Themes.contrast.ratio": "Contrast Ratio: {ratio}",
1041
1041
  "Themes.contrast.rating": "Contrast Rating: {rating}",
1042
1042
  "Themes.contrast.pass": "good",
1043
1043
  "Themes.contrast.fail": "fail",