PageSourceSearch

https://www.gla.ac.uk/3t4/js/dist/gu-entryrequirements.d8addf44.js

js gla.ac.uk collected 2026-09-24 07:21:33 UTC 7,919 bytes, 2 lines download raw bytes

1"use strict";(self.webpackChunkuniversity_of_glasgow=self.webpackChunkuniversity_of_glasgow||[]).push([[600],{45023:function(e,t,n){n.r(t),n.d(t,{default:function(){return EntryRequirements}});class EntryRequirements{constructor(e){this.el=e,this.entry="./src/programmes/entryrequirements.js",this.endpoint="/feeds/apex/ersProgrammeCountry",this.countryendpoint="/feeds/countrypicker/?countries=true",this.programme_id=programme_id,this.default=defaultEntryRequirements,this.defaultSendToSchoolSubjects=defaultSendToSchoolSubjects,this.defaultSendToSchoolGrades=defaultSendToSchoolGrades,this.init()}init(){this.preferencesLink||this.insertPreferencesLink(),this.countrySelector||this.insertCountrySelector(),this.title||this.insertTitle(),this.preferencesLink.addEventListener("click",this.preferencesLinkClickHandler),this.countrySelector.addEventListener("change",(e=>{this.countrySelectorChangeHandler(e)})),this.country&&this.getCountryDetails().then((e=>{this.isUK(e)?this.getEntryRequirements(!0):this.getEntryRequirements()}))}insertPreferencesLink(){this.preferencesLink=document.createElement("a"),this.preferencesLink.href="#",this.preferencesLink.textContent="Change your preferences",this.preferencesLink.classList.add("hide"),this.el.parentNode.insertBefore(this.preferencesLink,this.el)}insertCountrySelector(){this.countrySelector=document.createElement("select"),this.countrySelector.id="countrySelector",this.countrySelector.classList.add("entry-country-select"),this.countrySelector.setAttribute("aria-label","Select your country/region"),this.countrySelector.innerHTML='<option value="">Select your country/region</option>',this.el.parentNode.insertBefore(this.countrySelector,this.el),function getCountries(){return n.e(1842).then(n.bind(n,17967)).then((({default:e})=>e)).catch((e=>"An error occurred while loading the component"))}().then((e=>{new e("entry-country-select")}))}insertTitle(e){document.getElementById("entry-title")&&document.getElementById("entry-title").remove(),this.getCountryDetails().then((t=>{const n=t.title?e?"Showing standard entry requirements":`Showing requirements for ${t.title}`:"Showing standard entry requirements";document.getElementById("entry-title")?document.getElementById("entry-title").textContent=n:(this.title=document.createElement("span"),this.title.id="entry-title",this.title.textContent=n,this.el.parentNode.insertBefore(this.title,this.el))}))}preferencesLinkClickHandler(){alert("Clicked")}countrySelectorChangeHandler(e){const t=e.target.options[e.target.selectedIndex].getAttribute("data-id");if(this.setCountryCookie(t),this.country=t||null,!this.country)return this.el.innerHTML='<p class="entry-requirements-placeholder">Please select your country or region to see entry requirements.</p>',this.title.innerHTML="<span>Showing standard entry requirements</span>",void this.getEntryRequirements(!0);this.getCountryDetails().then((e=>{this.isUK(e)?this.getEntryRequirements(!0):this.getEntryRequirements()}))}getEntryRequirements(e=!1){this.el.innerHTML='<div style="text-align: center;">\n        <svg xmlns="http://www.w3.org/2000/svg" width="200px" height="200px" viewBox="0 0 100 100" preserveAspectRatio="xMidYMid" class="lds-ellipsis" style="background: none; text-align: center;"><circle cx="84" cy="50" r="0" fill="#5b4d94"><animate attributeName="r" values="10;0;0;0;0" keyTimes="0;0.25;0.5;0.75;1" keySplines="0 0.5 0.5 1;0 0.5 0.5 1;0 0.5 0.5 1;0 0.5 0.5 1" calcMode="spline" dur="3.7s" repeatCount="indefinite" begin="0s"></animate><animate attributeName="cx" values="84;84;84;84;84" keyTimes="0;0.25;0.5;0.75;1" keySplines="0 0.5 0.5 1;0 0.5 0.5 1;0 0.5 0.5 1;0 0.5 0.5 1" calcMode="spline" dur="3.7s" repeatCount="indefinite" begin="0s"></animate></circle><circle cx="16" cy="50" r="9.6148" fill="#951272"><animate attributeName="r" values="0;10;10;10;0" keyTimes="0;0.25;0.5;0.75;1" keySplines="0 0.5 0.5 1;0 0.5 0.5 1;0 0.5 0.5 1;0 0.5 0.5 1" calcMode="spline" dur="3.7s" repeatCount="indefinite" begin="-1.85s"></animate><animate attributeName="cx" values="16;16;50;84;84" keyTimes="0;0.25;0.5;0.75;1" keySplines="0 0.5 0.5 1;0 0.5 0.5 1;0 0.5 0.5 1;
10 0.5 0.5 1" calcMode="spline" dur="3.7s" repeatCount="indefinite" begin="-1.85s"></animate></circle><circle cx="84" cy="50" r="0.385197" fill="#0274af"><animate attributeName="r" values="0;10;10;10;0" keyTimes="0;0.25;0.5;0.75;1" keySplines="0 0.5 0.5 1;0 0.5 0.5 1;0 0.5 0.5 1;0 0.5 0.5 1" calcMode="spline" dur="3.7s" repeatCount="indefinite" begin="-0.925s"></animate><animate attributeName="cx" values="16;16;50;84;84" keyTimes="0;0.25;0.5;0.75;1" keySplines="0 0.5 0.5 1;0 0.5 0.5 1;0 0.5 0.5 1;0 0.5 0.5 1" calcMode="spline" dur="3.7s" repeatCount="indefinite" begin="-0.925s"></animate></circle><circle cx="82.6903" cy="50" r="10" fill="#011451"><animate attributeName="r" values="0;10;10;10;0" keyTimes="0;0.25;0.5;0.75;1" keySplines="0 0.5 0.5 1;0 0.5 0.5 1;0 0.5 0.5 1;0 0.5 0.5 1" calcMode="spline" dur="3.7s" repeatCount="indefinite" begin="0s"></animate><animate attributeName="cx" values="16;16;50;84;84" keyTimes="0;0.25;0.5;0.75;1" keySplines="0 0.5 0.5 1;0 0.5 0.5 1;0 0.5 0.5 1;0 0.5 0.5 1" calcMode="spline" dur="3.7s" repeatCount="indefinite" begin="0s"></animate></circle><circle cx="48.6903" cy="50" r="10" fill="#5b4d94"><animate attributeName="r" values="0;0;10;10;10" keyTimes="0;0.25;0.5;0.75;1" keySplines="0 0.5 0.5 1;0 0.5 0.5 1;0 0.5 0.5 1;0 0.5 0.5 1" calcMode="spline" dur="3.7s" repeatCount="indefinite" begin="0s"></animate><animate attributeName="cx" values="16;16;16;50;84" keyTimes="0;0.25;0.5;0.75;1" keySplines="0 0.5 0.5 1;0 0.5 0.5 1;0 0.5 0.5 1;0 0.5 0.5 1" calcMode="spline" dur="3.7s" repeatCount="indefinite" begin="0s"></animate></circle></svg>\n        </div>',this.title&&(this.title.innerHTML="<span>Loading entry requirements...</span>"),setTimeout((()=>{e?(this.el.innerHTML=`\n            <p>${this.default}</p>\n            ${null!==this.defaultSendToSchoolSubjects?`<p class="er-prog-subject-text">${this.defaultSendToSchoolSubjects}</p>`:""}\n            ${null!==this.defaultSendToSchoolGrades?`<p class="er-prog-grades-text">${this.defaultSendToSchoolGrades}</p>`:""}`,this.insertTitle(!0)):fetch(`${this.endpoint}/${this.country}/${this.programme_id}`).then((e=>e.text())).then((t=>{const n=JSON.parse(t),i=n.country_entry_requirements_text,r=n.country_school_requirements_text,s=null!==n.prog_send_to_school_subjects?n.prog_send_to_school_subjects:this.defaultSendToSchoolSubjects,o=null!==n.prog_send_to_school_grades?n.prog_send_to_school_grades:this.defaultSendToSchoolGrades;this.el.innerHTML=null!==i?`\n                        <p>${i}</p>\n                            ${null!==s?`<p class="er-prog-subject-text">${s}</p>`:""}\n                            ${null!==r?`<p class="er-country-school-text">${r}</p>`:""}\n                        `:`<p>Unfortunately we do not have entry requirements for the country you selected: please see below for the entry requirements for the United Kingdom:</p>\n                        <p>${this.default}</p>\n                        ${null!==s?`<p class="er-prog-subject-text">${s}</p>`:""}\n                        ${null!==o?`<p class="er-prog-grades-text">${o}</p>`:""}`,e="string"!=typeof i,this.insertTitle(e)})).catch((e=>{console.error("Error:",e)}))}),1e3)}setCountryCookie(e){}getCountryCookie(){return!!document.cookie.split(";").some((e=>e.trim().startsWith("gu_ct=")))&&document.cookie.split(";").find((e=>e.trim().startsWith("gu_ct="))).split("=")[1]}isUK(e){try{return!0===e.isUk}catch(e){return console.error("Error in isUK:",e),!1}}async getCountryDetails(){try{if(!this.countries){const e=await fetch(this.countryendpoint),t=await e.json();this.countries=t}for(const e of this.countries)if(e.id==this.country)return e;return!1}catch(e){return console.error("Error in get country details:",e),!1}}}}}]);
2//# sourceMappingURL=gu-entryrequirements.d8addf44.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.