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AAS,EACvCC,EAAWR,EAAQS,kBAGrB,OAAOZ,EAAMhB,EAAW,QADxBwB,EAAQA,GAAS,CAAC,EACsB5C,IACrCiD,KAAKV,EAAQL,OACbe,KAAKZ,GACLY,MAAK,SAAUX,GACd,OAAIO,IAAoBE,EACfL,EAAU,cAAVA,CAAyBJ,GAE3BA,CACT,IACCW,KAAKP,EAAU,SACpB,EAoBA5B,OAAQ,SAAUd,GAChB,IAtGUkD,EAsGNC,GAtGMD,EAsGmBX,EAAQC,aArGpC,WACL,OAAOU,CACT,GAoGM,OAAOd,EAAMhB,EAAW,cAAUY,EAAWhC,IAC1CiD,KAAKR,GACLQ,KAAKE,GACLF,KAAKP,EAAU,UACpB,EAwBA3B,SAAU,SAAU6B,EAAO5C,GAEzB,OAAOoC,EAAMhB,EAAW,WADxBwB,EAAQA,GAAS,CAAC,EACyB5C,IACxCiD,KAAKV,EAAQL,OACbe,KAAKZ,GACLY,KAAKP,EAAU,oBACpB,EAeAU,YAAa,WACX,OAAIb,EAAQS,kBACHpD,EAAGyD,KAAKd,EAAQC,cAElBD,EAAQ1B,OACjB,EAOAmC,gBAAiB,WACf,QAAST,EAAQC,YACnB,GAGF,OAAOD,CACT,EAEJ,GACD,CAvUD,CAuUGpD,Q","sources":["webpack://typist6/./app/javascript/shared/imagesMapping.js","webpack://typist6/./app/javascript/vendor/angular-devise.js"],"sourcesContent":["// Note: this is not an angularjs service or factory because we need to share this between the main app and applicant screening\n\n// Large files are added directly into S3 and removed from our production\nconst s3ProductionBucket = 'https://production-assets-typist.s3.amazonaws.com';\n\n// Accommodation page\nconst highContrastStickers = `${s3ProductionBucket}/accommodation/high-contrast-stickers.jpg`;\nconst zoomInDemo = `${s3ProductionBucket}/accommodation/zoom-in-demo.gif`;\nconst largeKeysKeyboard = `${s3ProductionBucket}/accommodation/large-keys-keyboard.jpg`;\nconst microErgoKeyboard = `${s3ProductionBucket}/accommodation/micro-ergo-keyboard.png`;\nconst rigidKeys = `${s3ProductionBucket}/accommodation/rigid-keys.png`;\nconst singleHandKeyboard = `${s3ProductionBucket}/accommodation/single-hand-keyboard.png`;\nconst compactKeyboard = `${s3ProductionBucket}/accommodation/compact-keyboard.jpg`;\n\n// Auth\nconst typewriterJpeg = `${s3ProductionBucket}/typewriter.jpeg`;\nconst typewriterWebp = `${s3ProductionBucket}/typewriter.webp`;\n\n// Finger Animated Keyboard\nimport fingerAnimLeftHand1 from '~Images/finger_animations/finger-anim-left-hand-1.png';\nimport fingerAnimLeftHand2 from '~Images/finger_animations/finger-anim-left-hand-2.png';\nimport fingerAnimLeftHand3 from '~Images/finger_animations/finger-anim-left-hand-3.png';\nimport fingerAnimLeftHand4 from '~Images/finger_animations/finger-anim-left-hand-4.png';\nimport fingerAnimLeftHand5 from '~Images/finger_animations/finger-anim-left-hand-5.png';\nimport fingerAnimLeftHandA from '~Images/finger_animations/finger-anim-left-hand-A.png';\nimport fingerAnimLeftHandB from '~Images/finger_animations/finger-anim-left-hand-B.png';\nimport fingerAnimLeftHandBACKTICK from '~Images/finger_animations/finger-anim-left-hand-BACKTICK.png';\nimport fingerAnimLeftHandC from '~Images/finger_animations/finger-anim-left-hand-C.png';\nimport fingerAnimLeftHandCAPSLOCK from '~Images/finger_animations/finger-anim-left-hand-CAPSLOCK.png';\nimport fingerAnimLeftHandD from '~Images/finger_animations/finger-anim-left-hand-D.png';\nimport fingerAnimLeftHandE from '~Images/finger_animations/finger-anim-left-hand-E.png';\nimport fingerAnimLeftHandF from '~Images/finger_animations/finger-anim-left-hand-F.png';\nimport fingerAnimLeftHandG from '~Images/finger_animations/finger-anim-left-hand-G.png';\nimport fingerAnimLeftHandHOME from '~Images/finger_animations/finger-anim-left-hand-HOME.png';\nimport fingerAnimLeftHandLEFTSHIFT from '~Images/finger_animations/finger-anim-left-hand-LEFT-SHIFT.png';\nimport fingerAnimLeftHandQ from '~Images/finger_animations/finger-anim-left-hand-Q.png';\nimport fingerAnimLeftHandR from '~Images/finger_animations/finger-anim-left-hand-R.png';\nimport fingerAnimLeftHandS from '~Images/finger_animations/finger-anim-left-hand-S.png';\nimport fingerAnimLeftHandT from '~Images/finger_animations/finger-anim-left-hand-T.png';\nimport fingerAnimLeftHandTAB from '~Images/finger_animations/finger-anim-left-hand-TAB.png';\nimport fingerAnimLeftHandV from '~Images/finger_animations/finger-anim-left-hand-V.png';\nimport fingerAnimLeftHandW from '~Images/finger_animations/finger-anim-left-hand-W.png';\nimport fingerAnimLeftHandX from '~Images/finger_animations/finger-anim-left-hand-X.png';\nimport fingerAnimLeftHandZ from '~Images/finger_animations/finger-anim-left-hand-Z.png';\nimport fingerAnimRightHandAPOSTROPHE from '~Images/finger_animations/finger-anim-right-hand-APOSTROPHE.png';\nimport fingerAnimRightHandBACKSLASH from '~Images/finger_animations/finger-anim-right-hand-BACKSLASH.png';\nimport fingerAnimRightHandBACKSPACE from '~Images/finger_animations/finger-anim-right-hand-BACKSPACE.png';\nimport fingerAnimRightHandCOMMA from '~Images/finger_animations/finger-anim-right-hand-COMMA.png';\nimport fingerAnimRightHandDASH from '~Images/finger_animations/finger-anim-right-hand-DASH.png';\nimport fingerAnimRightHandENTER from '~Images/finger_animations/finger-anim-right-hand-ENTER.png';\nimport fingerAnimRightHandEQUAL from '~Images/finger_animations/finger-anim-right-hand-EQUAL.png';\nimport fingerAnimRightHandH from '~Images/finger_animations/finger-anim-right-hand-H.png';\nimport fingerAnimRightHandHOME from '~Images/finger_animations/finger-anim-right-hand-HOME.png';\nimport fingerAnimRightHandI from '~Images/finger_animations/finger-anim-right-hand-I.png';\nimport fingerAnimRightHandJ from '~Images/finger_animations/finger-anim-right-hand-J.png';\nimport fingerAnimRightHandK from '~Images/finger_animations/finger-anim-right-hand-K.png';\nimport fingerAnimRightHandL from '~Images/finger_animations/finger-anim-right-hand-L.png';\nimport fingerAnimRightHandM from '~Images/finger_animations/finger-anim-right-hand-M.png';\nimport fingerAnimRightHandN from '~Images/finger_animations/finger-anim-right-hand-N.png';\nimport fingerAnimRightHandO from '~Images/finger_animations/finger-anim-right-hand-O.png';\nimport fingerAnimRightHandP from '~Images/finger_animations/finger-anim-right-hand-P.png';\nimport fingerAnimRightHandPERIOD from '~Images/finger_animations/finger-anim-right-hand-PERIOD.png';\nimport fingerAnimRightHandRIGHTSHIFT from '~Images/finger_animations/finger-anim-right-hand-RIGHT-SHIFT.png';\nimport fingerAnimRightHandRIGHTSQUAREBRACKET from '~Images/finger_animations/finger-anim-right-hand-RIGHTSQUAREBRACKET.png';\nimport fingerAnimRightHandSEMICOLON from '~Images/finger_animations/finger-anim-right-hand-SEMICOLON.png';\nimport fingerAnimRightHandSPACE from '~Images/finger_animations/finger-anim-right-hand-SPACE.png';\nimport fingerAnimRightHandU from '~Images/finger_animations/finger-anim-right-hand-U.png';\nimport fingerAnimRightHandY from '~Images/finger_animations/finger-anim-right-hand-Y.png';\n\n// Test link videos\n// MP4s are added directly into S3 and removed from our production\nconst setTestLinkSettings = `${s3ProductionBucket}/mp4s/set_test_link_settings.mp4`;\nconst testLinksPickDayWeek = `${s3ProductionBucket}/mp4s/test_links_pick_day_week.mp4`;\nconst copyTestLinks = `${s3ProductionBucket}/mp4s/copy_test_links.mp4`;\n\n// Home (student)\nimport handsOverKeyboardZoomed from '~Images/hands-over-keyboard-zoomed.png';\nimport postureSittingPositionZoomed from '~Images/posture-sitting-position-zoomed.png';\nimport postureEyeLevelZoomed from '~Images/posture-eye-level-zoomed.png';\n\n// Certificates\nimport typistCertificate from '~Images/Typist-Certificate-R3-1584x1224.png';\n\n// Create Account Payment\nimport accessCard from '~Images/access-card.png';\n\n// Profile\nimport badStudentProfile from '~Images/profile/bad_student_profile.png';\nimport goodStudentProfile from '~Images/profile/good_student_profile.png';\nimport kermitMeme from '~Images/profile/kermit-meme.jpeg';\n\n// Transcription\nimport transcriptionModalPrint from '~Images/transcription-modal-print.png';\nimport logoTranscriptionPrintBw from '~Images/logo-transcription-print-bw.png';\n\n// Account\nimport typistDocumentsWithIcon from '~Images/branding/typist_documents_with_icon.png';\nimport typistKeyboardingWithIcon from '~Images/branding/typist_keyboarding_with_icon.png';\nimport ehrUniversityWithIcon from '~Images/branding/ehr_university_with_icon.png';\n\n// Skill Assessment\nimport typistBrandSkillAssessment from '~Images/branding/Typist_Brand_Ext_SkillsSkills_BlueSmall.png';\n\n// A factory that provides the url paths to assets after they were compiled via webpack\n// By using import/require statements to images in project directory (webpack aliases are allowed),\n// webpack emits these files into the dist folders and returns the new name of the file (including the hash that was added)\n// NOTE: AngularJS factory is a singleton so this gets executed only once\n// Creating a factory instead of requiring it in controllers because not all states have dedicated controllers (eg. accommodation page)\n// and injecting a service/factory into an inline controller in the routes is much easier and faster\nconst imagesMapping = new Proxy(\n {\n // Accommodation page\n highContrastStickers,\n zoomInDemo,\n largeKeysKeyboard,\n microErgoKeyboard,\n rigidKeys,\n singleHandKeyboard,\n compactKeyboard,\n\n // Auth\n typewriterJpeg,\n typewriterWebp,\n\n // Finger Animated Keyboard\n fingerAnimLeftHand1,\n fingerAnimLeftHand2,\n fingerAnimLeftHand3,\n fingerAnimLeftHand4,\n fingerAnimLeftHand5,\n fingerAnimLeftHandA,\n fingerAnimLeftHandB,\n fingerAnimLeftHandBACKTICK,\n fingerAnimLeftHandC,\n fingerAnimLeftHandCAPSLOCK,\n fingerAnimLeftHandD,\n fingerAnimLeftHandE,\n fingerAnimLeftHandF,\n fingerAnimLeftHandG,\n fingerAnimLeftHandHOME,\n fingerAnimLeftHandLEFTSHIFT,\n fingerAnimLeftHandQ,\n fingerAnimLeftHandR,\n fingerAnimLeftHandS,\n fingerAnimLeftHandT,\n fingerAnimLeftHandTAB,\n fingerAnimLeftHandV,\n fingerAnimLeftHandW,\n fingerAnimLeftHandX,\n fingerAnimLeftHandZ,\n fingerAnimRightHandAPOSTROPHE,\n fingerAnimRightHandBACKSLASH,\n fingerAnimRightHandBACKSPACE,\n fingerAnimRightHandCOMMA,\n fingerAnimRightHandDASH,\n fingerAnimRightHandENTER,\n fingerAnimRightHandEQUAL,\n fingerAnimRightHandH,\n fingerAnimRightHandHOME,\n fingerAnimRightHandI,\n fingerAnimRightHandJ,\n fingerAnimRightHandK,\n fingerAnimRightHandL,\n fingerAnimRightHandM,\n fingerAnimRightHandN,\n fingerAnimRightHandO,\n fingerAnimRightHandP,\n fingerAnimRightHandPERIOD,\n fingerAnimRightHandRIGHTSHIFT,\n fingerAnimRightHandRIGHTSQUAREBRACKET,\n fingerAnimRightHandSEMICOLON,\n fingerAnimRightHandSPACE,\n fingerAnimRightHandU,\n fingerAnimRightHandY,\n\n // Test link videos\n setTestLinkSettings,\n testLinksPickDayWeek,\n copyTestLinks,\n\n // Home (student)\n handsOverKeyboardZoomed,\n postureSittingPositionZoomed,\n postureEyeLevelZoomed,\n\n // Certificates\n typistCertificate,\n\n // Create Account Payment\n accessCard,\n\n // Profile\n badStudentProfile,\n goodStudentProfile,\n kermitMeme,\n\n // Transcription\n transcriptionModalPrint,\n logoTranscriptionPrintBw,\n\n // Account\n typistDocumentsWithIcon,\n typistKeyboardingWithIcon,\n ehrUniversityWithIcon,\n\n // Skill Assessment\n typistBrandSkillAssessment,\n },\n {\n get(obj, prop) {\n if (!(prop in obj)) {\n throw new Error(\n `The key \"${prop}\" does not exist in ImagesFactory. Go to ImagesFactory in AngularJS and import it as a module (read docs).`\n );\n }\n return Reflect.get(...arguments);\n },\n }\n);\nexport default imagesMapping;\n","(function (angular) {\n 'use strict';\n var devise = angular.module('Devise', []);\n\n devise\n .provider('AuthIntercept', function AuthInterceptProvider() {\n /**\n * Set to true to intercept 401 Unauthorized responses\n */\n var interceptAuth = false;\n\n // The interceptAuth config function\n this.interceptAuth = function (value) {\n interceptAuth = !!value || value === void 0;\n return this;\n };\n\n this.$get = [\n '$rootScope',\n '$q',\n function ($rootScope, $q) {\n // Only for intercepting 401 requests.\n return {\n responseError: function (response) {\n // Determine if the response is specifically disabling the interceptor.\n var intercept = response.config.interceptAuth;\n intercept = !!intercept || (interceptAuth && intercept === void 0);\n\n if (intercept && response.status === 401) {\n var deferred = $q.defer();\n $rootScope.$broadcast('devise:unauthorized', response, deferred);\n console.log('AuthIntercept caught response. Returning an empty promise');\n return deferred.promise;\n } else {\n console.log('AuthIntercept caught response. Returning response:', response);\n return $q.reject(response);\n }\n },\n };\n },\n ];\n })\n .config([\n '$httpProvider',\n function ($httpProvider) {\n $httpProvider.interceptors.push('AuthIntercept');\n },\n ]);\n\n devise.provider('Auth', function AuthProvider() {\n /**\n * The default paths.\n */\n var paths = {\n login: '/users/sign_in.json',\n logout: '/users/sign_out.json',\n register: '/users.json',\n };\n\n /**\n * The default HTTP methods to use.\n */\n var methods = {\n login: 'POST',\n logout: 'DELETE',\n register: 'POST',\n };\n\n /**\n * Default devise resource_name is 'user', can be set to any string.\n * If it's falsey, it will not namespace the data.\n */\n var resourceName = 'user';\n\n /**\n * The parsing function used to turn a $http\n * response into a \"user\".\n *\n * Can be swapped with another parsing function\n * using\n *\n * angular.module('myModule', ['Devise']).\n * config(function(AuthProvider) {\n * AuthProvider.parse(function(response) {\n * return new User(response.data);\n * });\n * });\n */\n var _parse = function (response) {\n return response.data;\n };\n\n // A helper function that will setup the ajax config\n // and merge the data key if provided\n function httpConfig(action, data, additionalConfig) {\n var config = {\n method: methods[action].toLowerCase(),\n url: paths[action],\n };\n\n if (data) {\n if (resourceName) {\n config.data = {};\n config.data[resourceName] = data;\n } else {\n config.data = data;\n }\n }\n\n angular.extend(config, additionalConfig);\n return config;\n }\n\n // A helper function to define our configure functions.\n // Loops over all properties in obj, and creates a get/set\n // method for [key + suffix] to set that property on obj.\n function configure(obj, suffix) {\n angular.forEach(\n obj,\n function (v, action) {\n this[action + suffix] = function (param) {\n if (param === undefined) {\n return obj[action];\n }\n obj[action] = param;\n return this;\n };\n },\n this\n );\n }\n configure.call(this, methods, 'Method');\n configure.call(this, paths, 'Path');\n\n // The resourceName config function\n this.resourceName = function (value) {\n if (value === undefined) {\n return resourceName;\n }\n resourceName = value;\n return this;\n };\n\n // The parse configure function.\n this.parse = function (fn) {\n if (typeof fn !== 'function') {\n return _parse;\n }\n _parse = fn;\n return this;\n };\n\n // Creates a function that always\n // returns a given arg.\n function constant(arg) {\n return function () {\n return arg;\n };\n }\n\n this.$get = [\n '$q',\n '$http',\n '$rootScope',\n function ($q, $http, $rootScope) {\n // Our shared save function, called\n // by `then`s.\n function save(user) {\n service._currentUser = user;\n return user;\n }\n // A reset that saves null for currentUser\n function reset() {\n save(null);\n }\n\n function broadcast(name) {\n return function (data) {\n $rootScope.$broadcast('devise:' + name, data);\n return data;\n };\n }\n\n var service = {\n /**\n * The Auth service's current user.\n * This is shared between all instances of Auth\n * on the scope.\n */\n _currentUser: null,\n\n /**\n * The Auth service's parsing function.\n * Defaults to the parsing function set in the provider,\n * but may also be overwritten directly on the service.\n */\n parse: _parse,\n\n /**\n * A login function to authenticate with the server.\n * Keep in mind, credentials are sent in plaintext;\n * use a SSL connection to secure them. By default,\n * `login` will POST to '/users/sign_in.json'.\n *\n * The path and HTTP method used to login are configurable\n * using\n *\n * angular.module('myModule', ['Devise']).\n * config(function(AuthProvider) {\n * AuthProvider.loginPath('path/on/server.json');\n * AuthProvider.loginMethod('GET');\n * });\n *\n * @param {Object} [creds] A hash of user credentials.\n * @param {Object} [config] Optional, additional config which\n * will be added to http config for underlying\n * $http.\n * @returns {Promise} A $http promise that will be resolved or\n * rejected by the server.\n */\n login: function (creds, config) {\n var withCredentials = arguments.length > 0,\n loggedIn = service.isAuthenticated();\n\n creds = creds || {};\n return $http(httpConfig('login', creds, config))\n .then(service.parse)\n .then(save)\n .then(function (user) {\n if (withCredentials && !loggedIn) {\n return broadcast('new-session')(user);\n }\n return user;\n })\n .then(broadcast('login'));\n },\n\n /**\n * A logout function to de-authenticate from the server.\n * By default, `logout` will DELETE to '/users/sign_out.json'.\n *\n * The path and HTTP method used to logout are configurable\n * using\n *\n * angular.module('myModule', ['Devise']).\n * config(function(AuthProvider) {\n * AuthProvider.logoutPath('path/on/server.json');\n * AuthProvider.logoutMethod('GET');\n * });\n * @param {Object} [config] Optional, additional config which\n * will be added to http config for underlying\n * $http.\n * @returns {Promise} A $http promise that will be resolved or\n * rejected by the server.\n */\n logout: function (config) {\n var returnOldUser = constant(service._currentUser);\n return $http(httpConfig('logout', undefined, config))\n .then(reset)\n .then(returnOldUser)\n .then(broadcast('logout'));\n },\n\n /**\n * A register function to register and authenticate\n * with the server. Keep in mind, credentials are sent\n * in plaintext; use a SSL connection to secure them.\n * By default, `register` will POST to '/users.json'.\n *\n * The path and HTTP method used to login are configurable\n * using\n *\n * angular.module('myModule', ['Devise']).\n * config(function(AuthProvider) {\n * AuthProvider.registerPath('path/on/server.json');\n * AuthProvider.registerMethod('GET');\n * });\n *\n * @param {Object} [creds] A hash of user credentials.\n * @param {Object} [config] Optional, additional config which\n * will be added to http config for underlying\n * $http.\n * @returns {Promise} A $http promise that will be resolved or\n * rejected by the server.\n */\n register: function (creds, config) {\n creds = creds || {};\n return $http(httpConfig('register', creds, config))\n .then(service.parse)\n .then(save)\n .then(broadcast('new-registration'));\n },\n\n /**\n * A helper function that will return a promise with the currentUser.\n * Three different outcomes can happen:\n * 1. Auth has authenticated a user, and will resolve with it\n * 2. Auth has not authenticated a user but the server has an\n * authenticated session, Auth will attempt to retrieve that\n * session and resolve with its user.\n * 3. Neither Auth nor the server has an authenticated session,\n * and will reject with an unauthenticated error.\n *\n * @returns {Promise} A $http promise that will be resolved or\n * rejected by the server.\n */\n currentUser: function () {\n if (service.isAuthenticated()) {\n return $q.when(service._currentUser);\n }\n return service.login();\n },\n\n /**\n * A helper function to determine if a currentUser is present.\n *\n * @returns Boolean\n */\n isAuthenticated: function () {\n return !!service._currentUser;\n },\n };\n\n return service;\n },\n ];\n });\n})(angular);\n"],"names":["s3ProductionBucket","highContrastStickers","concat","zoomInDemo","largeKeysKeyboard","microErgoKeyboard","rigidKeys","singleHandKeyboard","compactKeyboard","typewriterJpeg","typewriterWebp","setTestLinkSettings","testLinksPickDayWeek","copyTestLinks","imagesMapping","Proxy","fingerAnimLeftHand1","fingerAnimLeftHand2","fingerAnimLeftHand3","fingerAnimLeftHand4","fingerAnimLeftHand5","fingerAnimLeftHandA","fingerAnimLeftHandB","fingerAnimLeftHandBACKTICK","fingerAnimLeftHandC","fingerAnimLeftHandCAPSLOCK","fingerAnimLeftHandD","fingerAnimLeftHandE","fingerAnimLeftHandF","fingerAnimLeftHandG","fingerAnimLeftHandHOME","fingerAnimLeftHandLEFTSHIFT","fingerAnimLeftHandQ","fingerAnimLeftHandR","fingerAnimLeftHandS","fingerAnimLeftHandT","fingerAnimLeftHandTAB","fingerAnimLeftHandV","fingerAnimLeftHandW","fingerAnimLeftHandX","fingerAnimLeftHandZ","fingerAnimRightHandAPOSTROPHE","fingerAnimRightHandBACKSLASH","fingerAnimRightHandBACKSPACE","fingerAnimRightHandCOMMA","fingerAnimRightHandDASH","fingerAnimRightHandENTER","fingerAnimRightHandEQUAL","fingerAnimRightHandH","fingerAnimRightHandHOME","fingerAnimRightHandI","fingerAnimRightHandJ","fingerAnimRightHandK","fingerAnimRightHandL","fingerAnimRightHandM","fingerAnimRightHandN","fingerAnimRightHandO","fingerAnimRightHandP","fingerAnimRightHandPERIOD","fingerAnimRightHandRIGHTSHIFT","fingerAnimRightHandRIGHTSQUAREBRACKET","fingerAnimRightHandSEMICOLON","fingerAnimRightHandSPACE","fingerAnimRightHandU","fingerAnimRightHandY","handsOverKeyboardZoomed","postureSittingPositionZoomed","postureEyeLevelZoomed","typistCertificate","accessCard","badStudentProfile","goodStudentProfile","kermitMeme","transcriptionModalPrint","logoTranscriptionPrintBw","typistDocumentsWithIcon","typistKeyboardingWithIcon","ehrUniversityWithIcon","typistBrandSkillAssessment","get","obj","prop","Error","Reflect","apply","arguments","angular","devise","module","provider","interceptAuth","this","value","$get","$rootScope","$q","responseError","response","intercept","config","status","deferred","defer","$broadcast","console","log","promise","reject","$httpProvider","interceptors","push","paths","login","logout","register","methods","resourceName","_parse","data","httpConfig","action","additionalConfig","method","toLowerCase","url","extend","configure","suffix","forEach","v","param","undefined","call","parse","fn","$http","save","user","service","_currentUser","reset","broadcast","name","creds","withCredentials","length","loggedIn","isAuthenticated","then","arg","returnOldUser","currentUser","when"],"sourceRoot":""}