{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./Usc.Web/scripts/bundles/programitem2022/_programitem2022.js","webpack:///./Usc.Web/scripts/bundles/programitem2022/controller.js"],"names":["installedModules","__webpack_require__","moduleId","exports","module","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","angular","controller","DOM","INT","AUD","filterValid","this","findValidLocationForAudience","validLocation","locationButtons","find","e","getAttribute","includes","audience","onLocationSelect","innerText","trim","location","onAudienceSelect","toLowerCase","localStorage","setItem","substring","currentLocationAudience","filterableElements","forEach","locAttribute","validLoc","audAttribute","validAud","classList","defaultAudienceArray","Array","from","document","querySelectorAll","map","x","split","flat","filter","v","arr","indexOf","getElementById","pathways","length","parentElement","setAttribute","getItem","search","locationElements","audienceElements","locationDropdown"],"mappings":"aACE,IAAIA,EAAmB,GAGvB,SAASC,EAAoBC,GAG5B,GAAGF,EAAiBE,GACnB,OAAOF,EAAiBE,GAAUC,QAGnC,IAAIC,EAASJ,EAAiBE,GAAY,CACzCG,EAAGH,EACHI,GAAG,EACHH,QAAS,IAUV,OANAI,EAAQL,GAAUM,KAAKJ,EAAOD,QAASC,EAAQA,EAAOD,QAASF,GAG/DG,EAAOE,GAAI,EAGJF,EAAOD,QAKfF,EAAoBQ,EAAIF,EAGxBN,EAAoBS,EAAIV,EAGxBC,EAAoBU,EAAI,SAASR,EAASS,EAAMC,GAC3CZ,EAAoBa,EAAEX,EAASS,IAClCG,OAAOC,eAAeb,EAASS,EAAM,CAAEK,YAAY,EAAMC,IAAKL,KAKhEZ,EAAoBkB,EAAI,SAAShB,GACX,oBAAXiB,QAA0BA,OAAOC,aAC1CN,OAAOC,eAAeb,EAASiB,OAAOC,YAAa,CAAEC,MAAO,WAE7DP,OAAOC,eAAeb,EAAS,aAAc,CAAEmB,OAAO,KAQvDrB,EAAoBsB,EAAI,SAASD,EAAOE,GAEvC,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esContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"/dist/\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 68);\n","import './controller.js';\r\n//import '../programitem/studentprofilemodal';\r\n\r\nimport 'Sass/views/program-item-2022.scss';","(function () {\r\n 'use strict';\r\n\r\n /*\r\n * Until we have an actual functioning curriculum information management system, this is as good as it gets.\r\n * @param {any} $scope\r\n * @param {any} $q\r\n * @param {any} capsService\r\n */\r\n function controller() {\r\n\r\n const DOM = 'domestic';\r\n const INT = 'international';\r\n const LOC = 'location';\r\n const AUD = 'audience';\r\n\r\n this.findValidLocationForAudience = () => {\r\n const validLocation = locationButtons.find(e => e.getAttribute(AUD).includes(this.audience));\r\n if (validLocation) {\r\n this.onLocationSelect(validLocation.innerText.trim());\r\n }\r\n }\r\n\r\n this.onLocationSelect = location => {\r\n this.location = location;\r\n filterValid();\r\n }\r\n\r\n this.onAudienceSelect = audience => {\r\n this.audience = audience.toLowerCase();\r\n localStorage.setItem('view_pref', this.audience.substring(0, 3));\r\n\r\n filterValid();\r\n\r\n // if the current location isn't available to the selected type, find the first valid\r\n // it's a bit ugly as it requires getting the node from the dropdown to check the audience\r\n const currentLocationAudience = locationButtons.find(e => e.innerText.trim() === this.location)?.getAttribute(AUD);\r\n if (currentLocationAudience && !currentLocationAudience.includes(this.audience)) {\r\n this.findValidLocationForAudience();\r\n }\r\n }\r\n\r\n const filterValid = () => {\r\n filterableElements.forEach(e => {\r\n const locAttribute = e.getAttribute(LOC);\r\n const validLoc = !locAttribute || locAttribute.includes(this.location);\r\n const audAttribute = e.getAttribute(AUD);\r\n const validAud = !audAttribute || audAttribute.includes(this.audience);\r\n\r\n e.classList[validLoc && validAud ? 'remove' : 'add']('d-none');\r\n e.classList[validLoc && validAud ? 'add' : 'remove']('pulse');\r\n });\r\n }\r\n\r\n // set the default location, trigger events\r\n // default location is determined by checking the header blocks\r\n const defaultAudienceArray = Array.from(document.querySelectorAll('.program-header--text [audience]'))\r\n .map(x => x.getAttribute('audience').split(' '))\r\n .flat()\r\n .filter((v, i, arr) => arr.indexOf(v) === i);\r\n\r\n // hide pathways for international if no pathways applicable\r\n if (defaultAudienceArray.includes(INT) && document.getElementById('pathways')) {\r\n const intPathways = pathways.querySelectorAll('[audience*=\"international\"]');\r\n if (intPathways.length == 0) {\r\n document.getElementById('pathways-tab').parentElement.setAttribute('audience', 'domestic');\r\n }\r\n }\r\n\r\n this.audience = defaultAudienceArray.length == 2 ? DOM : defaultAudienceArray[0] === INT ? INT : DOM;\r\n\r\n // override if querystring sets value or if localstore has international preference\r\n if ((localStorage.getItem('view_pref') === 'int' || location.search.includes('view=int')) && defaultAudienceArray.includes(INT)) this.audience = INT;\r\n else if (location.search.includes('view=dom') && defaultAudienceArray.includes(DOM)) this.audience = DOM;\r\n\r\n // find all elements with location attribute, hide em\r\n const locationElements = document.querySelectorAll('[location]');\r\n const audienceElements = document.querySelectorAll('[audience]');\r\n\r\n const filterableElements = [...locationElements, ...audienceElements];\r\n const locationButtons = Array.from(locationDropdown.querySelectorAll('button'));\r\n\r\n // cascades through locationSelect and filterValid\r\n this.findValidLocationForAudience();\r\n }\r\n\r\n angular.module('Uscapp').controller('Usc.ProgramItem2022.Controller', [controller]);\r\n}());\r\n"],"sourceRoot":""}