(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["api_token"],{"071e":function(e,t,o){},"2c21":function(e,t,o){"use strict";o("6bdc")},"3fbd":function(e,t,o){"use strict";o.d(t,"a",(function(){return h}));var a=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("BCard",{class:e.cardClass,attrs:{"header-bg-variant":e.headerBGVariant,"header-text-variant":e.headerTextVariant,"header-border-variant":"ams-header-orange","header-class":e.headerClass,"footer-bg-variant":"ams-gray","footer-text-variant":"white","footer-border-variant":"ams-gray","footer-class":e.footerClass,"body-class":"p-2"},scopedSlots:e._u([{key:"header",fn:function(){return[t("BRow",{attrs:{"no-gutters":""}},[t("BCol",{attrs:{cols:"auto"}},[e.title&&e.title.trim().length>0?t("h2",{class:e.titleClass},[e._v(" "+e._s(e.title)+" ")]):e._e(),e.htmlTitle&&e.htmlTitle.trim().length>0?t("h2",{class:e.titleClass},[t("span",{domProps:{innerHTML:e._s(e.htmlTitle)}})]):e._e()]),t("BCol",[e._t("header")],2)],1)]},proxy:!0},e.$slots.footer?{key:"footer",fn:function(){return[e._t("footer")]},proxy:!0}:null],null,!0)},[e._t("default")],2)},s=[],n=o("9ab4"),i=o("1b40");let r=class extends i["f"]{get headerClass(){const e=this.showOnSmallScreenOnly?"d-md-none":"",t=this.hideHeader?"d-none":"";return`border-bottom highlight-border p-2 ${e} ${t}`}get footerClass(){const e=this.showOnSmallScreenOnly?"d-md-none":"";return"p-0 position-relative "+e}get cardClass(){const e=this.showOnSmallScreenOnly?"shadow-show shadow-border-md-none":"",t=this.noShadow||this.showOnSmallScreenOnly?"":"shadow",o=this.noBorder?"border-0":"";return`${t} ${o} mb-4 ${e}`}get titleClass(){return"m-0 non-selectable"}get headerBGVariant(){return this.lightHeaderStyle?"white":"ams-gray"}get headerTextVariant(){return this.lightHeaderStyle?"gray":"black"}};Object(n["a"])([Object(i["b"])()],r.prototype,"title",void 0),Object(n["a"])([Object(i["b"])()],r.prototype,"htmlTitle",void 0),Object(n["a"])([Object(i["b"])({default:!1,type:Boolean})],r.prototype,"showOnSmallScreenOnly",void 0),Object(n["a"])([Object(i["b"])({default:!1,type:Boolean})],r.prototype,"lightHeaderStyle",void 0),Object(n["a"])([Object(i["b"])({default:!1,type:Boolean})],r.prototype,"hideHeader",void 0),Object(n["a"])([Object(i["b"])({default:!1,type:Boolean})],r.prototype,"noShadow",void 0),Object(n["a"])([Object(i["b"])({default:!1,type:Boolean})],r.prototype,"noBorder",void 0),r=Object(n["a"])([i["a"]],r);var l=r,c=l,d=(o("4b34"),o("2877")),u=Object(d["a"])(c,a,s,!1,null,"adbd90c2",null),h=u.exports},"4b34":function(e,t,o){"use strict";o("071e")},"6bdc":function(e,t,o){},a5c3:function(e,t,o){"use strict";o.r(t);var a=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("div",[t("PageHeader",[e._v(" API Token Request ")]),e.loading?t("div",[t("div",{staticClass:"text-center text-ams-orange"},[t("BSpinner",{})],1)]):!e.loading&&e.isLoggedIn?t("div",[null!==e.apiToken||e.isTokenAlreadyLinked?e.isTokenAlreadyLinked?t("div",{staticClass:"text-warning p-2 mt-2 border border-warning rounded text-center"},[e._v(" You have previously requested an API Token that is now associated with your account. ")]):null!==e.apiToken?t("div",[t("h3",{staticClass:"text-success"},[e._v(" API Token Generated Successfully! ")]),t("Card",{staticClass:"text-center",attrs:{title:"Your Token"}},[t("div",{staticStyle:{"font-size":"1.5rem"}},[e._v(" "+e._s(e.apiToken)+" ")]),t("hr"),t("div",[t("BButton",{attrs:{size:"sm",variant:"primary"},on:{click:e.copyToClipboard}},[e._v(" Copy ")])],1)]),t("BAlert",{attrs:{show:"",variant:"warning"}},[e._v(" This token will be displayed only once. Please copy and store it securely as it won't be retrievable again. Avoid exposing it in public repositories or unauthorized access points. ")])],1):e._e():t("BForm",{on:{submit:e.onSubmit}},[t("BFormGroup",{attrs:{label:"Can you provide details on how you intend to utilize the MathSciNet API?","label-for":"api-question-1"}},[t("BFormTextarea",{attrs:{id:"api-question-1",required:""},model:{value:e.reasonOfUse,callback:function(t){e.reasonOfUse=t},expression:"reasonOfUse"}})],1),t("BButton",{attrs:{type:"submit",variant:"primary"}},[e._v(" Submit ")])],1),t("BAlert",{staticClass:"mt-2",attrs:{show:"",variant:"info"}},[e._v(" You can access the API Documentation by visiting this link: "),t("a",{attrs:{href:e.apiDocsURL,target:"_blank"}},[e._v(" MathSciNet API ")])])],1):e._e()],1)},s=[],n=(o("d9e2"),o("9ab4")),i=o("1b40"),r=o("79f6"),l=o("fce7"),c=o("3fbd");let d=class extends i["f"]{constructor(){super(...arguments),this.loading=!0,this.isLoggedIn=!1,this.isTokenAlreadyLinked=!1,this.reasonOfUse="",this.apiToken=null,this.errorMessage=null,this.testing=""}async mounted(){this.testing=void 0!==this.$route.query.testing?this.$route.query.testing:"",this.testing.startsWith("token")&&(this.apiToken=this.testing),await this.checkIfIsLoggedIn(),await this.checkIfUserHasToken(),this.loading=!this.isLoggedIn}get apiDocsURL(){return this.$store.state.AppConfigModule.appConfig.restAPIDocsURL}async checkIfIsLoggedIn(){""===this.testing?(this.isLoggedIn=await r["a"].isLoggedIn(),this.isLoggedIn||r["a"].redirectToAMSLogin(window.location.href)):this.isLoggedIn=!0}async checkIfUserHasToken(){if(this.isLoggedIn){const e=await r["b"].getUserInfo();if("no-token"===this.testing||this.testing.startsWith("token"))return;this.isTokenAlreadyLinked=e&&!0===e.hasToken}}async onSubmit(e){e.preventDefault();const t=await r["b"].generateToken(this.reasonOfUse);t.token?this.apiToken=t.token:t.errorMessage?this.errorMessage=t.errorMessage:this.errorMessage="Something went wrong generatin the API token."}copyToClipboard(){const e=e=>navigator&&navigator.clipboard&&navigator.clipboard.writeText?navigator.clipboard.writeText(e):Promise.reject(Error("The Clipboard API is not available.")),t=e=>{if(null!==document.getSelection()){const t=document.createElement("textarea");t.value=e,t.setAttribute("readonly",""),t.style.position="absolute",t.style.left="-9999px",document.body.appendChild(t);const o=document.getSelection().rangeCount>0&&document.getSelection().getRangeAt(0);t.select(),document.execCommand("copy"),document.body.removeChild(t),o&&(document.getSelection().removeAllRanges(),document.getSelection().addRange(o))}};e(this.apiToken).catch(e=>{console.error(e),console.info("Using a different method to copy text."),t(this.apiToken)})}};d=Object(n["a"])([Object(i["a"])({components:{PageHeader:l["a"],Card:c["a"]}})],d);var u=d,h=u,g=o("2877"),p=Object(g["a"])(h,a,s,!1,null,null,null);t["default"]=p.exports},fce7:function(e,t,o){"use strict";o.d(t,"a",(function(){return h}));var a=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("div",[t("div",{class:e.internalTitleClass},[e._t("default")],2),t("div",{staticClass:"d-flex"},[t("div",{staticClass:"flex-fill"},[t("hr",{class:e.lineClass})]),e.noLogo?e._e():t("div",{staticClass:"d-none d-md-block"},[t("BImg",{attrs:{fluid:"",src:e.logoUrl,alt:"American Mathematical Society"}})],1)])])},s=[],n=o("9ab4"),i=o("1b40");let r=class extends i["f"]{constructor(){super(...arguments),this.logoUrl="",this.authorId=0}mounted(){o.e("chunk-2d0cbde8").then(o.t.bind(null,"4c03",7)).then(e=>this.logoUrl=e.default)}get internalTitleClass(){return("title "+this.titleClass).trim()}get lineClass(){return""+(this.noLogo?"noLogo-line":"")}};Object(n["a"])([Object(i["b"])({default:"",type:String})],r.prototype,"titleClass",void 0),Object(n["a"])([Object(i["b"])({default:!1})],r.prototype,"noLogo",void 0),r=Object(n["a"])([i["a"]],r);var l=r,c=l,d=(o("2c21"),o("2877")),u=Object(d["a"])(c,a,s,!1,null,"5091c60e",null),h=u.exports}}]); //# sourceMappingURL=api_token.f3387779.js.map