function getScriptConfiguration(){var n,t=currentScript,i="",r="";return t&&(n=$(t).attr("data-domain"),"undefined"!=typeof n&&(i=n),n=$(t).attr("data-loopDomain"),"undefined"!=typeof n&&(r=n)),{domain:i,loopDomain:r}}var currentScript,Loop;ko.bindingHandlers.fadeIf={init:function(n,t,i,r,u){var f=t();return $(n).toggle(ko.utils.unwrapObservable(f)),ko.bindingHandlers["if"].init(n,t,i,r,u)},update:function(n,t){var i=t();ko.utils.unwrapObservable(i)?$(n).slideDown(200).animate({opacity:"1"},200):$(n).animate({opacity:"0"},200).slideUp(200)}};ko.bindingHandlers.fadeVisible={init:function(n,t){var i=t();$(n).toggle(ko.utils.unwrapObservable(i))},update:function(n,t){var i=t();ko.utils.unwrapObservable(i)?$(n).slideDown(500,"easeInOutExpo").animate({opacity:"1"},500):$(n).animate({opacity:"0"},300).slideUp(500,"easeInOutExpo")}},function(n,t){var i=function(n,t,i){var r;return function(){function e(){i||n.apply(u,f);r=null}var u=this,f=arguments;r?clearTimeout(r):i&&n.apply(u,f);r=setTimeout(e,t||100)}};jQuery.fn[t]=function(n){return n?this.bind("resize",i(n)):this.trigger(t)}}(jQuery,"smartresize");Loop=Loop||{};Loop.Core=Loop.Core||{};Loop.Core.Configuration=function(){function n(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)}function r(n){var t,r=!1,u="",i="";return n=n||window.location.host,n&&(t=n.split(":"),t.length>1&&(n=t.slice(0,t.length-1).join(":"),u=t[t.length-1]),t=n.split("."),i=t.slice(-2).join("."),["com.au","net.au","org.au","edu.au","gov.au","net.za","co.uk","org.uk","ltd.uk","plc.uk","net.uk","sch.uk","ac.uk","gov.uk","com.fr","ac.jp","co.jp","ed.jp","go.jp","ne.jp","or.jp"].forEach(function(n){i===n&&(r=!0)}),r&&(i=t.slice(-3).join("."))),i}function e(n){n&&n.domain&&(u=t+("string"==typeof n.loopDomain&&n.loopDomain.length>0?n.loopDomain:"loop."+n.domain),i=t+"registration."+n.domain,f=t+"www."+n.domain,editorApplicationDomain=t+"editor-application."+n.domain)}function o(){Loop.Core.Configuration.loginPage=i+"/people/login";Loop.Core.Configuration.registerPage=i+"/people/register-user";Loop.Core.Configuration.UrlList.loopApi=u+"/api/v1";Loop.Core.Configuration.UrlList.frontiers=f;Loop.Core.Configuration.UrlList.editorApplication=editorApplicationDomain}function s(n){var t=window.location.host;n&&!n.domain&&t&&(n.domain=r(t));e(n);o()}var h="0.3.21237.0",t="//",u="loop.frontiersin.org",i="registration.frontiersin.org",f="www.frontiersin.org";return{init:s,getDomain:r,version:function(){return h},generateUUID:function(){return n()+n()+"-"+n()+"-"+n()+"-"+n()+"-"+n()+n()+n()},loginPage:null,registerPage:null,currentUserId:null,loggedUserId:null,isUserLogged:function(){return isNaN(this.loggedUserId)===!1&&parseInt(this.loggedUserId,10)>=0},getLoginUri:function(n,t){var i=window.location.protocol+"//"+window.location.host,r=this.loginPage;return t=t?"actionReferral="+t+"&":"",n=n?n:window.location,n="returnUrl="+encodeURI(i+n),r+"?"+t+n},getRegisterUri:function(n,t){var i=window.location.protocol+"//"+window.location.host,r=this.registerPage;return t=t?"actionReferral="+t+"&":"",n=n?n:window.location,n="returnUrl="+encodeURI(i+n),r+"?"+t+n},UrlList:{frontiers:null,loopApi:null,getLoopProfilePage:function(n){var t=this.getAbsoluteUrl("frontiers","/people/{0}/overview");return t=t.replace("www","loop"),Loop.Core.Utils.stringFormat(t,n)},getDefaultProfilePicture:function(){var n=this.getAbsoluteUrl("frontiers","/cdn/images/profile/default_240.jpg");return n.replace("www","loop")},getProfilePicture:function(n){var t=this.getAbsoluteUrl("frontiers","/images/profile/{0}/203");return t=t.replace("www","loop"),Loop.Core.Utils.stringFormat(t,n)},getAbsoluteUrl:function(n,t){var i=$.trim(this[n]);if(t=$.trim(t),!i)throw new Error("The 'Loop.Core.Configuration.UrlList."+n+"' property is undefined.");if("function"==typeof i)throw new Error("The 'Loop.Core.Configuration.UrlList."+n+"' is a function.");return"/"===i[i.length-1]&&(i=i.substring(0,i.length-1)),"/"===t[0]&&(t=t.substring(1)),i+"/"+t}}}}();Loop.Core.Utils=function(){function n(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)}function t(){return'<script type="text/html" id="multipleAuthorsTemplate">    <ul class="people-list" data-bind="foreach: $data.authorList, css: {\'one-line\': $data.extendDataOnDialog === false}">        <li>            <div class="image-container">                <img alt="author image" class="img-responsive" data-bind="customImg: { src: pictureUrl }" />            <\/div>            <div class="data-container">                <div class="name"><a data-bind="text: name, attr: { href: profileUrl }"><\/a><\/div>                <div class="cb"><\/div>                <ul class="list-hrz">                    <!-- ko if: affiliation -->                    <li data-bind="text: affiliation"><\/li>                    <!-- /ko -->                    <li data-bind="text: location"><\/li>                <\/ul>            <\/div>            <div class="cb"><\/div>        <\/li>    <\/ul><\/script>'}function i(){return'<script type="text/html" id="authorsListTemplate">    <ul class="people-list-hrz" data-test-id="author-list">        <!-- ko foreach: $data.visibleAuthorList -->        <li>            <!-- ko if: ($data.profileUrl || $data.clickAction) && $parent.enableLinks -->            <a data-bind="attr: { href: $data.profileUrl }, click: $data.clickAction" data-test-id="author-name">                <span class="img-frame" data-bind="visible: $data.showImageInList"><img data-bind="attr: {src: $data.imageUrl}, visible: $data.showImageInList"                     data-test-id="author-image"                     onerror="this.src=Loop.Core.Configuration.UrlList.getDefaultProfilePicture();" /><\/span>                <span class="name" data-bind="text: $data.fullName"><\/span>            <\/a>            <!-- /ko -->            <!-- ko ifnot: ($data.profileUrl || $data.clickAction) && $parent.enableLinks -->            <span data-test-id="author-profile-link-empty">                <span class="img-frame" data-bind="visible: $data.showImageInList"><img data-bind="attr: {src: $data.imageUrl}, visible: $data.showImageInList"                     data-test-id="author-image"                     onerror="this.src=Loop.Core.Configuration.UrlList.getDefaultProfilePicture();" /><\/span>                <span class="name" data-bind="text: $data.fullName" data-test-id="author-name"><\/span>            <\/span>            <!-- /ko -->        <\/li>        <!-- /ko -->                <!-- ko if: $data.lastAuthor -->        <li>            <!-- ko if: $data.enableLinks -->               <a data-bind="click: $data.showMoreAction" class="more" data-test-id="author-list-more">                   <span data-bind="text: $data.showMoreCounter() + \' more\'"><\/span>               <\/a>            <!-- /ko -->            <!-- ko ifnot: $data.enableLinks -->               <span data-bind="text: $data.showMoreCounter() + \' more\'"><\/span>            <!-- /ko -->        <\/li>        <li>            <!-- ko if: ($data.lastAuthor().profileUrl || $data.lastAuthor().clickAction) && $data.enableLinks -->            <a data-bind="attr: {href: $data.lastAuthor().profileUrl }, click: $data.lastAuthor().clickAction" data-test-id="last-author-name">                <span class="img-frame" data-bind="visible: $data.lastAuthor().showImageInList"><img data-bind="attr: {src: $data.lastAuthor().imageUrl}, visible: $data.lastAuthor().showImageInList"                     data-test-id="last-author-image"                     onerror="this.src=Loop.Core.Configuration.UrlList.getDefaultProfilePicture();" /><\/span>                <span data-bind="text: $data.lastAuthor().fullName"><\/span>            <\/a>            <!-- /ko -->            <!-- ko ifnot: ($data.lastAuthor().profileUrl || $data.lastAuthor().clickAction) && $data.enableLinks -->            <span data-test-id="author-profile-link-empty">                <span class="img-frame" data-bind="visible: $data.lastAuthor().showImageInList"><img data-bind="attr: {src: $data.lastAuthor().imageUrl}, visible: $data.lastAuthor().showImageInList"                     data-test-id="author-image"                     onerror="this.src=Loop.Core.Configuration.UrlList.getDefaultProfilePicture();" /><\/span>                <span data-bind="text: $data.lastAuthor().fullName" data-test-id="last-author-name"><\/span>            <\/span>            <!-- /ko -->        <\/li>        <!-- /ko -->    <\/ul>    <div class="cb"><\/div><\/script><script type="text/html" id="authorsListDetailedTemplate">    <ul class="people-list" data-bind="foreach: $data.fullInfoAuthorList, css: {\'one-line\': $data.extendDataOnDialog === false}">        <li>            <div class="image-container">                <!-- ko if: profileUrl-->                <a data-bind="attr: { href: profileUrl }" href="" data-test-id="author-image-link">                    <span class="img-frame"><img data-bind="attr: { src: imageUrl, alt: fullName }" alt="" class="img-responsive"                         data-test-id="author-image"                         onerror="this.src=Loop.Core.Configuration.UrlList.getDefaultProfilePicture();" /><\/span>                <\/a>                <!-- /ko-->                <!-- ko ifnot: profileUrl-->                <a style="pointer-events: none;" data-test-id="author-profile-link-empty">                    <span class="img-frame"><img data-bind="attr: { src: imageUrl, alt: fullName }" alt="" class="img-responsive"                         data-test-id="author-image"                         onerror="this.src=Loop.Core.Configuration.UrlList.getDefaultProfilePicture();" /><\/span>                <\/a>                <!-- /ko-->            <\/div>            <div class="data-container">                <div class="name">                    <!-- ko if: profileUrl-->                    <a data-bind="text: fullName, attr: { href: profileUrl }" href="" data-test-id="author-name"><\/a>                    <!-- /ko-->                    <!-- ko ifnot: profileUrl-->                    <span data-bind="text: fullName" data-test-id="author-name"><\/span>                    <!-- /ko-->                <\/div>                <div class="cb"><\/div>                <ul class="list-hrz">                    <li data-bind="text: affiliation" data-test-id="author-affiliation">Affiliation<\/li>                    <li data-bind="text: location" data-test-id="author-location">Location<\/li>                <\/ul>            <\/div>            <div class="cb"><\/div>        <\/li>    <\/ul><\/script>'}function r(){return'<script type="text/html" id="message-bar-template"><div data-bind="fadeVisible: visible, attr: { \'class\': \'alert \' + getCssClass() , \'data-test-id\': dataTestId}" role="alert"><p data-bind="html: htmlMessage, css: { \'icon\': showIcon() === true }"><\/p><!-- ko if: showCloseButton() === true--><i class="close" data-bind="click: close"><\/i><!-- /ko --><\/div><\/script>'}function u(){var n="";return n+='<script type="text/html" id="button">',n+="    <!-- ko template: { name: viewName } -->",n+="    <!-- /ko -->",n+="<\/script>",n+='<script type="text/html" id="defaultButton">',n+="    <button type=\"button\" data-bind=\"attr: { 'data-test-id': 'btn-' + buttonText, 'class': className, 'data-track': dataTrack }, css: { 'btn-saving': isWorking(), 'disabled': (isWorking() || disabled()) }, click: clickAction, enable: (!isWorking() && !disabled())\">",n+="        <span data-bind=\"html: buttonText, attr: { 'data-track': dataTrack }, css: { 'disabled-click': (isWorking() || disabled()) }\"><\/span>",n+="    <\/button>",n+="<\/script>",n+='<script type="text/html" id="cancelButton">',n+='    <button class="btn-cancel" type="button" data-test-id="cancelButton" data-dismiss="modal"',n+="            data-bind=\"click: clickAction, enable: !isWorking(), css: { 'disabled': isWorking() }, attr: { 'data-track': dataTrack }\">",n+="        <span data-bind=\"html: buttonText, attr: { 'data-track': dataTrack }, css: { 'disabled-click': (isWorking() || disabled()) }\"><\/span>",n+="    <\/button>",n+="<\/script>",n+='<script type="text/html" id="confirmButton">',n+='    <button class="btn-save" type="button" data-test-id="confirmButton"',n+="            data-bind=\"click: clickAction, css: {'btn-saving': isWorking(), 'disabled': disabled() }, enable: !isWorking() && !disabled(), attr: { 'data-track': dataTrack }\">",n+="        <span data-bind=\"html: buttonText, attr: { 'data-track': dataTrack }, css: { 'disabled-click': (isWorking() || disabled()) }\"><\/span>",n+="    <\/button>",n+"<\/script>"}function f(){return'<script type="text/html" id="loopMD">    <div class="modal fade" data-bind="attr:{id: id}" role="dialog" aria-hidden="true">        <div class="modal-dialog" data-test-id="actual-dialog">            <div class="modal-content">                <div class="modal-header">                    <button type="button" class="close" data-dismiss="modal"                            data-bind="visible: !hideCloseButton() || error(), click: close">                        <span aria-hidden="true">&times;<\/span><span class="sr-only" data-test-id="closeModalDialogButton"><\/span>                    <\/button>                    <h4 class="modal-title" data-bind="text: title" data-test-id="modal-title"><\/h4>                <\/div>                <div class="spinner" data-bind="fadeIf: isLoading()"><\/div>                <div class="modal-body" data-bind="fadeIf: !error() && isLoaded()">                    <!-- ko template : { name: viewModelTemplate, data: viewModelData } -->                    <!-- /ko -->                <\/div>                <div class="error-module" data-bind="fadeIf: error()">                    <p data-bind="html: error"><\/p>                <\/div>                <div class="modal-footer" style="text-align: center" data-bind="visible: !isLoading()">                    <div data-bind="fadeIf: !error() && isLoaded()">                        <div data-bind="template: { name: \'button\', foreach: buttons }"><\/div>                        <div class="cb"><\/div>                    <\/div>                    <div data-bind="fadeIf: actionButtonError() !== \'\' && actionButtonError() !== null" class="form-validator-warning">                       <span id="exp-ui-msg" data-bind="text: actionButtonError"><\/span>                    <\/div>                <\/div>            <\/div>        <\/div>    <\/div><\/script><script type="text/html" id="loopLoginOrRegisterMD">    <div class="modal fade" data-bind="attr:{id: id}" aria-hidden="true">        <div class="modal-dialog">            <div class="modal-content">                <div class="modal-header">                    <button type="button" class="close" data-dismiss="modal"                            data-bind="visible: !hideCloseButton() || error, click: close">                        <span aria-hidden="true">&times;<\/span><span class="sr-only" data-test-id="closeModalDialogButton"><\/span>                    <\/button>                    <h1 class="modal-title" data-bind="html: title" data-test-id="modal-title"><\/h1>                <\/div>                <div class="modal-body">                    <!-- ko template : { name: viewModelTemplate, data: viewModelData } -->                    <!-- /ko -->                    <div class="divider"><\/div>                <\/div>                <div class="modal-footer">                    <div class="button-container" data-bind="template: { name: \'button\', foreach: buttons }"><\/div>                    <div class="cb"><\/div>                <\/div>            <\/div>        <\/div>    <\/div><\/script><script type="text/html" id="loopSimpleMD">    <div data-bind="html: htmlString"><\/div><\/script>'}function e(){$("body").append(f());$("body").append(u());$("body").append(r());$("body").append(i());$("body").append(t())}return $(document).ready(function(){e()}),{generateUUID:function(){return n()+n()+"-"+n()+"-"+n()+"-"+n()+"-"+n()+n()+n()},stringFormat:function(n){var t=Array.prototype.slice.call(arguments,1);return n.replace(/{(\d+)}/g,function(n,i){return"undefined"!=typeof t[i]?t[i]:n})},scrollToElement:function(n,t){var i,r=null,u=!1;r="string"==typeof n?$("#"+n):n;void 0!==t?i="string"==typeof t?$("#"+t):t:(i=$("body"),u=!0);r&&r.offset()&&!i.is(":animated")&&($(window).bind("mousewheel",function(){i.stop()}),r.velocity("scroll",{duration:700,easing:"ease-in-out",container:u?void 0:i,complete:function(){$(window).unbind("mousewheel")}}))}}}();Loop.Core.Browser=function(){function s(){var r,t,u,i=navigator.userAgent;if(o)n.name="MSIE",n.version=11;else{if(t=i.match(/(opera|chrome|safari|firefox|msie|trident(?=\/))\/?\s*(\d+)/i)||[],/trident/i.test(t[1]))return r=/\brv[ :]+(\d+)/g.exec(i)||[],"IE "+(r[1]||"");if("Chrome"===t[1]&&(r=i.match(/\bOPR\/(\d+)/),null!==r))return"Opera "+r[1];t=t[2]?[t[1],t[2]]:[navigator.appName,navigator.appVersion,"-?"];null!==(r=i.match(/version\/(\d+)/i))&&t.splice(1,1,r[1]);n.name=t[0];n.version=parseInt(t[1],10)}u=navigator.userAgent.match(/Mobile/);n.isMobile=u?u.length>0:!1;n.isMobile===!0?(i=i.toLowerCase(),n.isIpad=i.indexOf("ipad")>-1,n.isIphone=i.indexOf("iphone")>-1):(n.isIpad=!1,n.isIphone=!1)}function i(i,r,u){for(var e=null,f=0;f<t.length;f++)if(t[f].name===i){e=t[f];break}if(null!==e)throw new Error(Loop.Core.Utils.stringFormat("The browser '{0}' with version {1} is already added.",e.name,e.version));"function"!=typeof u&&(u=function(){return"number"==typeof n.version?n.version>=this.minVersion:!1});t.push({name:i,minVersion:r,isSupportedVersion:u,toString:function(){return this.name+" "+this.minVersion}})}var t=[],n={name:null,version:null,isMobile:null,isIpad:null,isIphone:null,toString:function(){return this.name+" "+this.version}},h=!!window.opera||navigator.userAgent.indexOf(" OPR/")>=0,r="undefined"!=typeof InstallTrigger,u=Object.prototype.toString.call(window.HTMLElement).indexOf("Constructor")>0,f=!!window.chrome&&!h,e=!1||!!document.documentMode,o=!!navigator.userAgent.match(/Trident.*rv[ :]*11\./);return i("Chrome",40,function(){return f?"number"==typeof n.version?n.version>=this.minVersion:!1:!1}),i("Firefox",35,function(){return r?"number"==typeof n.version?n.version>=this.minVersion:!1:!1}),i("IE",11,function(){return e?"number"==typeof n.version?n.version>=this.minVersion:!1:!1}),i("Safari",8,function(){return u?"number"==typeof n.version?n.version>=this.minVersion:!1:!1}),s(),{addSupportedBrowser:i,getCurrentNavigator:function(){return n},getDefaultSupportedBrowsers:function(){return t},isSupportedBrowser:function(){return(r||u||f||e||o)&&!n.isMobile},isSupportedBrowserVersion:function(){var n=!1;return $.each(t,function(t,i){if(i.isSupportedVersion())return(n=!0,void 0)}),n}}}();Loop.Core.Tracking=function(){function o(){if(null===t)throw new Error("Endpoint cannot be null.");if("number"!=typeof t.type)throw new Error("Missing 'type' property in endpoint object.");if("function"!=typeof t.url)throw new Error("Missing 'url' function in endpoint object.");}function f(t){if(!i)throw new Error("Loop.Core.Tracking.eventType must be defined.");("undefined"==typeof n.userId||null===n.userId)&&(n.userId=Loop.Core.Configuration.currentUserId);("undefined"==typeof n.loggedUserId||null===n.loggedUserId)&&(n.loggedUserId=Loop.Core.Configuration.loggedUserId);var u=$(t).attr("data-track-referral"),f={eventType:i,action:$(t).attr("data-track"),actionReferral:u?u:""},r=jQuery.extend(!0,{},n,f);return r.userId<0&&(r.userId=0),r.loggedUserId<0&&(r.loggedUserId=0),r}function r(n){var e,s,r,i=n.target,h=!0;u&&(r="Click -> OnTrackEvent(). Node: ",r+=i.nodeName,i.id&&(r+=" Id: "+i.id),console.log(r));$(i).data("track")&&(u&&console.log("The element has a data-track attribute."),"function"==typeof Loop.Core.Tracking.canTrackThisElement&&(h=Loop.Core.Tracking.canTrackThisElement(i)),h?(o(),e=f(i),"function"==typeof Loop.Core.Tracking.setTrackInfo&&(s=Loop.Core.Tracking.setTrackInfo(i),$.extend(e,s)),Loop.Core.Ajax.createData({endpoint:t,inputData:JSON.stringify(e),successCallback:function(){},errorCallback:function(){},preventModalOnError:!0,loginRequired:!1})):u&&console.log("canTrackElement is false."))}function s(){window.addEventListener?window.addEventListener("click",r,!0):window.attachEvent("click",r)}function h(){window.removeEventListener?window.removeEventListener("click",r,!0):window.detachEvent("click",r)}var e=!1,t=null,i=null,n={eventType:i,action:"",actionReferral:"",page:window.location.pathname,host:window.location.hostname,userId:Loop.Core.Configuration.currentUserId,loggedUserId:Loop.Core.Configuration.loggedUserId},u=!1;return{eventType:function(n){return"string"==typeof n&&(i=n),i},enabled:function(n,t){return"boolean"==typeof n&&(n?s():h(),e=n),Loop.Core.Tracking.eventType(t),e},endpoint:function(n){return n&&(t=n),t},defaultTrackItem:n,setTrackInfo:null,canTrackThisAction:!0,getFakeTrackItem:function(n){var t,i=f(n);return"function"==typeof Loop.Core.Tracking.setTrackInfo&&(t=Loop.Core.Tracking.setTrackInfo(n),$.extend(i,t)),i},setVerbose:function(n){u=n}}}();Loop.Core=Loop.Core||{},function(){var n=function(){var n,t,f,i="trapScroll-enabled",e=".trapScroll",r=".trapScroll-container",o=null,u=null;o=function(r){if($("body").hasClass(i))if($(r.target).closest(n).length>0){var u=n.scrollTop(),o=r.originalEvent,e=o.deltaY;if(e>0&&u>=f||0>e&&0>=u)return!1}else if($(r.target).closest(t).length>0)return!1};u=function(){if(n=t.find(e+":first"),n&&n[0]){var r=n.outerHeight(),u=n[0].scrollHeight;f=u-r;$("body").addClass(i)}};$(document).on("wheel",o);Loop.Core.trapScroll=function(n,f){n&&(f||(f=n),f.addClass(r.substr(1)),n.addClass(e.substr(1)),f.on("mouseleave",function(){$("body").removeClass(i);t=$(this);t.parents(r).length>0&&(t=t.parents(r+":first"),u())}).on("mouseenter",function(n){t=$(this);u();n.stopPropagation()}))}};n()}();Loop.Core.Literals={errors:{defaultRead:{title:"",message:"Sorry, something went wrong and this content could not be loaded. Please refresh the page and try again."},defaultEdit:{title:"",message:"Sorry, something went wrong and your changes could not be saved. Please try again."},unauthorized:{title:"Authentication required",message:"Your session has expired. Please login to continue."},forbidden:{title:"Authorization required",message:"You are not allowed to perform this action. Please refresh the page and try again."},resourceNotFoundRead:{title:"Resource not found",message:"This resource is temporarily unavailable. Please refresh the page and try again."},resourceNotFoundEdit:{title:"Resource not found",message:"The resource you’re editing is temporarily unavailable. Please refresh the page and try again."},itemNotFoundEdit:{title:"Resource not found",message:"The resource you’re editing is temporarily unavailable."},genericLoadingErrorInModal:{title:"",message:"Sorry, something went wrong and this content could not be loaded. Please refresh the page and try again."}},modals:{loginOrRegister:{title:"Stay in the <span>Loop<\/span><br>&amp; up-to-date",message:"<h4>Loop maximizes the impact of researchers and their discoveries. Join the world's leading researchers and academics and become discoverable.<\/h4>"},unauthorized:{title:"Authentication required",message:"Your session has expired. Please login to continue."},forbidden:{title:"Forbidden",message:'Please set your profile to public in the <a href="/settings/privacy">settings<\/a> page so you will be able to perform this action.'},resourceNotFound:{title:"Resource not found",message:"The resource you’re editing is temporarily unavailable. Please refresh the page and try again."},itemNotFound:{title:"Resource not found",message:"The resource you’re editing is temporarily unavailable."}}};Loop.Core.Constants=Loop.Core.Constants||{};Loop.Core.Constants.EndpointType={PRIVATE:0,PUBLIC:1,SOCIAL:2};Loop.Core.Constants.ModalType={DEFAULT:0,LOGIN_OR_REGISTER:1};Loop.Core.Constants.ButtonTypes={DEFAULT:"default",CONFIRM:"confirm",CANCEL:"cancel",BLOCK:"block",UNBLOCK:"unblock"};Loop.Core.Constants.FloatPosition={NONE:"none",LEFT:"left",RIGHT:"right"};Loop.Core.Constants.MessageBarTypes={ERROR:0,SUCCESS:1,INFO:2,WARNING:3,PRIVATE:4};Loop.Core.Constants.Breakpoints={EXTRA_SMALL:"xs",SMALL:"sm",MEDIUM:"md",LARGE:"lg"};Loop.Core.Constants.PaginationMode={NONE:0,SCROLL_DOCUMENT:1,SCROLL_ELEMENT:2,SHOW_MORE:3,POOL:4,NUMBER:5};Loop.Core.Enum=Loop.Core.Enum||{};Loop.Core.Enum.APIActions=function(){return{Read:0,Create:1,Update:2,Delete:3,GetName:function(n){var t;switch(n){case Loop.Core.Enum.APIActions.Read:t="READ";break;case Loop.Core.Enum.APIActions.Create:t="CREATE";break;case Loop.Core.Enum.APIActions.Update:t="UPDATE";break;case Loop.Core.Enum.APIActions.Delete:t="DELETE"}return t}}}();Loop.Core.Constants.Events={},function(n,t){var i=n({});t.subscribe=function(t,r,u){return n.isArray(t)||(t=[t]),n.each(t,function(n,t){u?setTimeout(function(){i.on(t,function(){setTimeout(r,u)})}):i.on(t,r)}),!0};t.unsubscribe=function(n,t){return i.off(n,t),void 0};t.publish=function(n,t){i.trigger(n,t)}}(jQuery,window.Loop.Core=window.Loop.Core||{});Loop.Core.Controls=Loop.Core.Controls||{};Loop.Core.Controls.Pager=function(n){function o(){var i=jQuery.extend(!0,{},e,n);t.paginationMode=i.paginationMode;t.pageSize(i.pageSize);t.currentPage(i.currentPage);t.total(i.totalElements);t.customArgs=i.customArgs;t.onPagination=i.onPagination}function r(n){"function"==typeof t.onPagination?(f("paging"),t.pagingFinish=$.Deferred(),t.pagingFinish.promise(),t.onPagination(t),$.when(t.pagingFinish).then(function(){f("none");u=!0;t.paginationMode===Loop.Core.Constants.PaginationMode.NUMBER?s(t.total(),t.pageSize()):n===!0?t.currentPage(t.currentPage()+1):n===!1&&t.currentPage(t.currentPage()-1)},function(){f("none");u=!0})):console.warn("next function needs a handler for options.onPagination event. Pass it into the constractor.")}function s(n,i){var u,f=parseInt(n/i);for(0!=n%i&&(f+=1),t.totalPages(f),t.pages([]),u=0;f>u;u++)t.pages.push({index:u,isCurrent:u==t.currentPage(),goTo:function(){t.currentPage(this.index);r()}})}var t=this,i=!1,u=!1,f=ko.observable("none"),e={pageSize:100,currentPage:0,totalElements:0,paginationMode:Loop.Core.Constants.PaginationMode.NONE,customArgs:null,onPagination:null};t.pagingFinish=$.Deferred();t.pagingFinish.promise();t.paginationMode=null;t.disabled=!1;t.pageSize=ko.observable(e.pageSize);t.currentPage=ko.observable(0);t.pages=ko.observableArray([]);t.totalPages=ko.observable(0);t.total=ko.observable(0);t.customArgs=null;t.onPagination=null;t.getOffset=function(){return t.pageSize()*t.currentPage()};t.next=function(){if(i&&!u)throw new Error("pagingFinish deferred was not resolved nor rejected.");t.isEndOfPagination()!==!1&&i!==!1||t.isPaging()!==!1||(t.paginationMode===Loop.Core.Constants.PaginationMode.NUMBER&&t.currentPage(t.currentPage()+1),r(!0),i=!0)};t.previous=function(){if(i&&!u)throw new Error("pagingFinish deferred was not resolved nor rejected.");t.currentPage()>0&&t.isPaging()===!1&&(t.paginationMode===Loop.Core.Constants.PaginationMode.NUMBER&&t.currentPage(t.currentPage()-1),r(!1),i=!0)};t.loadPage=function(n){t.currentPage(n);r()};t.isPaging=ko.computed(function(){return"paging"===f()});t.isEndOfPagination=ko.computed(function(){if(t.paginationMode===Loop.Core.Constants.PaginationMode.NUMBER)return t.pages().length-1<=t.currentPage();var n=t.currentPage()*t.pageSize();return n>=t.total()});t.allowPagination=ko.computed(function(){return!t.isPaging()&&!t.isEndOfPagination()&&!t.disabled});o()};Loop.Core.Controls=Loop.Core.Controls||{};Loop.Core.Controls.Button=function(n){function u(){switch(r){case Loop.Core.Constants.ButtonTypes.CONFIRM:i="confirmButton";t=t||"btn-save";break;case Loop.Core.Constants.ButtonTypes.CANCEL:i="cancelButton";t=t||"btn-cancel";break;case Loop.Core.Constants.ButtonTypes.BLOCK:i="defaultButton";t=t||"btn-block";break;case Loop.Core.Constants.ButtonTypes.UNBLOCK:i="defaultButton";t=t||"btn-confirm";break;case Loop.Core.Constants.ButtonTypes.DEFAULT:i="defaultButton";t=t||"btn"}switch(o){case Loop.Core.Constants.FloatPosition.LEFT:t+=" pull-left";break;case Loop.Core.Constants.FloatPosition.RIGHT:t+=" pull-right"}}var r=n.buttonType||Loop.Core.Constants.ButtonTypes.DEFAULT,f=n.buttonText,i="",e=n.clickAction,o=n.floatPosition,s=n.isDefault||!1,h=n.isWorking||ko.observable(!1),t=n.buttonClass,c=n.dataTrack||null,l=n.isDisabled||ko.observable(!1),a=n.trackingData;return u(),{viewName:i,buttonType:r,buttonText:f,clickAction:e,isDefault:s,isWorking:h,disabled:l,className:t,dataTrack:c,trackingData:a}};Loop.Core.Controls=Loop.Core.Controls||{};Loop.Core.Controls.ModalDialog=function(n,t,i,r,u,f,e,o){function l(){return s.modalType===Loop.Core.Constants.ModalType.LOGIN_OR_REGISTER?"loopLoginOrRegisterMD":(s.modalType=Loop.Core.Constants.ModalType.DEFAULT,"loopMD")}function a(){return $.extend({backdrop:"static",keyboard:!1,show:!1},o||{})}function v(){var n=$($("#"+c).html().trim()).modal(a());return n.on("hide.bs.modal",function(){s.currentlyModalOnScreen=!1}),n.on("hidden.bs.modal",function(){f===!0&&n.remove()}),n}function y(){c=l();null===s.viewModelTemplate&&"string"==typeof s.viewModelData&&(s.viewModelData={htmlString:s.viewModelData},s.viewModelTemplate=p);s.dialog=v();ko.applyBindings(s,s.dialog[0])}f="boolean"==typeof f?f:!0;u="boolean"==typeof u?u:!1;var s=this,c=null,p="loopSimpleMD",h=ko.observable("none");s.dialogGUID=Loop.Core.Utils.generateUUID();s.dialog=null;s.currentlyModalOnScreen=!1;s.id=n;s.title=ko.observable(t);s.modalType=e;s.viewModelTemplate=null;s.viewModelData=i;s.buttons=r;s.error=ko.observable(!1);s.actionButtonError=ko.observable("");s.hideCloseButton=ko.observable(u);s.onDestroy=null;s.onClose=null;s.isLoading=ko.computed(function(){return"loading"===h()});s.isLoaded=ko.computed(function(){return"loaded"===h()});s.setDataStatus=function(n){n="boolean"==typeof n?n:!0;h(n?"loaded":"loading")};s.show=function(n){return s.setDataStatus(n),null===s.dialog&&y(),s.currentlyModalOnScreen||(s.dialog.modal("show"),s.currentlyModalOnScreen=!0,document.activeElement&&"function"==typeof document.activeElement.blur&&document.activeElement.blur()),s};s.close=function(){if(s.dialog.modal("hide"),s.currentlyModalOnScreen=!1,s.buttons&&s.buttons.length>0){var n=s.buttons.filter(function(n){return n.isDefault});n.length>0?n[0].clickAction():n.length>1&&(n[0].clickAction(),console.warn("The current dialog (id='"+s.id+"') has more than one default buttons. The first button action has been triggered."))}return"function"==typeof s.onClose&&s.onClose(s),s};s.toggle=function(){return s.dialog.modal("toggle"),s};s.destroy=function(){if(s)return(s.currentlyModalOnScreen&&s.dialog.modal("hide"),"function"==typeof s.onDestroy&&s.onDestroy(s),s.currentlyModalOnScreen=!1,s=null)}};Loop.Core.Modals=function(){function t(n){return"<p>"+n+"<\/p>"}function e(){for(;n.length;){var t=n.pop();t.destroy()}}function f(t){for(var i=0;i<n.length;i++)if(n[i]===t){n.splice(i,1);break}}function u(){var t=$.grep(n,function(n){return n.currentlyModalOnScreen===!0});if(t.length>0)return t[0]}function r(){return u()}function i(t,i,u,e,o){var s,h,c;return s=new Loop.Core.Controls.ModalDialog(t,i,u),c=function(){"function"==typeof e&&e();s.destroy()},h=new Loop.Core.Controls.Button({buttonType:Loop.Core.Constants.ButtonTypes.CONFIRM,buttonText:"OK",floatPosition:Loop.Core.Constants.FloatPosition.RIGHT,clickAction:c,isDefault:!0}),s.hideCloseButton(o),s.buttons=[h],s.onDestroy=f,r()||s.show(),n.push(s),s}function o(i){var u,s,h,e=[],o=[];if(!i)throw new Error("Method expects parameters.");if(i.id||e.push("id"),i.title||e.push("title"),i.message||e.push("message"),i.confirmAction||e.push("confirmAction"),i.cancelAction||e.push("cancelAction"),e.length>0)throw new Error("Missing required fields: "+e.join(","));if("string"!=typeof i.id&&o.push("id"),"string"!=typeof i.title&&o.push("title"),"string"!=typeof i.message&&o.push("message"),"function"!=typeof i.confirmAction&&o.push("confirmAction"),"function"!=typeof i.cancelAction&&o.push("cancelAction"),o.length>0)throw new Error("Wrong field types: "+o.join(","));return u=new Loop.Core.Controls.ModalDialog(i.id,i.title,t(i.message)),s=new Loop.Core.Controls.Button({buttonType:Loop.Core.Constants.ButtonTypes.CONFIRM,buttonText:i.confirmButtonText||"Confirm",floatPosition:Loop.Core.Constants.FloatPosition.RIGHT,clickAction:i.confirmAction,isWorking:i.isWorking,dataTrack:i.confirmDataTrack,trackingData:i.confirmTrackingData}),h=new Loop.Core.Controls.Button({buttonType:Loop.Core.Constants.ButtonTypes.CANCEL,buttonText:i.cancelButtonText||"Cancel",floatPosition:Loop.Core.Constants.FloatPosition.LEFT,clickAction:i.cancelAction,isDefault:!0,isWorking:i.isWorking,dataTrack:i.cancelDataTrack,trackingData:i.cancelTrackingData}),u.buttons=[s,h],u.onDestroy=f,void 0!==u.hideCloseButton&&u.hideCloseButton(!1),r()||u.show(),n.push(u),u}function s(n){var r=Loop.Core.Literals.modals.unauthorized.title,u=t(Loop.Core.Literals.modals.unauthorized.message);return i("unauthorizedModal",r,u,n,!0)}function h(i,u){var f,e,o;return f=new Loop.Core.Controls.ModalDialog("socialForbiddenAction",i,t(u)),o=function(){var n=window.location.protocol+"//"+window.location.host,t=n+"/settings/privacy";location.replace(t)},e=new Loop.Core.Controls.Button({buttonType:Loop.Core.Constants.ButtonTypes.DEFAULT,buttonText:"Change privacy settings",floatPosition:Loop.Core.Constants.FloatPosition.RIGHT,clickAction:o,buttonClass:"btn-flex"}),f.hideCloseButton(!1),f.buttons=[e],r()||f.show(),n.push(f),f}function c(){var n=Loop.Core.Literals.modals.forbidden.title,r=t(Loop.Core.Literals.modals.forbidden.message);return i("forbiddenModal",n,r,!0)}function l(n){var r=Loop.Core.Literals.modals.resourceNotFound.title,u=t(Loop.Core.Literals.modals.resourceNotFound.message);return i("errorModalResNotFound",r,u,n,!0)}function a(n){var r=Loop.Core.Literals.modals.itemNotFound.title,u=t(Loop.Core.Literals.modals.itemNotFound.message);return i("errorModalItemNotFound",r,u,n,!0)}function v(t,i,f,e){var o,s,h,c,l="modal-login-register",a=Loop.Core.Literals.modals.loginOrRegister.title,v=void 0===f?Loop.Core.Literals.modals.loginOrRegister.message:"<h4>"+f+"<\/h4>";return o=new Loop.Core.Controls.ModalDialog(l,a,v),o.modalType=Loop.Core.Constants.ModalType.LOGIN_OR_REGISTER,e=e?e:"",c=e?"actionReferral="+e+"&":"","function"!=typeof t&&(t=function(){var n=Loop.Core.Configuration.loginPage+"?"+c+"returnUrl="+encodeURI(window.location);location.replace(n)}),"function"!=typeof i&&(i=function(){var n=Loop.Core.Configuration.registerPage+"?"+c+"returnUrl="+encodeURI(window.location);location.replace(n)}),s=new Loop.Core.Controls.Button({buttonType:Loop.Core.Constants.ButtonTypes.DEFAULT,buttonText:"LOGIN",floatPosition:Loop.Core.Constants.FloatPosition.LEFT,clickAction:t,dataTrack:"login",trackingData:function(){return{brick:l,actionReferral:e}}}),h=new Loop.Core.Controls.Button({buttonType:Loop.Core.Constants.ButtonTypes.DEFAULT,buttonText:"REGISTER",floatPosition:Loop.Core.Constants.FloatPosition.RIGHT,clickAction:i,dataTrack:"register",trackingData:function(){return{brick:l,actionReferral:e}}}),s.className="btn-login",h.className="btn-register",o.buttons=[s,h],r()&&u().destroy(),o.show(),n.push(o),o}function y(n,u,f,e,o){f="string"==typeof f?t(f):f;var s=i(n,u,f,e,o);return r()||s.show(),s}function p(n,r,f,o){var s=u(),h="loopBlockingErrorModal",c=null;if(!s||s.id!==h)return(o="boolean"==typeof o?o:!0,e(),c=i(h,n,t(r),f,o),c.show())}function w(t,i,r,u,f,e,o,s){var h=new Loop.Core.Controls.ModalDialog(t,i,r,u,f,e,o,s);return n.push(h),h}var n=[];return{getCurrentModalOnScreen:u,getModal:w,showModal:y,showConfirmCancelModal:o,showForbiddenModal:c,showUnauthorizedModal:s,showResourceNotFound:l,showItemNotFound:a,showLoginRegisterModal:v,showSocialForbiddenModal:h,showBlockingErrorModal:p}}();Loop.Core.Controls=Loop.Core.Controls||{};Loop.Core.Controls.MessageBar=function(n){function u(){var u=jQuery.extend(!0,{},f,n),e=$("#"+r);if(0===e.length)throw new Error("Template script '"+r+"' not found.");i=$(e.html().trim());t.type(u.type);t.htmlMessage=ko.observable(u.htmlMessage);t.visible=ko.observable(u.visible);t.showCloseButton=ko.observable(u.showCloseButton);t.showIcon=ko.observable(u.showIcon);t.parent=u.parent;t.dataTestId=u.dataTestId;t.onClose=u.onClose;ko.applyBindings(t,i[0]);t.parent.prepend(i)}var f={type:Loop.Core.Constants.MessageBarTypes.INFO,htmlMessage:"",showCloseButton:!0,visible:!1,parent:$("body"),dataTestId:"msg-bar",showIcon:!0,onClose:null},r="message-bar-template",i=null,t=this;t.type=ko.observable();t.htmlMessage=null;t.visible=null;t.showCloseButton=null;t.parent=null;t.dataTestId=null;t.showIcon=null;t.show=function(){t.visible(!0)};t.close=function(){t.visible(!1);"function"==typeof t.onClose&&t.onClose(t)};t.getCssClass=ko.computed(function(){switch(t.type()){case Loop.Core.Constants.MessageBarTypes.ERROR:return"alert-error";case Loop.Core.Constants.MessageBarTypes.SUCCESS:return"alert-success";case Loop.Core.Constants.MessageBarTypes.INFO:return"alert-info";case Loop.Core.Constants.MessageBarTypes.WARNING:return"alert-warning";case Loop.Core.Constants.MessageBarTypes.PRIVATE:return"alert-private";default:return"alert-info"}});t.onClose=null;u()};Loop.Core.ErrorHandler=function(){function t(n,t,i,r){var u="EPT"+n+"_";return u+=t?t:"DEFAULT",i&&(u+="_"+i),u+(r?"_"+Loop.Core.Enum.APIActions.GetName(r):"_ALL")}function r(i){if(!i)throw new Error("Error trying to add a new error handler. Parameter 'handler' is null.");var r=n[t(i.endpointType,i.errorCode,i.subErrorCode,i.apiAction)];if(r)throw new Error("New error handler for endpoint type '"+i.endpointType+"', error code  '"+i.errorCode+"', error subcode '"+i.subErrorCode+"' and API action '"+i.apiAction+"' already exists.");if("string"!=typeof i.errorMessage&&"function"!=typeof i.action)throw new Error("New error handler doesn't contain error message and action.");}function u(t){r(t);var i=jQuery.extend(!0,{},e,t);n[i.getEntryCode()]=i}function i(i,r,u,f){var e=n[t(i,r,u,f)];return e||(e=n[t(i,r,u,null)]),e||(e=n[t(i,r,null,null)]),e||(e=n[t(i,null,null,f)]),e||(e=n[t(i,null,null,null)]),e}function f(n,t,r,u){var f=i(n,t,r,u);return f||(f=i(Loop.Core.Constants.EndpointType.PRIVATE,t,r,u)),f}var n={},e={endpointType:Loop.Core.Constants.EndpointType.PRIVATE,errorCode:null,subErrorCode:null,apiAction:null,errorTitle:null,errorMessage:null,action:null,getEntryCode:function(){return t(this.endpointType,this.errorCode,this.subErrorCode,this.apiAction)}};return{addErrorHandler:u,getErrorHandler:f,getAllErrorHandlers:function(){return n}}}();Loop.Core.ErrorHandler.addErrorHandler({errorTitle:Loop.Core.Literals.errors.defaultRead.title,errorMessage:Loop.Core.Literals.errors.defaultRead.message,apiAction:Loop.Core.Enum.APIActions.Read});Loop.Core.ErrorHandler.addErrorHandler({errorTitle:Loop.Core.Literals.errors.defaultEdit.title,errorMessage:Loop.Core.Literals.errors.defaultEdit.message,apiAction:Loop.Core.Enum.APIActions.Create});Loop.Core.ErrorHandler.addErrorHandler({errorTitle:Loop.Core.Literals.errors.defaultEdit.title,errorMessage:Loop.Core.Literals.errors.defaultEdit.message,apiAction:Loop.Core.Enum.APIActions.Update});Loop.Core.ErrorHandler.addErrorHandler({errorTitle:Loop.Core.Literals.errors.defaultEdit.title,errorMessage:Loop.Core.Literals.errors.defaultEdit.message,apiAction:Loop.Core.Enum.APIActions.Delete});Loop.Core.ErrorHandler.addErrorHandler({errorCode:401,errorTitle:Loop.Core.Literals.errors.unauthorized.title,errorMessage:Loop.Core.Literals.errors.unauthorized.message,action:function(){Loop.Core.Modals.showBlockingErrorModal(this.errorTitle,this.errorMessage,function(){var n=Loop.Core.Configuration.loginPage;n=n+"?ReturnUrl="+document.location.href;location.replace(n)})}});Loop.Core.ErrorHandler.addErrorHandler({errorCode:403,errorTitle:Loop.Core.Literals.errors.forbidden.title,errorMessage:Loop.Core.Literals.errors.forbidden.message,action:function(){Loop.Core.Modals.showBlockingErrorModal(this.errorTitle,this.errorMessage,function(){location.reload()})}});Loop.Core.ErrorHandler.addErrorHandler({errorCode:404,errorTitle:Loop.Core.Literals.errors.resourceNotFoundRead.title,errorMessage:Loop.Core.Literals.errors.resourceNotFoundRead.message,apiAction:Loop.Core.Enum.APIActions.Read,action:function(){Loop.Core.Modals.showBlockingErrorModal(this.errorTitle,this.errorMessage,function(){location.reload()})}});Loop.Core.ErrorHandler.addErrorHandler({errorCode:404,errorTitle:Loop.Core.Literals.errors.resourceNotFoundEdit.title,errorMessage:Loop.Core.Literals.errors.resourceNotFoundEdit.message,apiAction:Loop.Core.Enum.APIActions.Create,action:function(){Loop.Core.Modals.showBlockingErrorModal(this.errorTitle,this.errorMessage,function(){location.reload()})}});Loop.Core.ErrorHandler.addErrorHandler({errorCode:404,errorTitle:Loop.Core.Literals.errors.resourceNotFoundEdit.title,errorMessage:Loop.Core.Literals.errors.resourceNotFoundEdit.message,apiAction:Loop.Core.Enum.APIActions.Update,action:function(){Loop.Core.Modals.showBlockingErrorModal(this.errorTitle,this.errorMessage,function(){location.reload()})}});Loop.Core.ErrorHandler.addErrorHandler({errorCode:412,subErrorCode:7,errorTitle:Loop.Core.Literals.errors.itemNotFoundEdit.title,errorMessage:Loop.Core.Literals.errors.itemNotFoundEdit.message,apiAction:Loop.Core.Enum.APIActions.Update});Loop.Core.EndpointRepository=function(){function t(n,t){var i=n;return t&&(i+="_"+t),i}function r(n){if(!n)throw new Error("Error trying to add a new endpoint. Parameter 'endpoint' is null.");if(!n.key)throw new Error("Error trying to add a new endpoint. Parameter 'key' is null.");var t=i(n.key);if(t)throw new Error("Endpoint with key '"+t.key+"' already exists.");if("function"!=typeof n.url)throw new Error("endpoint.url must be a function which return the URI of the endpoint.");}function u(t){r(t);var i=jQuery.extend(!0,{},o,t);n[i.key]=i}function i(t,i){var u=n[t],r=null;return u?(r=jQuery.extend(!0,{},u),r.urlArgs=i,r):null}function f(t,i){var r=jQuery.extend(!0,{},s,i),u=n[t];u&&(u.customErrorMessages[r.getCustomMessageCode()]=r)}function e(t,i,r){var u=n[t];return u?u.getCustomMessage(i,r):null}var n={},o={key:null,url:null,urlArgs:null,params:null,type:Loop.Core.Constants.EndpointType.PRIVATE,customErrorMessages:{},getCustomMessage:function(n,i){if(this.customErrorMessages){var r=this.customErrorMessages[t(n,i)];return r?r:this.customErrorMessages[t(n,null)]}return null}},s={errorCode:null,subErrorCode:null,errorTitle:null,errorMessage:null,getCustomMessageCode:function(){return t(this.errorCode,this.subErrorCode)}};return{addEndpoint:u,getEndpoint:i,addCustomMessage:f,getCustomMessage:e,getAllEndpoints:function(){return n}}}();Loop.Core.Ajax=function(){function i(n,t,i,r,u){var e=u?u.ErrorCode:null,f=Loop.Core.ErrorHandler.getErrorHandler(n.type,t,e,i);return"function"==typeof f.action&&r!==!0&&f.action(n,t,e,i),f.errorMessage}function u(n,t,i){if(t){var u=Loop.Core.ErrorHandler.getErrorHandler(n.type,401,null,i),r=u.errorMessage;i===Loop.Core.Enum.APIActions.Delete?setTimeout(function(){t(401,r)},500):t(401,r)}}function f(n){return n?Loop.Core.Configuration.isUserLogged():!0}function r(n,t,r){if(f(n.loginRequired)){var o,s=!0;return $("html").hasClass("ie9")&&(s=!1),o={type:n.verb,url:n.endpoint.url(),async:r,timeout:n.timeout,tryCount:0,retryLimit:3,crossDomain:s,dataType:"json",contentType:"application/json; charset=utf-8",cache:!e,data:n.inputData,success:function(t){"function"==typeof n.successCallback&&n.successCallback(t)},error:function(r){var f,u;this.tryCount+=1;0===r.status&&"timeout"===r.statusText?this.tryCount<=this.retryLimit-1&&"GET"===n.verb?$.ajax(this):(u=i(n.endpoint,408,t,n.preventModalOnError),"function"==typeof n.errorCallback&&n.errorCallback(408,u)):(412===r.status&&(f=JSON.parse(r.responseText)),u=i(n.endpoint,r.status,t,n.preventModalOnError,f),"function"==typeof n.errorCallback&&n.errorCallback(r.status,u,f))}},r&&(o.xhrFields={withCredentials:n.withCredentials}),$.ajax(o)}u(n.endpoint,n.errorCallback,t)}function o(n,t){var r={url:n.endpoint.url(),timeout:n.timeout,type:"POST",data:n.inputData,mimeType:"multipart/form-data",contentType:!1,cache:!1,processData:!1,success:function(t){"function"==typeof n.successCallback&&n.successCallback(t)},error:function(t){var r;0===t.status&&"timeout"===t.statusText&&n.errorCallback(408,i(n.endpoint,408,Loop.Core.Enum.APIActions.Create,n.preventModalOnError));412===t.status&&(r=JSON.parse(t.responseText));n.errorCallback(t.status,i(n.endpoint,t.status,Loop.Core.Enum.APIActions.Create,r),r)}};return t&&(r.xhrFields={withCredentials:n.withCredentials}),$.ajax(r)}function n(n,t,i){var u=[],r=[];if(n.endpoint||u.push("endpoint"),n.verb||(n.verb=t),"boolean"!=typeof n.loginRequired&&(n.loginRequired=i),n.withCredentials||(n.withCredentials=!1),u.length>0)throw new Error("Missing required fields: "+u.join(","));if("object"!=typeof n.endpoint&&r.push("endpoint"),"string"!=typeof n.verb&&r.push("verb"),"boolean"!=typeof n.loginRequired&&r.push("loginRequired"),"boolean"!=typeof n.withCredentials&&r.push("withCredentials"),r.length>0)throw new Error("Wrong field types: "+r.join(","));isNaN(n.timeout)&&(n.timeout=15e3)}$.support.cors=!0;var e=!0,t={endpoint:null,verb:null,inputData:null,loginRequired:null,preventModalOnError:!1,timeout:15e3,successCallback:null,errorCallback:null};return{forceNoCache:function(n){e=n},handleErrors:i,loadData:function(i){return i=jQuery.extend(!0,{},t,i),n(i,"GET",!1),r(i,Loop.Core.Enum.APIActions.Read,!0)},loadDataSync:function(i){i=jQuery.extend(!0,{},t,i);n(i,"GET",!1);r(i,Loop.Core.Enum.APIActions.Read,!1)},updateData:function(i){i=jQuery.extend(!0,{},t,i);n(i,"PUT",!0);r(i,Loop.Core.Enum.APIActions.Update,!0)},createData:function(i){i=jQuery.extend(!0,{},t,i);n(i,"POST",!0);r(i,Loop.Core.Enum.APIActions.Create,!0)},deleteData:function(i){return i=jQuery.extend(!0,{},t,i),n(i,"DELETE",!0),r(i,"DELETE",!0)},createMultipartData:function(i){i=jQuery.extend(!0,{},t,i);n(i,"POST",!0);f(!0)?o(i):u(i.endpoint,i.errorCallback,Loop.Core.Enum.APIActions.Update)},isBlockingError:function(n){return 404===n||403===n||401===n}}}();Loop.Core.Breakpoints=function(){function n(){return window.innerWidth<t.sm}function i(){return window.innerWidth<t.md&&!n()}function r(){return window.innerWidth<t.lg&&!i()&&!n()}function u(){return window.innerWidth>=t.lg}function f(t){return t===Loop.Core.Constants.Breakpoints.EXTRA_SMALL?n():t===Loop.Core.Constants.Breakpoints.SMALL?i():t===Loop.Core.Constants.Breakpoints.MEDIUM?r():t===Loop.Core.Constants.Breakpoints.LARGE?u():(console.error("Bad argument for isCurrentBreakpoint()"),!1)}function e(){return n()?Loop.Core.Constants.Breakpoints.EXTRA_SMALL:i()?Loop.Core.Constants.Breakpoints.SMALL:r()?Loop.Core.Constants.Breakpoints.MEDIUM:u()?Loop.Core.Constants.Breakpoints.LARGE:void 0}function o(n){$(window).smartresize(n)}var t={xs:480,sm:768,md:992,lg:1300};return{getCurrentBreakpoint:e,isCurrentBreakpoint:f,smartResize:o}}();Loop.Core.Authors=Loop.Core.Authors||{};Loop.Core.Authors.MultipleAuthors=function(n){function u(n,t){var i=n||"",r=t||"";return i.trim()+" "+r.trim()}function f(n,t){var i=n||"",r=t||"";return i&&r?i+", "+r:i?i:r}function e(){var n=$.Deferred();return Loop.Core.Ajax.loadData({endpoint:Loop.Core.EndpointRepository.getEndpoint("LoopCore-MainInfoUserList",{userIDList:r}),successCallback:function(t){$.each(t,function(n,t){var e=t.LocationCountry?t.LocationCountry.Name||"":null,r={name:u(t.FirstName,t.LastName),affiliation:"",location:"",pictureUrl:t.ProfilePictureSmall||null,profileUrl:Loop.Core.Configuration.UrlList.getLoopProfilePage(t.UserId)};i.extendDataOnDialog===!0&&(r.affiliation=t.Affiliation||"",r.location=f(t.LocationCity,e));i.authorList.push(r)});n.resolve()},errorCallback:function(t,i,r){var u={errorCode:t,errorMessage:i,preconditionFailed:r};n.reject(u)},preventModalOnError:!0}),n.promise()}function o(){r="object"==typeof n.authorList?n.authorList:[];i.extendDataOnDialog="boolean"==typeof n.extendDataOnDialog?n.extendDataOnDialog:!0}var i=this,r=[],t=null;i.authorList=ko.observableArray();i.extendDataOnDialog=!0;i.showModal=function(){if(null===t)t=new Loop.Core.Controls.ModalDialog("multi-auth-modal","More than one user with this authoring name has confirmed this publication:","",null,!1,!1),t.viewModelData=i,t.viewModelTemplate="multipleAuthorsTemplate";0===i.authorList().length?(t.show(!1),$.when(e()).then(function(){t.viewModelData=i;t.setDataStatus(!0)},function(){t.error(Loop.Core.Literals.errors.genericLoadingErrorInModal.message);t.setDataStatus(!0)})):t.show(!0)};o()};Loop.Core.Authors=Loop.Core.Authors||{};Loop.Core.Authors.AuthorList=function(n){function o(){var i={};i[Loop.Core.Constants.Breakpoints.EXTRA_SMALL]=8;i[Loop.Core.Constants.Breakpoints.SMALL]=10;i[Loop.Core.Constants.Breakpoints.MEDIUM]=15;i[Loop.Core.Constants.Breakpoints.LARGE]=15;t.authorList="object"==typeof n.authorList?n.authorList:[];t.enableLinks="boolean"==typeof n.enableLinks?n.enableLinks:!0;t.extendDataOnDialog="boolean"==typeof n.extendDataOnDialog?n.extendDataOnDialog:!0;t.itemsToShowByBreakpoint="object"==typeof n.itemsToShowByBreakpoint?n.itemsToShowByBreakpoint:i;u=t.authorList.length;h();Loop.Core.Breakpoints.smartResize(c);f()}function s(){var r=[],n=$.Deferred(),u=0;return $.each(t.authorList,function(n,t){t.UserID.length>0&&r.push(t.UserID[0]);u+=t.UserID.length}),u>0?Loop.Core.Ajax.loadData({endpoint:Loop.Core.EndpointRepository.getEndpoint("LoopCore-MainInfoUserList",{userIDList:r}),successCallback:function(r){i=t.authorList;$.each(i,function(n,i){i.affiliation="";i.location="";$.each(r,function(n,r){i.UserID&&i.UserID[0]===r.UserId&&(i.imageUrl=r.ProfilePictureSmall,i.imageUrl&&(i.showImageInList=!0),t.extendDataOnDialog===!0&&(i.affiliation=r.Affiliation,i.location=r.LocationCountry?r.LocationCity+", "+r.LocationCountry.Name:r.LocationCity))})});n.resolve()},errorCallback:function(t,i,r){var u={errorCode:t,errorMessage:i,preconditionFailed:r};n.reject(u)},preventModalOnError:!0}):(i=t.authorList,$.each(i,function(n,t){t.affiliation="";t.location=""}),n.resolve()),n.promise()}function h(){var n=null;t.itemsToShowByBreakpoint[Loop.Core.Constants.Breakpoints.LARGE];t.authorList.length>e&&(n=t.authorList[t.authorList.length-1],t.authorList=t.authorList.slice(0,e),t.authorList.push(n));t.authorList=t.authorList.filter(function(n){return"string"==typeof n.FullName&&n.FullName.trim().length>0});$.each(t.authorList,function(n,i){i.fullName=i.FullName.trim();i.profileUrl=null;i.imageUrl=Loop.Core.Configuration.UrlList.getDefaultProfilePicture();i.showImageInList=!1;i.clickAction=null;i.UserID.length>0&&(i.showImageInList=!0);1===i.UserID.length&&(i.imageUrl=Loop.Core.Configuration.UrlList.getProfilePicture(i.UserID[0]));t.enableLinks&&(1===i.UserID.length?i.profileUrl=Loop.Core.Configuration.UrlList.getLoopProfilePage(i.UserID[0]):i.UserID.length>1&&(i.multiAuthors=new Loop.Core.Authors.MultipleAuthors({authorList:i.UserID,extendDataOnDialog:t.extendDataOnDialog}),i.clickAction=function(){this.multiAuthors.showModal()}))})}function f(){var n=0,i=t.itemsToShowByBreakpoint[r],f=[],e=u>i?i-1:i;for(0===i&&(i=2),n=0;e>n&&n<t.authorList.length;n++)f.push(t.authorList[n]);t.visibleAuthorList(f);t.showMoreCounter(u-t.visibleAuthorList().length-1);t.showMoreCounter()>0?t.lastAuthor(t.authorList[t.authorList.length-1]):t.lastAuthor(null)}function c(){var n=Loop.Core.Breakpoints.getCurrentBreakpoint();r!==n&&(r=n,f())}var t=this,r=Loop.Core.Breakpoints.getCurrentBreakpoint(),e=1e4,u=0,i=null;t.authorList=[];t.visibleAuthorList=ko.observableArray([]);t.lastAuthor=ko.observable();t.showMoreCounter=ko.observable(0);t.showMoreAction=function(){function r(){return{fullInfoAuthorList:i,extendDataOnDialog:t.extendDataOnDialog}}if(t.enableLinks){var n=new Loop.Core.Modals.getModal("multi-auth-modal","Authors of this publication",!0);n.viewModelData=r();n.viewModelTemplate="authorsListDetailedTemplate";null===i?(n.show(!1),$.when(s()).then(function(){n.viewModelData=r();n.setDataStatus(!0)},function(t){n.error(t.errorMessage);n.setDataStatus(!0)})):n.show(!0)}};t.enableLinks=!0;t.extendDataOnDialog=!0;t.itemsToShowByBreakpoint={xs:8,sm:10,md:15,lg:15};o()};Loop.Core.EndpointRepository.addEndpoint({type:Loop.Core.Constants.EndpointType.PRIVATE,key:"LoopCore-MainInfoUserList",urlArgs:{userIDList:[]},url:function(){var n="";return"object"==typeof this.urlArgs.userIDList&&($.each(this.urlArgs.userIDList,function(t,i){if("number"!=typeof i)throw new Error("'"+typeof i+"' type is not valid for the querystring of 'LoopCore-MainInfoUserList' endpoint.");n+="usersIds="+i+"&"}),n.length>0&&(n=n.substr(0,n.length-1))),Loop.Core.Configuration.UrlList.getAbsoluteUrl("loopApi","/users/main-info?"+n)}});currentScript=document.currentScript;$(document).ready(function(){var n=getScriptConfiguration();Loop.Core.Configuration.init(n)});Loop=window.Loop||{};Loop.constants=Loop.constants||{};Loop.constants.TabNames={OVERVIEW:"overview",BIO:"BIO",NETWORK:"NETWORK",PUBLICATIONS:"PUBLICATIONS",EDITORIAL:"EDITORIAL",IMPACT:"IMPACT"};Loop.constants.BioEditMode={BIO:"bio",EXPERTISE:"expertise",SPECIALTY:"specialty",AFFILIATIONS:"affiliations"};Loop.constants.BioFocusMode={AFFILIATIONS:"affiliations"};Loop.constants.APIErrorMessages={HTTP412_7_UPDATE:"The resource you’re editing is temporarily unavailable."};Loop.constants.natureDoiCode="10.1038";Loop.constants.frontiersDoiCode="10.3389";Loop.constants.IJPHDoiCodes=["10.1007/BF020","10.1007/S00038","10.3389/IJPH"];Loop.constants.IJPHPublisherName="International Journal of Public Health";Loop.constants.PHRDoiCodes=["10.1007/BF033","10.1186/S40985","10.3389/PHRS"];Loop.constants.PHRPublisherName="Public Health Reviews";Loop.constants.publicationType={SUGGESTED:0,CONFIRMED:1,REJECTED:3,EDITED:4,REVIEWED:5};Loop.constants.publicationFilter={AUTHOR:"1",TITLE:"2",DOI:"3",YEAR:"4",SEARCH:"5"};Loop.constants.UIMessages={titlePage:"Loop",required:"Please fill in this field.",requiredWithMinLength:function(n){return"Please fill in this field (min. "+n+" characters)."},yearRequired:"Please select a year.",invalidEmail:"Please enter a valid email address.",pleaseRefresh:"Please refresh the page to see the changes.",nameAlreadyExists:"Name already exists.",invalidYearRange:"From date should be earlier than To date.",emailAlreadyAssociatedValidator:"This email is already associated to this account. ",emailAlreadyAssociated:function(n){return"Sorry, the email "+n+" is already associated to this account. "+Loop.constants.UIMessages.pleaseRefresh},emailNotAssociated:function(n){return"Sorry, the email "+n+" is not associated to this account. "+Loop.constants.UIMessages.pleaseRefresh},emailDifferentUser:function(n){return"Sorry, the email "+n+" is already used by another person. "+Loop.constants.UIMessages.pleaseRefresh},emailCharacterLimitExceded:function(n){return"The email has exceeded the "+n+" character limit."},emailNotVerified:"Sorry, this email is not verified.",emailAlreadyValidated:function(n){return"Sorry, the email "+n+" is already validated. "+Loop.constants.UIMessages.pleaseRefresh},emailAlreadyPrimary:function(n){return"Sorry, the email "+n+" is already primary. "+Loop.constants.UIMessages.pleaseRefresh},emailValidationSent:function(n){return"Validation email sent to "+n+". Please click on the link in the email to complete the validation process."},emailRemovedCorrectly:function(n){return"The email "+n+" has been removed successfully."},emailCannotBeValidatedBecausePrimary:function(n){return"Sorry, the email "+n+" can't be validated because it is primary. "+Loop.constants.UIMessages.pleaseRefresh},emailCannotBeRemovedBecausePrimary:function(n){return"Sorry, the email "+n+" can't be removed because it is primary. "+Loop.constants.UIMessages.pleaseRefresh},emailAddSuccess:function(n){return"The email "+n+" has been succesfully associated to this account."},emailInProcessForPrimary:function(n){return"Your request to change your primary email to "+n+" has been received and will be processed shortly."},secondaryEmailValidationTokenNotValid:"The validation token is not valid or has expired.",emailValidationSuccess:"Your email has been validated successfully.",emailGenericValidationError:"Sorry, something went wrong and your email could not be verified. Please try again.",limitExceded:function(n){return n+" character limit exceeded."},existingLoopAccount:"There is an existing Loop account associated with this name and date of birth.",firstNameLimitExceded:function(n){return"First name has exceeded the "+n+" character limit."},middleNameLimitExceded:function(n){return"Middle name has exceeded the "+n+" character limit."},lastNameLimitExceded:function(n){return"Last name has exceeded the "+n+" character limit."},passwordInvalid:"Sorry, invalid password. Please try again.",passwordNewInvalid:"Sorry, new password is not valid. Please try again.",passwordLengthInvalid:"Password length is not valid.",passwordDontMatch:"Passwords don't match.",changesSavedSuccesfully:"Your changes have been saved successfully.",genericErrorSaving:"Sorry, something went wrong and your changes could not be saved. Please try again.",tagCloudInvalidCharacters:"The input data contains invalid characters. The following characters are not allowed: ",selectRequired:"Please select an option.",tagsCloudBlankNewTag:"The tag cannot be blank.",tagsCloudTagExistingTag:"The tag is already in the list.",tagsCloudTagHasInvalidCharacters:function(n){return"Invalid characters: "+n.join(",")},tagsCloudXXLNewTag:function(n){return"The tag cannot exceed "+n+" characters."},tagsCloudXXLTags:function(n){return"There are tags bigger than "+n+" characters."},tagsCloudEmptyCloud:"The tags cloud is empty.",tagsCloudBlankTags:"Some of the tags are empty.",tagsCloudDuplicatedTags:"The tags cloud contains duplicated items.",expertiseBlankNewTag:"Please fill in this field.",expertiseAlreadyUsed:"This expertise is already in your list.",expertiseXXLNewTag:function(n){return n.toString()+" characters limit exceeded."},expertiseXXLTags:function(n){return"Invalid expertise: "+n+" characters limit exceeded."},expertiseNoTags:"Your expertise can't be empty. Please add at least one keyword.",expertiseBlankTags:"Invalid expertise: empty keywords.",expertiseDuplicatedTags:"Invalid expertise: duplicated keywords.",bioHtmlValidationError:"Sorry, the text includes invalid characters: <, >.",notificationsSuccessOperation:"Your changes have been saved successfully.",notificationErrorOperation:"Sorry, something went wrong and your changes could not be saved. Please try again",emailInvitationSuccess:"Your invitation has been sent successfully.",emailInvitationFail:"Sorry, something went wrong and your invitation could not be sent. Please try again.",emailInvitationUnavailable:"This service is currently unavailable.",emailAlreadyAssociated2:"This email is already associated to an existing person.",dateInFuture:"Selected date exceeds the current date.",monthNotSet:"Please select a month.",setMonthAndYear:"Please select month and year.",setYear:"Please select a year.",genericLoadingErrorInModal:"Sorry, something went wrong and this content could not be loaded. Please refresh the page and try again.",genericLoadingErrorInModalWithoutRefresh:"Sorry, something went wrong and this content could not be loaded.",noHistoryDataAvailable:"No history data available.",loginImpactTab:"Please login to access the impact metrics of Loop researchers.",discardUnsavedConversation:"You haven't sent your message yet. Are you sure you want to discard this message?",actionNotAvailable:"Action not available",publicProfileRequired:"Public profile required",personCannotReceiveMessages:"This person cannot receive messages.",conversationMessageError:"Sorry, something went wrong and your message could not be sent. Please try again.",conversationActionError:"Sorry, something went wrong and your action could not be performed. Please try again.",conversationPreviousMessagesError:"Sorry, something went wrong and previous messages could not be loaded. Please try again.",conversationSendMessageError:"Sorry, something went wrong and your message could not be sent. Please try again.",messageCharacterLimitExceeded:"8000 character limit exceeded.",privateProfileLimitedSendMessage:"Actions for people with a private profile are limited. Please set your profile to public to send this person a message.",messagingUnavailable:"Messaging service is temporary unavailable. Please try again later.",organizationAlreadyExists:"This organization already exists. Please, select it from the suggestions list.",preventNavigationWhileSaving:"Please click Cancel or Save before continuing.",autocompleteRequired:function(n){return"Please select a valid "+n+" from the suggestions."},noResultsMatchingCriteria:"Sorry, your search didn't match any results. Please try again.",primaryAffiliationMandatory:"Primary affiliation information is mandatory. To change yours, just add a new one and set it as your primary affiliation."};Loop.constants.PreconditionFailErrors={ItemNotFound:7,AtLeastOneItem:10,SocialActionPrivateProfile:29,SocialActionBlockedUser:11,SocialActionUserBlockedMe:32};Loop.constants.RouteAliases={Impact:"impact"};Loop.constants.impactChartTypes={SPLINE:"spline",COLUMN:"column"};Loop.constants.benchmarkRankingType={ALL_LOOP_AUTHORS:"All Loop Authors",COAUTHORS:"Co-Authors"};Loop.constants.authorImpactSummaryTotal={CITATIONS:"Citations",VIEWS:"Views",DOWNLOADS:"Downloads"};Loop.constants.infoHint={PREFIX:"info",ICON_PREFIX:"info-icon"};Loop.constants.chartTimeLapseType={SINCE_BEGINNING:"Since beginning",LAST_WEEK:"Last week",LAST_MONTH:"Last month",LAST_YEAR:"Last year"};Loop.constants.importYourPublications={ModalTitle:"Import Your Publications",Orcid:{AccessDeniedHtml:"Sorry, your ORCID publication list could not be imported because you didn't grant Loop permission to perform this operation. <a id='ms-bar-orcid-access-denied-anchor' href='#' data-track='grant-permissions'data-track-referral='orcid-alert' data-test-id='msg-bar-orcid-access-denied-link'>Grant Loop permission<\/a>.",AuthErrorHtml:"Sorry, an error occurred and your ORCID publication list could not be imported. <a id='ms-bar-orcid-error-anchor' href='#' data-track='retry-import' data-track-referral='orcid-alert' data-test-id='msg-bar-orcid-error-link'>Retry<\/a>.",OrchisApiError:"Sorry, an error occurred and your ORCID publication list could not be imported. Please try again.",Redirecting:"Redirecting to ORCID...",PredigestEmpty:"We have not found any publications from your ORCID account. If you have publications in this repository, please check that they are set to public or can be shared with trusted partners like Loop.",PredigestOnlyErrors:"We have not found any publications from your ORCID account that can be imported.",PredigestUpToDate:"Your Loop profile is up-to-date with your ORCID publication list.",PredigestBeforeCounter:"We have found <span class='number' data-test-id='import-your-pubs-counter'>",PredigestAfterCounter:"<\/span> publications from your ORCID account that will be imported to your Loop profile.",PredigestApiError:"Sorry, an error occurred and your ORCID publication list could not be imported. <a data-bind='click: retry' href='#' data-track='retry-import' data-track-referral='orcid-modal' data-test-id='retry-import-link'>Retry<\/a>.",DigestConfirmApiError:"Sorry, something went wrong and your publications could not be imported. Please try again.",DigestConfirmApiPartialSuccess:"Sorry, something went wrong and not all your publications could be imported. Please try again.",DigestConfirmBarSuccess:"You successfully imported your publication list from ORCID. They are now displayed on your profile as confirmed publications.",DigestConfirmApiImporting:"We're importing publications from your ORCID account. Once we're done they will be automatically added to your Loop profile. Please check back later."}};Loop.constants.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.constants.EndpointType={SOCIALWIHOUTMODAL:"Loop-SocialWithoutModal"};Loop.constants.EndpointKeys={GetConversationStatus:"Loop-ConversationStatus",GetConversationMessages:"Loop-ConversationMessages",GetConversations:"Loop-Conversations",GetConversationById:"Loop-ConversationById",CanContact:"Loop-CanContact",AcceptConversation:"Loop-AcceptConversation",DeclineConversation:"Loop-DeclineConversation",SendMessage:"Loop-SendMessage",CreateConversation:"Loop-CreateConversation"};Loop.constants.ConversationStatus={NO_CONVERSATION:0,WAITING_ACCEPTANCE:1,CONVERSATION_ACCEPTED:2,CONVERSATION_DECLINED:3,PENDING_INVITATION:4,INVITATION_ACCEPTED:5,INVITATION_DECLINED:6,getName:function(n){var t;switch(n){case Loop.constants.conversationStatus.NO_CONVERSATION:t="NO_CONVERSATION";break;case Loop.constants.conversationStatus.WAITING_ACCEPTANCE:t="WAITING_ACCEPTANCE";break;case Loop.constants.conversationStatus.CONVERSATION_ACCEPTED:t="CONVERSATION_ACCEPTED";break;case Loop.constants.conversationStatus.CONVERSATION_DECLINED:t="CONVERSATION_DECLINED";break;case Loop.constants.conversationStatus.PENDING_INVITATION:t="PENDING_INVITATION";break;case Loop.constants.conversationStatus.INVITATION_ACCEPTED:t="INVITATION_ACCEPTED";break;case Loop.constants.conversationStatus.INVITATION_DECLINED:t="INVITATION_DECLINED";break;default:t="UNKNOWN"}return t}};Loop.constants.ConversationStatusMessages={SendInvitation:"This person needs to approve message invitations. You can send one invitation only, so please introduce yourself appropriately.",WaitingAcceptance:"Invitation pending."};Loop.constants.ConversationAvailability={ReceiverDoesntExist:{id:2,message:"This account has been deactivated."},SenderIsPrivate:{id:3,message:"Researchers with a private profile cannot send messages. Please set your profile to public to enable direct messaging."},ReceiverIsPrivate:{id:4,message:"This person has a private profile and cannot receive messages."},SenderHasBlockedReceiver:{id:5,message:"Please unblock this person to send them a message."},ReceiverChangedPrivacySettings:{id:6,message:"This person has changed their privacy settings and can no longer receive messages."},MaxWaitingAcceptanceConversationExceeded:{id:11,message:"You have exceeded the maximum number of message invitations pending approval. Please try again later."}};Loop.constants.PrivateMessagesAvailability={CanSendMessage:0,SenderDoesntExists:1,ReceiverDoesntExist:2,SenderIsPrivate:3,ReceiverIsPrivate:4,SenderHasBlockedReceiver:5,ReceiverHasBlockedSender:6,SenderPrivateMessagesPrivacySetToPrivate:7,ReceiverPrivateMessagesPrivacySetToPrivate:8,SenderAndReceiverAreSamePerson:9,CanSendMessageWithInvitation:10,MaxWaitingAcceptanceConversationExceeded:11};Loop.constants.publicationsTimeout=3e4;Loop.Core.Constants.EndpointType.EXTERNAL_PRIVATE="External_Private";Loop=window.Loop||{};Loop.constants=Loop.constants||{};Loop.constants.googleAnalytics={ABOUT_RESEARCH_TOPICS:"?utm_source=F-LPP&utm_medium=WCTA&utm_campaign=LOP_FLOP_20151200_RTmain",BLOG_READ_MORE:"?utm_source=F-LPP&utm_medium=WCTA&utm_campaign=LOP_FLOP_20151200_Blog",JOIN_EDITORIAL_BOARD:"?utm_campaign=EB_Application_Offer&utm_source=Loop&utm_medium=fweb",SUGGEST_EDITORIAL_BOARD:"?utm_source=F-LPP&utm_medium=WCTA&utm_campaign=LOP_FLOP_20151200_SuggestEditorial",CONFIRM_PUBLICATIONS:"?utm_source=F-LPP&utm_medium=WCTA&utm_campaign=LOP_FLOP_20151200_ConfirmPub"};Loop.Core.ErrorHandler.addErrorHandler({endpointType:Loop.Core.Constants.EndpointType.SOCIAL,errorCode:401,action:function(n){Loop.Core.Modals.showLoginRegisterModal(n.params.loginAction,n.params.registerAction)}});Loop.Core.ErrorHandler.addErrorHandler({endpointType:Loop.Core.Constants.EndpointType.SOCIAL,errorCode:403,action:function(n,t,i){var r=n.getCustomMessage(t,i);Loop.Core.Modals.showBlockingErrorModal(r.errorTitle,r.errorMessage,null,!1)}});Loop.Core.ErrorHandler.addErrorHandler({endpointType:Loop.Core.Constants.EndpointType.SOCIAL,errorCode:412,subErrorCode:Loop.constants.PreconditionFailErrors.SocialActionBlockedUser,action:function(n,t,i){var r=n.getCustomMessage(t,i);Loop.Modals.showUserIsBlockedModal(r.errorTitle,r.errorMessage,n.params.loggedUserId,n.params.followUserId)}});Loop.Core.ErrorHandler.addErrorHandler({endpointType:Loop.Core.Constants.EndpointType.SOCIAL,errorCode:412,subErrorCode:Loop.constants.PreconditionFailErrors.SocialActionPrivateProfile,action:function(n,t,i){var r=n.getCustomMessage(t,i);Loop.Core.Modals.showSocialForbiddenModal(r.errorTitle,r.errorMessage)}});Loop.Core.ErrorHandler.addErrorHandler({endpointType:Loop.Core.Constants.EndpointType.SOCIAL,errorCode:412,subErrorCode:Loop.constants.PreconditionFailErrors.SocialActionUserBlockedMe,action:function(n,t,i){var r=n.getCustomMessage(t,i);Loop.Modals.showUserBlockedMeModal(r.errorTitle,r.errorMessage)}});Loop.Core.ErrorHandler.addErrorHandler({endpointType:Loop.Core.Constants.EndpointType.EXTERNAL_PRIVATE,errorCode:404,action:function(){}});Loop=window.Loop||{};Loop.Enum=Loop.Enum||{};Loop.Enum.BrickDataStatus=function(){return{NotInitialized:0,Loading:1,LoadedWithContent:2,LoadedWithoutContent:3,LoadedWithErrors:4,NotAvailable:5,Hidden:6,ReadyToReload:7,RunningInBackground:8,getName:function(n){var t;switch(n){case Loop.Enum.BrickDataStatus.NotInitialized:t="NotInitialized";break;case Loop.Enum.BrickDataStatus.Loading:t="Loading";break;case Loop.Enum.BrickDataStatus.LoadedWithContent:t="LoadedWithContent";break;case Loop.Enum.BrickDataStatus.LoadedWithoutContent:t="LoadedWithoutContent";break;case Loop.Enum.BrickDataStatus.LoadedWithErrors:t="LoadedWithErrors";break;case Loop.Enum.BrickDataStatus.NotAvailable:t="NotAvailable";break;case Loop.Enum.BrickDataStatus.Hidden:t="Hidden";break;case Loop.Enum.BrickDataStatus.ReadyToReload:t="ReadyToReload";break;case Loop.Enum.BrickDataStatus.RunningInBackground:t="RunningInBackground";break;default:t="UNKNOWN"}return t}}}();Loop.Enum.SelectDateErrors=function(){return{DateInFuture:{errorCode:1,errorMessage:Loop.constants.UIMessages.dateInFuture},MonthNotSet:{errorCode:2,errorMessage:Loop.constants.UIMessages.monthNotSet},SetMonthAndYear:{errorCode:3,errorMessage:Loop.constants.UIMessages.setMonthAndYear},SetYear:{errorCode:4,errorMessage:Loop.constants.UIMessages.setYear}}}();Loop.Enum.ChartStatus=function(){return{UNKNOWN:-1,NOT_INITIALIZED:0,LOADING:1,DATA_READY:2,CHART_ELEMENT_VISIBLE:3,CHART_SHOWN:4,CHART_NO_DATA:5,ERROR:6,HIDDEN:7,GetName:function(n){var t;switch(n){case Loop.Enum.ChartStatus.NOT_INITIALIZED:t="NOT_INITIALIZED";break;case Loop.Enum.ChartStatus.HIDDEN:t="HIDDEN";break;case Loop.Enum.ChartStatus.LOADING:t="LOADING";break;case Loop.Enum.ChartStatus.DATA_READY:t="DATA_READY";break;case Loop.Enum.ChartStatus.CHART_ELEMENT_VISIBLE:t="CHART_ELEMENT_VISIBLE";break;case Loop.Enum.ChartStatus.CHART_SHOWN:t="CHART_SHOWN";break;case Loop.Enum.ChartStatus.CHART_NO_DATA:t="CHART_NO_DATA";break;case Loop.Enum.ChartStatus.ERROR:t="ERROR";break;default:t="UNKNOWN"}return t}}}();Loop.Enum.Bootstrap={Layouts:{TwoThirds:{MainColumn:{xs:12,sm:12,md:8,lg:8},SideBar:{xs:12,sm:12,md:4,lg:4}},TwoColumns:{FullSize:{xs:12,sm:12,md:12,lg:12},HalfSize:{xs:12,sm:12,md:6,lg:6}}}},function(n){n.clickDisabled=null;n.event.special.click={add:function(t){var i=t.handler,r=n(this);t.handler=function(t){if(n.clickDisabled&&r.is(n.clickDisabled))Loop.Common.PreventNavigation(t),t.preventDefault();else return i.apply(this,arguments)}}};n("html").on("mouseup",function(t){if(!n(t.target).closest(".popover").length){var i=n(t.target).parent().attr("id");n(".popover").each(function(){n(this).parent().find("*[data-onclickout='hide']").each(function(){i!==n(this).attr("id")&&n(this).popover("hide")})})}});n("html").on("mouseup",function(t){if(!n(t.target).closest(".hide-on-clickout").length){var i=n(t.target).parent().attr("id");n(".hide-on-clickout").each(function(){i!==n(this).attr("id")&&n(this).css("display")!=="none"&&n(this).fadeOut(500,"easeOutExpo")})}});n(document).ready(function(){n("#profile-navigation > #impactTab").on("click",function(){if(!Loop.Core.Configuration.isUserLogged())return Loop.Common.showImpactLoginRegisterModal("/people/"+Loop.Configuration.profile.ProfileUserId+"/impact","click-impact-page"),!1});n("img[data-test-id='ibar-profile-picture'],img[data-test-id='ibar-profile-menu-mobile-profile-picture']").on("error",function(){n(this).attr("src",Loop.Configuration.urls.DefaultProfilePictureUrl)})})}(jQuery);Loop=Loop||{};Loop.Common=function(){function e(n){return"/publications/"+n}function c(){return Loop.Configuration.urls.JournalBaseUrl+"/MyFrontiers/Impact/ArticleImpact.aspx?ART_ARTICLEID="}function l(n){return Loop.Core.Utils.stringFormat("https://dx.doi.org/{0}",n)}function a(n,t,i){return Loop.Core.Configuration.UrlList.getAbsoluteUrl("frontiers",Loop.Core.Utils.stringFormat("article/{0}/full{1}",t,typeof i=="boolean"?"#impact":""))}function o(n,t,i){return Loop.Configuration.features.TunguskaImpactLinks?"http:"+Loop.Core.Configuration.UrlList.getAbsoluteUrl("frontiers",Loop.Core.Utils.stringFormat("impact/article/{0}",n)).replace("www","loop-impact"):Loop.Core.Configuration.UrlList.getAbsoluteUrl("frontiers",Loop.Core.Utils.stringFormat("article/{0}/full{1}",t,typeof i=="boolean"?"#impact":""))}function v(n){return Loop.Core.Configuration.UrlList.getAbsoluteUrl("frontiers",Loop.Core.Utils.stringFormat("journal/{0}",n))}function i(n){var t=Loop.constants.natureDoiCode;return u(n,t)}function y(n){var t=Loop.constants.frontiersDoiCode;return u(n,t)}function p(n,t){return k(n)||!!t&&t.toLowerCase()===Loop.constants.IJPHPublisherName.toLowerCase()}function w(n,t){return b(n)||!!t&&t.toLowerCase()===Loop.constants.PHRPublisherName.toLowerCase()}function b(n){var t=Loop.constants.PHRDoiCodes;return s(n,t)}function k(n){var t=Loop.constants.IJPHDoiCodes;return s(n,t)}function u(n,t){return!!n&&n.search(new RegExp(t,"i"))>-1}function s(n,t){for(var f,r=!1,i=0;i<t.length;i++)if(f=t[i],u(n,f)){r=!0;break}return r}function f(n){if(Loop.Common.IsEditMode){var i=$("#"+r);if(i.has(n.currentTarget).length>0)return!1;i.length>0&&Loop.Core.Utils.scrollToElement(i);t&&typeof t.UIMessage=="function"&&t.UIMessage(Loop.constants.UIMessages.preventNavigationWhileSaving)}return!1}function h(t){var i=$(t.target);i.find(".disable-on-edit").addClass("disabled");i.find(".disable-on-edit a").addClass(n);i.find(".disable-on-edit i").addClass(n);i.find(".disable-on-edit span").addClass(n);Loop.Common.DeactivateAnchors(i)}function d(n,t){Loop.Core.Modals.showLoginRegisterModal(function(){document.location.replace(Loop.Core.Configuration.getLoginUri(n,t))},function(){document.location.replace(Loop.Core.Configuration.getRegisterUri(n,t))},Loop.constants.UIMessages.loginImpactTab,t)}function g(n){if(Loop.Core.Browser.isSupportedBrowser()&&!Loop.Core.Browser.isSupportedBrowserVersion()){var t=new Loop.Core.Controls.MessageBar({type:Loop.Core.Constants.MessageBarTypes.WARNING,htmlMessage:"<strong> Unsupported browser:<\/strong> You’re using an outdated web browser and certain features may not function properly. Please upgrade your browser.",parent:n,dataTestId:"msg-bar-unsupported-browser",showCloseButton:!0});t.show()}}function nt(n,t,i){if(typeof window.history.replaceState=="function"){var r,u;r=document.URL.split("?")[1];u=r!==undefined?i+"?"+r:i;window.history.replaceState(n,t,u)}}var n="disabled-click",r=null,t=null;return $.clickDisabled="."+n,{Location:window.location.href,LocationHash:window.location.hash,IsEditMode:!1,PreventNavigation:f,ReplaceStateWithQueryString:nt,DisableClickClass:n,ActivateIcons:function(t,i,r,u){u||(u=$(document));u.find(t).addClass(i).removeClass(r).removeClass(n)},DeactivateIcons:function(t,i,r,u){u||(u=$(document));u.find(t).addClass(i).removeClass(r).addClass(n)},DeactivateAnchors:function(t){t||(t=$(document));var i="."+n;t.find(i).on("click",f)},ActivateAnchors:function(t){t||(t=$(document));var i="."+n;t.find(i).off("click",f)},ActivateElement:function(t){var i;if(t==="undefined")throw new Error("Missing required field: e. It must be a jQuery element or the id of an element.");i=typeof t=="string"?$(t):t;i.removeClass(n)},ActivateAllIcons:function(){Loop.Common.IsEditMode=!1;r=null;t=null;Loop.Common.ActivateAnchors();$(".disable-on-edit").removeClass("disabled");$(".disable-on-edit a").removeClass(n);$(".disable-on-edit i").removeClass(n);$(".disable-on-edit span").removeClass(n);$("button.disable-on-edit").removeClass(n);$("#profile-navigation a").removeClass(n);$("body").off("DOMNodeInserted",h);Loop.Core.publish(Loop.constants.Events.EDIT_MODE_DEACTIVATED)},DeactivateAllIcons:function(i,u){Loop.Common.IsEditMode=!0;r=i;t=u;$(".disable-on-edit").addClass("disabled");$(".disable-on-edit a").addClass(n);$(".disable-on-edit i").addClass(n);$(".disable-on-edit span").addClass(n);$("button.disable-on-edit").addClass(n);$("#profile-navigation a").addClass(n);Loop.Common.DeactivateAnchors();$("body").on("DOMNodeInserted",h);var f=t.brick!==undefined?t.brick.elementId:i;Loop.Core.publish(Loop.constants.Events.EDIT_MODE_ACTIVATED,f)},SetExternalPublicationsLinks:function(){$(".externalPublicationSite").attr("href",function(n,t){var i=Loop.Configuration.urls.JournalBaseUrl;return t.indexOf(i)<0?i+t:t})},updateNetworkingTotals:function(){var n=Loop.Configuration.profile.ProfileUserId;return Loop.Core.Ajax.loadData({endpoint:Loop.Core.EndpointRepository.getEndpoint("NetworkingTotals",{userID:n}),successCallback:function(n){n&&(Loop.Configuration.totals.FollowersCount=n.TotalNetwork.numberOfFollowers,Loop.Configuration.totals.FollowingCount=n.TotalNetwork.numberOfFollowing,Loop.Configuration.totals.CoAuthorsCount=n.TotalNetwork.numberOfCoAuthors,Loop.Configuration.totals.NetworkCount=n.TotalNetwork.numberOfConnections,Loop.viewModels.Main.profileNavigationViewModel.numberOfConnections(n.TotalNetwork.numberOfConnections))}})},isNaturePublication:i,isFrontiersPublicationByDoi:y,isIJPHPublication:p,isPHRPublication:w,isFrontiersPublication:function(n){return n.ArticleId!==0&&!i(n.Doi)},isOpenAccess:function(n){return n.IsOpenAccess},getPublicationType:function(n){return i(n.DoiLink)?"nature":Loop.Common.isIJPHPublication(n.Doi,n.PublisherName)||Loop.Common.isPHRPublication(n.Doi,n.PublisherName)?"public health":Loop.Common.isFrontiersPublication(n)||Loop.Common.isFrontiersPublicationByDoi(n.Doi)?"frontiers":"external"},getPublicationLink:function(n){return e(n.PublicationId)},getArticleLink:function(n,t,i){return a(n,t,i)},getJournalLink:v,viewImpactLink:o,getReadFullArticleLink:function(n){return l(n.Doi)},getPublicationTarget:function(n){return i(n.Doi)?"_blank":Loop.Common.isFrontiersPublication(n)?"_blank":"_self"},getPublicationJournalSourceLogo:function(n){return i(n.Doi)?"logo-npg":Loop.Common.isIJPHPublication(n.Doi,n.PublisherName)?"logo-ijph":Loop.Common.isPHRPublication(n.Doi,n.PublisherName)?"logo-phr":Loop.Common.isFrontiersPublication(n)||Loop.Common.isFrontiersPublicationByDoi(n.Doi)?"logo-fr":"no-logo"},getImpactLink:function(n){return i(n.DoiLink)?e(n.PublicationId)+"?impact":Loop.Common.isFrontiersPublication(n)?o(n.ArticleId,n.Doi,!0):c()+n.PublicationId+"&type=2"},getImpactTarget:function(n){return i(n.Doi)?"_blank":Loop.Common.isFrontiersPublication(n)?"_blank":"_self"},getAddPublicationsUrl:function(){var t="",n=Loop.Configuration.urls.AddPublications;return n&&n.length>0&&(t=n),t},getSubmissionUrl:function(){var t="",n=Loop.Configuration.urls.Submission;return n&&n.length>0&&(t=n),t},showImpactLoginRegisterModal:d,checkSupportedBrowsers:g,updateAutosizeElement:function(n){var t,i="autosize:update",r=document.querySelector(n);typeof Event=="function"?t=new Event(i,{bubbles:!0,cancelable:!1}):(t=document.createEvent("Event"),t.initEvent(i,!0,!1));r.dispatchEvent(t)},updateJscrollPaneElement:function(n){var t=$(n).data("jsp");t&&typeof t.reinitialise=="function"&&t.reinitialise()}}}();Loop=window.Loop||{};Loop.viewModels=Loop.viewModels||{};Loop.viewModels.transitions=function(){function t(n,t){var i=$("#"+t).find("#"+n),r=i.find(".brick-content");return{brickDiv:i,contentDiv:r}}function r(n){var r=$("#"+n),t,i={};return r[0]&&(t=ko.contextFor(r[0]),i=t.$data.brick?t.$data.brick:t.$data.viewModel.brick),i.transitions||(i.transitions={}),i}function u(n){return r(n).transitions.lockLoadingAnimation}function f(n,i){var r;u(i)===!0?setTimeout(function(){f(n,i)},100):(r=t(n,i),r.brickDiv.find(".border-colors-anim").remove())}function e(n,t){var r=n.contentDiv.find(".brick-content-text"),i=r.height(),u=$.Deferred(),f=$.Deferred(),e=$.Deferred();return n.contentDiv.find(".border-colors").length>0&&(i=i-n.contentDiv.find(".border-colors").height()-1),n.contentDiv.velocity({height:i+"px"},1,"easeInOutExpo",function(){u.resolve()}),$.when(u).done(function(){n.contentDiv.height("auto");n.contentDiv.children(".spinner").remove();$("#"+t+"_cb_spinner").remove();r.introContent(function(){f.resolve()});$.when(f).done(function(){n.brickDiv.css("height","auto");e.resolve()})}),e}function o(n){var i=$.Deferred(),r=$.Deferred(),u=$.Deferred(),f=$.Deferred(),e=$.Deferred(),t=n.contentDiv.height();return t<100&&(t=100),n.brickDiv.find(".border-colors-anim").velocity({opacity:"0"},1,"swing",function(){f.resolve()}),$.when(f).done(function(){n.brickDiv.height(t);r.resolve(t)}),$.when(r).done(function(t){function i(t){var r=n.contentDiv.height();r!==t?n.brickDiv.velocity({height:r+"px"},1,"easeInOutExpo",function(){i(r)}):n.contentDiv.slideDown(0,"easeInOutExpo").velocity({opacity:"1"},200,function(){u.resolve()})}i(t)}),$.when(u).done(function(){n.brickDiv.find(".border-colors-anim").remove();i.resolve()}),$.when(i).done(function(){n.brickDiv.css("height","auto");e.resolve()}),e}function i(n,t){r(n).transitions.lockLoadingAnimation=t}var n=this;return n.notInitializedToLoading=function(n,r){var u=t(n,r),f=$.Deferred(),e=$.Deferred(),o=$.Deferred();return i(r,!0),$("#"+r).css("display","block"),u.brickDiv.slideDown(1,"easeInOutExpo").velocity({opacity:"1"},1,function(){f.resolve()}),$.when(f).done(function(){u.brickDiv.append('<div class="border-colors-anim"><div class="bc-orange"><\/div><\/div>');$("#"+n+" .border-colors-anim").velocity({opacity:"1"},1,"easeInOutExpo",function(){e.resolve()})}),$.when(e).done(function(){i(r,!1);o.resolve("Loading")}),o},n.loadingToLoaded=function(i,r,f){var s=t(i,r),h;return typeof f=="undefined"&&(f=$.Deferred()),u(r)===!0?setTimeout(function(){n.loadingToLoaded(i,r,f)},10):(h=s.contentDiv.children(".spinner").length>0?e(s,i):o(s,i),$.when(h).done(function(){f.resolve()})),f},n.hiddenToLoaded=function(n,i){var u=t(n,i),e,l=r(i),o=$.Deferred(),s=$.Deferred(),h=$.Deferred(),c=$.Deferred();return u.brickDiv.find(".border-colors-anim").remove(),u.brickDiv.fadeIn(0,"easeInOutExpo").velocity({opacity:"1"},1,function(){o.resolve()}),$.when(o).done(function(){e=u.contentDiv.height()+"px";u.brickDiv.velocity({height:e},1,"easeInOutExpo",function(){s.resolve()})}),$.when(s).done(function(){u.contentDiv.velocity("slideDown",{duration:1}).velocity({opacity:"1"},1,function(){h.resolve()})}),$.when(h).done(function(){u.brickDiv.css("height","auto");c.resolve()}),f(n,i),c},n.loadedToUnavailable=function(n,i){var r=t(n,i),e=r.brickDiv.height(),u=$.Deferred(),f=$.Deferred();return r.contentDiv.velocity("fadeOut",{duration:1},function(){u.resolve()}),$.when(u).done(function(){r.brickDiv.height(e);r.brickDiv.velocity("slideUp",{duration:1},"easeInOutBack");f.resolve()}),f},n.reloadingToLoading=function(n,r){var u=t(n,r),f=u.contentDiv.find(".brick-content-text"),e=$.Deferred();return i(r,!0),f.css("opacity","0"),f.css("display","none"),u.contentDiv.height("150px"),u.contentDiv.append("<div class='cb' id='"+n+"_cb_spinner'><\/div>"),u.contentDiv.append("<div class='spinner' data-test-id='"+n+"_spinner'><\/div>"),setTimeout(function(){i(r,!1);e.resolve()},500),e},n.loadedToRunningInBackground=function(n,i){var r=t(n,i),u=$.Deferred(),f=$.Deferred(),e=$.Deferred();return r.brickDiv.velocity({opacity:"0"},1,function(){u.resolve()}),$.when(u).done(function(){r.brickDiv.velocity({height:"0"},1,"easeInOutExpo",function(){f.resolve()})}),$.when(f).done(function(){r.brickDiv.removeAttr("style");r.contentDiv.removeAttr("style");e.resolve()}),e},n.hiddenToLoading=function(i,r){var u=t(i,r),f=$.Deferred(),e;return u.brickDiv.css("height",""),u.contentDiv.removeAttr("style"),e=n.notInitializedToLoading(i,r),$.when(e).done(function(){f.resolve()}),f},n}();Loop=Loop||{};Loop.tracking=Loop.tracking||{};Loop.tracking.Events=Loop.tracking.Events||{};Loop.tracking.Events=function(){function n(n){var t=ko.contextFor(n),r=$(n).closest(".brick-content"),i={brick:r?r.attr("id"):"",page:window.location.pathname.replace(/\/\d+/,""),userId:Loop.Configuration.profile?Loop.Configuration.profile.ProfileUserId:0};return t&&(t.$data&&t.$data.trackingData&&$.extend(i,t.$data.trackingData()),t.$parents.forEach(function(n){n&&n.trackingData&&$.extend(i,n.trackingData())})),i}function t(n){var t=!0;return $.clickDisabled&&$(n).is($.clickDisabled)&&(t=!1),t}function i(){Loop.Core.EndpointRepository.addEndpoint({type:Loop.Core.Constants.EndpointType.PRIVATE,key:"TrackEvents",url:function(){return Loop.Configuration.urls.ApiBaseUrl+"/tracking/events"}});Loop.Core.Tracking.endpoint(Loop.Core.EndpointRepository.getEndpoint("TrackEvents"));Loop.Core.Tracking.setTrackInfo=n;Loop.Core.Tracking.canTrackThisElement=t;Loop.Core.Tracking.enabled(!1,"LoopTrackingEvent")}return i(),{}}();Loop=window.Loop||{};Loop.viewModels=Loop.viewModels||{};Loop.viewModels.searchPeople=function(){function u(){r();var t=$.trim(n.searchTerm())||"";if(t.length<3){n.info("Please, type at least 3 characters to search.");return}n.isLoading(!0);Loop.Core.Ajax.createData({endpoint:Loop.Core.EndpointRepository.getEndpoint(i),inputData:JSON.stringify({search:t,top:10}),successCallback:function(n){var t=n.Items.map(function(n){return n.Affiliation=n.Affiliation.replace(/,/g,", "),n});o(t)},errorCallback:function(){n.isError(!0);n.isLoading(!1)},preventModalOnError:!0,loginRequired:!1})}function f(){e();r()}function e(){n.searchTerm("")}function r(){n.isError(!1);n.info("");n.searchPeopleResults.removeAll()}function o(t){n.isLoading(!1);r();n.searchPeopleResults(t);t.length||n.info("Sorry, your search didn't match any results. Please try again")}var n=this,t=-1,i="SearchPeople";n.searchPeopleResults=ko.observableArray();n.searchTerm=ko.observable("");n.isActive=ko.observable(!1);n.isLoading=ko.observable(!1);n.isError=ko.observable(!1);n.isVisible=ko.observable(!1);n.info=ko.observable("");n.keyupEvent=function(){clearTimeout(t);t=setTimeout(function(){t=null;u()},300)};n.activate=function(){n.isActive(!0);$("#people-suggestions-plugin").focus()};n.deactivate=function(){n.isActive(!1);f();$("#people-suggestions-plugin").blur()};n.navigateToSearchResult=function(n){var t=new URL(n.ProfileUrl);t.host=window.location.host;t.searchParams.set("utm_source","searchPeople");typeof dataLayer!="undefined"&&dataLayer.push({event:"searchPeople_resultClicked",searchResult:n});window.location=t.toString()};n.init=function(){if(Loop.Configuration.features.EnableSearchPeople){Loop.Core.EndpointRepository.getEndpoint(i)||Loop.Core.EndpointRepository.addEndpoint({type:Loop.Core.Constants.EndpointType.PUBLIC,key:i,url:function(){return Loop.Configuration.urls.ApiBaseUrl+"/people/search"}});$(document).click(function(t){t.target.closest(".nav-search")||n.deactivate()});var t=document.getElementById("searchPeople");ko.applyBindings(n,t);n.isVisible(!0)}}};Loop=window.Loop||{};Loop.constants=Loop.constants||{};Loop.constants.Delays={REFRESH_PUBLICATION_DELAY:2e3};Loop=window.Loop||{};Loop.constants=Loop.constants||{};Loop.constants.Events={FOLLOWING_FOLLOWER_VISIBILITY_CHANGED:"followingFollowersVisibilityChanged",USER_FOLLOW_STATE_CHANGED:"userFollowStateChanged",MODAL_DIALOG_DESTROY:"destroyDialog",PUBLICATIONS_COUNT_CHANGED:"publicationsCountChanged",ACTIVATE_ALL:"activateAll",DEACTIVATE_ALL:"deactivateAll",PYMK_VISIBILITY_CHANGED:"pymkVisibilityChanged",AUTHORING_NAMES_CHANGED:"authoringNamesChanged",BRIEF_BIO_MODIFIED:"briefBioModified",PROFILE_PICTURE_UPDATED:"profilePictureUpdated",PUBLICATION_CONFIRMED:"publicationConfirmed",PUBLICATION_REJECTED:"publicationRejected",PUBLICATIONS_UPDATED:"publicationsUpdated",EDIT_MODE_ACTIVATED:"editModeActivated",EDIT_MODE_DEACTIVATED:"editModeDeactivated",PYMK_USER_DISMISSED:"pymkUserDismissed",SOCIAL_BUTTON_SAVING:"socialButtonSaving",IMPACT_PUBLICATIONS_FOUND:"impactPublicationsFound",IMPACT_PUBLICATIONS_NOT_FOUND:"impactPublicationsNotFound",SPA_KO_BINDING_DONE:"SpaKoBindingDone",UPDATE_SUGGESTED_PUBLICATIONS:"updateSuggestedPublications",CONVERSATION_CREATED:"ConversationCreated",CONVERSATION_CLOSED:"ConversationClosed",CONVERSATION_MINIMIZED:"ConversationMinimized",CONVERSATION_REQUESTED:"ConversationRequested",CONVERSATION_SELECTED:"ConversationSelected",CONVERSATION_OPENED:"ConversationOpened",CONVERSATION_MESSAGE_SENT:"MessageSent",COMPOSE_PANEL_REQUESTED:"ComposePanelRequested",CONVERSATION_DISCARDED:"ConversationDiscarded",CONVERSATION_COMPOSE:"ConversationCompose",CONVERSATION_COMPOSE_REQUESTED:"ConversationComposeRequested",CONVERSATION_CONTROL_STATUS_CHANGED:"ConversatinControlStatusChanged",EDIT_BRIEF_BIO:"EditBriefBioEditorEvent",CREATE_ORGANIZATION_INIT:"CreateOrganizationInit",CREATE_ORGANIZATION_FINISHED:"CreateOrganizationFinished",NAVIGATION_WHILE_SAVING:"NavigationWhileSavingHappened",PRIMARY_AFFILIATION_CHANGED:"PrimaryAffiliationChanged",AFFILIATION_ADDED:"NewAffiliationAdded",AFFILIATION_EDITED:"AffiliationEdited",AFFILIATION_DELETED:"AffilitionDeleted",HEADER_SECTION_UPDATED:"HeaderSectionUpdated",VIEW_ALL_AFFILIATIONS_CLICKED:"ViweAllAffiliationsClicked",SNACKBAR_MESSAGE:"SnackBarMessage"};Loop=window.Loop||{};Loop.constants=Loop.constants||{};Loop.constants.tracking=Loop.constants.tracking||{};Loop.constants.tracking.DataTrack={SAVE_PROFILE_UPDATE:"save-profile-update",CANCEL_PROFILE_UPDATE:"cancel-profile-update"};Loop.constants.tracking.ActionReferral={ADD:"add",EDIT:"edit",REMOVE:"remove"};Loop=window.Loop||{};Loop.Configuration=function(n){function i(){var n=t.urls.OrchisApiBaseUrl.lastIndexOf("/"),i=t.urls.OrchisApiBaseUrl.substring(0,n);return i+"/close"}var t=this;t.LoggedUserId=n.LoggedUserId;t.urls={};t.urls.SecureApiBaseUrl=n.SecureApiBaseUrl;t.urls.ApiBaseUrl=n.ApiBaseUrl;t.urls.LoginUrl=n.LoginPage;t.urls.RegisterUrl=n.RegisterPage;t.urls.PublicationsUrl=n.PublicationsUrl;t.urls.DefaultProfilePictureUrl=n.DefaultProfilePictureUrl;t.urls.LoopBaseUrl=n.LoopBaseUrl;t.urls.OrganizationsApiBaseUrl=n.OrganizationsApiBaseUrl;t.urls.OrganizationsApi=n.OrganizationsApiBaseUrl?{domain:new RegExp(/\.(.+)/).exec(n.OrganizationsApiBaseUrl)[1],subDomain:new RegExp(/\/\/(.+?)\./).exec(n.OrganizationsApiBaseUrl)[1]}:n.OrganizationsApiBaseUrl;t.urls.JournalAboutResearchTopics=function(){return Loop.Core.Configuration.UrlList.getAbsoluteUrl("frontiers","about/research-topics"+Loop.constants.googleAnalytics.ABOUT_RESEARCH_TOPICS)};t.urls.JournalPublishingModel=function(){return Loop.Core.Configuration.UrlList.getAbsoluteUrl("frontiers","about/publishing-model")};t.urls.BlogUrl=function(n){var t=Loop.Core.Configuration.UrlList.getAbsoluteUrl("frontiers",n);return t.replace("www","blog")};t.features={};t.features.KaleidoscopeProfilePicturesEnabled=n.KaleidoscopeProfilePicturesEnabled;t.features.CreateOrganizationsEnabled=n.CreateOrganizationsEnabled;t.features.ResearchTopicInEditorialRoleBrickEnabled=n.ResearchTopicsInOverview;t.features.PublicationsInEditorialTabEnabled=n.PublicationsInEditorialTabEnabled;t.features.TunguskaImpactLinks=n.TunguskaImpactLinks;t.features.HideTotalViewsOnPublications=n.HideTotalViewsOnPublications;t.features.UsePreviousImpactVersion=n.UsePreviousImpactVersion;t.features.EnableSearchPeople=n.EnableSearchPeople;t.features.ScheduledTooltipMessage=n.ScheduledTooltipMessage;t.totals={};t.totals.FollowersCount=0;t.totals.FollowingCount=0;t.totals.CoAuthorsCount=0;t.totals.NetworkCount=0;t.totals.TopicsCount=0;t.totals.EditedPublicationsCount=0;t.totals.ReviewedPublicationsCount=0;t.totals.GetTotalEditorialContributions=function(){return(t.totals.TopicsCount||0)+(t.totals.EditedPublicationsCount||0)+(t.totals.ReviewedPublicationsCount||0)};t.disabledEditorialContributions=function(){return t.totals.GetTotalEditorialContributions()===0&&Loop.Configuration.isOwnProfile()===!1};t.device={};t.device.isIphone=!1;t.device.isIpad=!1;t.device.isMobile=!1;t.device.name=n.Device;n.Device==="iphone"&&(t.device.isIphone=!0);n.Device==="ipad"&&(t.device.isIpad=!0);/android|iphone|ipad|ipod|blackberry|windowsphone/i.test(n.Device)&&(t.device.isMobile=!0);t.addProfileConfig=function(n,i){t.profile={};t.profile.ProfileUserId=n.UserId;t.profile.showAsPublic=i;i&&(n.ProfileInfo&&(t.profile.JobTitle=n.ProfileInfo.JobTitle,t.profile.Affiliation=n.ProfileInfo.Affiliation,t.profile.Country=n.ProfileInfo.LocationCountry?n.ProfileInfo.LocationCountry.CountryId:-1,t.profile.City=n.ProfileInfo.LocationCity,t.profile.FirstName=n.ProfileInfo.FirstName,t.profile.LastName=n.ProfileInfo.LastName),t.totals.FollowersCount=n.FollowersCount,t.totals.FollowingCount=n.FollowingCount,t.totals.CoAuthorsCount=n.CoAuthorsCount,t.totals.NetworkCount=n.NetworkCount,t.totals.TopicsCount=n.TopicsCount,t.totals.EditedPublicationsCount=n.EditedPublicationsCount,t.totals.ReviewedPublicationsCount=n.ReviewedPublicationsCount,n.ProfileHeader&&(t.urls.ProfilePicture=n.ProfileHeader.PictureUrl))};t.isOwnProfile=function(){return Loop.Configuration.profile.ProfileUserId===Loop.Configuration.LoggedUserId};t.loadSPAUrls=function(n){t.urls.researchTopics={};t.urls.researchTopics.Url="/researchtopic/{0}";t.urls.researchTopics.GuidelinesUrl=n.ResearchTopicsGuidelines;t.urls.researchTopics.SuggestUrl=n.ResearchTopicsSuggest;t.urls.AddPublications=n.AddPublicationsExternalSite;t.urls.Submission=n.Submission;t.urls.JournalBaseUrl=n.JournalBaseUrl;t.urls.ImpactApiBaseUrl=n.ImpactApiBaseUrl;t.urls.ImpactPublicApiBaseUrl=n.ImpactPublicApiBaseUrl;t.urls.ImpactApiV2BaseUrl=n.ImpactApiV2BaseUrl;t.urls.ImpactApiV3BaseUrl=n.ImpactApiV3BaseUrl;t.urls.OrchisApiBaseUrl=n.OrchisApiBaseUrl;t.urls.OrchisRestartUrl=i();t.urls.Journal={};t.urls.Journal.JournalPage=n.JournalPageBaseUrl};t.ga={};t.ga.Sources={};t.ga.Sources.Loop="LOP";t.ga.Mediums={};t.ga.Mediums.Profile="Profile";t.ga.Campaigns={};t.ga.Campaigns.RTSubmissionsFromEditorialBrick="editorialRolesBrick_FrontiersRTSubmissions_Submit";t.ga.Campaigns.RTSubmissionsFromEditorialBrick_Open="editorialRolesBrick_FrontiersRTSubmissions_OpenSubmit"}