(window.webpackJsonp=window.webpackJsonp||[]).push([[29],{520:function(t,e){!function(t){var e={DOI:"",widgetContainer:null,widgetContainerContent:null,selectors:{CONTAINER:".federated-access-login",LOADER:".federated-access-login__loading",CONTENT:".federated-access-login__content",CURRENT_URL_INPUT:'[name="federatedAccessLoginCurrentURL"]'},htmlMarkups:{},ACTION_URL:"",MAX_TITLE_LENGTH:32,init:function init(){var t;this.DOI=null===(t=document.querySelector('[scheme="doi"]'))||void 0===t?void 0:t.getAttribute("content");var e=this.DOI?"article-access-seamless":"access-seamless";if(this.widgetContainer=document.querySelector(this.selectors.CONTAINER),this.widgetLoader=document.querySelector(this.selectors.LOADER),this.widgetContent=document.querySelector(this.selectors.CONTENT),this.widgetContainer&&this.widgetLoader){var i,s=(null===(i=document.querySelector(this.selectors.CURRENT_URL_INPUT))||void 0===i?void 0:i.value)||window.location.href,n=new URL(s),a=this.DOI?n.pathname:n.searchParams.get("uri");this.ACTION_URL="/action/ssostart?redirectUri=".concat(n.origin).concat(a||"");var c="

Access journal content via a university, library or employer subscription.

");this.htmlMarkups.empty=c,this.htmlMarkups[1004]=c,this.htmlMarkups[1001]="

Access via {{institutionName}} is not available as they do not subscribe to Sage Journals content.

"),this.htmlMarkups[1002]="

{{institutionName}} does not have access to this article.

"),this.htmlMarkups[1003]="

Access journal content via a university, library or employer subscription.

"),this.control()}},control:function control(){var t=this;if(t.DOI)try{SeamlessAccessService.getEntitiesWithAllInfo(t.DOI).then(t.onFulfilled,t.onRejected)}catch(t){console.error("SeamlessAccessService is not imported...")}else try{SeamlessAccessService.retrieveEntity().then((function(i){if(i.length>0){var s=i[i.length-1],n="/pb/widgets/shibboleth/sage/checkSupportedInstitution?entityid=".concat(s.entity.entityID);$.ajax({type:"GET",url:n,accept:{text:"application/json"},timeout:SeamlessAccessService.timeout,success:function success(i){(i={entityID:s.entity.entityID,entityTitle:s.entity.title,entityStatusObj:JSON.parse("string"!=typeof i?JSON.stringify(i):i).supported,entitySsoUrl:SeamlessAccessService.getWAYFLessUrl(s.entity.entityID)}).entityTitle.length>e.MAX_TITLE_LENGTH&&(i.entityTitle=i.entityTitle.slice(0,e.MAX_TITLE_LENGTH)+"...");var n="";i.entityStatusObj?(n=t.htmlMarkups[1003].replace("{{entitySsoUrl}}",i.entitySsoUrl).replace("{{institutionName}}",i.entityTitle),t.widgetContent.innerHTML=n):(n=t.htmlMarkups[1001].replace("{{entitySsoUrl}}",i.entitySsoUrl).replace("{{institutionName}}",i.entityTitle),t.widgetContent.innerHTML=n)},error:function error(e){t.widgetContent.innerHTML=t.htmlMarkups.empty}})}else t.widgetContent.innerHTML=t.htmlMarkups.empty}))}catch(t){console.error("SeamlessAccessService is not imported...")}},onFulfilled:function onFulfilled(t){var i,s="empty",n={};if(t.length>0){for(var a,c=t.length-1;c>=0;c--)if(1003===t[c].entityStatusObj.code){a=t[c];break}s=(n=null!=a?a:t[t.length-1]).entityStatusObj.code}(null===(i=n.entityTitle)||void 0===i?void 0:i.length)>e.MAX_TITLE_LENGTH&&(n.entityTitle=n.entityTitle.slice(0,e.MAX_TITLE_LENGTH)+"..."),e.widgetContent.innerHTML=e.htmlMarkups[s].replace("{{entitySsoUrl}}",n.entitySsoUrl).replace("{{institutionName}}",n.entityTitle)},onRejected:function onRejected(t){e.widgetContent.innerHTML=e.htmlMarkups.empty,console.warn(t)}};t.federatedAccessLogin=e}(UX)}}]); //# sourceMappingURL=federatedAccessLogin-abb8efe8971274d22a6d.js.map