vendor: 5,044 bytes, lines 1-2
1/*! For license information please see libraryLogin-cb577da27b500e4f1cc8.bundle.js.LICENSE.txt */ 2"use strict";(self.webpackChunkcodecombat=self.webpackChunkcodecombat||[]).push([[1925],{197535:(r,t,e)=>{function n(r){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(r){return typeof r}:function(r){return r&&"function"==typeof Symbol&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},n(r)}Object.defineProperty(t,"X",{value:!0}),t.Z=void 0;var o=e(482156);function a(){a=function(){return t};var r,t={},e=Object.prototype,o=e.hasOwnProperty,i=Object.defineProperty||function(r,t,e){r[t]=e.value},s="function"==typeof Symbol?Symbol:{},c=s.iterator||"@@iterator",l=s.asyncIterator||"@@asyncIterator",u=s.toStringTag||"@@toStringTag";function d(r,t,e){return Object.defineProperty(r,t,{value:e,enumerable:!0,configurable:!0,writable:!0}),r[t]}try{d({},"")}catch(r){d=function(r,t,e){return r[t]=e}}function h(r,t,e,n){var o=t&&t.prototype instanceof g?t:g,a=Object.create(o.prototype),s=new O(n||[]);return i(a,"_invoke",{value:I(r,e,s)}),a}function p(r,t,e){try{return{type:"normal",arg:r.call(t,e)}}catch(r){return{type:"throw",arg:r}}}t.wrap=h;var f="suspendedStart",y="executing",_="completed",v={};function g(){}function b(){}function m(){}var w={};d(w,c,(function(){return this}));var x=Object.getPrototypeOf,L=x&&x(x(E([])));L&&L!==e&&o.call(L,c)&&(w=L);var C=m.prototype=g.prototype=Object.create(w);function k(r){["next","throw","return"].forEach((function(t){d(r,t,(function(r){return this._invoke(t,r)}))}))}function P(r,t){function e(a,i,s,c){var l=p(r[a],r,i);if("throw"!==l.type){var u=l.arg,d=u.value;return d&&"object"==n(d)&&o.call(d,"__await")?t.resolve(d.__await).then((function(r){e("next",r,s,c)}),(function(r){e("throw",r,s,c)})):t.resolve(d).then((function(r){u.value=r,s(u)}),(function(r){return e("throw",r,s,c)}))}c(l.arg)}var a;i(this,"_invoke",{value:function(r,n){function o(){return new t((function(t,o){e(r,n,t,o)}))}return a=a?a.then(o,o):o()}})}function I(t,e,n){var o=f;return function(a,i){if(o===y)throw Error("Generator is already running");if(o===_){if("throw"===a)throw i;return{value:r,done:!0}}for(n.method=a,n.arg=i;;){var s=n.delegate;if(s){var c=S(s,n);if(c){if(c===v)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===f)throw o=_,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=y;var l=p(t,e,n);if("normal"===l.type){if(o=n.done?_:"suspendedYield",l.arg===v)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=_,n.method="throw",n.arg=l.arg)}}}function S(t,e){var n=e.method,o=t.iterator[n];if(o===r)return e.delegate=null,"throw"===n&&t.iterator.return&&(e.method="return",e.arg=r,S(t,e),"throw"===e.method)||"return"!==n&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+n+"' method")),v;var a=p(o,t.iterator,e.arg);if("throw"===a.type)return e.method="throw",e.arg=a.arg,e.delegate=null,v;var i=a.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=r),e.delegate=null,v):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,v)}function A(r){var t={tryLoc:r[0]};1 in r&&(t.catchLoc=r[1]),2 in r&&(t.finallyLoc=r[2],t.afterLoc=r[3]),this.tryEntries.push(t)}function N(r){var t=r.completion||{};t.type="normal",delete t.arg,r.completion=t}function O(r){this.tryEntries=[{tryLoc:"root"}],r.forEach(A,this),this.reset(!0)}function E(t){if(t||""===t){var e=t[c];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var a=-1,i=function e(){for(;++a<t.length;)if(o.call(t,a))return e.value=t[a],e.done=!1,e;return e.value=r,e.done=!0,e};return i.next=i}}throw new TypeError(n(t)+" is not iterable")}return b.prototype=m,i(C,"constructor",{value:m,configurable:!0}),i(m,"constructor",{value:b,configurable:!0}),b.displayName=d(m,u,"GeneratorFunction"),t.isGeneratorFunction=function(r){var t="function"==typeof r&&r.constructor;return!!t&&(t===b||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(r){return Object.setPrototypeOf?Object.setPrototypeOf(r,m):(r.__proto__=m,d(r,u,"GeneratorFunction")),r.prototype=Object.create(C),r},t.awrap=function(r){return{__await:r}},k(P.prototype),d(P.prototype,l,(function(){return this})),t.AsyncIterator=P,t.async=function(r,e,n,o,a){void 0===a&&(a=Promise);var i=new P(h(r,e,n,o),a);return t.isGeneratorFunction(e)?i:i.next().then((function(r){return r.done?r.value:i.next()}))},k(C),d(C,u,"Generator"),d(C,c,(function(){return this})),d(C,"toString",(function(){return"[object Generator]"})),t.keys=function(r){var t=Object(r),e=[];for(var n in t)e.push(n);return e.reverse(),function r(){for(;e.length;){var n=e.pop();if(n in t)return r.value=n,r.done=!1,r}return r.done=!0,r}},t.values=E,O.prototype={constructor:O,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=r,this.done=!1,this.delegate=null,this.method="next",this.arg=r,this.tryEntries.forEac
2h(N),!t)for(var e in this)"t"===e.charAt(0)&&o.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=r)},stop:function(){this.done=!0;var r=this.tryEntries[0].completion;if("throw"===r.type)throw r.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(n,o){return s.type="throw",s.arg=t,e.next=n,o&&(e.method="next",e.arg=r),!!o}for(var a=this.tryEntries.length-1;a>=0;--a){var i=this.tryEntries[a],s=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var c=o.call(i,"catchLoc"),l=o.call(i,"finallyLoc");if(c&&l){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(c){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(r,t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc<=this.prev&&o.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var a=n;break}}a&&("break"===r||"continue"===r)&&a.tryLoc<=t&&t<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=r,i.arg=t,a?(this.method="next",this.next=a.finallyLoc,v):this.complete(i)},complete:function(r,t){if("throw"===r.type)throw r.arg;return"break"===r.type||"continue"===r.type?this.next=r.arg:"return"===r.type?(this.rval=this.arg=r.arg,this.method="return",this.next="end"):"normal"===r.type&&t&&(this.next=t),v},finish:function(r){for(var t=this.tryEntries.length-1;t>=0;--t){var e=this.tryEntries[t];if(e.finallyLoc===r)return this.complete(e.completion,e.afterLoc),N(e),v}},catch:function(r){for(var t=this.tryEntries.length-1;t>=0;--t){var e=this.tryEntries[t];if(e.tryLoc===r){var n=e.completion;if("throw"===n.type){var o=n.arg;N(e)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:E(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=r),v}},t}function i(r,t,e,n,o,a,i){try{var s=r[a](i),c=s.value}catch(r){return void e(r)}s.done?t(c):Promise.resolve(c).then(n,o)}function s(r){return function(){var t=this,e=arguments;return new Promise((function(n,o){var a=r.apply(t,e);function s(r){i(a,n,o,s,c,"next",r)}function c(r){i(a,n,o,s,c,"throw",r)}s(void 0)}))}}var c=e(760185),l=e(504015);t.Z={name:"LibraryLoginView",props:{libraryId:{type:String,required:!0},code:{type:String,default:null},libName:{type:String,default:null},isDeeplink:{type:String,default:"false"},entityID:{type:String,default:null},target:{type:String,default:null}},data:function(){return{libraryProfileId:null,libraryPassword:null,errMsg:null,progressState:null,alreadyLoggedIn:!1,isInLibraryNetwork:null,hasSubscription:!1}},computed:{canAccessPremium:function(){return this.hasSubscription||!!this.isInLibraryNetwork},checkingNetwork:function(){return!this.hasSubscription&&null===this.isInLibraryNetwork&&!this.errMsg},isHoustonLibrary:function(){return this.isOpenAthens&&"houston"===this.libName},isAirdrieLogin:function(){return this.isOpenAthens&&"airdrie"===this.libName},isOpenAthens:function(){return"open-athens"===this.libraryId||"open-athens-redirect"===this.libraryId},isArapahoe:function(){return"arapahoe-13579"===this.libraryId},isLafourche:function(){return"lafourche"===this.libraryId},isShreve:function(){return"shreve"===this.libraryId},showWayFinder:function(){return"way-finder"===this.libName}},mounted:function(){var r=this;return s(a().mark((function t(){var e;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r.libraryProfileId=null===(e=me.get("library"))||void 0===e?void 0:e.profileId,r.alreadyLoggedIn=!me.isAnonymous(),"true"!==r.isDeeplink||r.alreadyLoggedIn){t.next=5;break}return r.redirectToOpenAthens(),t.abrupt("return");case 5:if(!(r.isHoustonLibrary||r.isOpenAthens||r.isAirdrieLogin)){t.next=8;break}return r.handleByOpenAthens(),t.abrupt("return");case 8:if(!r.isArapahoe){t.next=12;break}return r.hasSubscription=me.hasSubscription(),t.next=12,r.handleArapahoe();case 12:case"end":return t.stop()}}),t)})))()},methods:{onLibraryLogin:function(r){var t=this;return s(a().mark((function e(){var n;return a().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=r.libraryName,t.errMsg=null,e.prev=2,!t.isLafourche){e.next=6;break}return e.next=6,c.loginLafourche({libraryProfileId:t.libraryProfileId,libraryPassword:t.libraryPassword,libraryName:n});case 6:if(!t.isShreve){e.next=9;break}return e.next=9,c.loginShreve({libraryProfileId:t.libraryProfileId,libraryPassword:t.libraryPassword,libraryName:n});case 9:return e.next=11,t.postLogin();case 11:e.next=18;break;case 13:e.prev=13,e.t0=e.catch(2),console.error("error resp",e.t0),t.errMsg=e.t0.message,t.progressState=null;case 18:case"end":return e.stop()}}),e,null,[[2,13]])})))()},loginAgain:function(){return s(a().mark((function r(){return a().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return l.currentView.logoutRedirectURL=null,r.next=3,me.logout();case 3:case"end":return r.stop()}}),r)})))()},postLogin:function(){return s(a().mark((function r(){return a().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return(0,o.extraProvisions)(),r.next=3,me.fetch({cache:!1});case 3:window.location="/play";case 4:case"end":return r.stop()}}),r)})))()},handleByOpenAthens:function(){var r=this;return s(a().mark((function t(){return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!r.alreadyLoggedIn){t.next=2;break}return t.abrupt("return");case 2:if(r.loadWayFinder(),!r.code){t.next=19;break}return r.progressState="Fetching user info...",r.errMsg=null,t.prev=6,t.next=9,c.loginOpenAthens({code:r.code});case 9:return r.progressState="Trying to login...",t.next=12,r.postLogin();case 12:t.next=19;break;case 14:t.prev=14,t.t0=t.catch(6),console.error("handleOA err",t.t0),r.errMsg=(null===t.t0||void 0===t.t0?void 0:t.t0.message)||"Failed to retrieve user info",r.progressState=null;case 19:case"end":return t.stop()}}),t,null,[[6,14]])}
2)))()},loadWayFinder:function(){!function(r,t,e,n){r._wayfinder=r._wayfinder||function(){(r._wayfinder.q=r._wayfinder.q||[]).push(arguments)};var o={oaDomain:"codecombat.com",oaAppId:"6a0d8c7e-3577-41e0-9e6b-220da4c8e8c6"};r._wayfinder.settings=o;var a=t.getElementsByTagName("head")[0],i=t.createElement("script");i.async=1;var s=Object.keys(o).map((function(r){return r+"="+o[r]})).join("&");i.src="https://wayfinder.openathens.net/embed/v1/loader.js?"+s,a.appendChild(i)}(window,document)},redirectToOpenAthens:function(){var r=l.application.isProduction()?"codecombat.com.oidc-app-v1.705681f4-8cce-48aa-a022-a7a3c65f23c9":"codecombat.com.oidc-app-v1.6a0d8c7e-3577-41e0-9e6b-220da4c8e8c6",t=this.libraryId.includes("-redirect")?this.libraryId:"".concat(this.libraryId,"-redirect"),e=encodeURIComponent("".concat(window.location.origin,"/library/").concat(t,"/login")),n=this.entityID?"&entityID=".concat(encodeURIComponent(this.entityID)):"";window.location="https://connect.openathens.net/oidc/auth?client_id=".concat(r,"&scope=").concat("openid","&response_type=").concat("code","&redirect_uri=").concat(e).concat(n)},handleArapahoe:function(){var r=this;return s(a().mark((function t(){var e;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!r.hasSubscription){t.next=2;break}return t.abrupt("return");case 2:return t.prev=2,t.next=5,(0,o.extraProvisions)();case 5:e=t.sent,r.isInLibraryNetwork=!(null==e||!e.isInLibraryNetwork),t.next=13;break;case 9:t.prev=9,t.t0=t.catch(2),console.error("handleArapahoe err",t.t0),r.errMsg=(null===t.t0||void 0===t.t0?void 0:t.t0.message)||"Failed to verify library network";case 13:case"end":return t.stop()}}),t,null,[[2,9]])})))()},playCoco:function(){window.location="/play"}}}},207950:(r,t)=>{t.xk=t.sY=void 0,t.sY=function(){var r=this,t=r._self._c;return t("div",[t("div",{staticClass:"library-login"},[r.isArapahoe?t("div",{staticClass:"arapahoe common"},[r._m(0),r._v(" "),t("div",{staticClass:"arapahoe__body"},[r.checkingNetwork?t("div",{staticClass:"arapahoe__checking"},[r._v("\n "+r._s(r.$t("common.loading"))+"\n ")]):[t("div",{staticClass:"arapahoe__body__submit"},[t("button",{staticClass:"arapahoe__body__submit-btn purple-btn",attrs:{type:"button"},on:{click:r.playCoco}},[r._v("\n "+r._s(r.canAccessPremium?r.$t("library.play_premium"):r.$t("library.play_free"))+"\n ")])]),r._v(" "),r.canAccessPremium?r._e():t("div",{staticClass:"arapahoe__msg warning"},[r._v("\n "+r._s(r.$t("library.not_in_library_network"))+"\n ")])],r._v(" "),r.errMsg?t("div",{staticClass:"arapahoe__error error"},[r._v("\n "+r._s(r.errMsg)+"\n ")]):r._e()],2)]):r.isShreve?t("div",{staticClass:"shreve common"},[r._m(1),r._v(" "),r.alreadyLoggedIn?t("div",{staticClass:"common__already"},[r._v("\n "+r._s(r.$t("library.already_logged_in"))+"\n ")]):t("form",{on:{submit:function(t){return t.preventDefault(),function(){return r.onLibraryLogin({libraryName:"shreve"})}.apply(null,arguments)}}},[t("div",{staticClass:"shreve__body"},[t("div",{staticClass:"shreve__body__library"},[t("h2",{staticClass:"shreve__body__library-text"},[r._v("\n "+r._s(r.$t("library.enter_library_card"))+"\n ")]),r._v(" "),t("div",{staticClass:"shreve__body__library-input"},[t("input",{directives:[{name:"model",rawName:"v-model",value:r.libraryProfileId,expression:"libraryProfileId"}],staticClass:"form-control shreve__body__library-input-box",attrs:{type:"text",placeholder:"Library Card No."},domProps:{value:r.libraryProfileId},on:{input:function(t){t.target.composing||(r.libraryProfileId=t.target.value)}}})]),r._v(" "),t("div",{staticClass:"shreve__body__password-input"},[t("input",{directives:[{name:"model",rawName:"v-model",value:r.libraryPassword,expression:"libraryPassword"}],staticClass:"form-control shreve__body__library-input-box",attrs:{type:"password",placeholder:"Password"},domProps:{value:r.libraryPassword},on:{input:function(t){t.target.composing||(r.libraryPassword=t.target.value)}}})])]),r._v(" "),t("div",{staticClass:"shreve__body__submit"},[t("button",{staticClass:"shreve__body__submit-btn purple-btn",attrs:{type:"submit"}},[r._v("\n "+r._s(r.$t("library.access_coco"))+"\n ")])]),r._v(" "),r.errMsg?t("div",{staticClass:"shreve__error error"},[r._v("\n "+r._s(r.errMsg)+"\n ")]):r._e()])])]):r.isLafourche?t("div",{staticClass:"lafourche common"},[r._m(2),r._v(" "),r.alreadyLoggedIn?t("div",{staticClass:"common__already"},[r._v("\n "+r._s(r.$t("library.already_logged_in"))+"\n ")]):t("form",{on:{submit:function(t){return t.preventDefault(),function(){return r.onLibraryLogin({libraryName:"lafourche"})}.apply(null,arguments)}}},[t("div",{staticClass:"lafourche__body"},[t("div",{staticClass:"lafourche__body__library"},[t("h2",{staticClass:"lafourche__body__library-text"},[r._v("\n "+r._s(r.$t("library.enter_library_card"))+"\n ")]),r._v(" "),t("div",{staticClass:"lafourche__body__library-input"},[t("input",{directives:[{name:"model",rawName:"v-model",value:r.libraryProfileId,expression:"libraryProfileId"}],staticClass:"form-control lafourche__body__library-input-box",attrs:{type:"text",placeholder:"Library Card No."},domProps:{value:r.libraryProfileId},on:{input:function(t){t.target.composing||(r.libraryProfileId=t.target.value)}}})]),r._v(" "),t("div",{staticClass:"lafourche__body__password-input"},[t("input",{directives:[{name:"model",rawName:"v-model",value:r.libraryPassword,expression:"libraryPassword"}],staticClass:"form-control lafourche__body__library-input-box",attrs:{type:"password",placeholder:"Password"},domProps:{value:r.libraryPassword},on:{input:function(t){t.target.composing||(r.libraryPassword=t.target.value)}}})])]),r._v(" "),t("div",{staticClass:"lafourche__body__submit"},[t("button",{staticClass:"lafourche__body__submit-btn purple-btn",attrs:{type:"submit"}},[r._v("\n "+r._s(r.$t("library.access_coco"))+"\n ")])]),r._v(" "),r.errMsg?t("div",{staticClass:"lafourche__error error"},[r._v("\n "+r._s(r.errMsg)+"\n ")]):r._e()])])]):r.isOpenAthens||r.isHoustonLibrary||r.isAirdrieLogin?t("div",{staticClass:"houston common"},[r.isHoustonLibrary?t("div",{staticClass:"common__head"},[t("img",{staticClass:"common__head-logo",attrs:{src:"/images/pages/play/houston-library-logo.png",alt:"Houston logo"}})]):r.isAirdrieLogin?t("div",{staticClass:"common__head"},[t("img",{staticClass:"common__head-logo",attrs:{src:"/images/pages/play/airdrie-library-logo.png",alt:"Airdrie logo"}})]):r._e(),r._v(" "),t("div",{directives:[{name:"show",rawName:"v-show",value:!r.progressState&&!r.alreadyLoggedIn&&r.showWayFinder,expression:"!progressState && !alreadyLoggedIn && showWayFinder"}],attrs:{id:"wayfinder"}},[r._v("\n "+r._s(r.$t("common.loading"))+"\n ")]),r._v(" "),r.alreadyLoggedIn?t("div",{staticClass:"common__already"},[r._v("\n "+r._s(r.$t("library.already_logged_in"))+"\n ")]):t("div",{staticClass:"houston__login"},[!r.progressState&&r.showWayFinder?t("p",{staticClass:"houston__login__option"},[r._v("\n "+r._s(r.$t("library.search_box_option"))+"\n "),t("a",{staticClass:"houston__login__option-link",attrs:{href:"#"},on:{click:function(t){return t.preventDefault(),r.redirectToOpenAthens.apply(null,arguments)}}},[r._v("\n "+r._s(r.$t("general.here"))+"\n ")]),r._v("\n "+r._s(r.$t("code.or"))+" "),t("a",{attrs:{href:"mailto:[email protected]"}},[r._v(r._s(r.$t("contact.contact_us"))+" ")])]):r._e(),r._v(" "),r.progressState||r.showWayFinder||"true"===r.isDeeplink?"true"===r.isDeeplink?t("div",{staticClass:"houston__login__redirect"},[r._v("\n Redirecting..\n ")]):r._e():t("div",{staticClass:"houston__login__btn"},[t("button",{staticClass:"purple-btn",on:{click:r.redirectToOpenAthens}
2},[r._v("\n Login / Sign Up\n ")])])]),r._v(" "),r.progressState?t("div",{staticClass:"houston__progress"},[r._v("\n "+r._s(r.progressState)+"\n ")]):r.errMsg?t("div",{staticClass:"houston__error error"},[r._v("\n "+r._s(r.errMsg)+"\n ")]):r._e()]):t("div",{staticClass:"unknown"},[r._v("\n "+r._s(r.$t("not_found.page_not_found"))+"\n ")])])])},t.xk=[function(){var r=this._self._c;return r("div",{staticClass:"common__head"},[r("img",{staticClass:"common__head-logo",attrs:{src:"/images/pages/play/arapahoe-logo.png",alt:"Arapahoe logo"}})])},function(){var r=this._self._c;return r("div",{staticClass:"shreve__head"},[r("img",{staticClass:"common__head-logo",attrs:{src:"/images/pages/play/shreve-logo.webp",alt:"shreve logo"}})])},function(){var r=this._self._c;return r("div",{staticClass:"lafourche__head"},[r("img",{staticClass:"common__head-logo",attrs:{src:"/images/pages/play/lafourche-logo.webp",alt:"Lafourche logo"}})])}]},680104:(r,t,e)=>{e.r(t),e.d(t,{__esModule:()=>o.X,default:()=>i});var n=e(207950),o=e(197535);const a=o.Z,i=(0,e(551900).Z)(a,n.sY,n.xk,!1,null,"b9e80180",null).exports}}]); 3//# sourceMappingURL=libraryLogin-cb577da27b500e4f1cc8.bundle.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.