ias("ember-vector-images/components/lazy-image","msg-multisend/components/lazy-image") define.alias("artdeco-icons-web/components/linkedin-logo","msg-multisend/components/linkedin-logo") define("msg-multisend/components/multi-send",["exports","@babel/runtime/helpers/esm/initializerDefineProperty","@babel/runtime/helpers/esm/defineProperty","@babel/runtime/helpers/esm/applyDecoratedDescriptor","@babel/runtime/helpers/esm/initializerWarningHelper","@ember/template-factory","@ember/helper","msg-shared/utils/view-data-helpers","msg-typeahead/viewdata/graphql-possible-recipient-viewdata","msg-shared/utils/constants","global-helpers/helpers/name","tracked-built-ins","@ember/service","ember-lifeline","@glimmer/tracking","@glimmer/component","ember","@ember/object","@ember/destroyable","@ember/utils","ember-set-helper/helpers/set","artdeco-modal/components/artdeco-modal","@ember/render-modifiers/modifiers/did-update","ember-cli-pemberly-i18n/helpers/t","msg-multisend/components/social-share","@ember/component","@ember/modifier","global-modifiers/modifiers/focus","hue-web-icons/components/icon","artdeco-loader/components/artdeco-loader","msg-typeahead/components/possible-recipient-presenter","global-helpers/helpers/includes","artdeco-inline-feedback/components/artdeco-inline-feedback","ember-cli-pemberly-tracking/modifiers/track-interaction","global-helpers/helpers/gt","asset-loader/components/asset-loader","rsvp","ember-test-waiters","msg-shared/utils/pem-config","global-helpers/helpers/or","ember-batcher"],(function(e,t,n,i,s,l,o,a,r,d,c,m,u,p,h,g,f,b,y,v,_,S,R,w,k,T,M,A,x,P,D,O,C,U,E,z,j,L,N,B,I){"use strict" Object.defineProperty(e,"__esModule",{value:!0}) e.default=void 0 var G,F,q,H,W,V,Y,K,$,J,Q,X,Z,ee,te,ne,ie,se,le,oe,ae,re,de const{GROUP_THREADS:ce}=d.MESSAGE_TYPEAHEAD_RESULT_TYPES,me=(0,L.buildWaiter)("message-send") e.default=(0,T.setComponentTemplate)((0,l.createTemplateFactory)({id:"sHz021Kc",block:'[[[1,"\\n"],[1," "],[8,[32,0],[[4,[32,1],[[30,0,["fetchSuggestedRecipients"]],[30,0,["multiSend","isMultiSendModalOpen"]]],null]],[["@isOpen","@size","@dismissModal","@modalClasses"],[[30,0,["multiSend","isMultiSendModalOpen"]],"large",[30,0,["closeMultiSend"]],[29,[[52,[30,0,["multiSend","centerModalVertically"]],"msg-multisend__modal--v-center"]," ",[52,[51,[30,0,["multiSend","showRepostOptionsAndSendStep"]]],"full-height"]]]]],[["default"],[[[[1,"\\n "],[8,[30,1,["artdeco-modal-header"]],null,[["@classNames"],[[29,["display-flex ",[52,[30,0,["hasSocialShare"]],"msg-multisend__modal--no-header-divider"]]]]],[["default"],[[[[1,"\\n "],[10,"h2"],[14,1,"multi-send-modal-header"],[12],[1,"\\n"],[41,[30,0,["multiSend","headerTitle"]],[[[1," "],[1,[30,0,["multiSend","headerTitle"]]],[1,"\\n"]],[]],[[[41,[30,0,["postAuthor"]],[[[41,[30,0,["multiSend","useShareHeader"]],[[[1," "],[1,[28,[32,2],["i18n_share_post","msg-multisend/components/multi-send"],[["postAuthor"],[[30,0,["postAuthor"]]]]]],[1,"\\n"]],[]],[[[1," "],[1,[28,[32,2],["i18n_sendPost","msg-multisend/components/multi-send"],[["postAuthor"],[[30,0,["postAuthor"]]]]]],[1,"\\n"]],[]]]],[]],[[[41,[30,0,["multiSend","useShareHeader"]],[[[1," "],[1,[28,[32,2],["i18n_share_post_no_author","msg-multisend/components/multi-send"],null]],[1,"\\n"]],[]],[[[1," "],[1,[28,[32,2],["i18n_sendPostNoAuthor","msg-multisend/components/multi-send"],null]],[1,"\\n"]],[]]],[1," "]],[]]]],[]]],[1," "],[13],[1,"\\n "]],[]]]]],[1,"\\n "],[8,[30,1,["artdeco-modal-content"]],[[24,0,"msg-multisend__modal-content full-height"]],null,[["default"],[[[[1,"\\n"],[41,[28,[32,3],[[30,0,["multiSend","showRepostOptions"]],[30,0,["multiSend","showRepostOptionsAndSendStep"]]],null],[[[1," "],[10,0],[15,0,[29,["msg-multisend__repost-options\\n ",[52,[30,0,["multiSend","showRepostOptionsAndSendStep"]],"mb0"]]]],[12],[1,"\\n "],[10,"ul"],[14,0,"list-style-none"],[12],[1,"\\n "],[10,"li"],[12],[1,"\\n "],[11,"button"],[16,"aria-label",[28,[32,2],["i18n_repost_with_thoughts","msg-multisend/components/multi-send"],null]],[24,0,"msg-multisend__repost-option-button artdeco-button--tertiary artdeco-button--muted"],[24,4,"button"],[4,[32,4],["click",[30,0,["multiSend","repostWithCommentary"]]],null],[4,[32,5],["reshare_with_commentary"],null],[12],[1,"\\n "],[8,[32,6],[[24,0,"msg-multisend__repost-option-button-icon"]],[["@name","@size"],["compose","medium"]],null],[1,"\\n "],[10,1],[14,0,"mb1 t-14 t-bold t-black"],[12],[1,"\\n "],[1,[28,[32,2],["i18n_repost_with_thoughts","msg-multisend/components/multi-send"],null]],[1,"\\n "],[13],[1,"\\n "],[10,1],[14,0,"t-12 t-normal"],[12],[1,"\\n"],[41,[30,0,["postAuthor"]],[[[1," "],[1,[28,[32,2],["i18n_repost_with_thoughts_subtext_author","msg-multisend/components/multi-send"],[["postAuthor"],[[30,0,["postAuthor"]]]]]],[1,"\\n"]],[]],[[[1," "],[1,[28,[32,2],["i18n_repost_with_thoughts_subtext_author_default","msg-multisend/components/multi-send"],null]],[1,"\\n"]],[]]],[1," "],[13],[1,"\\n "],[13],[1,"\\n "],[13],[1,"\\n "],[10,"li"],[12],[1,"\\n "],[11,"button"],[16,"aria-label",[28,[32,2],["i18n_repost","msg-multisend/components/multi-send"],null]],[24,0,"msg-multisend__repost-option-button artdeco-button--tertiary artdeco-button--muted"],[24,4,"button"],[4,[32,4],["click",[30,0,["multiSend","repostWithoutCommentary"]]],null],[4,[32,5],["reshare_as_is"],null],[12],[1,"\\n "],[8,[32,6],[[24,0,"msg-multisend__repost-option-button-icon"]],[["@name","@size"],["repost","medium"]],null],[1,"\\n "],[10,1],[14,0,"mb1 t-14 t-bold t-black"],[12],[1,"\\n "],[1,[28,[32,2],["i18n_repost","msg-multisend/components/multi-send"],null]],[1,"\\n "],[13],[1,"\\n "],[10,1],[14,0,"t-12 t-normal"],[12],[1,"\\n"],[41,[30,0,["postAuthor"]],[[[1," "],[1,[28,[32,2],["i18n_repost_subtext_author","msg-multisend/components/multi-send"],[["postAuthor"],[[30,0,["postAuthor"]]]]]],[1,"\\n"]],[]],[[[1," "],[1,[28,[32,2],["i18n_repost_subtext_default","msg-multisend/components/multi-send"],null]],[1,"\\n"]],[]]],[1," "],[13],[1,"\\n "],[13],[1,"\\n "],[13],[1,"\\n"],[41,[30,0,["multiSend","showRepostOptionsAndSendStep"]],[[[1," "],[10,"li"],[12],[1,"\\n "],[11,"button"],[16,"aria-label",[28,[32,2],["i18n_send_as_message","msg-multisend/components/multi-send"],null]],[24,0,"msg-multisend__repost-option-button artdeco-button--tertiary artdeco-button--muted"],[24,4,"button"],[4,[32,4],["click",[30,0,["onSendAsMessageButtonClick"]]],null],[4,[32,5],["compose_multisend"],null],[12],[1,"\\n "],[8,[32,6],[[24,0,"msg-multisend__repost-option-button-icon"]],[["@name","@size"],["send-privately","medium"]],null],[1,"\\n "],[10,1],[14,0,"mb1 t-14 t-bold t-black"],[12],[1,"\\n "],[1,[28,[32,2],["i18n_send_as_message","msg-multisend/components/multi-send"],null]],[1,"\\n "],[13],[1,"\\n "],[10,1],[14,0,"t-12 t-normal"],[12],[1,"\\n "],[1,[28,[32,2],["i18n_send_as_message_subtext","msg-multisend/components/multi-send"],null]],[1,"\\n "],[13],[1,"\\n "],[13],[1,"\\n "],[13],[1,"\\n"]],[]],null],[1," "],[13],[1,"\\n "],[13],[1,"\\n"]],[]],null],[41,[30,0,["multiSend","showRecipientSearchAndResults"]],[[[1," "],[10,0],[14,0,"relative"],[12],[1,"\\n "],[10,"label"],[14,"for","multisend-typeahead"],[14,0,"visually-hidden"],[12],[1,"\\n "],[1,[28,[32,2],["i18n_typeahead_label","msg-multisend/components/multi-send"],null]],[1,"\\n "],[13],[1,"\\n "],[8,[32,7],[[24,1,"multisend-typeahead"],[16,0,[29,["mb4\\n ",[52,[30,0,["isSafariOnIphone"]],"msg-multisend__typeahead-safari-on-iphone"]]]],[16,"placeholder",[28,[32,2],["i18n_typeahead_placeholder","msg-multisend/components/multi-send"],null]],[24,"role","combobox"],[24,"aria-controls","multisend-recipient-results-container"],[24,"aria-expanded","true"],[4,[32,4],["input",[30,0,["debounceFetchRecipients"]]],null],[4,[32,8],null,null]],null,null],[1,"\\n"],[41,[30,0,["searchTerm"]],[[[1," "],[11,"button"],[24,0,"msg-multisend__typeahead-cancel-icon"],[16,"aria-label",[28,[32,2],["i18n_clear_input","msg-multisend/components/multi-send"],null]],[24,4,"button"],[4,[32,4],["click",[30,0,["clearTypeaheadSearch"]]],null],[12],[1,"\\n "],[8,[32,6],null,[["@type","@size","@name"],["system","small","close"]],null],[1,"\\n "],[13],[1,"\\n"]],[]],null],[1," "],[13],[1,"\\n "],[10,0],[14,1,"multisend-recipient-results-container"],[12],[1,"\\n"],[41,[30,0,["isLoading"]],[[[1," "],[8,[32,9],null,[["@size","@a11yText"],["small",[28,[32,2],["i18n_loading","msg-multisend/components/multi-send"],null]]],null],[1,"\\n"]],[]],[[[41,[30,0,["searchTerm"]],[[[41,[30,0,["typeaheadRecipients","length"]],[[[42,[28,[31,3],[[28,[31,3],[[30,0,["typeaheadRecipients"]]],null]],null],null,[[[1," "],[8,[32,10],null,[["@index","@viewData","@selectPersonResult","@isSelectedRecipient","@isMultiSend"],[[30,3],[30,2],[30,0,["selectPossibleRecipient"]],[28,[32,11],[[30,0,["selectedRecipientUrns"]],[30,2,["entityUrn"]]],null],true]],null],[1,"\\n"]],[2,3]],null]],[]],[[[1," "],[8,[32,12],null,[["@message"],[[28,[32,2],["i18n_no_results","msg-multisend/components/multi-send"],null]]],null],[1,"\\n"]],[]]]],[]],[[[41,[30,0,["selectedRecipients","length"]],[[[1," "],[10,0],[14,0,"mb2"],[12],[1,"\\n "],[10,0],[14,0,"display-flex justify-space-between"],[12],[1,"\\n "],[10,2],[14,0,"t-14 t-black t-normal"],[12],[1,"\\n "],[1,[28,[32,2],["i18n_selected","msg-multisend/components/multi-send"],null]],[1,"\\n "],[13],[1,"\\n "],[13],[1,"\\n"],[42,[28,[31,3],[[28,[31,3],[[30,0,["selectedRecipients"]]],null]],null],null,[[[1," "],[8,[32,10],null,[["@index","@viewData","@selectPersonResult","@isSelectedRecipient","@isMultiSend"],[[30,5],[30,4],[30,0,["selectPossibleRecipient"]],true,true]],null],[1,"\\n"]],[4,5]],null],[1," "],[13],[1,"\\n"]],[]],null],[41,[30,0,["multiSend","suggestedRecipientLists"]],[[[42,[28,[31,3],[[28,[31,3],[[30,0,["suggestedRecipientsLists"]]],null]],null],null,[[[1," "],[10,2],[14,0,"t-14 t-black t-bold pt3"],[12],[1,"\\n "],[1,[30,6,["title"]]],[1,"\\n "],[13],[1,"\\n"],[42,[28,[31,3],[[28,[31,3],[[30,6,["recipients"]]],null]],null],null,[[[1," "],[8,[32,10],null,[["@index","@viewData","@selectPersonResult","@isSelectedRecipient","@isMultiSend"],[[30,8],[30,7,["recipient"]],[30,0,["selectPossibleRecipient"]],[30,7,["selected"]],true]],null],[1,"\\n"]],[7,8]],null]],[6]],null]],[]],[[[42,[28,[31,3],[[28,[31,3],[[30,0,["possibleRecipientsToShow"]]],null]],null],null,[[[1," "],[8,[32,10],null,[["@index","@viewData","@selectPersonResult","@isSelectedRecipient","@isMultiSend"],[[30,10],[30,9],[30,0,["selectPossibleRecipient"]],false,true]],null],[1,"\\n"]],[9,10]],null]],[]]]],[]]]],[]]],[1," "],[13],[1,"\\n"]],[]],null],[1," "]],[]]]]],[1,"\\n"],[41,[30,0,["showFooter"]],[[[1," "],[8,[30,1,["artdeco-modal-footer"]],null,null,[["default"],[[[[1,"\\n"],[41,[30,0,["showSocialShare"]],[[[1," "],[8,[32,13],null,[["@shareUrl","@socialShareButtonClickTrackingCallback"],[[30,0,["multiSend","update","socialContent","shareUrl"]],[30,0,["multiSend","socialShareButtonClickTrackingCallback"]]]],null],[1,"\\n"]],[]],[[[1," "],[8,[32,14],null,[["@bundle"],["msg-ui"]],[["resolved"],[[[[1,"\\n"],[44,[[28,[30,11,["component"]],["msg-form/base-form-feature"],null]],[[[1," "],[8,[30,12],null,[["@isMessagingExternalSendFlow","@overridePlaceholder","@submitMessage","@update","@externallyValid","@prefilledMessage","@mandatoryMessageAttachment"],[true,[28,[32,2],["i18n_write_a_message","msg-multisend/components/multi-send"],null],[30,0,["submitMessage"]],[30,0,["multiSend","update"]],[30,0,["enableMultiSend"]],[30,0,["multiSend","prefilledMessage"]],[30,0,["multiSend","mandatoryMessageAttachment"]]]],[["default"],[[[[1,"\\n "],[10,0],[15,0,[29,["msg-multisend__msg-form\\n ",[52,[30,0,["hideMessageContainer"]]," hidden"]]]],[12],[1,"\\n "],[8,[30,13,["messageContentContainerPresenter"]],[[24,0,"msg-form__message-texteditor relative flex-grow-1 display-flex"]],[["@shouldHideSendButton"],[true]],null],[1,"\\n "],[10,0],[14,0,"msg-form__multisend-preview t-12 t-black--light t-normal"],[12],[1,"\\n "],[8,[32,6],[[24,0,"msg-multisend__attachment-icon"]],[["@type","@size","@name"],["system","small",[30,0,["attachmentPreviewIconName"]]]],null],[1,[30,0,["attachmentPreviewLabel"]]],[1,"\\n "],[13],[1,"\\n "],[13],[1,"\\n\\n "],[10,0],[14,0,"align-items-center msg-multisend__send-controls"],[12],[1,"\\n"],[41,[30,0,["showSendAsGroupButton"]],[[[1," "],[8,[30,13,["sendControlsPresenter"]],[[4,[32,4],["click",[28,[32,15],[[30,0],"sendingToGroup",true],null]],null],[4,[32,5],["send_as_group"],null]],[["@buttonClass","@customSendButtonText"],["artdeco-button artdeco-button--secondary",[28,[32,2],["i18n_send_message_as_group","msg-multisend/components/multi-send"],null]]],null],[1,"\\n"]],[]],null],[1," "],[8,[30,13,["sendControlsPresenter"]],[[24,0,"ml2"],[4,[32,5],["send"],null]],[["@buttonClass","@customSendButtonText"],["artdeco-button artdeco-button--primary",[52,[28,[32,16],[[30,0,["selectedRecipients","length"]],1],null],[28,[32,2],["i18n_send_message_separately","msg-multisend/components/multi-send"],null],[28,[32,2],["i18n_send_message","msg-multisend/components/multi-send"],null]]]],null],[1,"\\n "],[13],[1,"\\n "]],[13]]]]],[1,"\\n"]],[12]]],[1," "]],[11]]]]],[1,"\\n"]],[]]],[1," "]],[]]]]],[1,"\\n"]],[]],null],[1," "]],[1]]]]],[1,"\\n "]],["modal","recipient","index","recipient","index","receipientsList","item","index","recipient","index","resolved","BaseFormFeature","components"],false,["if","unless","each","-track-array","let"]]',moduleName:"msg-multisend/components/multi-send.gjs",scope:()=>[S.default,R.default,w.default,B.default,M.on,U.default,x.default,T.Input,A.default,P.default,D.default,O.default,C.default,k.default,z.default,_.default,E.default],isStrictMode:!0}),(G=(0,u.inject)("message-button@multi-send"),F=(0,u.inject)("msg-data@data-manager"),q=(0,u.inject)("i18n"),H=(0,u.inject)("persistent-toast-manager@persistent-toast-manager"),W=(0,u.inject)("formatter"),V=(0,u.inject)("tracking"),Y=(0,u.inject)("global-services@a11y-notification"),K=(0,u.inject)("global-services@window"),$=class e extends g.default{get postAuthor(){var e,t,n,i,s,l,o return(null===(e=this.multiSend.update)||void 0===e||null===(t=e.actor)||void 0===t||null===(n=t.name)||void 0===n?void 0:n.text)||(null===(i=this.multiSend.update)||void 0===i||null===(s=i.content)||void 0===s||null===(l=s.actor)||void 0===l||null===(o=l.name)||void 0===o?void 0:o.text)}get selectedRecipientNames(){return[...this.selectedRecipients.map((e=>(0,c.getName)(e.profileAPIModel))),{firstName:this.i18n.lookupTranslation(e,"i18n_you")(),isSelf:!0}]}get postAuthorProfileUrn(){var e,t,n,i,s,l,o,a,r,d,c,m,u,p const{update:h}=this.multiSend,g=(null==h||null===(e=h.content)||void 0===e?void 0:e.actor)||(null==h||null===(t=h.content)||void 0===t||null===(n=t.announcementComponent)||void 0===n?void 0:n.actor)||(null==h?void 0:h.actor),f=(null==g?void 0:g.name)||(null==g?void 0:g.image) return(null==f||null===(i=f.attributes)||void 0===i||null===(s=i[0])||void 0===s||null===(l=s.miniProfile)||void 0===l?void 0:l.entityUrn)||(null==f||null===(o=f.attributesV2)||void 0===o||null===(a=o[0])||void 0===a||null===(r=a.detailData)||void 0===r||null===(d=r.profileFullName)||void 0===d?void 0:d.entityUrn)||(null==f||null===(c=f.attributes)||void 0===c||null===(m=c[0])||void 0===m||null===(u=m.detailData)||void 0===u||null===(p=u.nonEntityProfilePicture)||void 0===p?void 0:p.profileUrn)}get possibleRecipientsToShow(){return this.possibleRecipients.filter((e=>!this.selectedRecipients.includes(e)))}get selectedRecipientUrns(){return this.selectedRecipients.map((e=>e.entityUrn))}get showSendAsGroupButton(){return this.selectedRecipients.length>=2&&!this.selectedRecipients.some((e=>e.isGroupTypeaheadResult))}get disableSendToGroup(){const e=this.selectedRecipients.filter((e=>e.recipientType===ce)) return this.selectedRecipients.length<2||e.length}get hasSocialShare(){return!!this.multiSend.showSocialShare}get showSocialShare(){return this.hideMessageContainer&&this.hasSocialShare}get isSafariOnIphone(){const{userAgent:e}=this.windowService.navigator,t=/^((?!chrome).)*safari/i.test(e),n=/iPhone.*AppleWebKit/.test(e) return t&&n}constructor(){super(...arguments);(0,t.default)(this,"multiSend",J,this);(0,t.default)(this,"msgDataManager",Q,this);(0,t.default)(this,"i18n",X,this);(0,t.default)(this,"persistentToastManager",Z,this);(0,t.default)(this,"formatter",ee,this);(0,t.default)(this,"tracking",te,this);(0,t.default)(this,"a11yNotification",ne,this);(0,t.default)(this,"windowService",ie,this);(0,t.default)(this,"searchTerm",se,this);(0,t.default)(this,"isLoading",le,this);(0,t.default)(this,"sendingToGroup",oe,this);(0,t.default)(this,"possibleRecipients",ae,this);(0,t.default)(this,"selectedRecipients",re,this);(0,t.default)(this,"typeaheadRecipients",de,this);(0,n.default)(this,"wasSuggestedRecipientsListConverted",!1);(0,n.default)(this,"convertedSuggestedRecipients",[]) this.fetchSuggestedRecipients()}selectPossibleRecipient(t){const n=this.selectedRecipients.findIndex((e=>e.entityUrn===t.entityUrn)) if(-1!==n){(0,I.mutateDOM)((()=>{const e=document.getElementById(`possible-recipient-presenter__checkbox-${t.entityUrn}`) null==e||e.focus()})) this._removeRecipient(n)}else{if(10===this.selectedRecipients.length){const t=this.i18n.lookupTranslation(e,"i18n_maximum_selected_recipients")([{maxRecipients:10}]) this.persistentToastManager.notice({message:t}) return}(0,I.mutateDOM)((()=>{const e=document.getElementById(`possible-recipient-presenter__checkbox-${t.entityUrn}`) null==e||e.focus()})) this._addRecipient(t)}}debounceFetchRecipients(e){let{target:{value:t}}=e this.searchTerm=t if(this.searchTerm){this.isLoading=!0 this.tracking.fireInteractionEvent("begin_recipient_search") if(f.default.testing)this._fetchTypeaheadRecipients(this.searchTerm) else{const e=200;(0,p.debounceTask)(this,"_fetchTypeaheadRecipients",this.searchTerm,e)}}else this.typeaheadRecipients=new m.TrackedArray}clearTypeaheadSearch(){const e=document.querySelector("#multisend-typeahead") if(null!=e&&e.value){(0,I.mutateDOM)((()=>e.focus())) e.value=""}this.typeaheadRecipients=new m.TrackedArray this.searchTerm=""}closeMultiSend(){this.selectedRecipients=new m.TrackedArray this.clearTypeaheadSearch() this.multiSend.closeMultiSend()}_removeRecipient(e){this.selectedRecipients.splice(e,1) this.clearTypeaheadSearch()}_addRecipient(e){this.selectedRecipients.unshift(e) this.clearTypeaheadSearch()}get hideMessageContainer(){return!this.selectedRecipients.length}get showFooter(){return!this.searchTerm}get attachmentPreviewIconName(){var e return null!==(e=this.multiSend.attachmentPreview)&&void 0!==e&&e.iconName?this.multiSend.attachmentPreview.iconName:"newspaper"}get attachmentPreviewLabel(){var t,n if(null!==(t=this.multiSend.attachmentPreview)&&void 0!==t&&t.label)return this.multiSend.attachmentPreview.label const i=this.postAuthor,s=null===(n=this.multiSend.update)||void 0===n?void 0:n.content if(i)return this.i18n.lookupTranslation(e,"i18n_postByAuthor")([{postAuthor:i}]) if(s){var l return null===(l=s.title)||void 0===l?void 0:l.text}return this.i18n.lookupTranslation(e,"i18n_content")}get enableMultiSend(){return!!this.selectedRecipients.length}get suggestedRecipientsLists(){const e=new Set this.selectedRecipients.forEach((t=>e.add(t.entityUrn))) const t=[] this.convertedSuggestedRecipients.forEach((n=>{const i=n.recipients.map((t=>{const{recipient:n}=t let i=!1 e.has(n.entityUrn)&&(i=!0) return{recipient:n,selected:i}})) t.push({title:n.title,recipients:i})})) return t}fetchSuggestedRecipients(){if(this.multiSend.isMultiSendModalOpen){this.isLoading=!0 if(!this.multiSend.suggestedRecipientLists||this.wasSuggestedRecipientsListConverted)this.msgDataManager.fetchSuggestedRecipients([],this.postAuthorProfileUrn,this.multiSend.preselectedRecipientUrns,N.VOYAGER_MESSAGING_DEGRADATION_METADATA.SUGGESTION).then((t=>{(0,y.isDestroying)(this)||(this.possibleRecipients=t.reduce(((n,i,s)=>{const{suggestedRecipients:l}=i let o;(0,v.isEmpty)(this.multiSend.preselectedRecipientUrns)&&2===t.length&&0===s&&(o=this.i18n.lookupTranslation(e,"i18n_author")) return[...n,...l.map((e=>{var t const n=new r.default({possibleRecipient:e,formatter:this.formatter,label:o}) null!==(t=this.multiSend.preselectedRecipientUrns)&&void 0!==t&&t.includes(n.entityUrn)&&this.selectedRecipients.length<10&&this.selectedRecipients.unshift(n) return n}))]}),[]))})).finally((()=>{(0,y.isDestroying)(this)||(this.isLoading=!1)})) else{this.multiSend.suggestedRecipientLists.forEach((e=>{this.convertedSuggestedRecipients.push(this._convertSuggestedRecipientsList(e))})) this.isLoading=!1 this.wasSuggestedRecipientsListConverted=!0}}}_convertSuggestedRecipientsList(e){const t=e.suggestedRecipients.map((e=>({recipient:new r.default({possibleRecipient:e,formatter:this.formatter,undefined:void 0}),selected:!1}))) return{title:e.title,recipients:t}}_fetchTypeaheadRecipients(t){this.msgDataManager.fetchTypeaheadResults(t,["CONNECTIONS","GROUP_THREADS","COWORKERS"],N.VOYAGER_MESSAGING_DEGRADATION_METADATA.TYAH).then((t=>{if(!(0,y.isDestroying)(this)&&t){this.typeaheadRecipients=t.map((e=>new r.default({possibleRecipient:e,formatter:this.formatter}))) this.typeaheadRecipients.length?this.a11yNotification.setTextInLiveRegion(this.i18n.lookupTranslation(e,"i18n_a11y_search_results_found")([{resultsLength:this.typeaheadRecipients.length}])):this.a11yNotification.setTextInLiveRegion(this.i18n.lookupTranslation(e,"i18n_no_results")())}})).finally((()=>{(0,y.isDestroying)(this)||(this.isLoading=!1)}))}submitMessage(e){e.attributedBody.text&&this.tracking.fireInteractionEvent("compose_custom") const t={renderContent:[],messageRequestContextByRecipient:[]} if(this.multiSend.update){var n,i t.renderContent.push({hostUrnData:{hostUrn:(null===(n=this.multiSend.update)||void 0===n?void 0:n.dashEntityUrn)||(null===(i=this.multiSend.update)||void 0===i?void 0:i.entityUrn),type:"FEED_UPDATE"}})}this.multiSend.hostMessageCreateContent&&(t.hostMessageCreateContent=this.multiSend.hostMessageCreateContent) return this.sendingToGroup?this._sendToGroup(e,t):this._sendSeparately(e,t)}_sendToGroup(e,t){this.selectedRecipients.forEach((e=>{if(e.contextEntityUrn){const n={contextEntityUrn:e.contextEntityUrn,hostRecipientUrn:e.entityUrn} t.messageRequestContextByRecipient.push(n)}})) return this.msgDataManager.getMailbox().then((e=>e.createDraftConversation(this.selectedRecipients.map((e=>(0,a.getProfileDashUrn)(e.profileAPIModel)))))).then((n=>{this.isDestroying||this._sendMessageAndHandleResponse(n.clientId,e.attributedBody,t)}))}_sendSeparately(e,t){const n=me.beginAsync() return Promise.all(this.selectedRecipients.map((n=>n.recipientType===ce?this.msgDataManager.fetchConversation(n.groupThreadConversationId).then((n=>{if(!(0,y.isDestroying)(this))return n.entityUrn?this._sendMessageAndHandleResponse(n.entityUrn,e.attributedBody,t):(0,j.resolve)()})):this.msgDataManager.fetchLatestConversationByRecipients([n.entityUrn]).then((i=>{if((0,y.isDestroying)(this))return if(!i)return(0,j.resolve)() const s=i.entityUrn??i.clientId,l={...t} if(n.contextEntityUrn){const e={contextEntityUrn:n.contextEntityUrn,hostRecipientUrn:n.entityUrn} l.messageRequestContextByRecipient=[e]}return this._sendMessageAndHandleResponse(s,e.attributedBody,l)}))))).finally((()=>{me.endAsync(n)}))}_sendMessageAndHandleResponse(e,t,n){return this.msgDataManager.sendMessage(e,t,n,!0).then((e=>{let{conversation:t}=e if((0,y.isDestroying)(this))return const{entityUrn:n}=t return this.msgDataManager.fetchMailboxConversation(n)})).then((e=>{if(!(0,y.isDestroying)(this))return e?this._onMessageSendSuccess(e):e})).catch((e=>{if((0,y.isDestroying)(this))throw e this._onMessageSendFail(e) throw e})).finally((()=>{(0,y.isDestroying)(this)||this.closeMultiSend()}))}_onMessageSendFail(t){const n=this.i18n.lookupTranslation(e,"i18n_send_failed_message") this.persistentToastManager.error({message:n}) return t}_onMessageSendSuccess(t){var n,i const s=this.i18n.lookupTranslation(e,"i18n_send_success_message") null===(n=(i=this.multiSend).afterSend)||void 0===n||n.call(i) this.persistentToastManager.success({message:s}) return t}onSendAsMessageButtonClick(){this.multiSend.showRepostOptions=!1 this.multiSend.showRepostOptionsAndSendStep=!1 this.multiSend.showRecipientSearchAndResults=!0}},J=(0,i.default)($.prototype,"multiSend",[G],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Q=(0,i.default)($.prototype,"msgDataManager",[F],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),X=(0,i.default)($.prototype,"i18n",[q],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Z=(0,i.default)($.prototype,"persistentToastManager",[H],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),ee=(0,i.default)($.prototype,"formatter",[W],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),te=(0,i.default)($.prototype,"tracking",[V],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),ne=(0,i.default)($.prototype,"a11yNotification",[Y],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),ie=(0,i.default)($.prototype,"windowService",[K],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),se=(0,i.default)($.prototype,"searchTerm",[h.tracked],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return""}}),le=(0,i.default)($.prototype,"isLoading",[h.tracked],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),oe=(0,i.default)($.prototype,"sendingToGroup",[h.tracked],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),ae=(0,i.default)($.prototype,"possibleRecipients",[h.tracked],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return new m.TrackedArray}}),re=(0,i.default)($.prototype,"selectedRecipients",[h.tracked],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return new m.TrackedArray}}),de=(0,i.default)($.prototype,"typeaheadRecipients",[h.tracked],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return new m.TrackedArray}}),(0,i.default)($.prototype,"selectPossibleRecipient",[b.action],Object.getOwnPropertyDescriptor($.prototype,"selectPossibleRecipient"),$.prototype),(0,i.default)($.prototype,"debounceFetchRecipients",[b.action],Object.getOwnPropertyDescriptor($.prototype,"debounceFetchRecipients"),$.prototype),(0,i.default)($.prototype,"clearTypeaheadSearch",[b.action],Object.getOwnPropertyDescriptor($.prototype,"clearTypeaheadSearch"),$.prototype),(0,i.default)($.prototype,"closeMultiSend",[b.action],Object.getOwnPropertyDescriptor($.prototype,"closeMultiSend"),$.prototype),(0,i.default)($.prototype,"fetchSuggestedRecipients",[b.action],Object.getOwnPropertyDescriptor($.prototype,"fetchSuggestedRecipients"),$.prototype),(0,i.default)($.prototype,"submitMessage",[b.action],Object.getOwnPropertyDescriptor($.prototype,"submitMessage"),$.prototype),(0,i.default)($.prototype,"onSendAsMessageButtonClick",[b.action],Object.getOwnPropertyDescriptor($.prototype,"onSendAsMessageButtonClick"),$.prototype),$))})) define("msg-multisend/components/social-share-button",["exports","@ember/template-factory","@ember/helper","@ember/component/template-only","@ember/component","artdeco-button/components/artdeco-button","@ember/modifier"],(function(e,t,n,i,s,l,o){"use strict" Object.defineProperty(e,"__esModule",{value:!0}) e.default=void 0 const a=(0,s.setComponentTemplate)((0,t.createTemplateFactory)({id:"ulj/T8QL",block:'[[[1,"\\n "],[8,[32,0],[[17,1],[4,[32,1],["click",[30,5]],null]],[["@type","@controlType","@icon","@ariaLabel","@text"],["tertiary","button",[30,2],[30,3],[30,4]]],null],[1,"\\n"]],["&attrs","@icon","@ariaLabel","@text","@onClick"],false,[]]',moduleName:"msg-multisend/components/social-share-button.gjs",scope:()=>[l.default,o.on],isStrictMode:!0}),(0,i.default)("social-share-button","SocialShareButton")) e.default=a})) define("msg-multisend/components/social-share",["exports","@babel/runtime/helpers/esm/initializerDefineProperty","@babel/runtime/helpers/esm/defineProperty","@babel/runtime/helpers/esm/applyDecoratedDescriptor","@babel/runtime/helpers/esm/initializerWarningHelper","@ember/template-factory","@ember/component","feed-utils/utils/share-via","@glimmer/component","@ember/service","@ember/object","msg-multisend/components/social-share-button","ember-cli-pemberly-i18n/helpers/t"],(function(e,t,n,i,s,l,o,a,r,d,c,m,u){"use strict" Object.defineProperty(e,"__esModule",{value:!0}) e.default=void 0 var p,h,g,f,b,y,v const _="COPY_LINK" e.default=(0,o.setComponentTemplate)((0,l.createTemplateFactory)({id:"9VW04C5r",block:'[[[1,"\\n"],[1," "],[10,"ul"],[14,0,"display-flex list-style-none m1"],[12],[1,"\\n "],[10,"li"],[12],[1,"\\n "],[8,[32,0],null,[["@icon","@ariaLabel","@text","@onClick"],["link",[28,[32,1],["i18n_social_share_copy_link_to_post","msg-multisend/components/social-share"],null],[28,[32,1],["i18n_social_share_copy_link_to_post","msg-multisend/components/social-share"],null],[30,0,["copyLink"]]]],null],[1,"\\n "],[13],[1,"\\n "],[13],[1,"\\n "]],[],false,[]]',moduleName:"msg-multisend/components/social-share.gjs",scope:()=>[m.default,u.default],isStrictMode:!0}),(p=(0,d.inject)("i18n"),h=(0,d.inject)("global-services@clipboard"),g=(0,d.inject)("persistent-toast-manager@persistent-toast-manager"),f=class extends r.default{constructor(){super(...arguments);(0,t.default)(this,"i18n",b,this);(0,t.default)(this,"clipboard",y,this);(0,t.default)(this,"persistentToastManager",v,this)}copyLink(){var e,t const{shareUrl:n}=this.args null===(e=(t=this.args).socialShareButtonClickTrackingCallback)||void 0===e||e.call(t,_);(0,a.default)(this.clipboard,this.i18n,this.persistentToastManager,n)}},b=(0,i.default)(f.prototype,"i18n",[p],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),y=(0,i.default)(f.prototype,"clipboard",[h],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),v=(0,i.default)(f.prototype,"persistentToastManager",[g],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),(0,i.default)(f.prototype,"copyLink",[c.action],Object.getOwnPropertyDescriptor(f.prototype,"copyLink"),f.prototype),f))})) define("msg-multisend/config/environment",["exports"],(function(e){"use strict" Object.defineProperty(e,"__esModule",{value:!0}) e.default=void 0 let t try{const e="msg-multisend/config/environment",n=document.querySelector('meta[name="'+e+'"]').getAttribute("content") t=JSON.parse(unescape(n))}catch(e){t={}}e.default=t})) define.alias("ember-truth-helpers/helpers/and","msg-multisend/helpers/and") define.alias("ember-holy-futuristic-template-namespacing-batman/helpers/-translate-dynamic-2","msg-multisend/helpers/ember-holy-futuristic-template-namespacing-batman-translate-dynamic-2") define.alias("ember-truth-helpers/helpers/eq","msg-multisend/helpers/eq") define.alias("ember-cli-pemberly-i18n/helpers/format-number","msg-multisend/helpers/format-number") define.alias("ember-truth-helpers/helpers/gt","msg-multisend/helpers/gt") define.alias("ember-truth-helpers/helpers/gte","msg-multisend/helpers/gte") define.alias("@linkedin/hue-web-artdeco-migration-runtime/helpers/convert-to-icon-name","msg-multisend/helpers/hue-web-artdeco-icon-migration-runtime") define.alias("@linkedin/hue-web-artdeco-migration-runtime/helpers/convert-to-icon-v2","msg-multisend/helpers/hue-web-artdeco-li-icon-migration-runtime-v2") define.alias("@linkedin/hue-web-artdeco-migration-runtime/helpers/convert-to-icon-path","msg-multisend/helpers/hue-web-artdeco-li-icon-migration-runtime") define.alias("@linkedin/hue-web-artdeco-migration-runtime/helpers/convert-argument","msg-multisend/helpers/hue-web-artdeco-migration-runtime") define.alias("ember-truth-helpers/helpers/is-array","msg-multisend/helpers/is-array") define.alias("ember-truth-helpers/helpers/is-empty","msg-multisend/helpers/is-empty") define.alias("ember-truth-helpers/helpers/is-equal","msg-multisend/helpers/is-equal") define.alias("artdeco-icons-web/helpers/li-icon","msg-multisend/helpers/li-icon") define.alias("ember-async-data/helpers/load","msg-multisend/helpers/load") define.alias("ember-truth-helpers/helpers/lt","msg-multisend/helpers/lt") define.alias("ember-truth-helpers/helpers/lte","msg-multisend/helpers/lte") define.alias("ember-truth-helpers/helpers/not-eq","msg-multisend/helpers/not-eq") define.alias("ember-truth-helpers/helpers/not","msg-multisend/helpers/not") define.alias("ember-truth-helpers/helpers/or","msg-multisend/helpers/or") define.alias("ember-app-scheduler/helpers/route-idle","msg-multisend/helpers/route-idle") define.alias("ember-set-helper/helpers/set","msg-multisend/helpers/set") define.alias("ember-cli-pemberly-i18n/helpers/t","msg-multisend/helpers/t") define.alias("ember-truth-helpers/helpers/xor","msg-multisend/helpers/xor") define.alias("ember-uuid","msg-multisend/index") define("msg-multisend/initializers/icons",["exports","artdeco-icons-web/src/icons","msg-multisend/config/environment"],(function(e,t,n){"use strict" Object.defineProperty(e,"__esModule",{value:!0}) e.default=void 0 function i(e){throw e}e.default={name:"icons",initialize:function(){const{environment:e,APP:s}=n.default let l,o s&&({artdecoCustomSpriteUrl:l,artdecoCustomSpriteName:o}=s) const a="test"!==e t.default.load(a,l,o).catch(i)}}})) define.alias("ember-cli-pemberly-lix/initializers/lix","msg-multisend/initializers/lix") define.alias("ember-m3/initializers/m3-store","msg-multisend/initializers/m3-store") define.alias("@ember/render-modifiers/modifiers/did-insert","msg-multisend/modifiers/did-insert") define.alias("@ember/render-modifiers/modifiers/did-update","msg-multisend/modifiers/did-update") define.alias("@ember/render-modifiers/modifiers/will-destroy","msg-multisend/modifiers/will-destroy") define.alias("artdeco-hoverables/services/artdeco-hoverable","msg-multisend/services/artdeco-hoverable") define.alias("artdeco-modal/services/artdeco-modal","msg-multisend/services/artdeco-modal") define.alias("artdeco-toast/services/artdeco-toast","msg-multisend/services/artdeco-toast") define.alias("client-sensor-web/services/client-sensor","msg-multisend/services/client-sensor") define.alias("ember-date-service/services/date","msg-multisend/services/date") define.alias("@linkedin/ember-restli-graphql/services/graphql","msg-multisend/services/graphql") define.alias("@linkedin/ember-pem/services/internal-event-utils","msg-multisend/services/internal-event-utils") define.alias("@linkedin/ember-pem/services/internal-pem-tracking","msg-multisend/services/internal-pem-tracking") define.alias("ember-cli-pemberly-lix/services/lix","msg-multisend/services/lix") define.alias("ember-m3/services/m3-schema-manager","msg-multisend/services/m3-schema-manager") define.alias("@linkedin/ember-pem/services/pem-response-metadata","msg-multisend/services/pem-response-metadata") define.alias("@linkedin/ember-pem/services/pem-tracking","msg-multisend/services/pem-tracking") define.alias("persistent-toast-manager/services/persistent-toast-manager","msg-multisend/services/persistent-toast-manager") define.alias("ember-cli-pemberly-m3/services/store","msg-multisend/services/store") define.alias("ember-cli-pemberly-litms/services/tag-manager","msg-multisend/services/tag-manager") define.alias("@linkedin/ember-pem/services/tracer","msg-multisend/services/tracer") define.alias("ember-cli-pemberly-litms/services/tracking-adapter-for-tag-manager","msg-multisend/services/tracking-adapter-for-tag-manager") define("msg-multisend/template-registry",[],(function(){})) define.alias("ember-async-data/tracked-async-data","msg-multisend/tracked-async-data") define.alias("client-sensor-web/utils/helpers","msg-multisend/utils/helpers") define.alias("@linkedin/hue-web-artdeco-migration-runtime/utils/mapping-data","msg-multisend/utils/mapping-data") define("msg-multisend/utils/uuid-generator",["exports","ember-uuid/utils/uuid-generator"],(function(e,t){"use strict" Object.defineProperty(e,"__esModule",{value:!0}) Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.default}}) Object.defineProperty(e,"parse",{enumerable:!0,get:function(){return t.parse}}) Object.defineProperty(e,"unparse",{enumerable:!0,get:function(){return t.unparse}}) Object.defineProperty(e,"v1",{enumerable:!0,get:function(){return t.v1}}) Object.defineProperty(e,"v4",{enumerable:!0,get:function(){return t.v4}})})) define.alias("ember-vector-images/utils/vector-url","msg-multisend/utils/vector-url") //# sourceMappingURL=engine.mapÓ˜