ationsSummary).then((e=>{(0,a.isDestroying)(this)||(0,c.set)(this,"currentModel.invitationsSummary",e)}))}_backfillReceivedInvitations(){const e=this.getCurrentPendingInvites((0,c.get)(this.currentModel,"invitationViews")),t=this.numPendingInvitations,n=this._formatInvitationsForPreview(e);(0,c.set)(this.currentModel,"formatInvitationViews",n)
const i=(0,c.get)(e,"length")
t<=i||i<=10+(0,c.get)(this.currentModel,"invitationsPreviewBuffer")&&this.loadMoreReceivedInvitations()}_getConnectionConnections(e){if(!(0,c.get)(this,"currentModel.acceptInviteCC.length")){const t=(0,c.get)(e,"genericInviter.memberProfileUrn")
this._fetchConnectionConnections(t)}}buildRouteInfoMetadata(){return{debug:{suggestedTeams:["myNetwork","invitations"]}}}model(e,t){if((0,a.isDestroying)(this))return
"onboarding-landing"===e.trk&&(0,c.set)(this,"showOnboardingGDPRNotice",!0)
const{jet:n,storeShim:o,graphql:r}=this,{trk:l,inviteActionFailed:m,isAcceptInvite:d,companyUrn:p,member:b}=t.to?t.to.queryParams:{},_=(0,C.getPaginationTokenFromLocalStorage)(this.localStorage),w={degradations:[T.NEW_DEGRADATION_TRACKING_METADATA.INVITATION_PREVIEW],degradedEntityIDsToRemove:[]},v=g.default.getDashInvitationViews(r,n,{start:0,count:3,includeInsights:!0,isInvitationPreview:!0,paginationToken:_,adapterOptions:w}),k=this.invitationPlatform.getInvitationsSummary(["PENDING_INVITATION_COUNT","UNSEEN_INVITATION_COUNT"])
let E,I=null
this.getBadgeCount()>0&&(E=g.default.getMyNetworkNotifications(o,{jet:n,shouldReloadRecord:!0}))
"true"===d&&!m&&b&&(I=(0,F.getProfileById)(this.storeShim,b,"com.linkedin.voyager.dash.deco.identity.profile.MiniProfile"))
const O=new f.Abi(s.Promise),P={coreRail:Re.CONNECT_HUB_ABI_PROMO,sideRail:Re.CONNECT_HUB_SIDE_RAIL_ABI_PROMO};(0,c.set)(this,"shouldShowAcceptReplayNotification",l===Me)
const S={abiEntryPoint:P,abiInstance:O,companyUrn:p,invitationViews:v,invitationsSummary:k,inviterProfile:I,inviteActionFailed:m,memberVanityName:b,myNetworkNotifications:E,acceptInvite:d,showInviteAlert:!!d||m,isFetchDiscoverySectionsCohortAndPymkEnabled:this.isFetchDiscoverySectionsCohortAndPymkEnabled,discoverySectionsFetchCount:this.discoverySectionsFetchCount,isNurtureTabEnabled:this.isNurtureTabEnabled}
return(0,s.hash)(S).then((e=>{if((0,a.isDestroying)(this))return
const t={}
this.isGameEntryPointEnabled&&(0,i.default)(this,Ce,qe).call(this,e)
t.showCondensedLeftRailSummary=this.showCondensedLeftRailSummary
let n=null
const o=(0,c.get)(e,"invitationViews"),r=(0,c.get)(e,"invitationsSummary")
n=null===o?null:(0,h.dedupInvitationsHandler)({context:this,invitationViews:o,updateCache:!1});(0,c.set)(e,"invitationViews",n)
if(null===r||null===o)(0,c.setProperties)(t,{isInvitationsApiFailure:!0,invitationError:x.ERROR_STATE_TYPES.INVITATION})
else{(0,c.set)(this,"numPendingInvitations",null==r?void 0:r.numPendingInvitations)
if("true"===e.acceptInvite&&e.memberVanityName&&!e.inviteActionFailed){const t=(0,c.get)(e,"inviterProfile.publicIdentifier"),n=o.find((e=>(0,c.get)(e,"invitation.publicIdentifier")===t))
if(n){(0,c.set)(n,"isUnloaded",!0)
this.storeShim.unloadRecord(n)}}const n=this._formatInvitationsForPreview(e.invitationViews);(0,c.setProperties)(t,{formatInvitationViews:n,invitationsPreviewBuffer:this.maxInvitationsPreview+1})}const l=e.myNetworkNotifications?this.myNetworkNotificationsUtil.getNotificationsByType(e.myNetworkNotifications):null
l&&(0,c.setProperties)(t,{isSummaryCardNotificationOpen:(0,u.isPresent)((0,c.get)(l,"summaryCardNotification")),summaryCardNotification:(0,c.get)(l,"summaryCardNotification")})
this._displayBiteSize(t)
const s=o&&o.length
t.readyToRenderInvitations=!0
y.default&&this._checkForSuggestions()
this.isRenderMiddleRailAbiAfterFirstPaint=s
this.isRenderMiddleRailAbiAfterFirstPaint||(t.readyToRenderMiddleRailAbi=!0);(0,c.set)(t,"entityInviteeSuggestionsManager",new z.default({store:this.storeShim,lix:this.lix,formatter:this.formatter}))
return Object.assign(e,t)}))}afterModel(e,t){var n
if((0,a.isDestroying)(this))return
super.afterModel(...arguments)
const i=this.lix.getTreatmentIsEnabled("voyager.web.mynetwork-mojo-tabbed-experience"),o=null===(n=t.targetName)||void 0===n?void 0:n.includes("grow");(!i||o)&&(0,c.get)(e,"invitationsSummary")&&this.numPendingInvitations>0&&this.tracking.firePageViewEvent("flagship3_people_invitations_preview")}updateNotifications(){return g.default.getMyNetworkNotifications(this.storeShim,{shouldReloadRecord:!0,jet:this.jet}).then((e=>{if((0,a.isDestroying)(this))return;(0,c.set)(this.currentModel,"myNetworkNotifications",e)
return e?this.myNetworkNotificationsUtil.getNotificationsByType(e):null}))}getBadgeCount(){return this.badgeService.getBadgeCount("mynetwork")||0}onBadgeCountChanged(){this.getBadgeCount()>0&&this.updateNotifications()}resetController(e,t){super.resetController(...arguments)
t&&(0,c.setProperties)(e,{isAcceptInvite:void 0,acceptedFrom:void 0,member:void 0})}onAfterFirstRoutePaint(){const{currentModel:e,graphql:t,jet:n,storeShim:o}=this,r={store:o,jet:n,adapterOptions:{degradations:[T.DEGRADATION_TRACKING_METADATA.COHORTS],degradedEntityIDsToRemove:[]},count:20,numCards:b.COHORT_CARDS_COUNT.DEFAULT,start:0};(0,c.set)(e,"isFirstRoutePaintDone",!0)
this.isRenderMiddleRailAbiAfterFirstPaint&&(0,c.set)(e,"readyToRenderMiddleRailAbi",!0)
const l=this.isFetchDiscoverySectionsCohortAndPymkEnabled?_.default.getDiscoverySectionsForMynetwork({graphql:t,jet:n,adapterOptions:{degradations:[T.DEGRADATION_TRACKING_METADATA.COHORTS_LIST],degradedEntityIDsToRemove:[]},count:this.discoverySectionsFetchCount,start:0}):_.default.getCohorts(r);(0,i.default)(this,Se,Ke).call(this).then((t=>{if(!(0,a.isDestroying)(this)){(0,c.set)(e,"premiumUpsellCard",t);["hiring_my_network","hiring_adv_search_filter"].includes(null==t?void 0:t.funnelCommonHeader.utype)&&(0,c.set)(e,"shouldShowRLiteFacetsUpsell",!0)}}));(0,s.hash)({cohorts:l}).then((t=>{if(!(0,a.isDestroying)(this))if(void 0===t.cohorts){(0,c.setProperties)(e,{isCohortRecommendationsFailure:!0,recommendationError:x.ERROR_STATE_TYPES.RECOMMENDATION})
this.isFetchDiscoverySectionsCohortAndPymkEnabled&&this.clientSensor.incrementMetricCounter({groupName:b.CLIENT_SENSOR_GROUP_MYNETWORK,metricName:b.DISCOVERY_CLIENT_SENSOR_METRICS.DISCOVERY_SECTIONS_EMPTY})}else{const{currentDiscoveryCohorts:n}=this,i=t.cohorts;(0,W.pushValues)(n,(0,c.get)(i,"elements"));(0,c.setProperties)(e,{discoveryCohorts:n,paginationToken:(0,c.get)(i,"metadata.paginationToken")})}})).catch((e=>{if(this.isDestroying)throw e
this.isFetchDiscoverySectionsCohortAndPymkEnabled&&this.clientSensor.incrementMetricCounter({groupName:b.CLIENT_SENSOR_GROUP_MYNETWORK,metricName:b.DISCOVERY_CLIENT_SENSOR_METRICS.DISCOVERY_SECTIONS_FAILED})})).finally((()=>{(0,a.isDestroying)(this)||(0,c.set)(e,"readyToRenderDiscoveryRecommendations",!0)}));(0,c.set)(e,"readyToRenderCommunitySummary",!0);(0,i.default)(this,Oe,Ye).call(this)}onAfterContentPaint(){const{currentModel:e,jet:t,storeShim:n}=this;(0,c.set)(e,"isContentPaintDone",!0)
const i={sourceType:"PYMK_ENTITY",reasonContext:"PYMK_ENTITY"};(0,c.set)(e,"cohortRecommendationsReason",i)
if(!this.isFetchDiscoverySectionsCohortAndPymkEnabled){const o={degradations:[T.DEGRADATION_TRACKING_METADATA.PYMK_GRID],degradedEntityIDsToRemove:[]},r=_.default.getAllRecommendationsByReasons({adapterOptions:o,jet:t,count:4,reasons:[i],start:0,store:n});(0,s.hash)({pymkEntities:r}).then((t=>{if(!(0,a.isDestroying)(this))if(null===t.pymkEntities)(0,c.setProperties)(e,{isDiscoveryRecommendationsFailure:!0,recommendationError:x.ERROR_STATE_TYPES.RECOMMENDATION})
else{let n=t.pymkEntities
n=(0,c.get)(n,"elements");(0,c.setProperties)(e,{discoveryEntities:n,pymkPaginationToken:(0,c.get)(t,"pymkEntities.metadata.paginationToken"),prefetchedEntitiesCount:4})}}))}}getCurrentPendingInvites(e){return this.invitationPlatform.getValidPendingInvitationViews(e)}loadMoreReceivedInvitations(){var e=this
const t=this.start??0
this.start=t+10
return g.default.getDashInvitationViews(this.graphql,this.jet,{start:t,count:10}).then((function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]
if((0,a.isDestroying)(e))return
const{currentModel:n}=e,i=(0,c.get)(n,"invitationViews.length")
if((0,c.get)(t,"length")>0){const i=(0,h.dedupInvitationsHandler)({context:e,invitationViews:t})
if((0,c.get)(i,"length")){const e=(0,W.pushValues)(new U.TrackedArray((0,c.get)(n,"invitationViews")),i);(0,c.set)(n,"invitationViews",e)}}i<(0,c.get)(n,"invitationViews.length")&&(0,c.setProperties)(n,{hasInvites:!0,pendingEmptyStateEnabled:!1})}))}willTransition(e){var t
super.actions.willTransition.call(this,...arguments)
const{invitationViews:n,isNurtureTabEnabled:i}=(0,c.get)(this,"controller.model"),o=(null===(t=e.from)||void 0===t?void 0:t.name)===G.NURTURE_TAB_ROUTES.grow;(!i&&(null==n?void 0:n.length)>0||o&&(null==n?void 0:n.length)>0)&&n.forEach((e=>{(0,c.get)(e,"invitation.unseen")?(0,c.set)(e,"invitation.unseen",!1):(0,c.get)(e,"genericInvitationView.unseen")&&(0,c.set)(e,"genericInvitationView.unseen",!1)}))
y.default&&!i&&this._clearUnseenInvitations()
this.badgeService.off(xe,this,this.onBadgeCountChanged);(0,c.setProperties)(this,{start:0,invitationCache:new U.TrackedArray([]),currentDiscoveryCohorts:new U.TrackedArray([])})
return!0}queryParamsDidChange(e){if(!e.doMynetworkRefresh||this.updatingMynetwork)return;(0,c.setProperties)(this,{updatingMynetwork:!0,start:0,invitationCache:new U.TrackedArray([])})
const t={degradations:[T.NEW_DEGRADATION_TRACKING_METADATA.INVITATION_PREVIEW],degradedEntityIDsToRemove:[]},n=g.default.getDashInvitationViews(this.graphql,this.jet,{start:0,count:10,includeInsights:!0,isInvitationPreview:!0,paginationToken:(0,C.getPaginationTokenFromLocalStorage)(this.localStorage),adapterOptions:t}),i=this.invitationPlatform.getInvitationsSummary(["PENDING_INVITATION_COUNT","UNSEEN_INVITATION_COUNT"]);(0,s.hash)({invitationsSummaryRequest:i,invitationViewsRequest:n,myNetworkNotificationsRequest:this.updateNotifications()}).then((e=>{let{invitationViewsRequest:t,invitationsSummaryRequest:n,myNetworkNotificationsRequest:i}=e
if((0,a.isDestroying)(this))return
const o=(0,h.dedupInvitationsHandler)({context:this,invitationViews:t,updateCache:!1}),r=this._formatInvitationsForPreview(o);(0,c.setProperties)(this.currentModel,{invitationsSummary:n,invitationViews:o,formatInvitationViews:r,isPrefetchCompleted:!1,isInlineConfirmationOpen:!1})
if(i){const e=(0,c.get)(i,"summaryCardNotification");(0,c.setProperties)(this.currentModel,{summaryCardNotification:e,isSummaryCardNotificationOpen:(0,u.isPresent)(e)})}})).then((()=>this.badgeService.markAllItemsAsSeen({badgeName:"mynetwork"}))).finally((()=>{(0,a.isDestroying)(this)||(this.updatingMynetwork=!1)}))}didTransition(){super.actions.didTransition.call(this,...arguments);(0,E.whenRouteIdle)().then((()=>{if(!(0,a.isDestroying)(this)){this.onAfterFirstRoutePaint()
if(y.default){this.onAfterContentPaint()
this.currentModel.isNurtureTabEnabled||this._clearUnseenInvitations()}}}))
this.shouldShowAcceptReplayNotification&&this._showAcceptReplayNotification()
this.badgeService.on(xe,this,this.onBadgeCountChanged)
this.currentModel.isInvitationsApiFailure||d.default.trackBadgeIssues(this.currentModel.invitationsSummary,this.currentModel.myNetworkNotifications,this.badgeCount,this.isBadgeCountIncremented)
y.default&&this.prefetch.prefetchAssets("jobs")
const{i18n:e,gdprNotice:t}=this,n=e.lookupTranslation(je,"i18n_contact_notice")(),i=e.lookupTranslation(je,"i18n_view_settings")(),o=e.lookupTranslation(je,"i18n_pending_invite_notice")(),r=e.lookupTranslation(je,"i18n_invite_settings")(),l=e.lookupTranslation(je,"i18n_profile_visiblity_notice")(),s=e.lookupTranslation(je,"i18n_profile_visiblity_settings")()
if(this.showOnboardingGDPRNotice)(0,v.default)(t,M.GDPR_NOTICE_POLICY_TYPE.REGISTRATION_FLOW_PROFILE_VISIBILITY,l,s,this)
else{(0,v.default)(t,M.GDPR_NOTICE_POLICY_TYPE.MANAGE_CONTACT_PAGE,n,i,this);(0,v.default)(t,M.GDPR_NOTICE_POLICY_TYPE.MY_NETWORK_PAGE,o,r,this)}}loading(){return!1}dismissABIForm(){(0,c.set)(this.currentModel,"abiFormDismissed",!0)
this.tracking.fireInteractionEvent("dismiss_bite_size")
try{this.localStorage.setItem(Ae,Date.now())}catch(e){console.warn("Error occurred while storing dismiss value in storage",e)}}dismissPymkHero(){(0,c.set)(this.currentModel,"pymkHeroDismissed",!0)}triggerInlineConfirmationCard(e,t){(0,c.setProperties)(this.currentModel,{actionOnInvitation:t,inlineInvitationView:e,isInlineConfirmationOpen:!0,inviteHasBeenReported:!1,isSummaryCardNotificationOpen:!1})}closeInlineConfirmationCard(){const e=document.getElementById("dismiss-inline-confirmation-card")
if(e){const t=document.getElementById("my-network-container"),n=Array.from(t.querySelectorAll('button, a, [tabindex]:not([tabindex="-1"])')),i=n.indexOf(e),o=n[i+1]
null==o||o.focus()}(0,c.set)(this.currentModel,"isInlineConfirmationOpen",!1)}closeInvitationSummaryCard(){(0,c.set)(this.currentModel,"isSummaryCardNotificationOpen",!1)}actOnInvitation(e){let{invitationView:t,actionOnInvitation:n,isInlineConfirmationExperience:o}=e
const r=(0,c.get)(t,"invitation"),l="accept"===n
return(l?this.invitationPlatform.acceptInvitation(r):this.invitationPlatform.ignoreInvitation(r)).then((()=>{if(!(0,a.isDestroying)(this)){if(l){this._triggerPostAcceptFlow(r)
const e=(0,c.get)(t,"invitation.genericInvitationType")
let n
e&&e!==We?e===He?n=Fe:e===Ve&&(n=Ue):n=ze
this.controller.getHeadsUpPrompt(n)}else{const{currentModel:e}=this,n=(0,c.get)(t,"invitation.genericInvitationType"),i=(0,P.shouldShowSettingsPopup)(this.localStorage,n);(0,c.setProperties)(e,{settingsPopupEntityType:n,isSettingsPopupOpen:i})}(0,i.default)(this,Pe,Be).call(this,r,l)
t.isDestroying||!o||(0,N.isDashUrn)((0,c.get)(r,"entityUrn"))||(0,c.set)(t,"isUnloaded",!0)
this._backfillReceivedInvitations()}}))}_triggerPostAcceptFlow(e){if(this.invitationPlatform.isGenericInvitation(e)){this.currentModel.entityInviteeSuggestionsManager.fetchInviteeSuggestions(e);(0,c.set)(this.currentModel,"connectionConnectionsDismissed",!0)}else{this._getConnectionConnections(e)
this.currentModel.entityInviteeSuggestionsManager.dismissModule()
this.didFetchVerificationCard||(0,i.default)(this,Ne,$e).call(this,e)}}}),ce=(0,o.default)(se.prototype,"clientSensor",[q],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),ue=(0,o.default)(se.prototype,"badgeService",[B],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),me=(0,o.default)(se.prototype,"gdprNotice",[K],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),de=(0,o.default)(se.prototype,"i18n",[$],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),pe=(0,o.default)(se.prototype,"invitationPlatform",[Q],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),fe=(0,o.default)(se.prototype,"jet",[Z],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),ye=(0,o.default)(se.prototype,"lix",[X],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),he=(0,o.default)(se.prototype,"formatter",[J],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),ge=(0,o.default)(se.prototype,"localStorage",[ee],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),be=(0,o.default)(se.prototype,"persistentToastManager",[te],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),_e=(0,o.default)(se.prototype,"storeShim",[ne],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),we=(0,o.default)(se.prototype,"tracking",[ie],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),ve=(0,o.default)(se.prototype,"prefetch",[oe],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),ke=(0,o.default)(se.prototype,"graphql",[re],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Te=(0,o.default)(se.prototype,"router",[ae],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Ee=(0,o.default)(se.prototype,"gameEntrypointFetch",[le],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),(0,o.default)(se.prototype,"willTransition",[c.action],Object.getOwnPropertyDescriptor(se.prototype,"willTransition"),se.prototype),(0,o.default)(se.prototype,"queryParamsDidChange",[c.action],Object.getOwnPropertyDescriptor(se.prototype,"queryParamsDidChange"),se.prototype),(0,o.default)(se.prototype,"didTransition",[c.action],Object.getOwnPropertyDescriptor(se.prototype,"didTransition"),se.prototype),(0,o.default)(se.prototype,"loading",[c.action],Object.getOwnPropertyDescriptor(se.prototype,"loading"),se.prototype),(0,o.default)(se.prototype,"dismissABIForm",[c.action],Object.getOwnPropertyDescriptor(se.prototype,"dismissABIForm"),se.prototype),(0,o.default)(se.prototype,"dismissPymkHero",[c.action],Object.getOwnPropertyDescriptor(se.prototype,"dismissPymkHero"),se.prototype),(0,o.default)(se.prototype,"triggerInlineConfirmationCard",[c.action],Object.getOwnPropertyDescriptor(se.prototype,"triggerInlineConfirmationCard"),se.prototype),(0,o.default)(se.prototype,"closeInlineConfirmationCard",[c.action],Object.getOwnPropertyDescriptor(se.prototype,"closeInlineConfirmationCard"),se.prototype),(0,o.default)(se.prototype,"closeInvitationSummaryCard",[c.action],Object.getOwnPropertyDescriptor(se.prototype,"closeInvitationSummaryCard"),se.prototype),(0,o.default)(se.prototype,"actOnInvitation",[c.action],Object.getOwnPropertyDescriptor(se.prototype,"actOnInvitation"),se.prototype),se)
function Ge(e){const t=e<30;(0,c.setProperties)(this.currentModel,{showABIInMiddleRail:t,showABIPromoInSideRail:!t})}function Ye(){const{currentModel:e,graphql:t,jet:n}=this,o={degradations:[T.NEW_DEGRADATION_TRACKING_METADATA.COMMUNITY_SUMMARY],degradedEntityIDsToRemove:[]},r={myNetworkSummary:(0,w.getMyNetworkSummary)({jet:n,graphql:t,adapterOptions:o})}
r.savedContactsSummary=(0,O.getContactsCountSummary)(n,t);(0,s.hash)(r).then((t=>{if((0,a.isDestroying)(this))return
const n=((0,c.get)(t,"myNetworkSummary.metadata.primaryFilterCluster.primaryFilters.0.primaryFilterValues")||[]).reduce(((e,t)=>({...e,[(0,c.get)(t,"value")]:(0,c.get)(t,"count")||0})),{});(0,c.setProperties)(e,{connectionsCount:n.CONNECTIONS||0,eventsCount:n.EVENTS||0,groupsCount:n.GROUPS||0,hashtagCount:n.HASHTAG||0,newslettersCount:n.CONTENT_SERIES||0,pagesCount:n.PAGES||0,peopleFollowCount:n.PEOPLE_FOLLOW||0});(0,c.set)(e,"savedContactsCount",(0,c.get)(t.savedContactsSummary,"paging.total")||0);(0,i.default)(this,Ie,Ge).call(this,e.connectionsCount)})).catch((t=>{if((0,a.isDestroying)(this))throw t;(0,c.setProperties)(e,{isMyNetworkSummaryFailure:!0,myNetworkSummaryError:x.ERROR_STATE_TYPES.CONNECTION_SUMMARY})})).finally((()=>{(0,a.isDestroying)(this)||(0,c.set)(e,"isReadyToRenderSummary",!0)}))}function qe(e){this.gameEntrypointFetch.getGameEntryPointsPromise(Y.GAME_ENTRY_POINT_TYPES.MY_NETWORK,A.DEGRADATION_METADATA.OLD_MY_NETWORK_GAMES_ENTRY_POINT_FETCH).then((t=>{var n,i
if((0,a.isDestroying)(this))return
const o=(null==t||null===(n=t.data)||void 0===n||null===(i=n.identityDashGameEntryPointsByTypes)||void 0===i?void 0:i.elements)||[];(0,c.set)(e,"gameEntryPoints",o)})).catch((e=>{if((0,a.isDestroying)(this))throw e}))}function Be(e,t){const{currentModel:n}=this,i=(0,c.get)(n,"connectionsCount"),o=(0,c.get)(e,"genericInvitationType")===j.INVITATION_TYPES.CONNECTION
i&&o&&t&&(0,c.set)(n,"connectionsCount",i+1)
const r=this.invitationsSummary||(0,c.get)(n,"invitationsSummary")
r&&(0,c.get)(r,"numPendingInvitations")>0&&(0,c.set)(r,"numPendingInvitations",(0,c.get)(r,"numPendingInvitations")-1)}function Ke(){return(0,S.queryUpsellCardDataV2)({clientSensor:this.clientSensor,graphql:this.graphql},{upsellSlot:"MY_NETWORK_SALES_NAVIGATOR"}).then((e=>(0,c.get)(e,"data.premiumDashUpsellSlotContentBySlotType.elements.0.upsellCard")))}function $e(e){const t=(0,c.get)(e,"genericInviter.memberProfileUrn.entityUrn")
t&&(0,H.queryVerificationEntryPoint)(this.graphql,{verificationEntryPoint:V.ENTRY_POINT.NEXT_BEST_ACTION_ON_ACCEPTED_INVITATION.toUpperCase(),vieweeUrn:t}).then((e=>{if(!(0,a.isDestroying)(this)){this.didFetchVerificationCard=!0
if(null!==e){(0,c.set)(this.currentModel,"verificationEntryPointCard",e)
this.controllerFor(this.routeName).isVerificationCardDismissed=!1}}}))}}))
define("mynetwork/routes/index/index",["exports","@babel/runtime/helpers/esm/defineProperty","@ember/routing/route"],(function(e,t,n){"use strict"
Object.defineProperty(e,"__esModule",{value:!0})
e.default=void 0
class i extends n.default{constructor(){super(...arguments);(0,t.default)(this,"pageKey","flagship3_people")}}e.default=i}))
define("mynetwork/routes/invitation-manager",["exports","@babel/runtime/helpers/esm/initializerDefineProperty","@babel/runtime/helpers/esm/defineProperty","@babel/runtime/helpers/esm/applyDecoratedDescriptor","@babel/runtime/helpers/esm/initializerWarningHelper","@ember/destroyable","@ember/service","rsvp","@ember/routing/route","@linkedin/abi-js/src/index","ember-cli-pemberly-tracking","mynetwork/utils/connection-util","@ember/object"],(function(e,t,n,i,o,r,a,l,s,c,u,m,d){"use strict"
Object.defineProperty(e,"__esModule",{value:!0})
e.default=void 0
var p,f,y,h,g
e.default=(p=(0,a.inject)("jet"),f=(0,a.inject)("global-services@store-shim"),y=class extends s.default{constructor(){super(...arguments);(0,t.default)(this,"jet",h,this);(0,t.default)(this,"storeShim",g,this);(0,u.setupNonAnchorRoute)(this)}setupController(e,t){if((0,r.isDestroying)(this))return
super.setupController(...arguments)
const n=new c.Abi(l.Promise);(0,d.setProperties)(e,{abiInstance:n,connectionsSummary:t.connectionsSummary})}resetController(e,t){super.resetController(...arguments)
t&&(0,d.setProperties)(e,{page:1,filterCriteria:"",invitationType:"",relevanceCategory:"",isInvitationSettingsOpen:!1})}model(){if(!(0,r.isDestroying)(this))return this._fetchModel()}_fetchModel(){const e={connectionsSummary:(0,m.getConnectionsSummary)(this.storeShim,{jet:this.jet})}
return(0,l.hash)(e)}},h=(0,i.default)(y.prototype,"jet",[p],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),g=(0,i.default)(y.prototype,"storeShim",[f],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),y)}))
define("mynetwork/routes/invitation-manager/pending-common",["exports","@babel/runtime/helpers/esm/initializerDefineProperty","@babel/runtime/helpers/esm/defineProperty","@babel/runtime/helpers/esm/applyDecoratedDescriptor","@babel/runtime/helpers/esm/initializerWarningHelper","@ember/destroyable","@ember/service","@ember/routing/route","ember-app-scheduler","@ember/object","invitation/utils/i18n-constants","global-utils/utils/is-browser"],(function(e,t,n,i,o,r,a,l,s,c,u,m){"use strict"
Object.defineProperty(e,"__esModule",{value:!0})
e.default=void 0
var d,p,f,y,h,g,b
e.default=(d=(0,a.inject)("i18n"),p=(0,a.inject)("persistent-toast-manager@persistent-toast-manager"),f=(0,a.inject)("invitation-platform@invitation-platform"),y=class extends l.default{constructor(){super(...arguments);(0,n.default)(this,"pageKey","flagship3_people_invitations");(0,n.default)(this,"controllerName","invitation-manager");(0,t.default)(this,"i18n",h,this);(0,t.default)(this,"persistentToastManager",g,this);(0,t.default)(this,"invitationPlatform",b,this)}beforeModel(e){var t,n
null!==(t=e.to)&&void 0!==t&&null!==(n=t.queryParams)&&void 0!==n&&n.entityInviteFailed&&(0,c.set)(this,"entityInviteFailed",!0)}resetController(e,t){super.resetController(...arguments)
t&&(0,c.setProperties)(e,{page:1,filterCriteria:"",invitationType:"",isInvitationSettingsOpen:!1})}_clearUnseenInvitations(){this.invitationPlatform.clearUnseenInvitations(this.currentModel.invitationsSummary).then((e=>{(0,r.isDestroying)(this)||(0,c.set)(this,"currentModel.invitationsSummary",e)}))}didTransition(){(0,s.whenRouteIdle)().then((()=>{if(!(0,r.isDestroying)(this)){if(this.entityInviteFailed){const e=this.i18n.lookupTranslation(u.default.TEMPLATE,u.default.INVITATION_GENERAL_FAILURE_HELPCENTER)(u.default.HELPCENTER_ACCEPT_FAILURE_LINK_INFO)
this.persistentToastManager.error({message:e})}m.default&&this._clearUnseenInvitations()}}))
return!0}willTransition(){m.default&&this._clearUnseenInvitations()
this.invitationCache=[]
return!0}},h=(0,i.default)(y.prototype,"i18n",[d],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),g=(0,i.default)(y.prototype,"persistentToastManager",[p],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),b=(0,i.default)(y.prototype,"invitationPlatform",[f],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),(0,i.default)(y.prototype,"didTransition",[c.action],Object.getOwnPropertyDescriptor(y.prototype,"didTransition"),y.prototype),(0,i.default)(y.prototype,"willTransition",[c.action],Object.getOwnPropertyDescriptor(y.prototype,"willTransition"),y.prototype),y)}))
define("mynetwork/routes/invitation-manager/pending",["exports","@babel/runtime/helpers/esm/initializerDefineProperty","@babel/runtime/helpers/esm/defineProperty","@babel/runtime/helpers/esm/applyDecoratedDescriptor","@babel/runtime/helpers/esm/initializerWarningHelper","@ember/destroyable","@ember/service","rsvp","@ember/object","@ember/utils","mynetwork/routes/invitation-manager/pending-common","mynetwork/utils/dedup-invites","mynetwork/utils/constants","mynetwork/utils/constants-common","invitation-platform/utils/constants","mynetwork/utils/mynetwork-request","mynetwork/utils/invitation-util","ember-app-scheduler","global-utils/utils/is-browser","invitation-platform/utils/pem-tracking","global-utils/utils/array/push","tracked-built-ins"],(function(e,t,n,i,o,r,a,l,s,c,u,m,d,p,f,y,h,g,b,_,w,v){"use strict"
Object.defineProperty(e,"__esModule",{value:!0})
e.default=void 0
var k,T,E,I,O,C,P,S,N,R,A
const D="COMMON_COMPANY",M={COMMON_COMPANY:"your_company",COMMON_EDUCATION:"your_school",COMMON_CONNECTION:"has_mutual_connections",ALL:"all_invitations"}
e.default=(k=(0,a.inject)("@linkedin/ember-restli-graphql@graphql"),T=(0,a.inject)("global-services@local-storage"),E=(0,a.inject)("invitation-platform@invitation-platform"),I=(0,a.inject)("jet"),O=(0,a.inject)("router"),C=class extends u.default{constructor(){super(...arguments);(0,t.default)(this,"graphql",P,this);(0,t.default)(this,"localStorage",S,this);(0,t.default)(this,"invitationPlatform",N,this);(0,t.default)(this,"jet",R,this);(0,t.default)(this,"router",A,this);(0,n.default)(this,"queryParams",{page:d.REFRESH,filterCriteria:d.REFRESH,invitationType:d.REFRESH});(0,s.setProperties)(this,{paginationMeta:{},currentInvitationViews:new v.TrackedArray([]),inlineConfirmationCount:0})}model(){if(!(0,r.isDestroying)(this))return this._pendingModelHash(this.paramsFor(this.routeName),!0)}afterModel(e){if(!(0,r.isDestroying)(this)){this._setupPendingInvitations(e)
!(0,s.get)(this,"paginationMeta.token")&&d.CACHE_WARMUP_THRESHOLD<=e.total&&(0,g.whenRouteIdle)().then((()=>{if(!this.isDestroying){y.default.getDashInvitationViewMeta(this.graphql,this.jet,{filterCriteria:[D]}).then((e=>{(0,r.isDestroying)(this)||this._setPaginationMeta(D,e)}))}}))
this._isLazyLoad(e)&&this._fetchNextInvitationsBatch(e)
this._setFocusOnPill(e)}}_pendingModelHash(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1]
const n=(0,h.getPaginationTokenFromLocalStorage)(this.localStorage),{filterCriteria:i,invitationType:o}=e,a=i in M?i:"ALL",c="ALL"!==a?[a]:void 0,u=o||"ALL",g="ALL"!==u?[u]:void 0,b=this._convertFilterUrlParams(e),w=d.DEFAULT_PAGINATION_COUNT,v=(e.page-1)*w,k=t?d.DEFAULT_FIRST_LOAD_COUNT:w,T={degradations:[_.DEGRADATION_TRACKING_METADATA.PENDING_INVITATIONS],degradedEntityIDsToRemove:[]},E=y.default.getDashInvitationViews(this.graphql,this.jet,{q:"pendingInvitationsBasedOnRelevance",start:v,count:k,invitationTypes:g??[],filterCriteria:c??[],paginationToken:n,adapterOptions:T}),I="ALL"!==a?y.default.getDashInvitationViewMeta(this.graphql,this.jet,{filterCriteria:c??[],paginationToken:n}):null,O={invitesPerPage:w,start:v,filter:a,filterName:b,invitationViewsBeforeResolve:E,invitationsSummary:this.invitationPlatform.getInvitationsSummary(),invitationViewMetaBeforeResolve:I,invitationFacetsBeforeResolve:this.invitationPlatform.getGenericInvitationFacets({q:p.GENERIC_INVITATION_FACET_QUERY.PENDING}),invitationType:u}
return(0,l.hash)(O).then((e=>{if((0,r.isDestroying)(this))return
null!==(0,s.get)(e,"invitationViewsBeforeResolve")&&null!==(0,s.get)(e,"invitationFacetsBeforeResolve")||(0,s.setProperties)(e,{isInvitationsApiFailure:!0,invitationError:p.ERROR_STATE_TYPES.INVITATION})
const n=(0,s.get)(this.controllerFor("invitation-manager"),"resolvedPendingInvitationCache")
let i=(0,s.get)(e,"invitationViewsBeforeResolve")
const o=(0,s.get)(e,"invitationViewMetaBeforeResolve")
t&&(i=(0,m.dedupInvitationsHandler)({context:this,invitationViews:i,updateCache:!0,resolvedInvitationCache:n}))
const{currentInvitationViews:a}=this,l=a.reduce(((e,t)=>{const n=(0,s.get)(t,"invitation.entityUrn")
e.push(n)
return e}),[]),c=i.filter((e=>{const t=(0,s.get)(e,"invitation.entityUrn")
return!l.includes(t)}))
a.push(...c)
const u=(0,s.get)(e,"invitationFacetsBeforeResolve.elements")
u&&u.forEach((t=>{const n=(0,s.get)(t,"invitationType")
n===e.invitationType||!n&&e.invitationType===f.INVITATION_TYPES.ALL?(0,s.set)(t,"isSelected",!0):(0,s.set)(t,"isSelected",!1)}));(0,s.setProperties)(e,{paginationMeta:o,invitationViews:a,invitationViewsCount:i.length,isAdvanceFilterDropdownOpen:!1})
return e}))}_setupPendingInvitations(e){const t=(0,s.get)(e,"invitationsSummary.numPendingInvitations")>0,n=this.paramsFor(this.routeName)
let i=0,o=0
const r=this._getTotalCount(e)
if(t){i=r&&e.start+1
o=Math.min(i+e.invitesPerPage-1,r)}else n.page>1&&this.router.transitionTo({queryParams:{page:1,filterCriteria:(0,s.get)(e,"filter"),invitationType:(0,s.get)(e,"invitationType")}})
const a=e.invitationViews.length&&this._validateInvitationList(e.invitationViews);(0,s.setProperties)(e,{hasInvites:t,total:r,itemStart:i,itemEnd:o,pendingEmptyStateEnabled:!a&&!this.inlineConfirmationCount,isFilterPresent:"ALL"===(0,s.get)(e,"filter"),isInvitationTypePresent:(0,s.get)(e,"invitationType")===f.INVITATION_TYPES.ALL,invitationFacets:(0,s.get)(e,"invitationFacetsBeforeResolve.elements")})}_validateInvitationList(e){return e.some((e=>(0,c.isPresent)((0,s.get)(e,"invitation"))))}_setFocusOnPill(e){(0,g.whenRouteIdle)().then((()=>{if(!(0,r.isDestroying)(this)&&b.default){const t=document.querySelector(`#mn-invitation-manager__invitation-facet-pills--${(0,s.get)(e,"invitationType")}`)
t instanceof window.HTMLButtonElement&&t.focus()}}))}_getTotalCount(e){const{filter:t,invitationType:n}=e
let i=0
if("CONNECTION"===n&&"ALL"!==t){this._setPaginationMeta(t,e.paginationMeta)
i=(0,s.get)(e,"paginationMeta.total")}else{const t=(0,s.get)(e,"invitationFacetsBeforeResolve.elements")
t&&t.forEach((e=>{const t=(0,s.get)(e,"invitationType");(t===n||!t&&n===f.INVITATION_TYPES.ALL)&&(i=(0,s.get)(e,"count"))}))}i<0&&(i=0)
return i}_isLazyLoad(e){let{itemStart:t,total:n,invitationViews:i=[]}=e
return(0,c.isPresent)(i)&&t+i.length-1<n}_convertFilterUrlParams(){let{filterCriteria:e="ALL"}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}
return e in M?`i18n_${M[e]}`:`i18n_${M.ALL}`}_setPaginationMeta(){this.paginationMeta||(0,s.set)(this,"paginationMeta",{});(0,s.setProperties)(this,{"paginationMeta.token":(0,s.get)(this,"metadata.paginationToken"),"paginationMeta.filterName":this.metadata})}_fetchNextInvitationsBatch(e){(0,g.whenRouteIdle)().then((()=>{if(!this.isDestroying){(0,s.set)(e,"isLoadingMoreInvites",!0)
const t=(0,s.get)(e,"itemStart")-1,n=(0,s.get)(e,"invitesPerPage"),i=(0,s.get)(e,"filter"),o=(0,s.get)(this.controllerFor("invitation-manager"),"resolvedPendingInvitationCache"),{localStorage:a}=this,l=(0,h.getPaginationTokenFromLocalStorage)(a),c=(0,s.get)(e,"invitationType"),u={degradations:[_.DEGRADATION_TRACKING_METADATA.PENDING_INVITATIONS],degradedEntityIDsToRemove:[]}
y.default.getDashInvitationViews(this.graphql,this.jet,{start:t,count:n,invitationTypes:"ALL"!==c?[c]:[],filterCriteria:"ALL"!==i?[i]:[],q:"pendingInvitationsBasedOnRelevance",paginationToken:l,adapterOptions:u}).then((t=>{(0,r.isDestroying)(this)||(0,s.get)(e,"isPreventSecondBatchCall")||(0,s.setProperties)(e,{invitationViews:(0,w.pushValues)((0,s.get)(e,"invitationViews"),(0,m.dedupInvitationsHandler)({context:this,invitationViews:t,updateCache:!1,resolvedInvitationCache:o})),isLoadingMoreInvites:!1})}))}}))}_updateInvitationsSummary(e,t,n){(0,s.get)(e,"invitationsSummary").decrementProperty("numPendingInvitations");(0,s.get)(e,"invitationFacetsBeforeResolve.elements").forEach((i=>{const o=(0,s.get)(i,"invitationType");(o===t||o===f.INVITATION_TYPES.CONNECTION&&n||!o&&e.invitationType===f.INVITATION_TYPES.ALL)&&i.decrementProperty("count")}))}_addInvitationToCacheIdList(e){const t=(0,s.get)(this.controllerFor("invitation-manager"),"resolvedPendingInvitationCache"),n=(0,s.get)(e,"invitation.entityUrn")
t.push(n)}_enterLoadingState(e){(0,s.setProperties)(e,{invitationViews:[],isLoadingMoreInvites:!0,pendingEmptyStateEnabled:!1,isPreventSecondBatchCall:!0});(0,s.get)(e,"invitationFacets").forEach((e=>{(0,s.set)(e,"isDisabled",!0)}))}_exitLoadingState(e){const t=(0,s.get)(e,"invitationFacets");(0,s.setProperties)(this,{isLoadingMoreInvites:!1,isPreventSecondBatchCall:!1})
t&&t.forEach((e=>{(0,s.set)(e,"isDisabled",!1)}))}willTransition(){super.actions.willTransition.call(this,...arguments);(0,s.get)(this,"controller.checkedInvitations")&&this.controllerFor("invitation-manager").send("unSelectAll");(0,s.setProperties)(this,{currentInvitationViews:new v.TrackedArray([]),inlineConfirmationCount:0})}updatePendingInvitations(e){const{currentModel:t}=this,n=(0,s.get)(e,"invitation.genericInvitationType"),i=n===f.INVITATION_TYPES.CONNECTION
this._updateInvitationsSummary(t,n,i)
this._addInvitationToCacheIdList(e)
this.inlineConfirmationCount++
const o=this.paramsFor(this.routeName)
this._pendingModelHash(o).then((e=>{if(!(0,r.isDestroying)(this)){this._exitLoadingState(t);(0,s.setProperties)(t,e)
this._setupPendingInvitations(t)}}))}changeInvitationType(e){const{currentModel:t}=this,n=(0,s.get)(t,"invitationType")
if(n!==e&&("ALL"!==n||!(0,c.isEmpty)(e))){this._enterLoadingState(t)
this.router.transitionTo({queryParams:{page:1,filterCriteria:null,invitationType:e||f.INVITATION_TYPES.ALL}})}}decrementInlineConfirmationCount(){this.inlineConfirmationCount--
const{currentModel:e}=this,t=(0,s.get)(e,"invitationViewsCount");(0,s.set)(e,"pendingEmptyStateEnabled",!t&&!this.inlineConfirmationCount)}},P=(0,i.default)(C.prototype,"graphql",[k],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),S=(0,i.default)(C.prototype,"localStorage",[T],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),N=(0,i.default)(C.prototype,"invitationPlatform",[E],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),R=(0,i.default)(C.prototype,"jet",[I],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),A=(0,i.default)(C.prototype,"router",[O],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),(0,i.default)(C.prototype,"willTransition",[s.action],Object.getOwnPropertyDescriptor(C.prototype,"willTransition"),C.prototype),(0,i.default)(C.prototype,"updatePendingInvitations",[s.action],Object.getOwnPropertyDescriptor(C.prototype,"updatePendingInvitations"),C.prototype),(0,i.default)(C.prototype,"changeInvitationType",[s.action],Object.getOwnPropertyDescriptor(C.prototype,"changeInvitationType"),C.prototype),(0,i.default)(C.prototype,"decrementInlineConfirmationCount",[s.action],Object.getOwnPropertyDescriptor(C.prototype,"decrementInlineConfirmationCount"),C.prototype),C)}))
define("mynetwork/routes/invitation-manager/sent-common",["exports","@babel/runtime/helpers/esm/defineProperty","@babel/runtime/helpers/esm/applyDecoratedDescriptor","@ember/routing/route","@ember/object","mynetwork/utils/constants-common"],(function(e,t,n,i,o,r){"use strict"
Object.defineProperty(e,"__esModule",{value:!0})
e.default=void 0
var a
e.default=(a=class extends i.default{constructor(){super(...arguments);(0,t.default)(this,"pageKey","flagship3_people_sent_invitations");(0,t.default)(this,"start",0);(0,t.default)(this,"controllerName","invitation-manager");(0,t.default)(this,"queryParams",{page:r.REFRESH,invitationType:r.REFRESH})}resetController(e,t,n){super.resetController(e,t,n)
t&&(0,o.setProperties)(e,{page:1,invitationType:""})}willTransition(){(0,o.set)(this,"start",0)
return!0}},(0,n.default)(a.prototype,"willTransition",[o.action],Object.getOwnPropertyDescriptor(a.prototype,"willTransition"),a.prototype),a)}))
define("mynetwork/routes/invitation-manager/sent",["exports","@babel/runtime/helpers/esm/initializerDefineProperty","@babel/runtime/helpers/esm/defineProperty","@babel/runtime/helpers/esm/applyDecoratedDescriptor","@babel/runtime/helpers/esm/initializerWarningHelper","@ember/destroyable","@ember/service","rsvp","@ember/object","@ember/utils","mynetwork/routes/invitation-manager/sent-common","mynetwork/utils/constants","mynetwork/utils/mynetwork-request","ember-app-scheduler","mynetwork/utils/constants-common","mynetwork/utils/dedup-invites","global-utils/utils/is-browser","invitation-platform/utils/pem-tracking"],(function(e,t,n,i,o,r,a,l,s,c,u,m,d,p,f,y,h,g){"use strict"
Object.defineProperty(e,"__esModule",{value:!0})
e.default=void 0
var b,_,w,v,k,T,E,I,O
e.default=(b=(0,a.inject)("@linkedin/ember-restli-graphql@graphql"),_=(0,a.inject)("invitation-platform@invitation-platform"),w=(0,a.inject)("jet"),v=(0,a.inject)("router"),k=class extends u.default{constructor(){super(...arguments);(0,t.default)(this,"graphql",T,this);(0,t.default)(this,"invitationPlatform",E,this);(0,t.default)(this,"jet",I,this);(0,t.default)(this,"router",O,this)}_setupSentInvitations(e){const t=((0,s.get)(e,"invitationViews")??[]).length,n=this._getTotalCount(e)
let i=0
t?i=Math.min(e.itemStart+e.invitesPerPage-1,n):e.page>1&&this.router.transitionTo({queryParams:{page:1,invitationType:(0,s.get)(e,"invitationType")}})
const o=t&&this._validateInvitationList(e.invitationViews);(0,s.setProperties)(e,{itemEnd:i,total:n,sentEmptyStateEnabled:!o})}_validateInvitationList(e){return!e.every((e=>!!e&&(0,c.isEmpty)((0,s.get)(e,"invitation"))))}_getTotalCount(e){const{invitationType:t}=e
let n=0;((0,s.get)(e,"invitationFacets")||[]).forEach((e=>{(0,s.get)(e,"invitationType")===t&&(n=(0,s.get)(e,"count"))}))
n<0&&(n=0)
return n}sentModelHash(e,t){const{jet:n,graphql:i}=this,{invitationType:o}=e,a=o||"CONNECTION",{page:c}=this.paramsFor(this.routeName),u=this.invitationPlatform.getInvitationsSummary(),p=this.invitationPlatform.getGenericInvitationFacets({q:f.GENERIC_INVITATION_FACET_QUERY.SENT}),h=m.DEFAULT_PAGINATION_COUNT,b=(c-1)*h,_=b+1,w=t?m.DEFAULT_FIRST_LOAD_COUNT:h,v={degradations:[g.DEGRADATION_TRACKING_METADATA.SENT_INVITATIONS],degradedEntityIDsToRemove:[]},k=d.default.getDashSentInvitationViews(i,n,{start:b,count:w,invitationType:a,adapterOptions:v})
return(0,l.hash)({page:c,invitesPerPage:h,itemStart:_,sentInvitationViews:k,invitationsSummary:u,rawInvitationFacets:p,invitationType:a}).then((e=>{if((0,r.isDestroying)(this))return
const t=(0,s.get)(this.controllerFor("invitation-manager"),"resolvedSentInvitationCache"),n=(0,y.dedupInvitationsHandler)({context:this,invitationViews:(0,s.get)(e,"sentInvitationViews.elements"),updateCache:!1,resolvedInvitationCache:t});(0,s.set)(e,"sentInvitationViews.elements",n);(0,s.set)(this,"invitationCache",[])
return e}))}model(){if(!(0,r.isDestroying)(this))return this.sentModelHash(this.paramsFor(this.routeName),!0)}_loadMoreInvites(e){(0,s.set)(e,"isLoadingMoreInvites",!0)
return this.sentModelHash(this.paramsFor(this.routeName),!1).then((t=>{if(!(0,r.isDestroying)(this)){(0,s.setProperties)(e,t);(0,s.set)(e,"invitationViews",(0,s.get)(e,"sentInvitationViews.elements"))
this._setupSentInvitations(e);(0,s.set)(e,"isLoadingMoreInvites",!1)}}))}afterModel(e){if((0,r.isDestroying)(this))return
const t=(0,s.get)(e,"rawInvitationFacets.elements")||[]
this._activateSelectedInvitationFacet(e,t);(0,s.setProperties)(e,{invitationFacets:t,invitationViews:(0,s.get)(e,"sentInvitationViews.elements"),sentInvitationType:(0,s.get)(e,"sentInvitationViews.metadata.invitationType")})
this._exitLoadingState(e)
this._setupSentInvitations(e)
const n=(0,s.get)(e,"itemStart")+(0,s.get)(e,"invitationViews.length")-1<(0,s.get)(e,"total");(0,p.whenRouteIdle)().then((()=>{if(!(0,r.isDestroying)(this)){n&&this._loadMoreInvites(e)
this._setFocusOnPill(e)}}))}_setFocusOnPill(e){if(h.default){const t=document.querySelector(`#mn-invitation-manager__invitation-facet-pills--${(0,s.get)(e,"invitationType")}`)
t instanceof window.HTMLButtonElement&&t.focus()}}_activateSelectedInvitationFacet(e,t){t.forEach((t=>{const n=(0,s.get)(t,"invitationType"),i=(0,s.get)(e,"invitationType"),o=n===i||"CONNECTION"===n&&(0,c.isEmpty)(i);(0,s.set)(t,"isSelected",o)}))}_updateSentInvitationsSummary(e){const t=(0,s.get)(e,"invitationType");(0,s.get)(e,"invitationFacets").forEach((e=>{const n=(0,s.get)(e,"invitationType");(n===t||"CONNECTION"===n&&(0,c.isEmpty)(t))&&e.decrementProperty("count")}))}_enterLoadingState(e){(0,s.setProperties)(e,{invitationViews:[],isLoadingMoreInvites:!0,sentEmptyStateEnabled:!1});(0,s.get)(e,"invitationFacets").forEach((e=>{(0,s.set)(e,"isDisabled",!0)}))}_exitLoadingState(e){const t=(0,s.get)(e,"invitationFacets");(0,s.set)(e,"isLoadingMoreInvites",!1)
t&&t.forEach((e=>{(0,s.set)(e,"isDisabled",!1)}))}_addInvitationToCacheIdList(e){const t=(0,s.get)(this.controllerFor("invitation-manager"),"resolvedSentInvitationCache"),n=(0,s.get)(e,"invitation.entityUrn")
t.push(n)}updateSentInvitations(e){const{currentModel:t}=this
this._updateSentInvitationsSummary(t)
this._addInvitationToCacheIdList(e)
this._loadMoreInvites(this.currentModel)}changeInvitationType(e){const{currentModel:t}=this
if((0,s.get)(t,"invitationType")!==e){this._enterLoadingState(t)
this.router.transitionTo({queryParams:{page:1,invitationType:e||"CONNECTION"}})}}},T=(0,i.default)(k.prototype,"graphql",[b],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),E=(0,i.default)(k.prototype,"invitationPlatform",[_],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),I=(0,i.default)(k.prototype,"jet",[w],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),O=(0,i.default)(k.prototype,"router",[v],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),(0,i.default)(k.prototype,"updateSentInvitations",[s.action],Object.getOwnPropertyDescriptor(k.prototype,"updateSentInvitations"),k.prototype),(0,i.default)(k.prototype,"changeInvitationType",[s.action],Object.getOwnPropertyDescriptor(k.prototype,"changeInvitationType"),k.prototype),k)}))
define("mynetwork/routes/invite-accept",["exports","@babel/runtime/helpers/esm/initializerDefineProperty","@babel/runtime/helpers/esm/defineProperty","@babel/runtime/helpers/esm/applyDecoratedDescriptor","@babel/runtime/helpers/esm/initializerWarningHelper","@ember/destroyable","@ember/service","@ember/routing/route","global-utils/utils/is-browser","global-utils/utils/urn-converter","mynetwork/utils/constants-common","mynetwork/utils/is-http-error-status"],(function(e,t,n,i,o,r,a,l,s,c,u,m){"use strict"
Object.defineProperty(e,"__esModule",{value:!0})
e.default=void 0
var d,p,f,y,h,g,b,_,w,v,k
const T=[...u.MYNETWORK_ERROR_TAGS,"mynetwork-invite-accept-error-log"]
e.default=(d=(0,a.inject)("client-sensor-web@client-sensor"),p=(0,a.inject)("tracking"),f=(0,a.inject)("invitation-platform@invitation-platform"),y=(0,a.inject)("jet"),h=(0,a.inject)("router"),g=class e extends l.default{constructor(){super(...arguments);(0,n.default)(this,"pageKey","flagship3_people_invite_accept");(0,t.default)(this,"clientSensor",b,this);(0,t.default)(this,"tracking",_,this);(0,t.default)(this,"invitationPlatform",w,this);(0,t.default)(this,"jet",v,this);(0,t.default)(this,"router",k,this)}beforeModel(){this.tracking.firePageViewEvent(this.pageKey)}model(e,t){var n
if((0,r.isDestroying)(this))return
if(!s.default)return null
const{invitationId:i,sharedKey:o}=e
this.invitationId=i
const{entityType:a,inviterVanityName:l,invitationTargetUrn:c,trkEmail:u}=(null===(n=t.to)||void 0===n?void 0:n.queryParams)||{}
return a&&c?this._acceptEntityInvite({invitationId:i,sharedKey:o,entityType:a,invitationTargetUrn:c}):this._acceptMemberInvite({invitationId:i,inviterVanityName:l,sharedKey:o,trkEmail:u})}_acceptMemberInvite(e){let{invitationId:t,inviterVanityName:n,sharedKey:i,trkEmail:o}=e
const a=o?"EMAIL":"OTHER"
return this.invitationPlatform.singleInvitationActionRequest({invitationIdOrUrn:t,sharedKey:i,action:"accept",invitationType:"CONNECTION"}).then((e=>this._transitionToHeathrowRedirect(e,!1,a,t,n))).catch((e=>{if((0,r.isDestroying)(this))throw e
if((0,m.default)(e)){this.jet.logError(e,T,!1)
return this._transitionToHeathrowRedirect(null,!0,a,t,n)}throw e}))}_acceptEntityInvite(t){let{invitationId:n,sharedKey:i,entityType:o,invitationTargetUrn:a}=t
const{entityRoute:l,invitationType:s,entityId:c}=e._getEntityInfo(o,a)
return l?this.invitationPlatform.singleInvitationActionRequest({invitationIdOrUrn:n,sharedKey:i,action:"accept",invitationType:s}).then((()=>this.transitionToExternal(l,c,{queryParams:{entityInviteAccepted:!0}}))).catch((e=>{if((0,r.isDestroying)(this))throw e
if((0,m.default)(e)){this.jet.logError(e,T,!1)
return this._transitionToInvitationManager(s)}throw e})):this._transitionToInvitationManager(s)}static _getEntityInfo(e,t){const n=(0,c.fromUrn)(t).id
switch(e){case"EVENT":return{entityRoute:"events.index",invitationType:"EVENT",entityId:n}
case"PAGE":return{entityRoute:"companies.company",invitationType:"ORGANIZATION",entityId:n}
case"GROUP":return{entityRoute:"groups.groups-entity.index",invitationType:"GROUP",entityId:n}
case"SERIES":return{entityRoute:"publishing-entity.newsletter",invitationType:"CONTENT_SERIES",entityId:n}
default:return{}}}_transitionToInvitationManager(e){return this.router.transitionTo("mynetwork.invitation-manager",{queryParams:{entityInviteFailed:!0,invitationType:e}})}_transitionToHeathrowRedirect(e,t,n,i,o){e&&!t&&this.invitationPlatform.writeFreshlyActedOnInvitationToCache(e,"accept")
const r=o,a={origin:n,invitationId:i,isAcceptInvite:!0}
r&&(a.vanityName=r)
t&&(a.inviteActionFailed=!0)
if(!e)return this.router.transitionTo("mynetwork.index",{queryParams:a})
if(r)return this.router.transitionTo("suggested-for-you.index","based-on-your-accepted-invite",{queryParams:{vanityName:r,triggerAction:"ACCEPT_INVITATION",error:t,origin:"EMAIL"===n?"EMAIL":"IN_APP"}})
this.clientSensor.incrementMetricCounter({groupName:"recommended-actions",metricName:"missing-vanity-name-invite-accept"})
return this.router.transitionTo("mynetwork.index",{queryParams:a})}},b=(0,i.default)(g.prototype,"clientSensor",[d],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),_=(0,i.default)(g.prototype,"tracking",[p],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),w=(0,i.default)(g.prototype,"invitationPlatform",[f],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),v=(0,i.default)(g.prototype,"jet",[y],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),k=(0,i.default)(g.prototype,"router",[h],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),g)}))
define("mynetwork/routes/invite-accepted-common",["exports","@babel/runtime/helpers/esm/initializerDefineProperty","@babel/runtime/helpers/esm/defineProperty","@babel/runtime/helpers/esm/applyDecoratedDescriptor","@babel/runtime/helpers/esm/initializerWarningHelper","@ember/destroyable","@ember/routing/route","@ember/service"],(function(e,t,n,i,o,r,a,l){"use strict"
Object.defineProperty(e,"__esModule",{value:!0})
e.default=void 0
var s,c,u
const m=Object.freeze({refreshModel:!1})
e.default=(s=(0,l.inject)("router"),c=class extends a.default{constructor(){super(...arguments);(0,t.default)(this,"router",u,this);(0,n.default)(this,"pageKey","flagship3_people_invite_accept_landing");(0,n.default)(this,"queryParams",{acceptedFrom:m})}model(e){if((0,r.isDestroying)(this))return
const{inviterVanityName:t,acceptedFrom:n}=e
this.router.transitionTo("mynetwork.heathrow-redirect",{queryParams:{origin:n||"EMAIL",vanityName:t,isAcceptInvite:!0}})}},u=(0,i.default)(c.prototype,"router",[s],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),c)}))
define("mynetwork/routes/invite-accepted-contextual",["exports","@babel/runtime/helpers/esm/defineProperty","@ember/routing/route"],(function(e,t,n){"use strict"
Object.defineProperty(e,"__esModule",{value:!0})
e.default=void 0
class i extends n.default{constructor(){super(...arguments);(0,t.default)(this,"pageKey","flagship3_people_invite_accepted_contextual")}beforeModel(e){const t=e.to?e.to.params:{},{inviteActionFailed:n,origin:i}=e.to?e.to.queryParams:{},{inviteeVanityName:o}=t
this.replaceWithExternal("suggested-for-you.index","based-on-your-accepted-invite",{queryParams:{vanityName:o,triggerAction:"ACCEPT_INVITATION",error:n,origin:"EMAIL"===i?"EMAIL":"IN_APP"}})}}e.default=i}))
define("mynetwork/routes/invite-accepted",["exports","@babel/runtime/helpers/esm/initializerDefineProperty","@babel/runtime/helpers/esm/defineProperty","@babel/runtime/helpers/esm/applyDecoratedDescriptor","@babel/runtime/helpers/esm/initializerWarningHelper","@ember/destroyable","@ember/service","@ember/object","rsvp","@ember/routing/route","global-utils/utils/urn-converter","@linkedin/abi-js/src/index","mynetwork/utils/mynetwork-request","ember-app-scheduler","discover-utils/utils/discover-util","mynetwork/utils/connection-util","mynetwork/utils/constants","mynetwork/utils/constants-common","mynetwork/utils/heathrow-organization-util"],(function(e,t,n,i,o,r,a,l,s,c,u,m,d,p,f,y,h,g,b){"use strict"
Object.defineProperty(e,"__esModule",{value:!0})
e.default=void 0
var _,w,v,k,T
e.default=(_=(0,a.inject)("jet"),w=(0,a.inject)("global-services@store-shim"),v=class extends c.default{constructor(){super(...arguments);(0,n.default)(this,"pageKey","flagship3_people_invite_accept_landing");(0,t.default)(this,"jet",k,this);(0,t.default)(this,"storeShim",T,this);(0,n.default)(this,"queryParams",{sentFrom:g.NO_REFRESH,inviteActionFailed:g.NO_REFRESH,isAcceptInvite:g.NO_REFRESH,knownError:g.NO_REFRESH})}model(e,t){if((0,r.isDestroying)(this))return
const{queryParams:n}=t.to?t.to:{},{inviteeVanityName:i}=e,{jet:o,storeShim:a}=this,c={inviteeVanityName:i,profile:d.default.getNormalizedProfileByVanityName(a,{jet:o,vanityName:i,recipe:h.HEATHROW.NORMALIZED_PROFILE_RECEIPE})}
return(0,s.hash)(c).then((t=>{if((0,r.isDestroying)(this))return
const i={acceptInvite:!0,organizationAcceptInvite:!!e.isAcceptInvite,inviteActionFailed:n.inviteActionFailed,knownError:n.knownError}
if(