var Loop=window.Loop||{},socialErrorCopies;Loop.Cache=function(){function v(){y()}function y(){function f(){if(t.length>0){var n=$.grep(t,function(n){return n.IsPrimary===!0},!1);return n[0]}return null}function i(){t===null&&(t=n.getAffiliations())}function u(n){var r=f(),u=n.affiliation,e=null,i;if(u.IsPrimary)if(r&&r.Id!==u.Id){for(i=0;i<t.length;i++)r.Id===t[i].Id?t[i].IsPrimary=!1:u.Id===t[i].Id&&(t[i].IsPrimary=!0,e=l(t[i]));Loop.Core.publish(Loop.constants.Events.PRIMARY_AFFILIATION_CHANGED,n)}else r||Loop.Core.publish(Loop.constants.Events.PRIMARY_AFFILIATION_CHANGED,n)}function r(n){n!==Loop.constants.Events.AFFILIATION_DELETED&&(t=t.sort(a))}function e(n,f){i();u(f);t.push(f.affiliation);r(Loop.constants.Events.AFFILIATION_ADDED,f)}function o(n,f){i();var e=-1,o=e;$.grep(t,function(n){return e++,n.Id===f.affiliation.Id?(o=e,!0):!1});u(f);t.splice(o,1,f.affiliation);r(Loop.constants.Events.AFFILIATION_EDITED,f)}function s(n,u){i();t=$.grep(t,function(n){return n.Id!==u.affiliation.Id});r(Loop.constants.Events.AFFILIATION_DELETED,u)}function h(n,t){if(t.primaryAffiliation!=null){i();var f={source:"headerSection",affiliation:t.primaryAffiliation};u(f);r()}}Loop.Core.subscribe(Loop.constants.Events.AFFILIATION_ADDED,e);Loop.Core.subscribe(Loop.constants.Events.AFFILIATION_EDITED,o);Loop.Core.subscribe(Loop.constants.Events.AFFILIATION_DELETED,s);Loop.Core.subscribe(Loop.constants.Events.HEADER_SECTION_UPDATED,h)}function h(n){return jQuery.extend([],n)}function l(n){return JSON.parse(JSON.stringify(n))}function a(n,t){function i(n,t){return n===undefined&&t===undefined?0:n===undefined&&t!==undefined?1:t===undefined&&n!==undefined?-1:n>t?-1:n<t?1:0}function r(n,t,r,u){var f=i(n,t);return f!==0?f:r.length===0?1:u.length===0?-1:r.localeCompare(u)}if(n.IsPrimary)return-1;if(t.IsPrimary)return 1;if(n.IsCurrent&&t.IsCurrent)return r(n.StartingDate,t.StartingDate,n.Name,t.Name);if(n.IsCurrent)return-1;if(t.IsCurrent)return 1;var u=i(n.EndingDate,t.EndingDate);return u!==0?u:r(n.StartingDate,t.StartingDate,n.Name,t.Name)}var n={},f=null,e=null,o=null,s=null,u=null,c=null,i={},r={},t=null;return n.getCountries=function(t){if(f===null&&Loop.Core.Ajax.loadDataSync({endpoint:Loop.Core.EndpointRepository.getEndpoint("Countries"),successCallback:function(n){n.sort(function(n,t){return n.Name===t.Name?0:n.Name>t.Name?1:-1});f=n}}),t!==undefined&&t)return n.getArrayWithDefaultItem(f,{CountryId:0,Name:"Select"});return f},n.getUgaritCountries=function(t){if(e===null&&Loop.Core.Ajax.loadDataSync({endpoint:Loop.Core.EndpointRepository.getEndpoint("UgaritCountries"),successCallback:function(n){n.sort(function(n,t){return n.name===t.name?0:n.name>t.name?1:-1});e=ko.observableArray(n)}}),t!==undefined&&t){var i={id:ko.observable(0),name:ko.observable("Select")},r=n.getArrayWithDefaultItem(e(),i);return ko.observableArray(r)}return e},n.getPositions=function(t){if(o===null&&Loop.Core.Ajax.loadDataSync({endpoint:Loop.Core.EndpointRepository.getEndpoint("Positions"),successCallback:function(n){o=n}}),t!==undefined&&t)return n.getArrayWithDefaultItem(o,{PositionId:0,PositionName:"Select"});return o},n.getDegrees=function(t){if(s===null&&Loop.Core.Ajax.loadDataSync({endpoint:Loop.Core.EndpointRepository.getEndpoint("Degrees"),successCallback:function(n){n.sort(function(n,t){return n.Degree===t.Degree?0:n.Degree>t.Degree?1:-1});s=n}}),t)return n.getArrayWithDefaultItem(s,{DegreeId:0,Name:"Select"});return s},n.getMonths=function(t){var i=[{Id:"1",Month:"January"},{Id:"2",Month:"February"},{Id:"3",Month:"March"},{Id:"4",Month:"April"},{Id:"5",Month:"May"},{Id:"6",Month:"June"},{Id:"7",Month:"July"},{Id:"8",Month:"August"},{Id:"9",Month:"September"},{Id:"10",Month:"October"},{Id:"11",Month:"November"},{Id:"12",Month:"December"}],r;return t!==undefined&&t?(r={Id:"",Month:"Month"},n.getArrayWithDefaultItem(i,r)):i},n.getYears=function(t,i,r,u){var e=[],f=0;if(t===undefined&&(t=(new Date).getFullYear()-100),i===undefined&&(i=(new Date).getFullYear()),t>i)console.warn("Loop.Cache.Years error. Invalid range");else if(u===undefined&&(u=!0),u)for(f=i;f>t;f-=1)e.push(f);else for(f=t;f<i;f+=1)e.push(f);return r!==undefined&&r?n.getArrayWithDefaultItem(e,"Year"):e},n.getArrayWithDefaultItem=function(n,t){var i=h(n);return i.unshift(t),i},n.getDomains=function(t){var i,r;return(u===null&&Loop.Core.Ajax.loadDataSync({endpoint:Loop.Core.EndpointRepository.getEndpoint("Domains"),successCallback:function(n){for(n.sort(function(n,t){return n.Value===t.Value?0:n.Value>t.Value?1:-1}),u=[],i=0;i<n.length;i+=1)u[i]={DomainId:n[i].DomainId,Name:n[i].Name}}}),t!==undefined&&t)?(r={DomainId:0,Name:"Select"},n.getArrayWithDefaultItem(u,r)):h(u)},n.getDomainName=function(n){for(var i=Loop.Cache.Domains(),t=0;t<i.length;t+=1)if(i[t].DomainId===n)return i[t].Name;return undefined},n.getFields=function(t,r){if(i[t]||(i[t]=[]),t>0&&i[t].length===0&&Loop.Core.Ajax.loadDataSync({endpoint:Loop.Core.EndpointRepository.getEndpoint("FieldsByDomainId",{domainId:t}),successCallback:function(n){n.sort(function(n,t){return n.Value===t.Value?0:n.Value>t.Value?1:-1});i[t]=[];$.each(n,function(n,r){i[t].push({FieldId:r.Key,Name:r.Value})})}}),r!==undefined&&r)return n.getArrayWithDefaultItem(i[t],{FieldId:0,Name:"Select"});return h(i[t])},n.getFieldName=function(n,t){for(var r=Loop.Cache.Fields(n),i=0;i<r.length;i+=1)if(r[i].FieldId===t)return r[i].Name;return undefined},n.getSpecialties=function(t,i,u){if(r[i]||(r[i]=[]),i>0&&r[i].length===0&&Loop.Core.Ajax.loadDataSync({endpoint:Loop.Core.EndpointRepository.getEndpoint("SpecialtiesByFieldId",{domainId:t,fieldId:i}),successCallback:function(n){n.sort(function(n,t){return n.Value===t.Value?0:n.Value>t.Value?1:-1});r[i]=[];$.each(n,function(n,t){r[i].push({SpecialtyId:t.Key,Name:t.Value})})}}),u!==undefined&&u)return n.getArrayWithDefaultItem(r[i],{FieldId:0,Name:"Select"});return h(r[i])},n.getSpecialtyName=function(n,t,i){for(var u=Loop.Cache.Specialties(n,t),r=0;r<u.length;r+=1)if(u[r].SpecialtyId===i)return u[r].Name;return undefined},n.getCommonOrganizations=function(){return c===null&&Loop.Core.Ajax.loadDataSync({endpoint:Loop.Core.EndpointRepository.getEndpoint("CommonOrganizations"),successCallback:function(n){c=n}}),c},n.getAffiliationsAsync=function(){var n=$.Deferred();return t===null?Loop.Core.Ajax.loadData({endpoint:Loop.Core.EndpointRepository.getEndpoint("Affiliations",{userID:Loop.Configuration.profile.ProfileUserId}),successCallback:function(i){t=i.sort(a);n.resolve(l(t))},errorCallback:function(){n.reject()}}):n.resolve(l(t)),n},n.getAffiliations=function(){return t===null&&Loop.Core.Ajax.loadDataSync({endpoint:Loop.Core.EndpointRepository.getEndpoint("Affiliations",{userID:Loop.Configuration.profile.ProfileUserId}),successCallback:function(n){t=n.sort(a)}}),t},n.resetAffiliations=function(){t=null},v(),{AffiliationsAsync:n.getAffiliationsAsync,Affiliations:n.getAffiliations,ResetAffiliations:n.resetAffiliations,Countries:n.getCountries,UgaritCountries:n.getUgaritCountries,Positions:n.getPositions,Degrees:n.getDegrees,Months:n.getMonths,Years:n.getYears,Domains:n.getDomains,GetDomainName:n.getDomainName,Fields:n.getFields,GetFieldName:n.getFieldName,Specialties:n.getSpecialties,GetSpecialtyName:n.getSpecialtyName,CommonOrganizations:n.getCommonOrganizations}}();Loop=window.Loop||{};Loop.controls=Loop.controls||{};Loop.controls.endpointProxy=function(n,t){function l(n){if(i.endpointKey==="RelatedPeople"){if(!n.userID)throw new Error("UserID was not provided for the related people endpoint call.");return Loop.Core.EndpointRepository.getEndpoint("RelatedPeople",{userID:n.userID,limit:i.options.endpointLimit,offset:i.currentEndpointOffset})}if(i.endpointKey==="CoAuthors"){if(!n.userID)throw new Error("UserID was not provided for the coauthors endpoint call.");return Loop.Core.EndpointRepository.getEndpoint("CoAuthors",{userID:n.userID,limit:i.options.endpointLimit,offset:i.currentEndpointOffset})}if(i.endpointKey==="PeopleAlsoLookedAt"){if(n.userID===void 0)throw new Error("UserID was not provided for the people also looked at endpoint call.");return Loop.Core.EndpointRepository.getEndpoint("PeopleAlsoLookedAt",{userID:n.userID,limit:i.options.endpointLimit,offset:i.currentEndpointOffset})}}function s(n){return u.slice(i.currentItemOffset,i.currentItemOffset+n)}function h(n){var t=n;return isNaN(n)&&(t=i.options.visibleItems),i.currentItemOffset+n>i.options.endpointLimit&&(t=i.options.endpointLimit-i.currentItemOffset),t}function a(n,t,i){var r,u;try{r=l(n)}catch(f){if(typeof i=="function"){u=Loop.Core.ErrorHandler.getErrorHandler(Loop.Core.Constants.EndpointType.PRIVATE,404,null,Loop.Core.Enum.APIActions.Read);i(404,u.errorMessage);return}}Loop.Core.Ajax.loadData({endpoint:r,successCallback:function(n){typeof t=="function"&&t(n)},errorCallback:function(n,t){typeof i=="function"&&i(n,t)},preventModalOnError:!1})}function c(n,t,u,f,e){var o=[],c=h(t);i.noContent||(o=s(c),i.currentItemOffset+=c);o.length===0&&(i.currentItemOffset=r,i.currentEndpointOffset=r);o.length!==0||i.noContent?(n.errorMessage(""),typeof f=="function"&&f(o)):i.getItems(n,t,u,f,e)}function v(n){return i.onlyOnePage&&s(h(n)).length===0?(i.currentItemOffset=r,!1):i.currentEndpointOffset===r&&!i.noContent?!0:i.currentItemOffset>=i.options.endpointLimit?!0:u.length===0&&!i.noContent?!0:!1}function o(n){return n.networkButtonState===Loop.controls.NetworkButtonState.Following}function y(n,t){var r=_.findWhere(u,{userId:t.userId});r&&(i.endpointKey==="RelatedPeople"&&(r.followState=o(t)),i.endpointKey==="CoAuthors"&&(r.following=o(t)),i.endpointKey==="PeopleAlsoLookedAt"&&(r.followState=o(t)?"following":"follow"))}var i=this,r=0,f={visibleItems:5,endpointLimit:50},u=[],e;i.options=$.extend({},f,t||{});i.currentItemOffset=r;i.currentEndpointOffset=r;i.endpointKey=n;i.noContent=!1;i.onlyOnePage=!1;i.options.visibleItems>i.options.endpointLimit&&(i.options.visibleItems=i.options.endpointLimit);i.options.visibleItems<=0&&(i.options.visibleItems=f.visibleItems);i.options.endpointLimit<=0&&(i.options.endpointLimit=f.endpointLimit);i.getItems=function(n,t,f,o,s){var h=[];e&&!_.isEqual(e,f)&&i.resetCounters();v(t)?(n.isDataLoaded()&&n.status(Loop.Enum.BrickDataStatus.ReadyToReload),n.status()===Loop.Enum.BrickDataStatus.NotInitialized?n.allowEmptyCase&&n.status(Loop.Enum.BrickDataStatus.Loading):n.status(Loop.Enum.BrickDataStatus.Loading),a(f,function(e){n.status()===Loop.Enum.BrickDataStatus.NotInitialized&&e.length>0&&n.status(Loop.Enum.BrickDataStatus.Loading);e.length===0&&i.currentEndpointOffset===r&&(i.noContent=!0);e.length>0&&e.length<i.options.endpointLimit&&i.currentEndpointOffset===r&&(i.onlyOnePage=!0);u=e;i.currentEndpointOffset+=i.options.endpointLimit;i.currentItemOffset=r;h=c(n,t,f,o,s)},function(t,i){n.errorMessage(i);n.status(Loop.Enum.BrickDataStatus.LoadedWithErrors);typeof s=="function"&&s(t,i);return})):h=c(n,t,f,o,s);e=f};i.resetCounters=function(){i.currentItemOffset=r;i.currentEndpointOffset=r};Loop.Core.subscribe(Loop.constants.Events.USER_FOLLOW_STATE_CHANGED,y)};Loop.Core.EndpointRepository.addEndpoint({type:Loop.Core.Constants.EndpointType.PRIVATE,key:"Experience",urlArgs:{userID:null,positionID:null},url:function(){var n="/users/"+this.urlArgs.userID+"/positions";return this.urlArgs.positionID&&(n+="/"+this.urlArgs.positionID),Loop.Configuration.urls.ApiBaseUrl+n}});Loop.Core.EndpointRepository.addEndpoint({type:Loop.Core.Constants.EndpointType.EXTERNAL_PRIVATE,key:"EditorialRoles",urlArgs:{userID:null},url:function(){var n="/users/"+this.urlArgs.userID+"/editorialroles";return Loop.Configuration.urls.ApiBaseUrl+n}});Loop.Core.EndpointRepository.addEndpoint({type:Loop.Core.Constants.EndpointType.PRIVATE,key:"Expertise",urlArgs:{userID:null},url:function(){var n="/users/"+this.urlArgs.userID+"/expertise";return Loop.Configuration.urls.ApiBaseUrl+n}});Loop.Core.EndpointRepository.addEndpoint({type:Loop.Core.Constants.EndpointType.PRIVATE,key:"Affiliations",urlArgs:{userID:null,affiliationID:null},url:function(){var n="/users/"+this.urlArgs.userID+"/affiliations";return this.urlArgs.affiliationID&&(n+="/"+this.urlArgs.affiliationID),Loop.Configuration.urls.ApiBaseUrl+n}});Loop.Core.EndpointRepository.addEndpoint({type:Loop.Core.Constants.EndpointType.PRIVATE,key:"Education",urlArgs:{userID:null,educationID:null},url:function(){var n="/users/"+this.urlArgs.userID+"/educations";return this.urlArgs.educationID&&(n+="/"+this.urlArgs.educationID),Loop.Configuration.urls.ApiBaseUrl+n}});Loop.Core.EndpointRepository.addEndpoint({type:Loop.Core.Constants.EndpointType.PRIVATE,key:"MainInfo",urlArgs:{userID:null},url:function(){var n="/users/"+this.urlArgs.userID+"/main-info";return Loop.Configuration.urls.ApiBaseUrl+n}});Loop.Core.EndpointRepository.addEndpoint({type:Loop.Core.Constants.EndpointType.PUBLIC,key:"MainInfoPublic",urlArgs:{userID:null},url:function(){var n="/users/"+this.urlArgs.userID+"/main-info";return Loop.Configuration.urls.ApiBaseUrl+n}});Loop.Core.EndpointRepository.addEndpoint({type:Loop.Core.Constants.EndpointType.PRIVATE,key:"Keywords",urlArgs:{prefix:null,limit:null},url:function(){var n="/suggest/keywords/";return this.urlArgs.prefix&&(n+="?prefix="+this.urlArgs.prefix+"&limit="+(this.urlArgs.limit||10)),Loop.Configuration.urls.ApiBaseUrl+n}});Loop.Core.EndpointRepository.addEndpoint({type:Loop.Core.Constants.EndpointType.PUBLIC,key:"Countries",url:function(){return Loop.Configuration.urls.ApiBaseUrl+"/info/countries"}});Loop.Core.EndpointRepository.addEndpoint({type:Loop.Core.Constants.EndpointType.PUBLIC,key:"Positions",url:function(){return Loop.Configuration.urls.ApiBaseUrl+"/info/positions"}});Loop.Core.EndpointRepository.addEndpoint({type:Loop.Core.Constants.EndpointType.PUBLIC,key:"Degrees",url:function(){return Loop.Configuration.urls.ApiBaseUrl+"/info/degrees"}});Loop.Core.EndpointRepository.addEndpoint({type:Loop.Core.Constants.EndpointType.PRIVATE,key:"Followers",urlArgs:{userID:null,limit:null,offset:null,search:null,sortBy:null},url:function(){var n="/users/"+this.urlArgs.userID+"/followers?limit="+this.urlArgs.limit+"&offset="+this.urlArgs.offset+"&search="+this.urlArgs.search+"&sortby="+this.urlArgs.sortBy;return Loop.Configuration.urls.ApiBaseUrl+n}});Loop.Core.EndpointRepository.addEndpoint({type:Loop.Core.Constants.EndpointType.PRIVATE,key:"Following",urlArgs:{userID:null,limit:null,offset:null,search:null,sortBy:null},url:function(){var n="/users/"+this.urlArgs.userID+"/following?limit="+this.urlArgs.limit+"&offset="+this.urlArgs.offset+"&search="+this.urlArgs.search+"&sortby="+this.urlArgs.sortBy;return Loop.Configuration.urls.ApiBaseUrl+n}});Loop.Core.EndpointRepository.addEndpoint({type:Loop.Core.Constants.EndpointType.PRIVATE,key:"RelatedPeople",urlArgs:{userID:null,limit:null,offset:null},url:function(){var n="/users/"+this.urlArgs.userID+"/related-people?limit="+this.urlArgs.limit+"&offset="+this.urlArgs.offset;return Loop.Configuration.urls.ApiBaseUrl+n}});Loop.Core.EndpointRepository.addEndpoint({type:Loop.Core.Constants.EndpointType.PRIVATE,key:"PeopleAlsoLookedAt",urlArgs:{userID:null,limit:null,offset:null},url:function(){var n="/users/"+this.urlArgs.userID+"/people-also-looked-at?offset="+this.urlArgs.offset+"&limit="+this.urlArgs.limit;return Loop.Configuration.urls.ApiBaseUrl+n}});Loop.Core.EndpointRepository.addEndpoint({type:Loop.Core.Constants.EndpointType.PRIVATE,key:"CoAuthors",urlArgs:{userID:null,limit:null,offset:null},url:function(){var n="/users/"+this.urlArgs.userID+"/co-authors?offset="+this.urlArgs.offset+"&limit="+this.urlArgs.limit;return Loop.Configuration.urls.ApiBaseUrl+n}});Loop.Core.EndpointRepository.addEndpoint({type:Loop.Core.Constants.EndpointType.PRIVATE,key:"BriefBio",urlArgs:{userID:null},url:function(){var n="/users/"+this.urlArgs.userID+"/briefbio";return Loop.Configuration.urls.ApiBaseUrl+n}});Loop.Core.EndpointRepository.addEndpoint({type:Loop.Core.Constants.EndpointType.PRIVATE,key:"Specialties",urlArgs:{userID:null},url:function(){var n="/users/"+this.urlArgs.userID+"/specialties";return Loop.Configuration.urls.ApiBaseUrl+n}});Loop.Core.EndpointRepository.addEndpoint({type:Loop.Core.Constants.EndpointType.PRIVATE,key:"Domains",url:function(){return Loop.Configuration.urls.ApiBaseUrl+"/info/domains"}});Loop.Core.EndpointRepository.addEndpoint({type:Loop.Core.Constants.EndpointType.PRIVATE,key:"FieldsByDomainId",urlArgs:{domainId:null},url:function(){var n="/info/fields?domainId="+this.urlArgs.domainId;return Loop.Configuration.urls.ApiBaseUrl+n}});Loop.Core.EndpointRepository.addEndpoint({type:Loop.Core.Constants.EndpointType.PRIVATE,key:"SpecialtiesByFieldId",urlArgs:{domainId:null,fieldId:null},url:function(){var n="/info/specialties?domainId="+this.urlArgs.domainId+"&fieldId="+this.urlArgs.fieldId;return Loop.Configuration.urls.ApiBaseUrl+n}});Loop.Core.EndpointRepository.addEndpoint({type:Loop.Core.Constants.EndpointType.PRIVATE,key:"GetOtherAuthoringNamesByUserId",urlArgs:{userID:null},url:function(){var n="/users/"+this.urlArgs.userID+"/authoringnames";return Loop.Configuration.urls.SecureApiBaseUrl+n}});Loop.Core.EndpointRepository.addEndpoint({type:Loop.Core.Constants.EndpointType.PRIVATE,key:"SaveAuthoringNames",urlArgs:{userID:null},url:function(){var n="/settings/"+this.urlArgs.userID+"/authoringnames";return Loop.Configuration.urls.SecureApiBaseUrl+n}});Loop.Core.EndpointRepository.addEndpoint({type:Loop.Core.Constants.EndpointType.PRIVATE,key:"NetworkingTotals",urlArgs:{userID:null},url:function(){var n="/users/"+this.urlArgs.userID+"/network-totals?totals=Network";return Loop.Configuration.urls.ApiBaseUrl+n}});Loop.Core.EndpointRepository.addEndpoint({type:Loop.Core.Constants.EndpointType.EXTERNAL_PRIVATE,key:"ResearchTopics",urlArgs:{userID:null,onlyEditorRole:!1},url:function(){var n="/users/"+this.urlArgs.userID+"/topics";return typeof this.urlArgs.onlyEditorRole=="boolean"&&(n+="?onlyEditorRole="+this.urlArgs.onlyEditorRole),Loop.Configuration.urls.ApiBaseUrl+n}});Loop.Core.EndpointRepository.addEndpoint({type:Loop.Core.Constants.EndpointType.PRIVATE,key:"ProfilePicture",urlArgs:{userID:null},url:function(){var n="/users/"+this.urlArgs.userID+"/profilepicture";return Loop.Configuration.urls.ApiBaseUrl+n}});Loop.Core.EndpointRepository.addEndpoint({type:Loop.Core.Constants.EndpointType.PRIVATE,key:"ProfilePictureBase64",urlArgs:{},url:function(){return Loop.Configuration.urls.ApiBaseUrl+"/profile/picturebase64"}});Loop.Core.EndpointRepository.addEndpoint({type:Loop.Core.Constants.EndpointType.PRIVATE,key:"HonorsAndAwards",urlArgs:{userID:null,awardID:null},url:function(){var n="/users/"+this.urlArgs.userID+"/honors-and-awards";return this.urlArgs.awardID&&(n+="/"+this.urlArgs.awardID),Loop.Configuration.urls.ApiBaseUrl+n}});Loop.Core.EndpointRepository.addEndpoint({type:Loop.Core.Constants.EndpointType.PRIVATE,key:"SocietyMembership",urlArgs:{userID:null,membershipId:null},url:function(){var n="/users/"+this.urlArgs.userID+"/societies";return this.urlArgs.membershipId&&(n+="/"+this.urlArgs.membershipId),Loop.Configuration.urls.ApiBaseUrl+n}});Loop.Core.EndpointRepository.addEndpoint({type:Loop.Core.Constants.EndpointType.PRIVATE,key:"EmailInvitation",urlArgs:{userID:null},url:function(){var n="/users/"+this.urlArgs.userID+"/email/invitation";return Loop.Configuration.urls.ApiBaseUrl+n}});Loop.Core.EndpointRepository.addEndpoint({type:Loop.Core.Constants.EndpointType.PRIVATE,key:"PublicationCounts",urlArgs:{userID:null},url:function(){var n="/users/"+this.urlArgs.userID+"/publications/totals";return Loop.Configuration.urls.ApiBaseUrl+n}});Loop.Core.EndpointRepository.addEndpoint({type:Loop.Core.Constants.EndpointType.PRIVATE,key:"Publications",urlArgs:{publicationType:null,userID:null,offset:null,limit:null,filterType:null,filterValue:null},url:function(){var n,t;switch(this.urlArgs.publicationType){case Loop.constants.publicationType.SUGGESTED:t="suggested";break;case Loop.constants.publicationType.REJECTED:t="rejected";break;case Loop.constants.publicationType.EDITED:t="edited";break;case Loop.constants.publicationType.REVIEWED:t="reviewed";break;default:t="confirmed"}n="/users/"+this.urlArgs.userID+"/publications/"+t+"?offset="+this.urlArgs.offset+"&limit="+this.urlArgs.limit;switch(this.urlArgs.filterType){case Loop.constants.publicationFilter.AUTHOR:n=n+"&author="+this.urlArgs.filterValue;break;case Loop.constants.publicationFilter.TITLE:n=n+"&title="+this.urlArgs.filterValue;break;case Loop.constants.publicationFilter.DOI:n=n+"&doi="+this.urlArgs.filterValue;break;case Loop.constants.publicationFilter.YEAR:n=n+"&year="+this.urlArgs.filterValue;break;case Loop.constants.publicationFilter.SEARCH:n=n+"&search="+this.urlArgs.filterValue}return Loop.Configuration.urls.ApiBaseUrl+n}});Loop.Core.EndpointRepository.addEndpoint({type:Loop.Core.Constants.EndpointType.PRIVATE,key:"ConfirmSuggestedPublication",urlArgs:{userID:null},url:function(){var n="/users/"+this.urlArgs.userID+"/publications/ConfirmSuggestedPublication";return Loop.Configuration.urls.ApiBaseUrl+n}});Loop.Core.EndpointRepository.addEndpoint({type:Loop.Core.Constants.EndpointType.PRIVATE,key:"ConfirmPublication",urlArgs:{userID:null,publicationID:null},url:function(){var n="/users/"+this.urlArgs.userID+"/publications/confirm/"+this.urlArgs.publicationID;return Loop.Configuration.urls.ApiBaseUrl+n}});Loop.Core.EndpointRepository.addEndpoint({type:Loop.Core.Constants.EndpointType.PRIVATE,key:"ConfirmedPublications",urlArgs:{userID:null},url:function(){var n="/users/"+this.urlArgs.userID+"/publications/confirmed";return Loop.Configuration.urls.ApiBaseUrl+n}});Loop.Core.EndpointRepository.addEndpoint({type:Loop.Core.Constants.EndpointType.PRIVATE,key:"RejectSuggestedPublication",urlArgs:{userID:null},url:function(){var n="/users/"+this.urlArgs.userID+"/publications/RejectSuggestedPublication";return Loop.Configuration.urls.ApiBaseUrl+n}});Loop.Core.EndpointRepository.addEndpoint({type:Loop.Core.Constants.EndpointType.PRIVATE,key:"RemovePublication",urlArgs:{userID:null,publicationID:null},url:function(){var n="/users/"+this.urlArgs.userID+"/publications/remove/"+this.urlArgs.publicationID;return Loop.Configuration.urls.ApiBaseUrl+n}});socialErrorCopies={CODE_403_TITLE:"Action not available",CODE_403_MESSAGE_INIT:"This person has a private profile and",CODE_412_7_TITLE:"Participant does not exist",CODE_412_11_TITLE:"Action not available",CODE_412_11_MESSAGE_INIT:"Blocked people cannot interact with each other. Please unblock this person",CODE_412_29_TITLE:"Public profile required",CODE_412_29_MESSAGE_INIT:"Actions for people with a private profile are limited. Please set your profile to public",CODE_412_32_TITLE:"Action not available",CODE_412_42_TITLE:"Action not available",CODE_412_44_TITLE:"Conversation already exists",CODE_412_45_TITLE:"Conversation not available",CODE_412_47_TITLE:"Conversation must be accepted",CODE_412_48_TITLE:"Conversation must be accepted"};Loop.Core.EndpointRepository.addEndpoint({type:Loop.Core.Constants.EndpointType.SOCIAL,key:"FollowUser",urlArgs:{loggedUserId:null,followUserId:null},url:function(){var i="/users/"+this.urlArgs.loggedUserId+"/following/"+this.urlArgs.followUserId,n=this.urlArgs.followUserId,r=this.urlArgs.loggedUserId,t="follow-user";return this.params={loggedUserId:r,followUserId:n,loginAction:function(){var i="/social/follow/"+n;window.location.replace(Loop.Core.Configuration.getLoginUri(i,t))},registerAction:function(){var i="/social/follow/"+n;window.location.replace(Loop.Core.Configuration.getRegisterUri(i,t))}},Loop.Configuration.urls.ApiBaseUrl+i},customErrorMessages:{"403":{errorCode:403,errorTitle:socialErrorCopies.CODE_403_TITLE,errorMessage:socialErrorCopies.CODE_403_MESSAGE_INIT+" their research activity cannot be followed."},"412_11":{errorCode:412,subErrorCode:11,errorTitle:socialErrorCopies.CODE_412_11_TITLE,errorMessage:socialErrorCopies.CODE_412_11_MESSAGE_INIT+" to follow their research activity."},"412_29":{errorCode:412,subErrorCode:29,errorTitle:socialErrorCopies.CODE_412_29_TITLE,errorMessage:socialErrorCopies.CODE_412_29_MESSAGE_INIT+" to follow this person's research activity."},"412_32":{errorCode:412,subErrorCode:29,errorTitle:socialErrorCopies.CODE_412_32_TITLE,errorMessage:"This person cannot be followed."}}});Loop.Core.EndpointRepository.addEndpoint({type:Loop.Core.Constants.EndpointType.SOCIAL,key:"UnfollowUser",urlArgs:{loggedUserId:null,followUserId:null},url:function(){var t="/users/"+this.urlArgs.loggedUserId+"/following/"+this.urlArgs.followUserId,n=this.urlArgs.followUserId,i=this.urlArgs.loggedUserId;return this.params={loggedUserId:i,followUserId:n,loginAction:function(){window.location.replace(Loop.Core.Configuration.getLoginUri("/people/"+n))},registerAction:function(){window.location.replace(Loop.Core.Configuration.getRegisterUri("/people/"+n))}},Loop.Configuration.urls.ApiBaseUrl+t},customErrorMessages:{"412_29":{errorCode:412,subErrorCode:29,errorTitle:socialErrorCopies.CODE_412_29_TITLE,errorMessage:socialErrorCopies.CODE_412_29_MESSAGE_INIT+" to unfollow this person's research activity."}}});Loop.Core.EndpointRepository.addEndpoint({type:Loop.Core.Constants.EndpointType.SOCIAL,key:"Comment",urlArgs:{},url:function(){return Loop.Configuration.urls.ApiBaseUrl+""},customErrorMessages:{"403":{errorCode:403,errorTitle:socialErrorCopies.CODE_403_TITLE,errorMessage:socialErrorCopies.CODE_403_MESSAGE_INIT+" their content cannot be commented on."},"412_11":{errorCode:412,subErrorCode:11,errorTitle:socialErrorCopies.CODE_412_11_TITLE,errorMessage:socialErrorCopies.CODE_412_11_MESSAGE_INIT+" to comment on their content."},"412_29":{errorCode:412,subErrorCode:29,errorTitle:socialErrorCopies.CODE_412_29_TITLE,errorMessage:socialErrorCopies.CODE_412_29_MESSAGE_INIT+" to comment on this content."},"412_32":{errorCode:412,subErrorCode:29,errorTitle:socialErrorCopies.CODE_412_32_TITLE,errorMessage:"This person's content cannot be commented on."}}});Loop.Core.EndpointRepository.addEndpoint({type:Loop.Core.Constants.EndpointType.SOCIAL,key:"Like",urlArgs:{},url:function(){return Loop.Configuration.urls.ApiBaseUrl+""},customErrorMessages:{"403":{errorCode:403,errorTitle:socialErrorCopies.CODE_403_TITLE,errorMessage:socialErrorCopies.CODE_403_MESSAGE_INIT+" their content cannot be liked."},"412_11":{errorCode:412,subErrorCode:11,errorTitle:socialErrorCopies.CODE_412_11_TITLE,errorMessage:socialErrorCopies.CODE_412_11_MESSAGE_INIT+" to like their content."},"412_29":{errorCode:412,subErrorCode:29,errorTitle:socialErrorCopies.CODE_412_29_TITLE,errorMessage:socialErrorCopies.CODE_412_29_MESSAGE_INIT+" to like their content."},"412_32":{errorCode:412,subErrorCode:29,errorTitle:socialErrorCopies.CODE_412_32_TITLE,errorMessage:"This person's content cannot be liked."}}});Loop.Core.EndpointRepository.addEndpoint({type:Loop.Core.Constants.EndpointType.SOCIAL,key:"Share",urlArgs:{},url:function(){return Loop.Configuration.urls.ApiBaseUrl+""},customErrorMessages:{"403":{errorCode:403,errorTitle:socialErrorCopies.CODE_403_TITLE,errorMessage:socialErrorCopies.CODE_403_MESSAGE_INIT+" their content cannot be shared."},"412_11":{errorCode:412,subErrorCode:11,errorTitle:socialErrorCopies.CODE_412_11_TITLE,errorMessage:socialErrorCopies.CODE_412_11_MESSAGE_INIT+" to share their content."},"412_29":{errorCode:412,subErrorCode:29,errorTitle:socialErrorCopies.CODE_412_29_TITLE,errorMessage:socialErrorCopies.CODE_412_29_MESSAGE_INIT+" to share their content."},"412_32":{errorCode:412,subErrorCode:29,errorTitle:socialErrorCopies.CODE_412_32_TITLE,errorMessage:"This person's content cannot be shared."}}});Loop.Core.EndpointRepository.addEndpoint({withCredentials:!0,type:Loop.Core.Constants.EndpointType.PUBLIC,key:"GetUserPercentile",urlArgs:{loggedUserId:null},url:function(){var n;return Loop.Configuration.features.UsePreviousImpactVersion?(n="/Impact/Loop/"+this.urlArgs.loggedUserId+"/Percentile",Loop.Configuration.urls.ImpactApiBaseUrl+n):(n="Authors/"+this.urlArgs.loggedUserId+"/Percentile",Loop.Configuration.urls.ImpactPublicApiBaseUrl+n)}});Loop.Core.EndpointRepository.addEndpoint({withCredentials:!0,type:Loop.Core.Constants.EndpointType.PUBLIC,key:"GetUserPercentileOverCoauthors",urlArgs:{loggedUserId:null},url:function(){var n="/Impact/Loop/"+this.urlArgs.loggedUserId+"/PercentileOverCoauthors";return Loop.Configuration.urls.ImpactApiBaseUrl+n}});Loop.Core.EndpointRepository.addEndpoint({withCredentials:!0,type:Loop.Core.Constants.EndpointType.EXTERNAL_PRIVATE,key:"ImpactData",urlArgs:{userID:null},url:function(){var n="Authors("+this.urlArgs.userID+")/ProfileOverview";return Loop.Configuration.features.UsePreviousImpactVersion?Loop.Configuration.urls.ImpactApiV2BaseUrl+"/"+n:Loop.Configuration.urls.ImpactPublicApiBaseUrl+n}});Loop.Core.EndpointRepository.addEndpoint({withCredentials:!0,type:Loop.Core.Constants.EndpointType.PUBLIC,key:"ImpactCitations",urlArgs:{loggedUserId:null},url:function(){var n="Authors("+this.urlArgs.loggedUserId+")/Impactmetrics('citations')";return Loop.Configuration.features.UsePreviousImpactVersion?Loop.Configuration.urls.ImpactApiV2BaseUrl+"/"+n:Loop.Configuration.urls.ImpactApiV3BaseUrl+n}});Loop.Core.EndpointRepository.addEndpoint({withCredentials:!0,type:Loop.Core.Constants.EndpointType.PUBLIC,key:"GetViewsImpactMetrics",urlArgs:{loggedUserId:null},url:function(){var n="Authors("+this.urlArgs.loggedUserId+")/ImpactMetrics('views')/";return Loop.Configuration.features.UsePreviousImpactVersion?Loop.Configuration.urls.ImpactApiV2BaseUrl+"/"+n:Loop.Configuration.urls.ImpactApiV3BaseUrl+n}});Loop.Core.EndpointRepository.addEndpoint({withCredentials:!0,type:Loop.Core.Constants.EndpointType.PUBLIC,key:"GetViewsImpactHistograms",urlArgs:{loggedUserId:null,provider:null,timeLapse:null},url:function(){var i="Authors("+this.urlArgs.loggedUserId+")/Histograms('views')/MonthElements",r=this.urlArgs.provider,u=this.urlArgs.timeLapse,t=[],n;if(r&&r!==null&&t.push("Provider eq '"+r+"'"),u&&u!==null){n=new Date;switch(this.urlArgs.timeLapse){case Loop.constants.chartTimeLapseType.SINCE_BEGINNING:n.setUTCMonth(n.getUTCMonth()+1);t.push("Date ge 2000-01-01 and Date lt "+n.getUTCFullYear()+"-"+("0"+n.getUTCMonth()).slice(-2)+"-01")}}return(t.length>0&&(i+="?$filter="+t.join(" and ")),Loop.Configuration.features.UsePreviousImpactVersion)?Loop.Configuration.urls.ImpactApiV2BaseUrl+"/"+i:Loop.Configuration.urls.ImpactApiV3BaseUrl+i}});Loop.Core.EndpointRepository.addEndpoint({withCredentials:!0,type:Loop.Core.Constants.EndpointType.PUBLIC,key:"GetDownloadsImpactMetrics",urlArgs:{loggedUserId:null},url:function(){var n="Authors("+this.urlArgs.loggedUserId+")/ImpactMetrics('downloads')/";return Loop.Configuration.features.UsePreviousImpactVersion?Loop.Configuration.urls.ImpactApiV2BaseUrl+"/"+n:Loop.Configuration.urls.ImpactApiV3BaseUrl+n}});Loop.Core.EndpointRepository.addEndpoint({withCredentials:!0,type:Loop.Core.Constants.EndpointType.PUBLIC,key:"GetDownloadsImpactHistograms",urlArgs:{loggedUserId:null,filter:null},url:function(){var i="Authors("+this.urlArgs.loggedUserId+")/Histograms('downloads')/MonthElements",r=this.urlArgs.provider,u=this.urlArgs.timeLapse,t=[],n;if(r&&r!==null&&t.push("Provider eq '"+r+"'"),u&&u!==null){n=new Date;switch(this.urlArgs.timeLapse){case Loop.constants.chartTimeLapseType.SINCE_BEGINNING:n.setUTCMonth(n.getUTCMonth()+1);t.push("Date ge 2000-01-01 and Date lt "+n.getUTCFullYear()+"-"+("0"+n.getUTCMonth()).slice(-2)+"-01")}}return(t.length>0&&(i+="?$filter="+t.join(" and ")),Loop.Configuration.features.UsePreviousImpactVersion)?Loop.Configuration.urls.ImpactApiV2BaseUrl+"/"+i:Loop.Configuration.urls.ImpactApiV3BaseUrl+i}});Loop.Core.EndpointRepository.addEndpoint({withCredentials:!0,type:Loop.Core.Constants.EndpointType.PUBLIC,key:"ImpactSummary",urlArgs:{userID:null},url:function(){var n="authors("+this.urlArgs.userID+")/impactsummary";return Loop.Configuration.features.UsePreviousImpactVersion?Loop.Configuration.urls.ImpactApiV2BaseUrl+"/"+n:Loop.Configuration.urls.ImpactApiV3BaseUrl+n}});Loop.Core.EndpointRepository.addEndpoint({type:Loop.Core.Constants.EndpointType.PRIVATE,key:"ImportPublicationsOrcid",urlArgs:{userID:null,restartUrl:null},url:function(){var n=Loop.Configuration.urls.LoopBaseUrl,t="/users/me/works?restartUrl="+n+"people/"+this.urlArgs.userID+"/publications/orcid?";return Loop.Configuration.urls.OrchisApiBaseUrl+t}});Loop.Core.EndpointRepository.addEndpoint({type:Loop.Core.Constants.EndpointType.PRIVATE,key:"OrcidPredigest",urlArgs:{userID:null},url:function(){var n="/v1/users/"+this.urlArgs.userID+"/orcid/check";return Loop.Configuration.urls.PublicationsUrl+n}});Loop.Core.EndpointRepository.addEndpoint({type:Loop.Core.Constants.EndpointType.PRIVATE,key:"OrcidDigestConfirmation",urlArgs:{userID:null},url:function(){var n="/v1/users/"+this.urlArgs.userID+"/orcid/import";return Loop.Configuration.urls.PublicationsUrl+n}});Loop.Core.EndpointRepository.addEndpoint({type:Loop.Core.Constants.EndpointType.PUBLIC,key:"UgaritElasticSuggestionV1",urlArgs:{query:null,limit:null},url:function(){var n="/ugarit/v1/organizations/elasticSuggestions?query="+this.urlArgs.query;return this.urlArgs.limit!==null&&(n+="&maxCount="+this.urlArgs.limit),Loop.Configuration.urls.OrganizationsApiBaseUrl+n}});Loop.Core.EndpointRepository.addEndpoint({withCredentials:!0,type:Loop.Core.Constants.EndpointType.PUBLIC,key:"UgaritCreateOrganizationBasic",url:function(){return Loop.Configuration.urls.OrganizationsApiBaseUrl+"/ugarit/v1/organizations/addBasic"}});Loop.Core.EndpointRepository.addEndpoint({withCredentials:!0,type:Loop.Core.Constants.EndpointType.PUBLIC,key:"UgaritCountries",url:function(){return Loop.Configuration.urls.OrganizationsApiBaseUrl+"/ugarit/v1/countries"}});Loop.Core.EndpointRepository.addEndpoint({withCredentials:!1,type:Loop.Core.Constants.EndpointType.PUBLIC,key:"CommonOrganizations",url:function(){return Loop.Configuration.urls.OrganizationsApiBaseUrl+"/ugarit/v1/commonOrganizations"}});Loop.Core.EndpointRepository.addEndpoint({type:Loop.Core.Constants.EndpointType.PUBLIC,key:"SocialProfiles",urlArgs:{userId:null},url:function(){var n="/users/"+this.urlArgs.userId+"/socialprofiles";return Loop.Configuration.urls.ApiBaseUrl+n}});Loop=window.Loop||{};Loop.GlobalEndpoints=function(){var n=new Loop.controls.endpointProxy("RelatedPeople",{visibleItems:5,endpointLimit:25}),t=new Loop.controls.endpointProxy("CoAuthors",{visibleItems:5,endpointLimit:25}),i=new Loop.controls.endpointProxy("PeopleAlsoLookedAt",{visibleItems:5,endpointLimit:20});return{relatedPeople:n,coAuthors:t,peopleAlsoLookedAt:i}}()