1(()=>{var e={532(){function e(e){let n=e.classList.contains("accordion-open"),o=e.nextElementSibling;n?(e.classList.remove("accordion-open"),o.style.display="none",o.style.overflow="hidden"):(e.classList.add("accordion-open"),o.addEventListener("transitionend",function e(){o.style.overflow="visible",o.removeEventListener("transitionend",e)}),o.style.display="block",o.hasChildNodes()?t(o):(o.style.maxHeight="3rem",o.style.height="3rem"))}function t(e){if(e){e.style.maxHeight=e.scrollHeight+"px";const t=new ResizeObserver(()=>{e.style.maxHeight=e.scrollHeight+"px"});Array.from(e.children).forEach(e=>{t.observe(e)})}}document.addEventListener("DOMContentLoaded",()=>{[...document.getElementsByClassName("accordion-link")].forEach(t=>{t.classList.contains("accordion-open-default")&&e(t),t.addEventListener("click",function(){e(t)})})}),document.addEventListener("DOMContentLoaded",()=>{const e=document.querySelectorAll(".accordion-panel"),n={childList:!0,subtree:!0},o=new MutationObserver(e=>{e.forEach(e=>{const n=e.target.closest(".accordion-panel");n&&t(n)})});for(const t of e)o.observe(t,n)}),window.openAccordion=e},1(){document.addEventListener("DOMContentLoaded",()=>{const e=document.getElementById("alert-bar"),t=document.querySelector(".alert-bar-include");e&&t&&t.innerHTML.length>0&&(function(e,t){e.innerHTML=`\n <div class="alert-bar">\n <div class="alert-bar-icon">\n <svg xmlns="http://www.w3.org/2000/svg" width="35" height="35" viewBox="0 0 35 35" fill="none">\n <circle cx="17.5" cy="17.5" r="16" fill="white" stroke="#EE2A7B" stroke-width="3"></circle>\n\n <path d="M15.6055 9.59961H19.5215V10.0396L18.4875 19.7636H16.6395L15.6055 10.0396V9.59961ZM19.3455 24.9996H15.7815V21.4796H19.3455V24.9996Z" fill="#EE2A7B"></path>\n </svg>\n </div>\n <div class="alert-bar-text">${t}</div>\n </div>\n `}(e,t.textContent),function(){const e=document.querySelector(".alert-bar-text"),t=document.querySelector(".alert-bar-icon"),n=t.querySelector("svg");if(e&&t&&n){const o=e.offsetHeight;o>0&&(t.style.width=`${o}px`,t.style.height=`${o}px`,n.style.width=`${o}px`,n.style.height=`${o}px`)}}(),e.style.display="block")})},118(){function e(e){for(const t of e)t.classList.contains("blur")&&(t.classList.remove("blur"),t.classList.add("unblur_filter"))}function t(e,t,n,o,a="0",r="",i="true"){return new Promise((s,l)=>{let c=new XMLHttpRequest;c.onreadystatechange=function(){if(4==c.readyState)if(200==c.status)try{let e=JSON.parse(this.responseText);s(e.blogposts)}catch(e){l(new Error("Failed to parse JSON response"))}else l(new Error("Request failed with status: "+c.status))},c.onerror=function(){l(new Error("Network request failed"))};let d="?dir="+e;""!=t&&"None"!=t&&(d+="&limit="+t),""!=n&&"None"!=n&&"All"!=n&&(d+="&tags="+n.trim()),""!=o&&"None"!=o&&"All"!=o&&(d+="&year="+o),""!=r&&(d+="&site="+r),"false"==i&&(d+="&listEmptyTags=false"),d+="&page="+a,c.open("GET","https://webapi.saskpolytech.ca/Blog/listing"+d),c.send()})}function n(e,t,n="2"){let o,a=document.getElementById(t);o="3"===n?"<div class='wrapper-grid-news'>":"<div class='blog-list'>",e.forEach(e=>{const t=e.imageThumb?e.imageThumb:e.imageSrc;o+=`<div class='news-item'><a href="${e.link}">\n <div class="news-item-image">\n <img src="${t||"https://saskpolytech.ca/news/images/thumb-sm.jpg"}" alt="${e.title}" />\n <div class="news-item-read-more">\n <span class="arrow-link">Read more</span>\n </div>\n </div>\n <div class="news-item-details">\n <div class="news-item-date">${e.date}</div>\n <div class="news-item-title">${e.title}</div>\n </div>\n </div>`}),o+="</div>",a.innerHTML=o}function o(e,t=""){let n=new URL(window.location),o=n.searchParams,a=o.get("tags")?o.get("tags"):"All";const i=document.getElementById("news-ctgr-btn");a&&(document.querySelector(".news-section").textContent=a);let s=document.querySelector(".category-selection");if(s){s=s.children;for(let a=0;a<s.length;a++){let c=s[a];c.addEventListener("click",a=>{let s=c.querySelector("a");i.textContent=s.textContent,s=s.hasAttribute("data-tag")?s.getAttribute("data-tag"):a.target.textContent;let d=o.get("year")?o.get("year"):"All",u=o.get("limit")?Number(o.get("limit")):9,m=o.get("columns")?o.get("columns"):"3";document.querySelector(".news-section").textContent=a.target.textContent,o.set("page","0"),o.set("tags",`${s}`),o.set("year",`${d}`),o.set("columns",`${m}`),o.set("limit",`${u}`),window.history.pushState({},"",n),l(e),r(e,0,s,d,m,u,t)})}document.getElementById("news-ctgr-toggle").addEventListener("click",()=>{const e=document.querySelector(".news-dropdown");
1i.classList.toggle("rotate-arrow"),e.classList.toggle("open-news-ctgrs"),e.classList.contains("open-news-ctgrs")?document.addEventListener("click",c):document.removeEventListener("click",c)})}function c(e){const t=document.querySelector(".news-dropdown");t.contains(e.target)||e.target===i||(t.classList.remove("open-news-ctgrs"),i.classList.remove("rotate-arrow"),document.removeEventListener("click",c))}}async function a(e,o,a,r,i,l){let c=new URL(window.location),u=c.searchParams.get("page")?Number(c.searchParams.get("page")):0;const m=document.querySelector(".news-section");m&&(m.textContent=a);const p=await t("news",i,a,r,u,l);n(p,e,o),s(p,u,i),d(e,o,a,r,i,l)}async function r(e,o,a,r,i,c,u=""){let m=await t("news",c,a,r,o,u);m.length>0&&(l(e),n(m,e,i),s(m,o,c),d(e,i,a,r,c,u))}function i(e,t,n,o,a){let r=new URL(window.location),i=r.searchParams,s=i.get("page")?Number(i.get("page")):0;return"older"===e?s++:"newer"===e&&s>0&&s--,i.set("page",`${s}`),i.set("tags",`${t}`),i.set("year",`${n}`),i.set("columns",`${o}`),i.set("limit",`${a}`),window.history.pushState({},"",r),c(document.getElementById("news-listing")),[s,t,n,o,a]}function s(e,t,n){let o=document.querySelector(".page-older"),a=document.querySelector(".page-newer");const r=Number(n);a.style.display=t>0?"inline":"none",e.length<r?o.style.display="none":o.style.display="inline"}function l(e){let t=document.getElementById(e);if(t.hasChildNodes())for(;t.firstChild;)t.removeChild(t.firstChild)}function c(e){e&&e.scrollIntoView({block:"start",behavior:"smooth"})}function d(e,t,n,o,a,s){let l=document.querySelector(".page-older"),c=document.querySelector(".page-newer"),d=l.cloneNode(!0);l.parentNode.replaceChild(d,l);let u=c.cloneNode(!0);c.parentNode.replaceChild(u,c),d.addEventListener("click",l=>{l.preventDefault();let c=i("older",n,o,t,a);r(e,...c,s)}),u.addEventListener("click",l=>{l.preventDefault();let c=i("newer",n,o,t,a);r(e,...c,s)})}document.addEventListener("DOMContentLoaded",()=>{const t=document.URL,n=["/news/posts/","/calendar/posts/"];let o=null,a=null;for(const e of n){const n=t.indexOf(e);if(-1!==n){o=e,a=t.substring(n+e.length,n+e.length+4);break}}if(o&&a){const e=parseInt(a,10);if(e>=2015&&e<=2023){const e=document.querySelector(".content-header figure img");e&&(e.style.aspectRatio="auto")}if("/calendar/posts/"===o&&e>=2015&&e<=2023){const e=document.querySelector(".content-header figure");e&&(e.style.width="60%")}}if(t.includes("/news/posts/")){const t=document.querySelector(".blog-content-section.enable-readmore");if(t){const n=t.children;let o=0,a=!1;for(const t of n){const r=t.querySelector("span.marketing-tagline");if("P"!==t.tagName||r||o++,!a&&2===o){a=!0;const o=document.createElement("div");o.className="blog-readmore-container";const r=document.createElement("a");r.href="#",r.classList.add("btn","blog-readmore"),r.textContent="Continue reading",o.appendChild(r),t.nextElementSibling&&(t.nextElementSibling.style.margin=0),t.insertAdjacentElement("afterend",o),o.addEventListener("click",t=>{e(n),o.classList.add("collapsed"),t.preventDefault()});continue}a&&!t.classList.contains("blog-readmore-container")&&t.classList.add("blur")}}}}),document.addEventListener("DOMContentLoaded",async()=>{const e=document.getElementById("news-listing"),r=document.getElementById("news-skeleton");if(!e)return;const i=async()=>{const i=new URL(window.location).searchParams,s=i.get("limit")||e.getAttribute("data-limit"),l=i.get("tags")||e.getAttribute("data-tags"),c=i.get("year")||e.getAttribute("data-year"),d=i.get("columns")||e.getAttribute("data-columns"),u=e.getAttribute("data-site"),m=e.getAttribute("data-listemptytags"),p=e.getAttribute("data-hascategories"),g=e.getAttribute("data-hasnavigation");if("true"===p){const t=document.getElementById("category-selection-template");if(t){const n=t.content.cloneNode(!0);e.before(n),o("news-listing")}}if("true"===g){const t=document.getElementById("news-navigation-template");if(t){const n=t.content.cloneNode(!0);return e.after(n),a("news-listing",d,l,c,s,u),void(r&&(r.style.display="none"))}}try{const e=await t("news",s,l,c,"0",u,m);await n(e,"news-listing",d)}catch(e){console.error("Failed to fetch and display news:",e)}finally{r&&(r.style.display="none")}};r?new IntersectionObserver((t,n)=>{t.forEach(t=>{t.isIntersecting&&(n.unobserve(e),i())})},{rootMargin:"50px"}).observe(e):i()}),document.addEventListener("DOMContentLoaded",async()=>
1{if(document.getElementById("recentnews"))try{let e="";const o=window.location.hostname;"saskpolytech.ca"===o&&(e=await t("news",2,"","","0")),"library.saskpolytech.ca"!==o&&"libdev.saskpolytech.ca"!==o||(e=await t("news",2,"","","0","library")),"alumni.saskpolytech.ca"!==o&&"alumnidev.saskpolytech.ca"!==o||(e=await t("news",2,"","","0","alumni")),"give.saskpolytech.ca"!==o&&"givedev.saskpolytech.ca"!==o||(e=await t("news",2,"","","0","donor")),n(e,"recentnews","2")}catch(e){console.error("Failed to fetch and display recent news:",e)}}),window.getNewsListing=t,window.newsDisplay=n,window.setNewsCategories=o,window.addNewsNavigation=a,window.unblurElements=e,window.scrollToTopNews=c},236(){document.addEventListener("DOMContentLoaded",()=>{const e=document.getElementById("booklist-container");if(e){const t=e.getAttribute("data-campus");displayBooklist(t,"booklist-container")}})},779(){window.displayBooklist=async function(e,t){const n=await function(e,t){return new Promise((n,o)=>{let a=new XMLHttpRequest;a.onreadystatechange=function(){if(4==a.readyState)if(200==a.status){let e=JSON.parse(this.responseText);n(e)}else!function(e){document.getElementById(e).innerHTML+='<div class="modal-alert">\n <div>\n <svg width="35" height="35" viewBox="0 0 35 35" fill="none" xmlns="http://www.w3.org/2000/svg">\n <circle cx="17.5" cy="17.5" r="16" fill="white" stroke="#EE2A7B" stroke-width="3"></circle>\n <path d="M15.6055 9.59961H19.5215V10.0396L18.4875 19.7636H16.6395L15.6055 10.0396V9.59961ZM19.3455 24.9996H15.7815V21.4796H19.3455V24.9996Z" fill="#EE2A7B"></path>\n </svg>\n </div>\n <p>Sorry. Something went wrong. Please try refreshing the page, and if the problem persists, please contact [email protected]</p>\n </div>'}(t),o(new Error("Failed to fetch booklist"))},a.open("GET","https://webapi.saskpolytech.ca/Booklist/"+e),a.send()})}(e,t);let o="";"content"in document.createElement("template")&&n.forEach(e=>{if(e.book[0]!==o){o=e.book[0];let t=document.querySelector("#index-item").content.cloneNode(!0);t.querySelector("a").textContent=o,t.querySelector("a").setAttribute("href",`#${o}`),document.getElementById("index-list").appendChild(t);let n=document.querySelector("#booklist-list").content.cloneNode(!0);n.querySelector("h2").textContent=o,n.querySelector("h2").setAttribute("id",o),document.getElementById("booklist-container").appendChild(n)}let t=document.querySelector("#booklist-item").content.cloneNode(!0);t.querySelector("a").textContent=e.book,t.querySelector("a").setAttribute("href",e.url),document.getElementById("booklist-container").lastElementChild.appendChild(t)})}},462(){async function e(e){if(!e)return void console.error("Container not found.");const t=await fetchData("https://webapi.saskpolytech.ca/Cip/list"),n=document.getElementById("template-table").content.cloneNode(!0);for(const e of t){const t=document.getElementById("template-table-row").content.cloneNode(!0),o=document.getElementById("template-table-column").content.cloneNode(!0);o.querySelector("td span").textContent=e.program;const a=document.getElementById("template-table-column").content.cloneNode(!0);a.querySelector("td span").textContent=e.credential;const r=document.getElementById("template-table-column").content.cloneNode(!0);r.querySelector("td span").textContent=e.cipCode,t.querySelector("tr").appendChild(o),t.querySelector("tr").appendChild(a),t.querySelector("tr").appendChild(r),n.querySelector("tbody").appendChild(t)}e.appendChild(n)}document.addEventListener("DOMContentLoaded",()=>{const t=document.querySelectorAll(".cip-listing");if(t)for(const n of t)e(n)})},601(){[...document.getElementsByClassName("collapse-link")].forEach(e=>e.addEventListener("click",function(){this.classList.toggle("collapse-open");let e=this.nextElementSibling;e.style.maxHeight?e.style.maxHeight=null:e.style.maxHeight=e.scrollHeight+"px"}))},602(){function e(e,t){e.forEach(e=>{e.isIntersecting&&!e.target.animated&&(e.target.animated=!0,e.target.classList.add("animate-fade"),e.target.classList.contains("animate-counter")&&function(e){let t=0;const n=parseInt(e.dataset.count,10);!function o(){t<n&&(t++,e.classList.contains("animate-percent")?e.textContent=t+"%":e.textContent=t,requestAnimationFrame(o))}()}(e.target),t.unobserve(e.target))})}function t(){window.scrollTo({top:0,behavior:"smooth"})}document.addEventListener("DOMContentLoaded",()=>{const e=document.querySelectorAll("h2"),n=document.getElementById("table-contents-mobile"),o=document.getElementById("table-contents-mobile-toggle"),a=document.getElementById("toc-mobile-menu"),r=e=>e.toString().toLowerCase().trim().replace(/\s+/g,"-").replace(/[^\w-]+/g,"").replace(/--+/g,"-"),i=e=>{const t=n?"sticky"===window.getComputedStyle(n).position?150:40:0,o=Math.round(e.getBoundingClientRect().top+window.pageYOffset)-t;window.scrollTo({top:o,behavior:"smooth"})};if(n&&o&&a){window.dataLayer=window.dataLayer||[];const t=document.createElement("ul");
1e.forEach(e=>{const n=document.createElement("li"),s=document.createElement("a"),l=r(e.textContent);e.id||(e.id=l),s.textContent=e.textContent,s.href=`#${l}`,s.addEventListener("click",t=>{t.preventDefault(),window.dataLayer.push({event:"toc_link_click",toc_link_text:e.textContent}),history.pushState(null,null,`#${l}`);const n=a.classList.contains("open-dropdown");a.classList.remove("open-dropdown"),o.classList.remove("rotate-arrow"),n?setTimeout(()=>{i(e)},450):i(e)}),n.appendChild(s),t.appendChild(n)}),a.innerHTML="",a.appendChild(t),window.dataLayer.push({event:"toc_rendered"}),o.addEventListener("click",e=>{e.preventDefault();const t=a.classList.toggle("open-dropdown");o.classList.toggle("rotate-arrow"),t&&window.dataLayer.push({event:"toc_expanded"})})}(()=>{const t=window.location.hash;if(t){const n=t.substring(1);let o=document.getElementById(n);if(!o)for(const t of e)if(r(t.textContent)===n){t.id=n,o=t;break}o&&setTimeout(()=>i(o),600)}})();const s=document.querySelector(".sticky-link");s&&s.addEventListener("click",function(){let e=this.classList.contains("sticky-open");this.parentElement.querySelectorAll(".sticky-open").forEach(e=>{e.classList.remove("sticky-open"),e.nextElementSibling.style.maxHeight=null});let t=this.nextElementSibling;e?(this.classList.remove("sticky-open"),t.style.maxHeight=null):(this.classList.toggle("sticky-open"),t.style.maxHeight?t.style.maxHeight=null:t.hasChildNodes()?t.style.maxHeight=t.scrollHeight+"px":(t.style.maxHeight="3rem",t.style.height="3rem"))});const l=document.querySelectorAll(".event-widget-url-text");l&&l.forEach(e=>{""===e.textContent&&(e.textContent="Details")});const c=document.querySelectorAll(".bio-info");c&&c.forEach(e=>{const t=e.querySelector(".bio-main");if(t){const e=t.getAttribute("data-bio-id");modal(e,`btn-${e}`)}});const d=document.getElementById("back-to-top");d&&(window.addEventListener("scroll",function(){document.documentElement.scrollTop>200?d.style.display="flex":d.style.display="none"}),document.getElementById("back-to-top").addEventListener("click",()=>{t()}))}),document.addEventListener("DOMContentLoaded",()=>{const t=document.querySelectorAll(".animated");if(t){const n={root:null,threshold:.5};t.forEach(t=>{t.animated=!1,new IntersectionObserver(e,n).observe(t)})}}),document.addEventListener("DOMContentLoaded",()=>{const e=document.getElementById("scheduled-btn-container"),t=document.querySelector(".scheduled-btn--btn-enabled");if(e&&t){const t=e.getAttribute("data-start-date"),n=e.getAttribute("data-end-date"),o=t&&""!==t.trim()?convertDateToUnix(t,"us"):null,a=n&&""!==n.trim()?convertDateToUnix(n,"us"):null,r=Date.now();let i=!0;o&&r<o&&(i=!1),a&&r>a&&(i=!1),i||(document.getElementById("scheduled-btn").style.display="none",document.getElementById("disabled-text").style.display="block")}}),document.addEventListener("DOMContentLoaded",()=>{const e=document.getElementById("pulse-survey");if(!e)return;const t=document.querySelectorAll(".feedback-container"),n=`pulse_survey_submitted_${window.location.pathname}`;if(localStorage.getItem(n))return void(e.style.display="none");const o=e.querySelector(".feedback-header"),a=e.querySelector(".feedback-subtitle"),r=e.querySelector(".feedback-options"),i=e.querySelector(".feedback-alert-sucess");o&&""===o.textContent.trim()&&o.remove(),a&&""===a.textContent.trim()&&a.remove(),i&&""===i.textContent.trim()&&(i.textContent="Thanks for your feedback!");const s={"feedback-not-helpful":1,"feedback-somewhat-helpful":2,"feedback-neutral":3,"feedback-helpful":4,"feedback-very-helpful":5};t.forEach(l=>{l.addEventListener("click",function(){e.classList.add("disable-clicks");const l=this.id,c=s[l],d=this.querySelector(".feedback-text"),u=d?d.innerText.trim():"";window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"pulse_survey_submission",feedback_text:u,feedback_score:c});try{localStorage.setItem(n,"true")}catch{console.log("Storage unavailable")}const m=e.offsetHeight;e.style.minHeight=`${m}px`,e.style.justifyContent="center";for(const e of t)e.id!==l&&e.classList.add("feedback-unselected");setTimeout(()=>{o&&e.contains(o)&&o.classList.add("feedback-unselected"),a&&e.contains(a)&&a.classList.add("feedback-unselected"),r&&r.classList.add("feedback-unselected"),requestAnimationFrame(()=>{requestAnimationFrame(()=>{i.classList.remove("hidden"),requestAnimationFrame(()=>{i.classList.add("feedback-visible")})})}),setTimeout(()=>{o&&e.contains(o)&&o.classList.add("hidden"),a&&e.contains(a)&&a.classList.add("hidden"),r&&r.classList.add("hidden")},400)},500)})})}),window.toggleSwitch=function(){const e=document.getElementById("program-course-list"),t=document.getElementById("parttime-course-list"),n=document.querySelector(".toggle-container");let o="true"===n.getAttribute("aria-checked");o?(e.setAttribute("style","display:block"),t.setAttribute("style","display:none")):(e.setAttribute("style","display:none"),t.setAttribute("style","display:block")),n.setAttribute("aria-checked",o?"false":"true")},window.policiesAndProceduresSearch=function(){document.getElementById("filter").addEventListener("keyup",function(){var e=this.value.split(" "),t=document.querySelectorAll("#fbody tr");""!==this.value?(t.forEach(function(e){e.style.display="none"}),t.forEach(function(t){e.some(function(e){return t.textContent.toUpperCase().indexOf(e.toUpperCase())>-1})&&(t.style.display="")})):t.forEach(function(e){e.style.display=""})})},window.scrollToTop=t},639(){window.agendaMooseJaw=function(e){e.includes("2023-06-08T09:30")&&document.getElementById("moosejaw-time1").setAttribute("style","display:block"),e.includes("2023-06-08T13:30")&&document.getElementById("moosejaw-time2").setAttribute("style","display:block")},window.agendaPrinceAlbert=function(e){e.includes("2023-06-06T09:30")&&document.getElementById("princealbert-time1").setAttribute("style","display:block"),e.includes("2023-06-06T13:30")&&document.getElementById("princealbert-time2").setAttribute("style","display:block")},window.agendaRegina=function(e){e.includes("2023-06-23T09:30")&&document.getElementById("regina-time1").setAttribute("style","display:block"),e.includes("2023-06-23T13:30")&&document.getElementById("regina-time2").setAttribute("style","display:block")},window.agendaSaskatoon=function(e){e.includes("2023-06-19T13:30")&&document.getElementById("saskatoon-time1").setAttribute("style","display:block"),e.includes("2023-06-20T09:30")&&document.getElementById("saskatoon-time2").setAttribute("style","display:block"),e.includes("2023-06-20T13:30")&&document.getElementById("saskatoon-time3").setAttribute("style","display:block")}},793(){window.addTimeOptions=function(e,t,n){for(;"time-placeholder"!==n.lastChild.id;)n.removeChild(n.lastChild);for(const o of e){let e=`${moment(o).format(t).replace(":00","")}`,a=document.createElement("option");a.innerText=e,a.setAttribute("value",o),n.appendChild(a)}},window.addNameOptions=function(e){const t=document.getElementById("namelist"),n=document.getElementById("name");t.innerHTML="",n.value="",fetchData(`https://webapi.saskpolytech.ca/Convocation/list?year=${e}`).then(async e=>{e.map(e=>{let n,o=document.createElement("option");n=e.firstName&&!e.lastName?e.firstName.trim():!e.firstName&&e.lastName?e.lastName.trim():`${e.firstName.trim()} ${e.lastName.trim()}`,o.setAttribute("value",n),o.setAttribute("data_time",`${e.date}`),o.setAttribute("data-campus",`${e.campus}`),t.appendChild(o)})})}},651(){window.generateSchoolInput=function(e,t){const n=document.getElementById("template-graduatelist--table-schoolinput"),o=e.map(e=>
1e.school.replace(/\s+/g," ").trim()).filter((e,t,n)=>n.indexOf(e)===t).sort();return o.forEach(e=>{let o=n.content.cloneNode(!0);o.querySelector(".schl-inp").textContent=e,o.querySelector(".schl-inp").value=e,t.appendChild(o)}),o},window.updateProgramInput=function(e,t,n){const o=document.getElementById("template-graduatelist--table-programinput"),a=new Set(e.filter(e=>e.school===t).map(e=>[e.program.replace(/\s+/g," ").trim(),e.degree].join("|"))),r=Array.from(a).map(e=>e.split("|")).sort();return r.forEach(e=>{let t=o.content.cloneNode(!0),a=`${e[0]} ${e[1]}`,r=`${e[0]},${e[1]}`;t.querySelector(".prg-inp").textContent=a,t.querySelector(".prg-inp").value=r,n.appendChild(t)}),r},window.updateGraduateList=function(e,t){const n=document.getElementById("template-graduatelist--table-item");e.forEach(e=>{let o,a=n.content.cloneNode(!0);o=e.firstName&&!e.lastName?e.firstName.trim():!e.firstName&&e.lastName?e.lastName.trim():`${e.firstName.trim()} ${e.lastName.trim()}`,a.querySelector(".graduate-name").textContent=o,e.program.includes(e.degree)?a.querySelector(".graduate-program").textContent=`${e.school} - ${e.program}`:a.querySelector(".graduate-program").textContent=`${e.school} - ${e.program} ${e.degree}`,t.querySelector("#graduatelist").appendChild(a)})}},471(){window.getConvocation=function(e){const t=document.getElementById("name"),n=document.getElementById("timelist");let o,a="",r="";const i="https://webapi.saskpolytech.ca/",s=`${i}Convocation/`;window.location.host.includes("omniupdate")&&document.getElementById("ceremony").setAttribute("style","display:block");const l="MMMM D, YYYY, [at] h:mm a";moment.updateLocale("en",{meridiem:function(e,t,n){return e>=12?n?"p.m.":"P.M.":n?"a.m.":"A.M."}}),addNameOptions(e);const c=document.getElementById("campuslist");function d(){let t=document.querySelectorAll(".ceremony-honorary"),n=document.querySelectorAll(".ceremony-agenda");for(let e of t)e.setAttribute("style","display:none");for(let e of n)e.setAttribute("style","display:none");const o=a.split(" ").join("-").toLowerCase();"Saskatoon"===a&&(u(o,r,e),m(o,r,e),document.getElementById("honorary-saskatoon").setAttribute("style","display:block")),"Regina"===a&&(u(o,r,e),m(o,r,e),document.getElementById("honorary-regina").setAttribute("style","display:block")),"Prince Albert"===a&&(u(o,r,e),m(o,r,e),document.getElementById("honorary-princealbert").setAttribute("style","display:block")),"Moose Jaw"===a&&(u(o,r,e),m(o,r,e),document.getElementById("honorary-moosejaw").setAttribute("style","display:block")),document.getElementById("ceremony").setAttribute("style","display:flex")}async function u(e,t,n){const o=(await fetchData(`${s}agenda`))[0][n][e][t];document.getElementById(o).setAttribute("style","display:block")}async function m(e,t,n){const o=await fetchData(`${s}livestream?year=${n}&campus=${e}`);let a;for(const e of o[0].dates)t===e.date&&(a=e.url);document.getElementById("ceremony-livestream").src=a}async function p(r){t.value="";const i=document.querySelector(".loading-indicator--search");i.style.display="block";const c=document.getElementById("time_search"),d=document.getElementById("timelist");c.style.display="none",document.getElementById("ceremony").style.display="none",n.selectedIndex=0,a=r,o=await fetchData(`${s}list?campus=${a}&year=${e}`);const u=function(e){let t=[];const n=new Map;for(const o of e)n.has(o.date)||(n.set(o.date,!0),t.push(o.date));const o=function(e){return e.sort((e,t)=>e.localeCompare(t))}(t);return o}(o);addTimeOptions(u,l,d),i.style.display="none",c.style.display="block",y("show")}async function g(t,n,r){if(document.getElementById("table-graduates").innerHTML="","content"in document.createElement("template")){let i=document.getElementById("template-graduatelist--table-header").content.cloneNode(!0);const l=i.getElementById("school"),c=i.getElementById("program"),d=generateSchoolInput(t,l);let u,m=updateProgramInput(t,d[0],c);if(r.name.length>0){for(u=await fetchData(`${s}list?campus=${a}&year=${e}&name=${encodeURIComponent(r.name)}&individual=true`),u=[u[0]],l.value=u[0].school;c.firstChild;)c.removeChild(c.firstChild);m=updateProgramInput(t,u[0].school,c),i.getElementById("program").value=`${u[0].program},${u[0].degree.toLowerCase()}`}r.date.length>0&&(u=await fetchData(`${s}list?campus=${n}&year=${e}&school=${encodeURIComponent(d[0])}&program=${encodeURIComponent(m[0][0])}°ree=${encodeURIComponent(m[0][1])}&date=${r.date}`)),updateGraduateList(u,i),document.getElementById("table-graduates").appendChild(i),document.getElementById("loadingindicator").setAttribute("style","display:none;"),async function(){document.getElementById("graduatesearch").addEventListener("keyup",function(e){let t=0;return function(...n){clearTimeout(t),t=setTimeout(e.bind(this,...n
1),500)}}(async t=>{let n=encodeURIComponent(t.target.value),o=document.getElementById("table-graduates");const r=encodeURIComponent(document.getElementById("school").value),i=document.getElementById("program").value.split(","),l=encodeURIComponent(i[0]),c=encodeURIComponent(i[1]),d=await fetchData(`${s}list?campus=${a}&year=${e}&name=${n}&school=${r}&program=${l}°ree=${c}`),u=document.getElementById("graduatelist");for(;u.firstChild;)u.removeChild(u.firstChild);updateGraduateList(d,o);const m=o.parentNode;m.style.maxHeight=m.scrollHeight+"px"})),document.getElementById("school").addEventListener("change",async t=>{let n=document.getElementById("table-graduates"),r=t.target.value;const i=document.getElementById("program");for(;i.firstChild;)i.removeChild(i.firstChild);let l=updateProgramInput(o,r,i);const c=document.getElementById("graduatelist");for(;c.firstChild;)c.removeChild(c.firstChild);const d=await fetchData(`${s}list?campus=${a}&year=${e}&school=${encodeURIComponent(r)}&program=${encodeURIComponent(l[0][0])}°ree=${encodeURIComponent(l[0][1])}`);updateGraduateList(d,n);const u=n.parentNode;u.style.maxHeight=u.scrollHeight+"px"}),document.getElementById("program").addEventListener("change",async t=>{let n=document.getElementById("table-graduates");const o=document.getElementById("graduatelist"),r=document.getElementById("school").value;let i=t.target.value.split(","),l=i[0],c=i[1];for(;o.firstChild;)o.removeChild(o.firstChild);const d=await fetchData(`${s}list?campus=${a}&year=${e}&school=${encodeURIComponent(r)}&program=${encodeURIComponent(l)}°ree=${encodeURIComponent(c)}`);updateGraduateList(d,n);const u=n.parentNode;u.style.maxHeight=u.scrollHeight+"px"})}();const p=i.parentNode;p&&(p.style.maxHeight=p.scrollHeight+"px")}}function y(e){const t=document.querySelectorAll("div.accordion-container");let n=null;t.forEach(e=>{const t=e.querySelector("h5.accordion-link");t&&"Graduate listings"===t.textContent.trim()&&(n=e)}),n&&("hide"===e&&(n.style.display="none"),"show"===e&&(n.style.display="block"))}c.addEventListener("change",()=>{p(c.value)}),document.getElementById("download-pdf").addEventListener("click",()=>{printGraduateList(`${s}list`,a,e,r,l)}),document.querySelectorAll(".agenda-button").forEach(e=>{e.addEventListener("click",e=>{printAgenda(e.target,a,r,l)})}),function(){const e=document.getElementById("campuslist"),t=new URLSearchParams(document.location.search).get("campus");if(t)switch(t){case"Moose Jaw":p("Moose Jaw"),e.value="Moose Jaw";break;case"Prince Albert":p("Prince Albert"),e.value="Prince Albert";break;case"Regina":p("Regina"),e.value="Regina";break;case"Saskatoon":p("Saskatoon"),e.value="Saskatoon"}}(),t.addEventListener("change",async t=>{const n=document.getElementById("time_search"),i=document.getElementById("campuslist");let c=document.getElementById("table-graduates");const u=t.target,m=document.querySelector("#namelist option[value='"+u.value+"']");n.style.display="none",a=m.getAttribute("data-campus"),r=m.getAttribute("data_time"),document.getElementById("ceremony-title").setAttribute("data-date",r),document.getElementById("ceremony-title").innerText=`${u.value} - ${moment(r).format(l).replace(":00","")}`,i.selectedIndex=0;const p=m.value,h=document.querySelector(".loading-indicator--ceremony");h.setAttribute("style","display:block"),o=await fetchData(`${s}list?campus=${a}&year=${e}`),g(o,a,{name:p,date:""}),c.parentNode&&c.parentNode.style.maxHeight&&(c.parentNode.style.maxHeight="none"),h.setAttribute("style","display:none"),y("hide"),d()}),n.addEventListener("change",async t=>{let n=document.getElementById("table-graduates");const i=document.getElementById("name"),c=document.getElementById("ceremony-title");r=t.target.value,c.setAttribute("data-date",r),i.value="";const u=document.querySelector(".loading-indicator--ceremony");u.setAttribute("style","display:block"),o=await fetchData(`${s}list?campus=${a}&date=${r}&year=${e}`),g(o,a,{name:"",date:r}),n.parentNode&&n.parentNode.style.maxHeight&&(n.parentNode.style.maxHeight="none"),u.setAttribute("style","display:none"),c.innerText=`${a} Program - ${moment(r).format(l).replace(":00","")}`,c.setAttribute("data-campus",a),d()}),async function(e){const t=await fetchData(`${i}Convocation/livestream?year=${e}`),n=document.getElementById("livestream-highlighted"),o=document.querySelector(".content-header figure img"),a=Date.now(),r=t.flatMap(e=>e.dates.map(({date:e,url:t})=>({date:e,url:t})));for(const e of r){const t=convertDateToUnix(e.date,"iso");t&&(a>=t&&a<t+108e5&&(o.style.display="none",n.appendChild(s(e.url))))}function s(e){const t=document.getElementById("template-livestream-highlighted").content.cloneNode(!0);return t.querySelector("iframe").src=e,t}}(e),document.getElementById("name").addEventListener("focus",function(){this.value=""}),document.getElementById("name").addEventListener("change",function(){this.blur()})}},429(e,t,n){let o="d";const a=new Intl.NumberFormat("en-US",{style:"currency",currency:"USD"}),r={year:"numeric",month:"short",day:"numeric",timeZone:"America/Regina"},i="https://webapi.saskpolytech.ca/",s=["/programs-and-courses/part-time-studies/course/","/
1part-time-studies/checkout.aspx","/part-time-studies/consent.aspx","/part-time-studies/create-account.aspx","/resources/dual-credit.aspx","/school-of-creative-media-arts-and-sciences/arts-and-sciences.aspx","/school-of-mining-manufacturing-and-engineering-technologies/machining-bootcamp-saskatoon.aspx","/admission-requirements/english-language-requirements.aspx","/literacy-and-adult-education/evening-programming.aspx","/part-time-studies/additional-authorized-practice.aspx","/part-time-studies/betag-outer-panel-repair.aspx","/part-time-studies/blue-seal-training.aspx","/part-time-studies/bridging-practical-nursing-continuing-care-assistants.aspx","/part-time-studies/building-maintenance-and-operations.aspx","/part-time-studies/business.aspx","/part-time-studies/coding.aspx","/part-time-studies/computer.aspx","/part-time-studies/digital-supercluster.aspx","/part-time-studies/fiber-optics.aspx","/part-time-studies/health-sciences.aspx","/part-time-studies/home-inspection.aspx","/part-time-studies/human-services-hospitality-tourism.aspx","/part-time-studies/icar.aspx","/part-time-studies/mariner.aspx","/part-time-studies/microsoft-skills.aspx","/part-time-studies/nursing.aspx","/part-time-studies/pesticide.aspx","/part-time-studies/practical-nursing-certificate-diploma.aspx","/part-time-studies/registered-nurse-prescribing.aspx","/part-time-studies/standardized-safety-training.aspx","/part-time-studies/trades.aspx","/part-time-studies/water-wastewater.aspx","/women-in-trades-and-technology/girls-exploring-trades-and-technology.aspx","/women-in-trades-and-technology/programs-events.aspx"];let l=document.querySelector(".intTuitionBtn");function c(e){const t=document.getElementById("toast");t.innerHTML=e,t.style.display="block",setTimeout(d,4500)}function d(){const e=document.getElementById("toast");e.innerHTML="",e.style.display="none"}l&&l.addEventListener("click",function(){"d"==o?w():b()});let u=null;const m=new URLSearchParams(window.location.search);let p;Object.fromEntries(m.entries()).checkoutcomplete&&eraseCookie("ce_cart");let g=[],y=!1,h="";function f(){if(p=getCookie("ce_cart"),p){if(g=JSON.parse(p),g.length>0){v();let e=document.getElementById("cart-icon-wrapper");e&&(e.style.display="block"),document.getElementById("unibuddy-chat-bubble-iframe")&&(document.getElementById("cart-icon-wrapper").style.bottom="145px",document.getElementById("cart-icon-wrapper").style.right="25px")}return g}}function w(){document.querySelectorAll(".dfees").forEach(function(e){e.style.display="none"}),document.querySelectorAll(".ifees").forEach(function(e){e.style.display="flex"});let e=document.querySelector(".intTuitionBtn");e&&(e.innerHTML="View domestic tuition rates."),setCookie("intfeeview","true",30),o="i",v(),window.location.pathname.endsWith("checkout.aspx")&&k()}function b(){document.querySelectorAll(".dfees").forEach(function(e){e.style.display="block"}),document.querySelectorAll(".ifees").forEach(function(e){e.style.display="none"});let e=document.querySelector(".intTuitionBtn");e&&(e.innerHTML="View international tuition rates."),eraseCookie("intfeeview"),o="d",v(),window.location.pathname.endsWith("checkout.aspx")&&k()}function v(){var e,t,n="",o="",i="",s=!1;getCookie("intfeeview")&&(s=!0),g.forEach(function(l){let c;var d,u;n+="<div class='cart-course'>",n+="<p class='cart-course-id'>"+l.courseCode+" ("+l.crn+")</p>",n+="<p class='cart-course-title'>"+l.courseTitle+"</p>",n+=s?"<p class='cart-course-price'>"+a.format(l.intFees)+"</p>":"<p class='cart-course-price'>"+a.format(l.fees)+"</p>","true"==l.waitlist&&(n+="<i>Waitlist</i>"),l&&(o=l.deliveryMode),"Online"!=o&&(o+=" ("+l.location+")"),"Invalid date"!=l.startDate&&"Invalid date"!=l.endDate&&(e=new Date(l.startDate),t=new Date(l.endDate),u=t,i=(d=e).getFullYear()===u.getFullYear()&&d.getMonth()===u.getMonth()&&d.getDate()===u.getDate()?E(u):E(d)+" - "+E(u)),n+="<p class='cart-course-date'>"+i+" (Saskatchewan/CST), "+o+"</p>",l.crnLab&&l.crnLab[0]&&(c=l.crnLab.map(e=>`<p>${new Date(e.labStartDate).toLocaleDateString("en-us",r)} - ${new Date(e.labEndDate).toLocaleDateString("en-us",r)}, ${l.crn.split("-")[0]}-${e.crnLab}</p>`).join(""),n+=`<p class="cart-course-labs">Labs: ${c}</p>`),l.crnLab&&l.crnLab.crnLab&&(c=`${new Date(l.crnLab.labStartDate).toLocaleDateString("en-us",r)} - ${new Date(l.crnLab.labEndDate).toLocaleDateString("en-us",r)}, ${l.crn.split("-")[0]}-${l.crnLab.crnLab}`,n+=`<p class="cart-course-labs">Lab: ${c}</p>`),n+="<a href='javascript:void(0)' class='cart-course-remove' onclick='removeFromCart(\""+l.crn+'", "'+l.waitlist+"\")'><p class='cart-course-remove-text'>
1Remove <i class='fas fa-trash'></i></p></a>",n+="</div>",parseFloat(l.fees);let m=document.getElementById("btn-"+l.crn);m&&(m.innerHTML="Proceed to checkout",m.classList.add("in-cart"))});let l=document.querySelector(".nav-cart-quantity");l&&(l.innerHTML=g.length);let c=document.getElementById("cart_list");c&&(c.innerHTML=n)}function E(e,t){return e.toLocaleDateString(void 0,{month:"long",day:"numeric",year:"numeric"}).replace(/\d{1,2}(?=\D|$)/g,e=>e.padStart(2,"0")).replace("undefined","").replace(/\s\s+/g," ").trim()}function k(){var e="",t="",n="",o=!1;getCookie("intfeeview")&&(o=!0),g.forEach(function(i){"Online"!==(t=i.deliveryMode)&&(t+=` (${i.location})`);var s=new Date(i.startDate),l=new Date(i.endDate),c=s.toLocaleDateString("en-US",r),d=l.toLocaleDateString("en-US",r);let u;n=`${c} - ${d}`,i.crnLab&&i.crnLab[0]&&(u=i.crnLab.map(e=>`<p>${new Date(e.labStartDate).toLocaleDateString("en-us",r)} - ${new Date(e.labEndDate).toLocaleDateString("en-us",r)}, ${i.crn.split("-")[0]}-${e.crnLab}</p>`).join("")),i.crnLab&&i.crnLab.crnLab&&(u=`${new Date(i.crnLab.labStartDate).toLocaleDateString("en-us",r)} - ${new Date(i.crnLab.labEndDate).toLocaleDateString("en-us",r)}, ${i.crn.split("-")[0]}-${i.crnLab.crnLab}`),e+=`\n <div class="checkout-course">\n <div class="checkout-course-title">\n ${i.courseTitle} (${i.courseCode}) - ${i.crn}\n <p>${n} (Saskatchewan/CST), ${t}</p>`,u&&i.crnLab&&i.crnLab[0]&&(e+=`\n <p class="lab-dates-checkout">Labs: ${u}</p>`),u&&i.crnLab&&i.crnLab.crnLab&&(e+=`\n <p class="lab-dates-checkout">Lab: ${u}</p>`),e+=`\n </div>\n <div class="checkout-course-price">\n ${o?`${a.format(i.intFees)} `:a.format(i.fees)}\n <a href="javascript:void(0)" class="checkout-course-remove" onclick="removeFromCart('${i.crn}', '${i.waitlist}')">\n Remove\n </a>\n ${"true"===i.waitlist?"<br /><i>Waitlist</i>":""}\n </div>\n </div>`,parseFloat(i.fees)});var i=document.getElementById("checkoutpreview");i&&(i.innerHTML=e)}function L(){let e=document.createElement("div");e.id="checkoutoverlay",e.style.cssText="position: fixed;display: none;width: 100%; height: 100%; top: 0; left: 0; right: 0; bottom: 0; background-color: rgba(255,255,255,0.9); z-index: 9999; cursor: wait; text-align:center",e.innerHTML="<div id='checkoutid' style='margin-top:25%'><img src='/_assets/img/loading.svg' alt='loading...' /></div>",document.querySelector(".main-content").appendChild(e),document.getElementById("checkoutoverlay").style.display="block"}function I(e){return e.toLocaleDateString(void 0,{month:"long",day:"numeric",year:"numeric"})}async function S(){return q||(q=(async()=>{const e=await n.e(683).then(n.bind(n,357));return{PublicClientApplication:e.PublicClientApplication,InteractionRequiredAuthError:e.InteractionRequiredAuthError}})()),q}f();let C=null,B=null,q=null;const A={scopes:["openid","profile","User.Read"]};function x(e){var t=e;u={username:t.userPrincipalName,firstName:t.givenName,id:t.onPremisesExtensionAttributes.extensionAttribute1},hideModal("accountmodal"),""!=h&&document.getElementById("btn-"+h).click(),null!=document.getElementById("newaccount")&&$();let n=document.getElementById("cart_list"),o=document.createElement("div");o.innerHTML=u.firstName+"<br />"+u.username+" (<a href='javascript:void(0)' onclick='signOut()'>sign out</a>)",n.before(o)}async function $(){let e=document.getElementById("checkout-btn-main");if(null!=u){let t=`Hi ${u.firstName} ${u.username} <a href='javascript:void(0)' onclick='signOut()'>(sign out)</a>`;const n=`${i}Account/userdetails`,o={studentId:u.id};try{const a=await fetch(n,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(o)}),r=await a.text();if(!a.ok)throw console.error("API Error"),new Error("Registration failed");const s=JSON.parse(r)[0];u.emails=s.emails,0===u.emails.length&&(T(e),addresstext+='<p style="color:red">No email found. Please update your email address to checkout</p>'),u.phones=s.phones;let l=s.addresses;!async function(e,t,n){let o="<h4>Contact Information</h4>",a=function(e){let t="";
1if(e.emails)return e.emails.forEach(e=>{e.address.includes("@saskpolytech.ca")?"personal"===e.type.emailType&&e.address.includes("@saskpolytech.ca")&&(t+=e.address+"<br />"):t+=e.address+"<br />"}),t}(e);if(a)o+=a;else{let t="";T(n),0===e.emails.filter(e=>"personal"===e.type.emailType).length&&(t+="<p>External email not found.</p>"),t+="<p>Please update your email address to checkout.</p>",o+=D(t)}if(o+=`${function(e){var t="",n=[];return e.phones.forEach(e=>{n.includes(e.number)||(t+=e.number+"<br />",n.push(e.number))}),t}(e)}`,t){const n=`${i}Account/useraddress`,a={addressId:t[0].address.id};try{const t=await fetch(n,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)}),r=await t.json();if(!t.ok)throw console.error(`API Error: ${t.status} ${t.statusText}`,r),new Error(`Registration failed: ${t.status} - ${r}`);e.address=r,o+=`${e.address.addressLines[0]}<br />${e.address.place.country.locality} ${e.address.place.country.region.title} ${e.address.place.country.postalCode}<br />`}catch(e){throw console.error("Failed to send registration request:"),new Error("Network error or failed to send request}")}}else{let e="<p>Please update your address to proceed to checkout.";T(n),o+=D(e)}o+="\n <a class='btn' href='https://ssb.saskpolytech.ca/ssomanagerords/saml/login?relayState=/c/auth/SSB?pkg=twbkwbis.P_GenMenu?name=bmenu.P_GenMnu' target='_blank'>Update Information</a>",document.getElementById("accountdetails").innerHTML=o}(u,l,e),e.style.display="inline-block",document.getElementById("newaccount").innerHTML=t,document.getElementById("accountdetails").innerHTML="<i class='fas fa-spinner fa-spin'></i>"}catch(e){throw console.error("Failed to send registration request:"),new Error("Network error or failed to send request")}}}function T(e){e.removeAttribute("href"),e.setAttribute("style","background-color:#f5f5f5 !important; border:2px solid #f5f5f5 !important; color:#a7a8aa !important"),e.setAttribute("aria-disabled","true")}function D(e){return`<div class="modal-alert">\n\t<div>\n\t\t<svg width="35" height="35" viewBox="0 0 35 35" fill="none" xmlns="http://www.w3.org/2000/svg">\n\t\t\t<circle cx="17.5" cy="17.5" r="16" fill="white" stroke="#EE2A7B" stroke-width="3" />\n\t\t\t<path d="M15.6055 9.59961H19.5215V10.0396L18.4875 19.7636H16.6395L15.6055 10.0396V9.59961ZM19.3455 24.9996H15.7815V21.4796H19.3455V24.9996Z" fill="#EE2A7B" />\n\t\t</svg>\n\t</div>\n\t<div>\n\t\t${e}\n\t</div>\n</div>`}async function M(){const e=C.getAllAccounts();0!==e.length&&(e.length>1?console.warn("Multiple accounts detected."):1===e.length&&(C.setActiveAccount(e[0]),async function(e){const{InteractionRequiredAuthError:t}=await S();return C.acquireTokenSilent(e).catch(n=>{if(console.warn("silent token acquisition fails. acquiring token using popup"),n instanceof t)return C.acquireTokenPopup(e).then(e=>e).catch(e=>{console.error("Token auth acquisition failed")});console.warn("Error acquiring token")})}(A).then(e=>{!function(e,t,n){const o=new Headers,a=`Bearer ${t}`;o.append("Authorization",a),fetch(e,{method:"GET",headers:o}).then(e=>e.json()).then(t=>n(t,e)).catch(e=>console.log("MSGraph error"))}("https://graph.microsoft.com/v1.0/me?$select=onPremisesExtensionAttributes,givenName,userPrincipalName",e.accessToken,x)}).catch(e=>{})))}window.addEventListener("load",async function(){for(const e of s)if(window.location.href.includes(e)){const{PublicClientApplication:e}=await S();B={auth:{clientId:"699cd8e2-c122-45b9-9934-f54e19205e7d",authority:"https://login.microsoftonline.com/a9531b3d-965b-4eb8-8c10-a8f55a606e94",redirectUri:"https://saskpolytech.ca/"},cache:{cacheLocation:"sessionStorage",storeAuthStateInCookie:!1},system:{loggerOptions:{logLevel:0}}},C=new e(B);try{await C.initialize(),await C.handleRedirectPromise(),M()}catch(e){console.error("Authentication initialization failed")}}}),getCookie("intfeeview")?w():b(),window.showIntFees=w,window.showDomesticFees=b,window.cart=g,window.openLearningDate=y,window.loggedInUser=u,window.addToCart=function(e,t,n,o,a,r,i,s,l,d,m,p,w,b,E=null){if(null==u&&!getCookie("accountrequested"))return h=n,modal("accountmodal",!1),void showModal("accountmodal");if(f(),g.length>=5)c("Your cart is full.");else if("true"===p&&!g.find(e=>e.crn===n)||"true"!==p&&!g.find(t=>t.courseCode===e&&"true"!==t.waitlist)){if("true"===s){if(!y){const e=document.getElementById("datepickmodal");e&&e.remove();const t=`\n <div class="modal-content">
1 \n <span class="close">×</span>\n <p><strong>Choose start date</strong></p>\n <input name="oldate" id="oldate" type="date" style="width: 100%;" />\n <p><a class="btn btn-primary" href="javascript:void(0)" onclick="selectOpenLearningDate('${n}', '${r}', '${i}')">Select</a></p>\n </div>\n `;let o=document.createElement("div");return o.id="datepickmodal",o.classList.add("modal"),o.innerHTML=t,document.body.appendChild(o),modal("datepickmodal",!1),showModal("datepickmodal"),document.getElementById("oldate").min=new Date(r).toISOString().split("T")[0],void(document.getElementById("oldate").max=new Date(i).toISOString().split("T")[0])}{i=(r=y).addDays(parseInt(b));var k={year:"numeric",month:"long",day:"numeric"};let e=r.toDateString("en-us",k).slice(4),t=e.split(" ");t[1]+=",",r=t.join(" "),e=i.toDateString("en-us",k).slice(4),t=e.split(" "),t[1]+=",",i=t.join(" ")}}g.push({courseCode:e,courseTitle:t,crn:n,fees:o,intFees:a,startDate:r,endDate:i,openLearning:s,credits:l,hours:d,deliveryMode:m,location:w,waitlist:p,crnLab:E}),setCookie("ce_cart",JSON.stringify(g),3),v(),function(e,t,n,o){"undefined"!=typeof dataLayer&&(dataLayer.push({ecommerce:null}),dataLayer.push({event:"add_to_cart",ecommerce:{items:[{item_id:n,item_name:t,currency:"CAD",index:0,item_brand:"Sask Polytech",price:parseFloat(o),quantity:1}]}}))}(0,t,n,o),document.getElementById("cart-icon-wrapper").style.display="block"}else"Proceed to checkout"===document.getElementById("btn-"+n).innerHTML?window.location.href="/programs-and-courses/part-time-studies/checkout.aspx":c("This course is already in your cart.")},window.signIn=async function(){try{const e=await C.loginPopup(A);C.setActiveAccount(e.account),M(),u=!0}catch(e){console.error("An error occurred during sign-in")}},window.signOut=async function(){const e=C.getActiveAccount();if(!e)return void console.warn("No active account to sign out.");const t={account:e,postLogoutRedirectUri:B.auth.redirectUri+"/programs-and-courses/part-time-studies/checkout.aspx",mainWindowRedirectUri:B.auth.redirectUri};try{await C.logoutPopup(t),u=null}catch(e){console.error("An error occurred during sign-out")}},window.toggleCart=function(e){e.stopPropagation();const t=document.getElementById("cart");t.classList.toggle("show")?t.setAttribute("aria-hidden","false"):t.setAttribute("aria-hidden","true")},window.estimateCourseLoad=function(){if(g.length<1)return;let e=g.map(e=>{let t=new Date(e.startDate),n=new Date(e.endDate);return{...e,startDate:t.toISOString(),endDate:n.toISOString()}});var t="",n=0;let o,a;var r=e.map(function(e){return new Date(e.startDate)}),i=e.map(function(e){return new Date(e.endDate)}),s=[];e.sort((e,t)=>new Date(e.endDate)-new Date(t.endDate));for(var l=1;l<e.length;l++){var c=new Date(e[l-1].endDate);6!=c.getDay()&&c.setDate(c.getDate()+(6-c.getDay()+1));var d=new Date(e[l].startDate);0!=d.getDay()&&d.setDate(d.getDate()+(7-d.getDay())),c<d&&(a=Math.ceil((d-c)/6048e5),a>=3&&s.push({from:c,until:d}))}for(var u=new Date(Math.min.apply(null,r)),m=new Date(Math.max.apply(null,i)),p=0;p<e.length;p++)parseInt(e[p].credits),n+=parseInt(e[p].hours);t+="Earliest start date: "+I(u)+"<br />",t+="Latest end date: "+I(m)+"<br />",t+="Total hours: "+n+"<br />",a=Math.ceil((m-u)/6048e5);var y=new Date(u.getFullYear(),11,25);y>=u&&y<=m&&(a-=2),t+="Total weeks: "+a+"<br />",o=n/(25*a)*100;var h=60;document.getElementById("disability")&&document.getElementById("disability").checked&&(h=40),t+="Course load: "+Math.round(o)+"%<br />",a<12?t+="You are <strong>not</strong> likely eligible for a full-time student loan. Your total weeks of training must total at least 12.":o>=h?s.length>0?t+="You <strong>may not</strong> be eligible for a full-time student loan. There is a break in study of 3 weeks or more.":t+="You are likely eligible for a full-time student loan.":e.length>0&&(t+="You are <strong>not</strong> likely eligible for a full-time student loan.");let f=document.getElementById("courseloadmodal");f&&f.remove();var w='<div class="modal-content"><span class="close">×</span><p><strong>Course Load Estimation</p></strong>'+t+"<p><a class='btn btn-primary' href='/admissions/resources/student-loan-estimator.aspx'>Find out more</a></p></div>";let b=document.createElement("div");b.id="courseloadmodal",b.classList.add("modal"),b.innerHTML=w,document.body.appendChild(b),modal("courseloadmodal",!1),showModal("courseloadmodal")},window.removeFromCart=function(e,t){g=g.filter(t=>t.crn!==e);const n=document.getElementById("btn-"+e);n&&(n.textContent="true"===t?"Waitlist":"Add to cart",n.classList.remove("in-cart")),setCo
1okie("ce_cart",JSON.stringify(g),3),v(),document.getElementById("checkoutpreview")&&k()},window.selectOpenLearningDate=function(e,t,n){if(y=new Date(document.getElementById("oldate").value+"T00:00-0800"),isNaN(y.getTime()))c("Please choose a valid date.");else{var o=new Date(t),a=new Date(n);if(o.getTime()>=y.getTime())return y=null,void c("Please choose a date that is after the course start date.");if(a.getTime()<=y.getTime())return y=null,void c("Please choose a date that is before the course end date.");hideModal("datepickmodal"),document.getElementById("btn-"+e).click(),y=!1}},window.showCheckoutPreview=k,window.showToast=c,window.startCheckout=async function(){if(g.length>0){g.forEach(e=>{e.courseTitle=e.courseTitle.replace(/&/g,"\\u0026"),e.crnLab&&e.crnLab[0]||e.crnLab&&!e.crnLab.crnLab||!e.crnLab?e.crnLab=null:e.crnLab=e.crnLab.crnLab}),L();const e=`${i}Account/register`,t={jsonData:JSON.stringify(g),type:"R"};try{const n=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}),o=await n.text();if(!n.ok)throw console.error("API Error"),new Error("Registration failed");!function(e){var t=JSON.parse(e);if(t.errors)document.getElementById("checkoutoverlay").style.display="none",c("There was a problem attempting to check out.");else{var n=JSON.parse(t.comment);!function(){if("undefined"!=typeof dataLayer){var e=[],t=0;g.forEach(function(n){var o={};o.item_id=n.crn,o.item_name=n.courseTitle,o.currency="CAD",o.index=t++,o.item_brand="Sask Polytech",o.price=parseFloat(n.fees),o.quantity=1,e.push(o)}),dataLayer.push({ecommerce:null}),dataLayer.push({event:"begin_checkout",ecommerce:{items:e}})}}(),window.location.href="https://ssb.saskpolytech.ca/ssomanagerords/saml/login?relayState=/c/auth/SSB?pkg=szpkosrf.p_show_student_summary?transid="+n.id}}(o)}catch(e){throw console.error("Failed to send registration request:"),new Error("Network error or failed to send request")}}else c("Your cart is empty.")},window.updateAccountMessage=$,window.startCreateAccount=async function(e){if(void 0!==e.email&&""!==e.email.trim()&&void 0!==e.first_name&&""!==e.first_name.trim()&&void 0!==e.last_name&&""!==e.last_name.trim()){L();const t=`${i}Account/register`,n={jsonData:JSON.stringify(e),type:"N"};try{const e=await fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)}),o=await e.text();if(!e.ok)throw console.error("API Error:"),new Error("Registration failed:");!function(e){var t=JSON.parse(e);t.errors?(document.getElementById("checkoutoverlay").style.display="none",c("There was a problem attempting to check out.")):(JSON.parse(t.comment),setCookie("accountrequested","true",1),window.location.href="/programs-and-courses/part-time-studies/new-account.aspx")}(o)}catch(e){throw console.error("Failed to send registration request"),new Error("Network error or failed to send request")}}},window.getCartFromCookie=f,window.removeAllFromCart=function(){g=[],setCookie("ce_cart",JSON.stringify(g),3),v(),document.getElementById("cart-icon-wrapper").setAttribute("style","display:none")}},422(){document.addEventListener("DOMContentLoaded",()=>{const e=document.getElementById("cart-icon");e&&e.addEventListener("click",e=>{toggleCart(e)});const t=document.getElementById("close-cart-btn");t&&t.addEventListener("click",e=>{toggleCart(e)});const n=document.getElementById("estimate-course-load");n&&n.addEventListener("click",estimateCourseLoad);const o=document.getElementById("sign-in-btn");o&&o.addEventListener("click",signIn)}),document.addEventListener("DOMContentLoaded",()=>{if(window.location.pathname.includes("programs-and-courses/part-time-studies/course/")&&getCourse(),window.location.pathname.endsWith("programs-and-courses/part-time-studies/checkout.aspx")&&(showCheckoutPreview(),document.getElementById("checkoutLogin")&&document.getElementById("checkoutLogin").addEventListener("click",signIn)),window.location.pathname.endsWith("programs-and-courses/part-time-studies/consent.aspx")){const e=document.getElementById("checkoutbtn");e&&e.addEventListener("click",function(){startCheckout()})}})},451(){const e=new Intl.NumberFormat("en-US",{style:"currency",currency:"USD"}),t="https://webapi.saskpolytech.ca/",n=new Date,o=new Date("2000-01-01T00:00:00"),a={year:"numeric",month:"short",day:"numeric",timeZone:"America/Regina"};async function r(e,t="full",n="",o=!1){const a=document.getElementById("course-template").content.cloneNode(!0);"minimal"==t&&(a.querySelector(".course-title").textContent=`${e.title} (${e.courseCode})`),"full"==t&&(document.title=e.title+" ("+e.courseCode+") | Saskatchewan Polytechnic",document.querySelector(".main-title").textContent=`${e.title} (${e.courseCode})`),a.querySelector(".course-description").innerHTML=e.description;let r=e.sections.length;r>0&&e.sections[0].prereqs.length>0&&(a.querySelector(".course-pre-reqs").innerHTML=`<p><strong>Prerequisites: ${e.sections[0].prereqs}</strong></p>`);let l=a.querySelector(".course-no-sections"),c=a.querySelector(".course-is-upcoming"),d=!1;if(r>0){let t=!1,n=[];for(const a of e.sections)n.push(s(a,e,o)),t=i(a);const r=await Promise.all(n);let l=a.querySelector("tbody");for(const e of r)null!=e&&(d=!0,t&&(c.style.display="block"),l.a
1ppendChild(e))}if(!d){a.querySelector(".pt-table").remove();let e=document.getElementById("int_fees");e&&e.remove(),l.style.display="block"}return d||""===n?a:""}function i(e){const t=new Date,n=new Date(t.getTime()+6e4*t.getTimezoneOffset()),o=new Date(n.getTime()+-216e5);return new Date(e.registrationOpens).getTime()>o.getTime()}async function s(t,r,i=!1){let s=new Date(t.registrationOpens),c=new Date(t.registrationCloses);c.getTime()!=o.getTime()&&c.setHours(23,59,59);let d=new Date(t.startDate),u=new Date(t.endDate);if(c.getTime()<n.getTime()&&c.getTime()!=o.getTime()||t.full&&"0"==t.waitList||"Zero Registrations"==t.specialApproval||"Dual Credit"==t.instructionalMethod&&!i||"Dual Credit"!=t.instructionalMethod&&"202311"===t.term&&i||("false"===t.dual&&i||""===t.dual)&&i||"true"===t.dual&&!i)return null;let m=!0;const p=document.querySelector("#section-template").content.cloneNode(!0);let g=p.querySelectorAll(".course-dates")[0],y=p.querySelectorAll(".registration-dates")[0],h=p.querySelectorAll(".registration")[0],f=p.querySelectorAll(".dfees")[0],w=p.querySelectorAll(".ifees")[0],b=p.querySelectorAll(".location")[0],v=p.querySelectorAll(".crn")[0],E=p.querySelector(".section-labs"),k=p.querySelectorAll(".section-description")[0];if(g.innerHTML=`${d.toLocaleDateString("en-us",a)}`,t.startDate!=t.endDate&&(g.innerHTML+=` - ${u.toLocaleDateString("en-us",a)}`),g.innerHTML+=" (Saskatchewan/CST)",s>n&&(y.innerHTML=`<span>Registration Opens: ${s.toLocaleDateString("en-us",a)} (Saskatchewan/CST)</span>`,m=!1),c>=n&&(y.innerHTML+=`<span>Registration Deadline: ${c.toLocaleDateString("en-us",a)} (Saskatchewan/CST)</span>`),""!=t.comments&&(k.innerHTML+=`<p>${t.comments}</p>`),""!=t.description&&(k.innerHTML+=`<p>${t.description}</p>`),""!=t.sectionDescription&&(k.innerHTML+=`<p>${t.sectionDescription}</p>`),m)if(""!=t.specialApproval)switch(h.innerHTML+="<br />",t.location){case"Moose Jaw":h.innerHTML+="Call (306) 691-8383 to register.";break;case"Prince Albert":h.innerHTML+="Call (306) 765-1600 to register.";break;case"Regina":h.innerHTML+="Call (306) 775-7301 to register.";break;case"Saskatoon":h.innerHTML+="Call (306) 659-4800 to register."}else h.innerHTML+=`<div id="reg-${t.term}-${t.crn}"></div>`,t.almostFull&&(h.innerHTML+="<div class='alert alert-warning'>This section is almost full.</div>");if(f.innerHTML=e.format(t.domesticFees),w.innerHTML=e.format(t.internationalFees),"202312"===t.term?b.innerHTML=t.deliveryMode:b.innerHTML=t.instructionalMethod,"Online"===t.deliveryMode&&"Online Self-Paced Learning"===t.instructionalMethod&&"Online Virtual Learning"===t.instructionalMethod||(b.innerHTML+=` (${t.location})`),v.innerHTML=`${t.term}-${t.crn}`,null!==t.requiredLab){const e=await l(t,r,"required",t.requiredLab.labSections);E.appendChild(e)}if(null!==t.electiveLab){const e=await l(t,r,"elective",t.electiveLab.labSections);E.appendChild(e)}return p}async function l(e,n,o,r){let i,s,l,u,m,p="",g="";"required"===o&&(i=document.querySelector("#section-lab-required-template").content.cloneNode(!0),s=i.querySelector("#lab-required"),l="checkbox",p="disabled",g="checked",m=r.map(e=>({lab:e,full:!1}))),"elective"===o&&(i=document.querySelector("#section-lab-elective-template").content.cloneNode(!0),s=i.querySelector("#lab-elective"),l="radio",m=await Promise.all(r.map(n=>function(e,n){return fetch(t+"Course/capacity?term="+e.term+"&crn="+n.crn).then(e=>{if(!e.ok)throw new Error("Network response was not ok");return e.json()}).then(e=>"true"===e[0].full).catch(e=>{console.error("There was a problem with the fetch operation:",e)})}(e,n).then(e=>({lab:n,full:e})))));const y=await async function(e,t){if(!e.electiveLab)return null;return t.map(e=>e.full).every(e=>e)}(e,m);for(const{lab:t,full:r}of m){if(r&&"elective"===o&&!1===y)continue;let i=document.createElement("div");i.classList.add(l);let m=e.term.trim(),h=t.crn.trim(),f=`${new Date(t.startDate).toLocaleDateString("en-us",a).trim()} - ${new Date(t.endDate).toLocaleDateString("en-us",a).trim()}`,w=`${m}-${h}`;i.innerHTML=`\n <input type="${l}" id="${l}-${m}-${h}" class="lab-${l}" name="lab-${l}" title="Lab CRN ${h}" value="${h}" ${p} ${g}>\n <label class="lab-${l}" for="${l}-${m}-${h}"><div><p class="section-lab-date">${f}</p><p class="section-lab-crn">${w}</p> <p class="section-lab-date">${t.sectionDescription?t.sectionDescription:""}</p></div></label>\n`,"elective"===o&&i.querySelector(".lab-radio").addEventListener("change",()=>{cart=getCartFromCookie(),removeFromCart(`${e.term}-${e.crn}`,"false"),cart=getCartFromCookie();
1let o=document.getElementById(`reg-${e.term}-${e.crn}`);o&&(o.innerHTML=""),u=d(t),c(n,e,u)}),s.appendChild(i)}return i}function c(e,t,n){u(t,e,n)}function d(e,t=""){return e?"required"===t?{type:t,crnLab:e.crn,labStartDate:e.startDate,labEndDate:e.endDate}:{crnLab:e.crn,labStartDate:e.startDate,labEndDate:e.endDate}:null}async function u(e,n,o=null){try{const r=await fetch(t+"Course/capacity?term="+e.term+"&crn="+e.crn);if(!r.ok)throw new Error("Network response was not ok");!function(e,t,n,o=null){const r=cart.find(e=>e.crn==t.term+"-"+t.crn);if(null!==t.electiveLab&&null===o&&void 0===r)return;let i;if(null!==t.requiredLab&&(i="required"),null!==t.electiveLab&&(i="elective"),void 0!==r&&r.crnLab&&null===o&&"elective"===i){const e=document.getElementById(`radio-${t.term}-${r.crnLab.crnLab}`);e&&(e.checked=!0)}let s=document.getElementById("reg-"+t.term+"-"+t.crn),l=new Date(t.startDate),c=new Date(t.endDate),u="Add to Cart",m=!1,p="btn btn-add-to-list";if("true"==n.full&&parseInt(n.waitlist)<=0)return void document.getElementById("reg-"+t.term+"-"+t.crn).closest("tr").remove();"true"==n.full&&parseInt(n.waitlist)>0&&(u="Waitlist",m=!0),cart&&void 0!==r&&(u="Added to cart",p+=" in-cart");let g=d(null);"required"===i&&(g=t.requiredLab.labSections.map(e=>d(e,i))),"elective"===i&&(g=o);let y=`<br /><button id="btn-${t.term}-${t.crn}" class="${p}">${u}</button>`;s&&(s.innerHTML=y,s.querySelector(`#btn-${t.term}-${t.crn}`).addEventListener("click",function(){addToCart(e.courseCode,e.title.replace("'",""),`${t.term}-${t.crn}`,t.domesticFees,t.internationalFees,l.toLocaleDateString("en-us",a),c.toLocaleDateString("en-us",a),t.continuousIntake,t.credits,t.hours,t.deliveryMode,m,t.location,t.courseLength,g)}))}(n,e,(await r.json())[0],o)}catch(e){console.error("There was a problem with the fetch operation:",e);const t=document.querySelector(".lab-headline");t&&(t.textContent="")}}function m(e){e.sections.filter(e=>"Dual Credit"!=e.instructionalMethod).forEach(t=>{document.getElementById("reg-"+t.term+"-"+t.crn)&&u(t,e)})}function p(e){const n=new XMLHttpRequest;n.onreadystatechange=function(){4==n.readyState&&200==n.status&&function(e){if(e.length>0){let t="<h2>Related Programs</h2>";e.forEach(e=>{"true"===e.isSpecialty?t+=`<a href="/programs-and-courses/programs/${e.filename}">${e.withinProgram}</a><br />`:t+=`<a href="/programs-and-courses/programs/${e.filename}">${e.name}</a><br />`}),document.getElementById("related").innerHTML=t}}(JSON.parse(this.responseText))},n.open("GET",t+"Program/related/"+e.replace("-","")),n.send()}window.getCourse=function(){let e;if(!location.pathname.endsWith("html")||location.pathname.endsWith("/")){let t=location.pathname.split("/");e=t[t.length-2]}else e=new URLSearchParams(window.location.search).get("code");fetch(t+"Course/code?code="+e).then(e=>{if(!e.ok)throw new Error("Network response was not ok");return e.json()}).then(e=>r(e).then(t=>{document.querySelector("#course").appendChild(t),p(e.courseCode),m(e),getCookie("intfeeview")?showIntFees():showDomesticFees()})).catch(e=>{console.error("There was a problem with the fetch operation:",e)})},window.dateDisplayOptions=a,window.getCourseInPage=function(e,n,o="",a="",i=!1){const s=document.getElementById(e);let l=`${t}Course/codes?code=${n.replace(/ /g,"")}`;return o&&(l+=`&order=${o}`),i&&(l+=`&dualCreditOnly=${i}`),fetch(l).then(e=>{if(!e.ok)throw new Error("Network response was not ok");return e.json()}).then(e=>{const t=e.map(e=>r(e,"minimal",a,i).then(t=>{t&&(s.appendChild(t),m(e),getCookie("intfeeview")?showIntFees():showDomesticFees())}));return Promise.all(t)}).catch(e=>{console.error("There was a problem with the fetch operation:",e)})},window.getRelatedPrograms=p,window.createLabSection=d},599(){document.addEventListener("DOMContentLoaded",async()=>{const e=[],t=(t,n=!1)=>{document.querySelectorAll(t).forEach(t=>{const{ceId:o,ceCourses:a,ceOrder:r,ceHide:i}=t.dataset;e.push(()=>getCourseInPage(o,a,r,i,n))})};t(".ce-course-attributes"),t(".ce-dual-course-attributes",!0),await async function(e){let t=0;async function n(){if(t>=e.length)return;const o=e[t++];try{await o()}catch(e){console.error("Task failed",e)}await n()}const o=[];for(let e=0;e<3;e++)o.push(n());await Promise.all(o)}(e)})},298(){const e=document.getElementById("courselisting");if(e){let t=25,n=!1,o="",a="",r="",i="",s="",l="",c=1,d=0,u=!1,m=!1,p=!1,g=!1,y=new IntersectionObserver(function(e){e[0].intersectionRatio<=0||async function(){if(n)return;let e;c++,e=l?await getCourseListing(o,a,r,i,s,l,c):await getCourseListing(o,a,r,i,s,l,c,!0),e.length<25&&(n=!0),throttle(function(e){manageCourseDisplay(e,"listing","courselisting",c)}(e),500)}()});document.addEventListener("DOMContentLoaded",async()=>{let h=await getCourseListing(o,a,r,i,s,l,c,!0);manageCourseDisplay(h,"listing","courselisting",c),h.length===t&&y.observe(document.getElementById("loadtrigger")),document.getElementById("keyword-search-lstg").addEventListener("keyup",throttle(async d=>{if(d.target.value.length>=3||0===d.target.value.length){e.innerHTML="",y.disconnect();let d,u=getCourseFilterValues();o=u[0],a=u[1],r=u[2],i=u[3],s=u[4],l=u[5],c=1,n=!1,d=l?await getCourseListing(o,a,r,i,s,l,c):await getCourseListing(o,a,r,i,s,l,c,!0),manageCourseDisplay(d,"listing","courselisting",c),d.length===t&&y.observe(document.getElementById("loadtrigger"))}}),500),document.getElementById("delivery-mode").addEventListener("change",async()=>{y.disconnect();let u,p=getCourseFilterValues();o=p[0],a=p[1],r=p[2],i=p[3],s=p[4],l=p[5],c=1,n=!1,e.innerHTML="",u=l?await getCourseListing(o,a,r,i,s,l,c):await getCourseListing(o,a,r,i,s,l,c,!0),manageCourseDisplay(u,"listing","courselisting",c),u.length===t&&y.observe(document.getElementById("loadtrigger")),i.length>0&&!1===m?(d++,m=!0):0===i.length&&(d--,m=!1),manageFilterCount(d)}),document.getElementById("location").addEventListener("change",async()=>{y.disconnect();let u,m=getCourseFilterValues();o=m[0],a=m[1],r=m[2],i=m[3],s=m[4],l=m[5],c=1,n=!1,e.innerHTML="",u=l?await getCourseListing(o,a,r,i,s,l,c):await getCourseListing(o,a,r,i,s,l,c,!0),manageCourseDisplay(u,"listing","courselisting",c),u.length===t&&y.observe(document.getElementById("loadtrigger")),r.length>0&&!1===p?(d++,p=!0):0===r.length&&(d--,p=!1),manageFilterCount(d)}),document.getElementById("credential").addEventListener("change",async()=>{y.disconnect();let u,m=getCourseFilterValues();o=m[0],a=m[1],r=m[2],i=m[3],s=m[4],l=m[5],c=1,n=!1,e.innerHTML="",u=l?await getCourseListing(o,a,r,i,s,l,c):await getCourseListing(o,a,r,i,s,l,c,!0),manageCourseDisplay(u,"listing","courselisting",c),u.length===t&&y.observe(document.getElementById("loadtrigger")),s.length>0&&!1===g?(d++,g=!0):0===s.length&&(d--,g=!1),manageFilterCount(d)}),document.getElementById("chk-current").addEventListener("click",async()=>{y.disconnect();let u,m=getCourseFilterValues();o=m[0],a=m[1],r=m[2],i=m[3],s=m[4],l=m[5],c=1,n=!1,e.innerHTML="",u=l?await getCourseListing(o,a,r,i,s,l,c):await getCourseListing(o,a,r,i,s,l,c,!0),manageCourseDisplay(u,"listing","courselisting",c),u.length===t&&y.observe(document.getElementById("loadtrigger")),l.length>0?d++:d--,manageFilterCount(d)});let f=document.querySelectorAll(".a-z-filters ul li");for(const m of f)m.addEventListener("click",async m=>{document.querySelector(".a-z-filters").dataset.initial=m.target.textContent;for(const e of f)e.setAttribute("style","text-decoration: underline;
1 color: purple; font-weight: normal;");m.target.setAttribute("style","text-decoration: none; color: #000; font-weight: bold;"),y.disconnect();let p,g=getCourseFilterValues();o=g[0],a=g[1],r=g[2],i=g[3],s=g[4],l=g[5],c=1,n=!1,e.innerHTML="",p=l?await getCourseListing(o,a,r,i,s,l,c):await getCourseListing(o,a,r,i,s,l,c,!0),manageCourseDisplay(p,"listing","courselisting",c),p.length===t&&y.observe(document.getElementById("loadtrigger")),"ALL"!==o?!1===u&&(d++,u=!0,manageFilterCount(d)):!0===u&&(d--,u=!1,manageFilterCount(d))});document.getElementById("open-filter-lstg").addEventListener("click",()=>{const e=document.querySelector(".modal-listing"),t=document.querySelector(".btn-filters");e.classList.toggle("modal-listing--open"),t.classList.toggle("btn-filters--open")})})}},85(){window.getCourseListing=function(e,t,n,o,a,r,i,s=!1){return new Promise((l,c)=>{let d=new XMLHttpRequest;d.onreadystatechange=function(){if(4==d.readyState)if(200==d.status){let e=JSON.parse(this.responseText);l(e)}else c(new Error("Failed to fetch course listing"))};let u="?limit=25";""!=e&&"ALL"!==e&&(u+="&firstLetter="+e),""!=t&&(u+="&keyword="+t),""!=n&&"All"!=n&&(u+="&location="+n),""!=o&&"All"!=o&&(u+="&instructionalMethod="+o),""!=a&&(u+="&credit="+a),""!=r&&"false"!=r&&(u+="¤tOnly="+r),""!==i&&(u+="¤tPage="+i),!0===s&&(u+="&listOnly="+s),d.open("GET","https://webapi.saskpolytech.ca/Course/list"+u),d.send()})},window.getCourseFilterValues=function(){let e=document.querySelector(".a-z-filters").dataset.initial,t=document.getElementById("keyword-search-lstg").value,n=document.getElementById("delivery-mode").value;return[e,t,document.getElementById("location").value,n,document.getElementById("credential").value,document.getElementById("chk-current").checked?"true":""]},window.manageCourseDisplay=function(e,t,n,o){switch(t){case"simple":!function(e,t,n){let o=document.getElementById(t),a="<ul class='az-list-simple'>",r="";if(0===e.length&&1===n)return a="<div style='text-align: center;'>No courses found</div>",void(o.innerHTML=a);e.forEach(e=>{let t=slugify(e.title);t&&(r=`/programs-and-courses/part-time-studies/course/${t}/${e.courseCode}`,a+=`<li><a href="${r}">${e.title} (${e.courseCode})</li>`)}),1===n?(a+="",a+="</ul>"):(a="",a+="</ul>"),o.innerHTML+=a}(e,n,o);break;case"listing":!function(e,t,n){let o=document.getElementById(t),a="<div class='az-list'>",r="",i="";if(0===e.length&&1===n)return a="<div style='text-align: center;'>No courses found</div>",void(o.innerHTML=a);e.forEach(e=>{let t=slugify(e.title);if(t){r+="<div class='az-item'>",i=`/programs-and-courses/part-time-studies/course/${t}/${e.courseCode}`;let n=function(e){return[...new Set(e.sections.map(e=>function(e){const t=new Date,n=new Date("2000-01-01T00:00:00");let o=new Date(e.registrationCloses);return!(o.getTime()<t.getTime()&&o.getTime()!=n.getTime()||e.full&&"0"==e.waitList||"Zero Registrations"==e.specialApproval||"true"==e.dual)}(e)?"202312"===e.term?e.deliveryMode.replace("*",""):e.instructionalMethod.replace("*",""):null).filter(e=>null!==e))].sort().map(function(e){return`<div class='white-tag'>${e}</div>`}).join("")}(e),o=function(e){return[...new Set(e.sections.map(e=>e.location))].sort().map(function(e){return`${e}`}).join(", ")}(e);r+=`\n <div class='az-info'>\n <div class='az-name'><a href="${i}">${e.title} (${e.courseCode})</a></div>\n <div class='az-locations'>${o}</a></div>\n <div class='az-credential'>${n}</div>\n </div>\n <a class='btn' href='${i}'>View</a>\n `,r+="</div>"}}),1===n?(a+=r,a+="</div>",o.innerHTML=a):(a=r,o.innerHTML+=a)}(e,n,o)}},window.manageFilterCount=function(e){let t=document.getElementById("filter-count");e>0?(t.textContent=e,t.style.display="block"):(e=0,t.style.display="none")}},378(){const e=function(e,t=300){let n;return(...o)=>{clearTimeout(n),n=setTimeout(()=>{e.apply(this,o)},t)}}(()=>function(){let e=document.getElementById("keyword").value,t=[],n="";if(e.length>3){const o=new XMLHttpRequest;o.onreadystatechange=function(){4==o.readyState&&200==o.status&&(t=JSON.parse(this.responseText),t.length>
10?t.forEach(e=>{let t=e.phoneNumber.replace(/(\d{4})$/g,"-$&");n+="<div class='staff'><h2>"+e.firstName+" "+e.lastName+"</h2><a href='tel:"+t+"'>"+t+"</a><br /><a href='mailto:"+e.email+"'>"+e.email+"</a></div>"}):n="<p><strong>No results found</strong></p>",document.getElementById("results").innerHTML=n)},o.open("GET","https://webapi.saskpolytech.ca/Employee/"+e),o.send()}}());window.employeeProcessChange=e},761(){document.addEventListener("DOMContentLoaded",()=>{document.getElementById("footer-year").textContent+=` ${(new Date).getFullYear()} Saskatchewan Polytechnic`})},680(){document.addEventListener("DOMContentLoaded",function(){window.location.pathname.endsWith("GPA.aspx")&&(document.getElementById("calculateBtn").addEventListener("click",function(e){e.preventDefault();var t=0,n=0;document.querySelectorAll(".grade_row").forEach(function(e){var o=e.querySelector(".grade_field").value,a=e.querySelector(".credits_field").value;""!==o&&""!==a&&(t+=parseFloat(o)*parseFloat(a),n+=parseFloat(a))});var o=t/n;document.querySelector(".total_credits").innerHTML="Total Credits: "+n,document.querySelector(".total_points").innerHTML="Total Grade Points: "+t;var a=document.getElementById("gpa_output");0===t||0===n?a.textContent="You must enter at least one grade and its corresponding credits.":isNaN(o)?a.textContent="Could not calculate GPA. Did you input a non-decimal grade?":a.innerHTML="<h3>GPA: "+o.toFixed(2)+"</h3>"}),document.getElementById("add_row").addEventListener("click",function(){!function(e){e||(e=1);const t=document.querySelector(".grades_table tbody");for(let n=0;n<e;n++)t.insertAdjacentHTML("beforeend","<tr class='grade_row'><td class='grade-course'><input type='text' name='class' class='class_field' /></td><td><input type='text' name='credits' class='credits_field' /></td><td><input type='text' name='grade' class='grade_field'></td></tr>")}()}))})},718(){document.addEventListener("DOMContentLoaded",()=>{const e=document.querySelectorAll("input.search");e&&e.forEach(e=>{e.addEventListener("keydown",t=>{const n=t.code||t.keyCode;"Enter"!==n&&13!==n||e.blur()})})}),document.addEventListener("DOMContentLoaded",()=>{(window.location.href.indexOf("complete")>-1||window.location.href.indexOf("logout")>-1)&&removeAllFromCart()}),document.addEventListener("DOMContentLoaded",()=>{if(window.location.pathname.startsWith("/search.aspx")){const e=document.querySelector(".content-section"),t=function(){const e=document.querySelectorAll("a.gs-title");e&&e.forEach(function(e){e.getAttribute("data-gtm-tracked")||(e.setAttribute("data-gtm-tracked","true"),e.addEventListener("click",function(e){e.preventDefault();const t=this.getAttribute("data-ctorig");t&&(window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"pse_link_click",pseClickedUrl:t}),setTimeout(function(){window.location.href=t},200))}))})};new MutationObserver(function(){document.querySelector("a.gs-title")&&t()}).observe(e,{childList:!0,subtree:!0}),t()}}),document.addEventListener("keydown",e=>{if("Escape"!==e.key)return;const t=document.getElementById("search-modal");t&&"flex"===t.style.display&&closeSearch();const n=document.getElementById("introModal");n&&n.classList.contains("active")&&closeCustomModal("introModal"),document.querySelectorAll(".modal").forEach(e=>{"block"===e.style.display&&(e.style.display="none")})}),window.fetchData=async function(e){try{const t=await fetch(e);if(!t.ok)throw new Error(`HTTP error! Status: ${t.status}`);return await t.json()}catch(e){throw console.error("An error occurred:",e),e}},window.convertDateToUnix=function(e,t){switch(t){case"iso":{const t=/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})$/i,n=e.match(t);if(!n)return console.error(`Invalid ISO format. Expected YYYY-MM-DDTHH:mm:ss, got: ${e}`),null;const[,o,a,r,i,s,l]=n,c=parseInt(o,10),d=parseInt(a,10)-1,u=parseInt(r,10),m=parseInt(i,10),p=parseInt(s,10),g=parseInt(l,10);return Date.UTC(c,d,u,m+6,p,g)}case"us":{const t=/^(\d{2})\/(\d{2})\/(\d{4})\s+(\d{1,2}):(\d{2})\s+(AM|PM)$/i,n=e.match(t);if(!n)return console.error(`Invalid US format. Expected MM/DD/YYYY HH:MM AM/PM, got: ${e}`),null;const[,o,a,r,i,s,l]=n,c=parseInt(r,10),d=parseInt(o,10)-1,u=parseInt(a,10),m=parseInt(s,10);let p=parseInt(i,10);return"PM"===l.toUpperCase()&&p<12&&(p+=12),"AM"===l.toUpperCase()&&12===p&&
1(p=0),Date.UTC(c,d,u,p+6,m)}default:return console.error(`Unknown format "${t}" provided. Please use "ISO" (YYYY-MM-DDTHH:mm:ss) or "US" (MM/DD/YYYY HH:MM AM/PM) formats.`),null}}},431(){let e=document.getElementById("main-menu"),t=document.getElementById("back-link"),n=document.getElementsByClassName("menu-bar-link"),o=document.getElementById("mobile-menu-trigger");const a=document.getElementById("search-modal"),r=document.getElementById("searchModal-close-btn"),i={queueName:"recentlyViewedQueue",maxSize:3,timeThreshold:1e4,timeZone:"UTC",allowedPaths:["/programs-and-courses/programs"],init:function(){this.checkExpiration(),this.trackActivity()},getFormattedTimestamp:function(){const e=new Date,t={timeZone:this.timeZone,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1};return new Intl.DateTimeFormat("en-GB",t).format(e)},getQueue:function(){const e=localStorage.getItem(this.queueName);return e?JSON.parse(e):{urls:[],lastUpdated:null}},saveQueue:function(e){try{localStorage.setItem(this.queueName,JSON.stringify(e))}catch(e){console.log("Storage unavailable")}},checkExpiration:function(){const e=this.getQueue();if(e.lastUpdated){const t=6048e5;if((new Date).getTime()-e.lastUpdated>t)try{localStorage.removeItem(this.queueName)}catch(e){console.log("Storage unavailable")}}},enqueue:function(e,t){if(!this.allowedPaths.some(t=>e.includes(t)))return;const n=t.split(" | ")[0];let o=this.getQueue(),a=o.urls;const r=a.findIndex(e=>e.title===n);-1!==r?a.splice(r,1):a.length>=this.maxSize&&a.pop();const i=this.getFormattedTimestamp();a.unshift({url:e,title:n,timestamp:i}),o.lastUpdated=(new Date).getTime(),this.saveQueue(o)},trackActivity:function(){let e=!1;setTimeout(()=>{e||(this.enqueue(window.location.href,document.title),e=!0)},this.timeThreshold)}};function s(){if("none"==a.style.display||""==a.style.display){a.style.display="flex",a.setAttribute("aria-hidden","false");const e=document.getElementById("cse-search-box").querySelector("input"),t=i.getQueue(),n=document.getElementById("main-search-history-container");t&&t.urls.length>0&&n?(window.innerWidth>480&&e&&e.focus(),window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"recently_viewed_displayed"})):e.focus(),window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"main_search_modal_opened"})}else a.style.display="none",a.setAttribute("aria-hidden","true"),document.getElementById("search-icon-btn-mobile").focus()}window.addEventListener("load",()=>{i.init();const e=i.getQueue(),t=document.getElementById("main-search-history-container");if(e&&e.urls.length>0&&t){t.style.display="block";const n=document.getElementById("search-history-links"),o=e.urls;if(o){n.innerHTML="";for(let e of o){let t=document.createElement("li");t.setAttribute("role","listitem");let o=document.createElement("a");const a=e.title.split(" | ")[0];o.textContent=a,o.href=e.url,o.classList.add("cwyl-link"),o.addEventListener("click",function(){window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"recently_viewed_link_click",cwyl_title:a,cwyl_url:e.url})}),t.appendChild(o),n.appendChild(t)}}}}),document.addEventListener("DOMContentLoaded",()=>{const e=document.querySelectorAll('a[role="button"][href="#"]');e&&e.forEach(e=>{e.addEventListener("click",function(e){e.preventDefault()})})}),document.addEventListener("DOMContentLoaded",()=>{const e=document.getElementById("search-icon-btn"),t=document.getElementById("search-icon-btn-mobile");e&&e.addEventListener("click",s),t&&t.addEventListener("click",s)}),document.addEventListener("DOMContentLoaded",()=>{const e=document.getElementById("query"),t=document.getElementById("search-click-btn");e&&(e.addEventListener("blur",()=>{""==this.U&&(this.U="Search")}),e.addEventListener("focus",()=>{"Search"==this.U&&(this.U="")}),t&&t.addEventListener("click",()=>{document.getElementById("cse-search-box").submit()}))}),document.addEventListener("DOMContentLoaded",()=>{const e=document.getElementById("mobile-menu-trigger");e&&e.addEventListener("click",function(){this.classList.toggle("is-open");const e=this.classList.contains("is-open");this.setAttribute("aria-expanded",e),this.setAttribute("aria-label",e?"Close mobile menu":"Open mobile menu")})}),a.addEventListener("click",e=>{"search-modal"==e.target.id&&s()}),r.addEventListener("click",e=>{"searchModal-close-btn"==e.target.id&&s()}),r.addEventListener("keydown",e=>{"searchModal-close-btn"!=e.target.id||" "!==e.key&&"Spacebar"!==e.key&&"Enter"!==e.key||(e.preventDefault(),s())}),o&&o.addEventListener("click",()=>{e.classList.toggle("show"),e.classList.contains("show")?document.querySelectorAll(".menu-bar-link.show").length>0&&t.classList.add("show"):t.classList.remove("show")}
1),Array.from(n).forEach(function(n){n.addEventListener("click",()=>{e.classList.contains("show")?t.classList.add("show"):t.classList.remove("show")})});let l=document.getElementsByClassName("menu-link");l&&Array.from(l).forEach(function(e){e.addEventListener("click",()=>{window.innerWidth,e.classList.toggle("show")})}),t&&t.addEventListener("click",()=>{let e=function(){let e=document.getElementById("main-menu");return[].slice.call(e.querySelectorAll(".menu-link.show")).reduce(function(t,n){for(var o=0,a=n;a!==e;o++,a=a.parentNode);return o>t.d?{d:o,el:n}:t},{d:0,el:e}).el}();e.classList.remove("show"),(e.parentNode.parentNode.classList.contains("menu-bar")||e.parentNode.parentNode.parentNode.parentNode.classList.contains("menu-bar"))&&t.classList.remove("show")});let c,d=document.querySelectorAll('.menu-bar-link[aria-haspopup="true"]'),u=document.querySelectorAll('.mega-menu-link[aria-haspopup="true"]'),m=document.querySelectorAll('.menu-list-link[aria-haspopup="true"]'),p=document.querySelectorAll('.menu-list-link[aria-haspopup="true"], .mega-menu-link[aria-haspopup="true"]');c="none"!==window.getComputedStyle(o).display,d&&!1===c&&Array.from(d).forEach(function(e){e.addEventListener("click",()=>{e.classList.add("show");let t=document.querySelectorAll(".menu-bar-link.show");Array.from(t).forEach(function(t){e!=t&&t.classList.remove("show")}),h(p),e.nextElementSibling.style.minHeight="auto"})}),document.addEventListener("click",function(t){let n=!1;(t.target===e||e.contains(t.target))&&(n=!0),!1===n&&Array.from(d).forEach(function(e){e.classList.remove("show")})}),p&&!1===c&&Array.from(p).forEach(function(e){e.addEventListener("click",()=>{e.classList.contains("mega-menu-link")&&h(u),e.classList.contains("menu-list-link")&&h(m);let t=e.nextElementSibling;if(t){t.setAttribute("style","display:block;transform-origin:left;animation:flyout 0.2s ease-out"),e.nextElementSibling.style.minHeight="auto";let n=e.nextElementSibling.offsetHeight,o=e.closest(".mega-menu"),a=e.closest(".menu");o.offsetHeight=a.offsetHeight,a.offsetHeight<n?o.style.minHeight=n+50+"px":o.style.minHeight=a.offsetHeight+50+"px"}})});const g=document.getElementById("info-for-toggle"),y=document.getElementById("info-dropdown");function h(e){Array.from(e).forEach(function(e){let t=e.nextElementSibling;t&&t.setAttribute("style","display:none;")})}g&&g.addEventListener("click",()=>{g.classList.toggle("rotate-arrow"),y.classList.toggle("open-dropdown")}),window.toggleSearch=s,window.closeSearch=function(){a.style.display="none"}},513(){document.addEventListener("DOMContentLoaded",()=>{const e=document.getElementById("primoQueryBtn");e&&e.addEventListener("click",e=>{e.preventDefault();const t=document.getElementById("primoQueryTemp");if(t){const e=t.value;document.getElementById("primoQueryValue").value="any,contains,"+e,document.forms.libsearch.submit()}});const t=document.getElementById("library-hours-container");t&&async function(e){if("content"in document.createElement("template")){const t="https://library.saskpolytech.ca/_resources/_data/hours-of-operation.json",n=await fetchData(t),o=function(){const e=new Date,t={timeZone:"America/Regina",weekday:"long",hour:"numeric",minute:"2-digit",second:"2-digit",dayPeriod:"short",hour12:!0};try{const n=new Intl.DateTimeFormat("en-CA",t).formatToParts(e),o={};for(const e of n)"literal"!==e.type&&(o[e.type]=e.value);return o}catch(e){return console.error("Error getting Saskatchewan date/time parts:",e),null}}().weekday;console.log(o);const a=n.data.filter(e=>"moose jaw"===e.location.toLowerCase().trim()&&e.day.toLowerCase().trim()===o.toLowerCase())[0],r=n.data.filter(e=>"prince albert"===e.location.toLowerCase().trim()&&e.day.toLowerCase().trim()===o.toLowerCase())[0],i=n.data.filter(e=>"regina"===e.location.toLowerCase().trim()&&e.day.toLowerCase().trim()===o.toLowerCase())[0],s=n.data.filter(e=>"saskatoon"===e.location.toLowerCase().trim()&&e.day.toLowerCase().trim()===o.toLowerCase())[0],l=n.data.filter(e=>"ave w"===e.location.toLowerCase().trim()&&e.day.toLowerCase().trim()===o.toLowerCase())[0],c=n.data.filter(e=>"ask us live"===e.location.toLowerCase().trim()&&e.day.toLowerCase().trim()===o.toLowerCase())[0];console.log(a);let d=document.getElementById("hours-operation-template").content.cloneNode(!0);d.querySelector(".hours-location").textContent=a.location,d.querySelector(".hours-operation").textContent=`${a.timeOpens} - ${a.timeCloses}`,console.log(d),e.appendChild(d);let u=document.getElementById("hours-operation-template").content.cloneNode(!0);u.querySelector(".hours-location").textContent=r.location,u.querySelector(".hours-operation").textContent=`${r.timeOpens} - ${r.timeCloses}`,e.appendChild(u);let m=document.getElementById("hours-operation-template").content.cloneNode(!0);m.querySelector(".hours-location").textContent=i.location,m.querySelector(".hours-operation").textContent=`${i.timeOpens} - ${i.timeCloses}`,e.appendChild(m);let p=document.getElementById("hours-operation-template").content.cloneNode(!0);p.querySelector(".hours-location").textContent=s.location,p.querySelector(".hours-operation").textContent=`${s.timeOpens} - ${s.timeCloses}`,e.appendChild(p);let g=document.getElementById("hours-operation-template").content.cloneNode(!0);g.querySelector(".hours-location").textContent=l.location,g.querySelector(".hours-operation").textContent=`${l.timeOpens}
1 - ${l.timeCloses}`,e.appendChild(g);let y=document.getElementById("hours-operation-template").content.cloneNode(!0);y.querySelector(".hours-location").textContent=c.location,y.querySelector(".hours-operation").textContent=`${c.timeOpens} - ${c.timeCloses}`,e.appendChild(y)}}(t)})},588(){window.modal=function(e,t){let n=document.getElementById(e);0!=t&&(document.getElementById(t).onclick=function(){n.style.display="block"}),n.getElementsByClassName("close")[0].onclick=function(){n.style.display="none"}},window.showModal=function(e){document.getElementById(e).style.display="block"},window.hideModal=function(e){document.getElementById(e).style.display="none"}},164(){document.addEventListener("DOMContentLoaded",()=>{const e=document.getElementById("panzoom-element");if(e){const t=document.getElementById("zoomin"),n=document.getElementById("zoomout"),o=e.parentElement,a=Panzoom(e,{maxScale:6});a.zoom(1,{animate:!0}),o.addEventListener("wheel",a.zoomWithWheel),e.parentElement.addEventListener("wheel",a.zoomWithWheel),t.addEventListener("click",a.zoomIn),n.addEventListener("click",a.zoomOut)}})},845(){document.addEventListener("DOMContentLoaded",()=>{const e=document.getElementById("orglist");e&&displayOrganizationAgreements(e)})},456(){window.displayOrganizationAgreements=async function(e){const t=await fetchData("https://webapi.saskpolytech.ca/Program/tcAgreements");"content"in document.createElement("template")&&t.forEach(t=>{const n=document.getElementById("institution-container").content.cloneNode(!0);n.querySelector(".institution-logo").setAttribute("href",t.url),t.logo?(n.querySelector(".institution-logo img").src=`https://saskpolytech.ca/${t.logo}`,n.querySelector(".institution-logo img").setAttribute("alt",`Logo of ${t.institution}`)):n.querySelector(".institution-logo").remove(),n.querySelector(".institution-title h2").textContent=t.institution,n.querySelector(".institution-title").setAttribute("href",t.url),t.programs.forEach(e=>{const t=document.getElementById("program-item").content.cloneNode(!0);t.querySelector(".program-url").textContent=e.program,t.querySelector(".program-url").setAttribute("href",`https://saskpolytech.ca/programs-and-courses/programs/${e.filename}#plar`),n.appendChild(t)}),e.appendChild(n)})}},442(){let e=document.querySelectorAll(".share-link");Array.from(e).forEach(function(e){e.addEventListener("click",()=>{let t=window.location.href,n="";e.classList.contains("facebook")?n="https://www.facebook.com/sharer/sharer.php?u="+t:e.classList.contains("twitter")?n="https://x.com/intent/tweet?text="+t:e.classList.contains("linkedin")&&(n="https://www.linkedin.com/shareArticle?mini=true&url="+t),window.open(n,"_blank").focus()})}),document.addEventListener("DOMContentLoaded",function(){const e=document.getElementById("calendar-container"),t=document.getElementById("timely_template"),n=document.getElementById("calendar-skeleton");e&&t&&n&&new IntersectionObserver((o,a)=>{o.forEach(o=>{if(o.isIntersecting){a.unobserve(e);let o=null;const r=new MutationObserver(()=>{e.querySelector(".timely-custom-display-visible")&&(clearTimeout(o),n.style.display="none",r.disconnect())});r.observe(e,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["class"]}),o=setTimeout(()=>{n.style.display="none",r.disconnect()},4e3);const i=t.content.querySelector("script");if(i){const t=document.createElement("script");for(const e of i.attributes)t.setAttribute(e.name,e.value);e.appendChild(t)}}})}).observe(e)})},226(){document.addEventListener("DOMContentLoaded",()=>{const e=document.getElementById("program-course-list"),t=document.getElementById("switch-part-time");if(t&&t.addEventListener("click",toggleSwitch),e){const e=document.getElementById("program-main").getAttribute("data-code"),t=document.getElementById("program-main").getAttribute("data-part-time");getProgramCourses(e,t)}})},678(){const e="https://webapi.saskpolytech.ca/";function t(e){let t=e.classList.contains("details-open"),n=e.nextElementSibling;t?(e.classList.remove("details-open"),n.style.maxHeight=null):(e.classList.toggle("details-open"),n.style.maxHeight?n.style.maxHeight=null:n.style.maxHeight=n.scrollHeight+"px")}function n(){let e=document.getElementsByClassName("program-list-details"),t=document.getElementById("show-all-course-details"),n="true"===t.getAttribute("data-all-open");Array.from(e).forEach(function(e){let t=e;n?(e.previousElementSibling.classList.remove("details-open"),t.style.maxHeight=null):(e.previousElementSibling.classList.add("details-open"),t.style.maxHeight=t.scrollHeight+"px")}),t.setAttribute("data-all-open",!n),t.textContent=n?"Expand all":"Collapse all"}document.addEventListener("DOMContentLoaded",e=>{const t=document.querySelector(".program-navigation-mobile"),n=document.querySelector(".back-to-top-container"),o=document.createElement("div");o.id="apply-now-program-mobile-navigation";const a=document.createElement("a");if(a.href="/admissions/apply-and-register/apply-now.aspx",a.classList.add("btn"),a.textContent="Apply Now",o.appendChild(a),t&&n){let t=n.firstChild;n.insertBefore(o,t);const a=document.querySelector("#program-navigation-mobile-toggle"),r=document.querySelector("#program-menu");if(null!=a){a.addEventListener("click",()=>{e.preventDefault(),a.classList.toggle("rotate-arrow"),r.classList.toggle("open-dropdown")});let t=document.querySelectorAll(".program-navigation-links ul li");t&&Array.from(t).forEach(function(t){t.addEventListener("click",()=>{e.preventDefault(),r.classList.remove("open-dropdown"),a.classList.remove("rotate-arrow")})})}const i=document.getElementById("apply-now-program-mobile-navigation"),s=document.querySelector("footer");window.addEventListener("scroll",function(){const e=s.getBoundingClientRect(),t=document.documentElement.scrollTop>200,n=e.top<window.innerHeight;i.style.display=t&&!n?"flex":"none"}),document.querySelectorAll('#program-menu ul li a[href^="#"]').forEach(e
1=>{e.addEventListener("click",function(e){e.preventDefault();const t=this.getAttribute("href"),n=document.querySelector(t);if(n){const e=document.querySelector(".program-navigation-mobile"),t=document.querySelector("#main-navigation-container"),o=(e?e.offsetHeight:0)+(t?t.offsetHeight:0),a=n.getBoundingClientRect().top+window.pageYOffset-o-20;window.scrollTo({top:a,behavior:"smooth"})}})})}}),window.getProgramCourses=function(o,a=!1){const r=new XMLHttpRequest;r.onreadystatechange=function(){4==r.readyState&&200==r.status&&function(o,a){const r=document.getElementById("program-course-list");let i="",s=!1,l='<a id="show-all-course-details" href="#" role="button">Expand all</a>',c=0,d=0;o.forEach(function(e,t,n){i!=e.key&&""!=e.key&&(s&&(l+="</div>",c>0&&(l+="<div class='semester-totals'>Total semester credits: "+c+"</div>"),s=!1),i=e.key,c=0,l+=`<h4>${e.key}</h4>`,l+="<div class='program-course-list-row heading'>\n <div class='program-list-code heading'>Code</div>\n <div class='program-list-name heading'>Name</div>\n <div class='program-list-credits heading'>Credits</div>\n <div class='heading'></div>\n </div>",s=!0),l+=`<div class='program-course-list-row'>\n <div class='program-list-code'>${e.value.subjectCode}-${e.value.courseNum}</div>\n <div class='program-list-name'>${e.value.title}</div>\n <div class='program-list-credits'>${e.value.creditHours}</div>\n <button class='program-list-details-toggle'></button>\n <div class='program-list-details'>\n <p>${e.value.description}</p><p id='pt-${e.value.subjectCode}-${e.value.courseNum}'></p>`,e.value.creditHours.length>0&&(l+="<strong>Credit Units: </strong>"+e.value.creditHours+"<br />"),e.value.contHours.length>0&&(l+="<strong>Course Hours: </strong>"+e.value.contHours+"<br />"),e.value.prereq.length>1&&(l+="<strong>Prerequisites: </strong>"+e.value.prereq+"<br />"),e.value.coreq.length>1&&(l+="<strong>Corequisites: </strong>"+e.value.coreq+"<br />"),e.value.equivalent.length>1&&(l+="<strong>Equivalent Courses: </strong>"+e.value.equivalent+"<br />"),e.value.learningMethods.length>0&&(l+="<strong>Learning Methods: </strong>",e.value.learningMethods.forEach(function(e){for(var t=0;t<e.method.length;t++)l+=e.method[t]+", ";l=l.replace(/,\s*$/,"")})),l+="</div></div>",""==e.value.creditHours||e.key.includes("(")||(c+=parseInt(e.value.creditHours),d+=parseInt(e.value.creditHours)),t===n.length-1&&c>0&&(l+="<div class='semester-totals'>Total semester credits: "+c+"</div>")}),r.innerHTML=l,document.querySelectorAll(".program-list-details-toggle").forEach(e=>{e.addEventListener("click",e=>{t(e.target)})});const u=document.getElementById("show-all-course-details");u.setAttribute("data-all-open",!1),u.addEventListener("click",e=>{e.preventDefault(),n()}),function(){if(window.location.hash){var e=document.querySelector(window.location.hash);e&&e.scrollIntoView({behavior:"smooth"})}}(),a&&o.forEach(function(t){const n=new XMLHttpRequest;n.onreadystatechange=function(){4==n.readyState&&200==n.status&&"true"==this.responseText&&document.querySelectorAll("#pt-"+t.value.subjectCode+"-"+t.value.courseNum).forEach(e=>{e.innerHTML=`<p><a class="arrow-link" href="/programs-and-courses/part-time-studies/course/${slugify(t.value.title)}/${t.value.subjectCode}-${t.value.courseNum}/">View part-time course offerings</a></p>`})},n.open("GET",e+"Course/hasofferings?code="+t.value.subjectCode+"-"+t.value.courseNum),n.send()})}(JSON.parse(this.responseText),a)},r.open("GET",e+"Program/"+o+"/courses"),r.send()},window.toggleCourseDetails=t,window.showAllCourseDetails=n},931(){document.addEventListener("DOMContentLoaded",()=>{const e=document.getElementById("programlist");if(e){const t=t=>e.getAttribute(`data-${t}`),n={display:t("display"),school:t("school"),location:t("location"),credential:t("credential"),international:t("international"),partTime:t("parttime"),shortTerm:t("shortterm"),witt:t("witt"),specialties:t("specialties")},o=document.getElementById("listing-filters");if("simple"===n.display)return void getProgramListing("simple","programlist","","",n.location,n.school,n.credential,n.international,n.partTime,"",n.shortTerm,n.witt,n.specialties);if("listing"===n.display){const e=document.getElementById("search-filters-template").content.cloneNode(!0),t=document.getElementById("modal-lstg-template").content.cloneNode(!0);o.appendChild(e),o.appendChild(t);const a=document.querySelector(".search-dropdown"),r=document.querySelector(".search-checkboxes");"All"===n.school&&"All"===n.location&&"All"===n.credential&&"false"===n.international&&"false"===n.partTime&&"false"===n.shortTerm&&"false"===n.witt&&"All"===n.specialties&&(a.appendChild(document.getElementById("dropdown-location-template").content.cloneNode(!0)),r.appendChild(document.getElementById("checkbox-international-template").content.cloneNode(!0)),r.appendChild(document.getElementById("checkbox-parttime-template").content.cloneNode(!0)),r.appendChild(document.getElementById("checkbox-online-template").content.cloneNode(!0)),r.appendChild(document.getElementById("checkbox-specialties-template").content.cloneNode(!0))),"All"===n.credential&&a.appendChild(document.getElementById("dropdown-credential-template").content.cloneNode(!0)),"All"===n.school&&a.appendChild(document.getElementById("dropdown-school-template").content.cloneNode(!0)),o.appendChild(document.getElementById("a-z-filters-template").content.cloneNode(!0)),o.appendChild(document.getElementById("modal-labels-template").content.cloneNode(!0));const i=()=>
1{const e=getFilterValues(),t={initial:e[0],keyword:e[1],location:"All"!==n.location?n.location:e[2],school:"All"!==n.school?n.school:e[3],credential:"All"!==n.credential?n.credential:e[4],international:"false"!==n.international?n.international:e[5],partTime:"false"!==n.partTime?n.partTime:e[6],online:e[7],specialties:"All"!==n.specialties?n.specialties:e[8]};let o=0;t.location&&"All"===n.location&&o++,t.school&&"All"===n.school&&o++,t.credential&&"All"===n.credential&&o++,t.international&&"false"===n.international&&o++,t.partTime&&"false"===n.partTime&&o++,t.online&&o++,"true"===t.specialties&&"All"===n.specialties&&o++,t.initial&&"ALL"!==t.initial&&o++,manageFilterCount(o);const a=t.keyword.length>=3,r=a?t.keyword:(t.keyword.length,""),i=!a&&void 0;getProgramListing("listing","programlist","ALL"===t.initial?"":t.initial,r,t.location,t.school,t.credential,t.international,t.partTime,t.online,n.shortTerm,n.witt,t.specialties,i)},s=new URL(window.location.href).searchParams.get("location"),l=new Set(["saskatoon","prince albert","moose jaw","regina"]);if(s&&l.has(s.toLowerCase())){const e=document.getElementById("location");e&&(e.value=s.toLowerCase())}i();const c=(e,t)=>{const n=document.getElementById(e);n&&n.addEventListener(t,i)};c("location","change"),c("credential","change"),c("school","change"),c("chk-international","click"),c("chk-parttime","click"),c("chk-online","click"),c("chk-specialties","click");const d=document.getElementById("keyword-search-lstg");d&&d.addEventListener("keyup",throttle(e=>{(e.target.value.length>=3||0===e.target.value.length)&&(e.target.value.length>=3&&resetProgramListingFilters(),i())},500));const u=document.querySelector(".a-z-filters");u&&u.addEventListener("click",e=>{if("LI"===e.target.tagName&&!e.target.classList.contains("is-disabled")){u.querySelectorAll("li").forEach(e=>{e.style.textDecoration="underline",e.style.color="purple",e.style.fontWeight="normal"}),e.target.style.textDecoration="none",e.target.style.color="#000",e.target.style.fontWeight="bold";const t=e.target.textContent.trim().toUpperCase();u.dataset.initial=t,i()}});const m=document.getElementById("open-filter-lstg");m&&m.addEventListener("click",()=>{document.querySelector(".modal-listing").classList.toggle("modal-listing--open"),document.querySelector(".btn-filters").classList.toggle("btn-filters--open")});const p=document.querySelector(".modal-data--labels");p&&p.addEventListener("click",e=>{const t=e.target.closest(".label-item");if(t&&t.dataset.filter){const e=t.dataset.filter,n=document.getElementById(e);n&&(resetProgramListingFilters(),n.checked=!0,i())}})}}})},871(){function e(e,t,n,o=!1,a,r=!1,i){document.querySelector(".modal-data--labels").style.display="grid";let s=document.getElementById(t),l="<div class='az-list'>";if(0===e.length)return l="<div style='text-align: center;'>No programs found</div>",void(s.innerHTML=l);const c=e.filter(e=>e.altName).map(e=>({...e,name:e.altName}));let d,u=[...e,...c];n&&"ALL"!==n&&(u=u.filter(e=>e.name.startsWith(n))),function(e,t){const n=e=>null==e||""===e,o=Object.values(t);if(n(t.keyword))return;if(o.length>0&&o.every(n))return;if("undefined"==typeof dataLayer||!Array.isArray(dataLayer))return void console.warn("dataLayer is not available or not an array. Event not pushed.");if(!Array.isArray(e))return void console.error("trackProgramSearch: 'programs' argument must be an array.");if("object"!=typeof t||null===t||Array.isArray(t))return void console.error("trackProgramSearch: 'filters' argument must be a plain object.");let a;a=e&&e.length>0?[...e].map(e=>e.name).join(", "):"empty",dataLayer.push({event:"programs-search",programs:a,initialletter:t.initial,keyword:t.keyword,location:t.location,school:t.school,credential:t.credential,international:t.international,parttime:t.parttime,shortterm:t.shortterm,online:t.online,specialties:t.isSpecialty,witt:t.witt})}(u,i),d=a?u.sort((e,t)=>e.name.localeCompare(t.name)):u,d.forEach(e=>{l+=function(e,t,n,o){let a,r="";r+=!1===o?"<div class='az-item'>":"<div class='az-item--apply'>",a=e.filename.startsWith("http")?e.filename:"/programs-and-courses/programs/"+e.filename;let i="";return""==e.specialties&&"true"!==e.isSpecialty||(i+="<img src='/_assets/img/specialties.svg' alt='Program contains specialties' title='Program contains specialties' />"),""!=e.online&&(i+="<img src='/_assets/img/online.svg' alt='Delivered via online/distance learning' title='Delivered via online/distance learning' />"),"true"==e.partTime&&(i+="<img src='/_assets/img/parttime.svg' alt='Available part-time' title='Available part-time' />"),"true"==e.international&&(i+="<img src='/_assets/img/international.svg' alt='Available for international students' title='Available for international students' />"),r+="\n <div class='az-info'>",r+=!1===o?`<div class='az-name'><a href="${a}">${t}</a></div>`:`<div class='az-name'><a>${t}</a></div>`,r+=`\n <div class='az-locations'>${e.location}</a>`,!0===o&&e.applyNowUrl&&e.nextStart?r+=`<div>${e.nextStart}</div></div>`:r+="</div>",r+=`\n <div class='az-credential'>${e.degree}</div>\n <div class='az-icons'>${i}</div>\n </div>`,!1===o?r+=`<a class='btn' href='${a}'>View</a>`:e.applyNowUrl?r+=`<a class='btn' href='${e.applyNowUrl}'>Apply Now</a>`:r+=`<span>${e.noApply}</span>`,n&&(r+=`<div class="az-international-note">${e.internationalNote.trim()}</div>`),r+="</div>",r}(e,e.name,o,r)}),l+="</div>",s.innerHTML=l}function t(e){const t=document.querySelector(".a-z-filters");if(!t)return;const n=new Set;
1e.forEach(e=>{e.name&&n.add(e.name.charAt(0).toUpperCase()),e.altName&&n.add(e.altName.charAt(0).toUpperCase())});let o=t.dataset.initial||"ALL";""===o&&(o="ALL"),o=o.toUpperCase();const a=t.querySelectorAll("li");let r="ALL"===o;if(a.forEach(e=>{const t=e.textContent.trim().toUpperCase();if("ALL"===t)return e.classList.remove("is-disabled"),e.style.pointerEvents="auto",void(e.style.opacity="1");n.has(t)?(e.classList.remove("is-disabled"),e.style.pointerEvents="auto",e.style.opacity="1",e.style.cursor="pointer",t===o&&(r=!0)):(e.classList.add("is-disabled"),e.style.pointerEvents="none",e.style.opacity="0.2",e.style.textDecoration="none",e.style.cursor="default",t===o&&(e.style.fontWeight="normal",e.style.color="purple",e.style.textDecoration="underline"))}),!r){const e=Array.from(a).find(e=>"ALL"===e.textContent.trim().toUpperCase());e&&(t.dataset.initial="ALL",e.click())}}window.getProgramListing=function(n,o,a,r,i,s,l,c,d,u,m,p,g,y=!0){let h=new XMLHttpRequest;h.onreadystatechange=function(){if(4==h.readyState&&200==
1h.status){let h=JSON.parse(this.responseText);t(h);const f={initial:a,keyword:r,location:i,school:s,credential:l,international:c,parttime:d,online:u,isSpecialty:g,shortterm:m,witt:p};switch(n){case"simple":!function(e,t){let n=document.getElementById(t),o="<ul class='az-list-simple'>",a="";if(0===e.length)return o="<div style='text-align: center;'>No programs found</div>",void(n.innerHTML=o);e.forEach(e=>{a=e.filename.startsWith("http")?e.filename:"/programs-and-courses/programs/"+e.filename,o+=`<li><a href="${a}">${e.name} - ${e.degree}</li>`}),o+="</ul>",n.innerHTML=o}(h,o);break;case"listing":e(h,o,a,1==c||"true"===c,y,!1,f);break;case"apply":e(h,o,a,!1,y,!0,f)}}};let f="?limit=200&active=true";"apply"===n&&(f+="&suspended=false"),""!=r&&(f+="&keyword="+r),""!=i&&"All"!=i&&(f+="&location="+i),""!=s&&"All"!=s&&(f+="&school="+s),1!=c&&"true"!==c||(f+="&international=true"),""!=l&&"All"!=l&&(f+="&credential="+l),!0!==d&&"true"!==d||(f+="&parttime=true"),!0!==u&&"true"!==u||(f+="&online=true"),!0!==m&&"true"!==m||(f+="&shortTermFlag=true"),!0!==p&&"true"!==p||(f+="&witt=true"),null!==g&&"All"!==g&&(f+="&isSpecialty="+g),h.open("GET","https://webapi.saskpolytech.ca/Program/list"+f),h.send()},window.throttle=function(e,t){let n=0;return function(...o){clearTimeout(n),n=setTimeout(e.bind(this,...o),t||0)}},window.getFilterValues=function(){const e=e=>{const t=document.getElementById(e);return t?t.value:""},t=e=>{const t=document.getElementById(e);return t&&t.checked?"true":""},n=document.querySelector(".a-z-filters");return[n&&n.dataset.initial?n.dataset.initial:"ALL",e("keyword-search-lstg"),e("location"),e("school"),e("credential"),t("chk-international"),t("chk-parttime"),t("chk-online"),t("chk-specialties")]},window.resetProgramListingFilters=function(){const e=document.querySelector(".a-z-filters");if(e){e.dataset.initial="ALL";const t=e.querySelectorAll("li");t.forEach(e=>{e.classList.remove("is-disabled"),e.style.opacity="1",e.style.pointerEvents="auto",e.style.textDecoration="underline",e.style.color="purple",e.style.fontWeight="normal"}),t[0]&&(t[0].style.textDecoration="none",t[0].style.color="#000",t[0].style.fontWeight="bold")}const t=e=>{const t=document.getElementById(e);t&&(t.value="")},n=e=>{const t=document.getElementById(e);t&&(t.checked=!1)};n("chk-parttime"),n("chk-international"),n("chk-online"),n("chk-specialties"),t("school"),t("location"),t("credential")},window.updateAZFilterUI=t},559(){document.addEventListener("DOMContentLoaded",async()=>{const e=document.getElementById("tuition-automated");if(e&&"none"!==e.style.display){const t=document.querySelector("h1.main-title"),n=document.querySelector(".wrapper-grid--credential .credential"),o=document.getElementById("tuition-automated");if(!t||!n)return;const a=t.textContent.trim().toLowerCase(),r=n.textContent.trim().toLowerCase(),i=`https://webapi.saskpolytech.ca/Tuition/tuitionprogram?programName=${encodeURIComponent(a)}&credential=${encodeURIComponent(r)}`;try{const e=await fetchData(i);e.items&&e.items.length>0&&function(e,t,n){const o=n.querySelector(".tuition-academic-year"),a=n.querySelector(".tuition-values");a.innerHTML="";const r=e[0];if(r.startDate&&r.endDate){const e=new Date(r.startDate).getFullYear(),t=new Date(r.endDate).getFullYear(),n=e===t?`${e}`:`${e}-${t.toString().slice(-2)}`;o.textContent=`${n} academic year`}e.forEach(e=>{const t=null==(n=e.domesticTotal)?0:"number"==typeof n?n:parseFloat(n.replace(/,/g,""))||0;var n;const o=100*Math.ceil(t/100),r=document.createElement("p");r.textContent=`Year ${e.year} - $${o.toLocaleString("en-US")}`,a.appendChild(r)})}(e.items,e.finalTotal,o)}catch(t){console.error("Error fetching tuition data:",t),function(e){const t=e.querySelector(".tuition-academic-year"),n=e.querySelector(".tuition-values");t&&(t.textContent=""),n&&(n.innerHTML="<p>To be determined</p>")}(e)}}})},102(){function e(){null!==document.getElementById("search-page-pse")||function(){const e=document.getElementById("google-autocomplete-container");function t(){document.querySelectorAll("table.gssb_c").forEach(t=>{t.parentElement!==e&&(e.appendChild(t),t.classList.add("search-modal-autocomplete"),t.style.removeProperty("position"),t.style.removeProperty("top"),t.style.removeProperty("right"),t.style.removeProperty("bottom"),t.style.removeProperty("left"),t.style.removeProperty("width"),t.style.removeProperty("z-index"),t.style.removeProperty("text-align"))})}e?"true"!==e.dataset.observerInitialized&&(e.dataset.observerInitialized="true",new MutationObserver(()=>{t()}).observe(document.body,{childList:!0,subtree:!0}),t()):console.warn("Google autocomplete container was not found.")}(),function(){const e=document.getElementById("main-search-submit");e?"true"!==e.dataset.searchInitialized&&(e.dataset.searchInitialized="true",e.addEventListener("pointerdown",e=>{e.preventDefault(),e.stopPropagation(),t()}),e.addEventListener("click",e=>{0===e.detail&&(e.preventDefault(),e.stopPropagation(),t())})):console.warn("Search button was not found.")}(),function(){const e=document.getElementById("search-container");if(!e)return;function t(){const t=e.querySelector("input.gsc-input");return!!t&&(t.placeholder="Search saskpolytech.ca...",!0)}if(t())return;const n=new MutationObserver(()=>{t()&&n.disconnect()});n.observe(e,{childList:!0,subtree:!0})}()}function t(){const e=document.querySelector("#search-container input.gsc-input");if(!e)return void console.warn("Google search input was not found.");const t=e.value.trim();t?window.location.assign("https://saskpolytech.ca/search.aspx?q="+encodeURIComponent(t)):e.focus()}"loading"===document.readyState?document.addEventListener("DOMContentLoaded",e,{once:!0}):e()},18(){document.addEventListener("DOMContentLoaded",()=>{const e=document.querySelectorAll(".sidebar-container ul li a");
1if(e){const t=window.location.pathname;for(const n of e){let e=new URL(n.href).pathname;e.includes("index.aspx")&&(e=e.replace("index.aspx","")),e===t&&n.classList.add("sidebar-highlight")}}})},48(){window.displaySocialDirectory=async function(e){const t=document.getElementById(e);let n="",o="";const a=await new Promise((e,t)=>{let n=new XMLHttpRequest;n.onreadystatechange=function(){if(4==n.readyState)if(200==n.status){let t=JSON.parse(this.responseText);e(t)}else t(new Error("Failed to fetch Social Directory"))},n.open("GET","https://webapi.saskpolytech.ca/SocialMedia/list/"),n.send()});if(null===a)return null;a.forEach(e=>{if(o=e.category,n!==o){const e=document.getElementById("template-social-category-name").content.cloneNode(!0);e.querySelector(".social-category-name").textContent=o,t.appendChild(e)}n=o;const a=document.getElementById("template-social-item").content.cloneNode(!0);a.querySelector(".social-image").setAttribute("src",e.imageUrl),a.querySelector(".social-image").setAttribute("alt",e.imageAlt),a.querySelector(".social-details .social-name").textContent=e.name;const r=a.querySelector(".social-details .social-icons-container");if(e.facebookUrl){let t=document.getElementById("template-social-icon").content.cloneNode(!0);t.querySelector("a").setAttribute("href",e.facebookUrl),t.querySelector("img").setAttribute("src","/about/organization/communications-and-marketing/images/Facebook.jpg"),r.appendChild(t)}if(e.linkedinUrl){let t=document.getElementById("template-social-icon").content.cloneNode(!0);t.querySelector("a").setAttribute("href",e.linkedinUrl),t.querySelector("img").setAttribute("src","/about/organization/communications-and-marketing/images/linkedin.png"),r.appendChild(t)}if(e.instagramUrl){let t=document.getElementById("template-social-icon").content.cloneNode(!0);t.querySelector("a").setAttribute("href",e.instagramUrl),t.querySelector("img").setAttribute("src","/about/organization/communications-and-marketing/images/Instagram.jpg"),r.appendChild(t)}if(e.xUrl){let t=document.getElementById("template-social-icon").content.cloneNode(!0);t.querySelector("a").setAttribute("href",e.xUrl),t.querySelector("img").setAttribute("src","/images/x_black.png"),r.appendChild(t)}if(e.youtubeUrl){let t=document.getElementById("template-social-icon").content.cloneNode(!0);t.querySelector("a").setAttribute("href",e.youtubeUrl),t.querySelector("img").setAttribute("src","/about/organization/communications-and-marketing/images/Youtube.jpg"),r.appendChild(t)}t.appendChild(a)})}},156(){window.displayTCAgreements=async function(e){const t=document.getElementById(e);let n="",o="";const a=await new Promise((e,t)=>{let n=new XMLHttpRequest;n.onreadystatechange=function(){if(4==n.readyState)if(200==n.status){let t=JSON.parse(this.responseText);e(t)}else t(new Error("Failed to fetch Agreements"))},n.open("GET","https://webapi.saskpolytech.ca/Program/list/?active=true"),n.send()});if(null===a)return null;let r=a.filter(e=>e.tcAgreements.length>0&&!e.specialties.includes("specialty"));r.sort(function(e,t){return e.cluster.localeCompare(t.cluster)}),"content"in document.createElement("template")&&r.forEach(e=>{if(o=e.cluster,n!==o){const e=document.getElementById("school-container").content.cloneNode(!0),n=document.getElementById("school-title").content.cloneNode(!0);n.querySelector(".school-title").textContent=o.trim(),e.appendChild(n),t.appendChild(e)}n=o;const a=document.getElementById("program-title").content.cloneNode(!0);a.querySelector(".program-title a").textContent=e.name.trim(),a.querySelector(".program-title a").setAttribute("href",`/programs-and-courses/programs/${e.filename}`),t.appendChild(a),function(e,t){let n="";t.tcAgreements.forEach(t=>{if(t.specialty.length&&n!==t.specialty){const o=document.getElementById("specialty-title").content.cloneNode(!0);o.querySelector("h5").textContent=t.specialty,e.appendChild(o),n=t.specialty}const o=document.getElementById("partner-accordion").content.cloneNode(!0);o.querySelector(".accordion-link").textContent=t.name.trim(),o.querySelector(".accordion-panel p").textContent=t.details.trim(),e.appendChild(o)})}(t,e)}
1),[...document.getElementsByClassName("accordion-link")].forEach(e=>e.addEventListener("click",function(){openAccordion(e)}))}},140(){document.addEventListener("DOMContentLoaded",()=>{const e=document.getElementById("undersubscribed-container");e&&async function(e){if(!e)return void console.error("Container not found.");const t=await fetchData("https://webapi.saskpolytech.ca/Undersubscribed/list"),n=document.getElementById("template-table").content.cloneNode(!0);for(const e of t){const t=document.getElementById("template-table-row").content.cloneNode(!0),o=document.getElementById("template-table-column").content.cloneNode(!0);if(e.url){const t=document.createElement("a");t.href=e.url,t.textContent=e.name,o.querySelector("td span").appendChild(t)}else o.querySelector("td span").textContent=e.name;const a=document.getElementById("template-table-column").content.cloneNode(!0);a.querySelector("td span").textContent=e.campus,t.querySelector("tr").appendChild(o),t.querySelector("tr").appendChild(a),n.querySelector("tbody").appendChild(t)}e.appendChild(n)}(e)})},312(){Date.prototype.addDays=function(e){var t=new Date(this.valueOf());return t.setDate(t.getDate()+e),t},window.setCookie=function(e,t,n){var o="";if(n){var a=new Date;a.setTime(a.getTime()+24*n*60*60*1e3),o="; expires="+a.toUTCString()}document.cookie=e+"="+(t||"")+o+"; path=/"},window.getCookie=function(e){for(var t=e+"=",n=document.cookie.split(";"),o=0;o<n.length;o++){for(var a=n[o];" "==a.charAt(0);)a=a.substring(1,a.length);if(0==a.indexOf(t))return a.substring(t.length,a.length)}return null},window.eraseCookie=function(e){document.cookie=e+"=; Path=/; Expires=Thu, 01 Jan 1970 00:00:01 GMT;"},window.slugify=function(e){return e.toLowerCase().replace(/[^\w ]+/g,"").replace(/ +/g,"-")}}};const t={};function n(o){const a=t[o];if(void 0!==a)return a.exports;const r=t[o]={exports:{}};return e[o].call(r.exports,r,r.exports,n),r.exports}n.m=e,n.d=(e,t)=>{if(Array.isArray(t))for(var o=0;o<t.length;){var a=t[o++],r=t[o++];n.o(e,a)?0===r&&o++:0===r?Object.defineProperty(e,a,{enumerable:!0,value:t[o++]}):Object.defineProperty(e,a,{enumerable:!0,get:r})}else for(var a in t)n.o(t,a)&&!n.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:t[a]})},n.f={},n.e=e=>Promise.all(Object.keys(n.f).reduce((t,o)=>(n.f[o](e,t),t),[])),n.u=e=>"msal-browser.js",n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{const e={};n.l=(t,o,a,r)=>{if(e[t])return void e[t].push(o);let i,s;if(void 0!==a){const e=document.getElementsByTagName("script");for(var l=0;l<e.length;l++){const n=e[l];if(n.getAttribute("src")==t){i=n;break}}}i||(s=!0,i=document.createElement("script"),i.charset="utf-8",n.nc&&i.setAttribute("nonce",n.nc),i.src=t),e[t]=[o];const c=(n,o)=>{i.onerror=i.onload=null,clearTimeout(d);const a=e[t];if(delete e[t],i.parentNode?.removeChild(i),a?.forEach(e=>e(o)),n)return n(o)},d=setTimeout(c.bind(null,void 0,{type:"timeout",target:i}),12e4);i.onerror=c.bind(null,i.onerror),i.onload=c.bind(null,i.onload),s&&document.head.appendChild(i)}})(),(()=>{let e;n.g.importScripts&&(e=n.g.location+"");const t=n.g.document;if(!e&&t&&("SCRIPT"===t.currentScript?.tagName.toUpperCase()&&(e=t.currentScript.src),!e)){const n=t.getElementsByTagName("script");if(n.length){let t=n.length-1;for(;t>-1&&(!e||!/^http(s?):/.test(e));)e=n[t--].src}}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),n.p=e})(),(()=>{const e={792:0};n.f.j=(t,o)=>{let a=n.o(e,t)?e[t]:void 0;if(0!==a)if(a)o.push(a[2]);else{const r=new Promise((n,o)=>a=e[t]=[n,o]);o.push(a[2]=r);const i=n.p+n.u(t),s=new Error,l=o=>{if(n.o(e,t)&&(a=e[t],0!==a&&(e[t]=void 0),a)){const e=o&&("load"===o.type?"missing":o.type),n=o&&o.target&&o.target.src;s.message="Loading chunk "+t+" failed.\n("+e+": "+n+")",s.name="ChunkLoadError",s.type=e,s.request=n,a[1](s)}};n.l(i,l,"chunk-"+t,t)}};const t=(t,o)=>{let[a,r,i]=o;var s,l,c=0;if(a.some(t=>0!==e[t])){for(s in r)n.o(r,s)&&(n.m[s]=r[s]);i&&i(n)}for(t&&t(o);c<a.length;c++)l=a[c],n.o(e,l)&&e[l]&&e[l][0](),e[l]=0},o=self.webpackChunk=self.webpackChunk||[];o.forEach(t.bind(null,0)),o.push=t.bind(null,o.push.bind(o))})(),(()=>{"use strict";n(312),n(429),n(422),n(451),n(599),n(718),n(680),n(588),n(532),n(601),n(678),n(226),n(431),n(442),n(871),n(931),n(559),n(85),n(298),n(779),n(236),n(156);const e=JSON.parse('{"Interests":["Working with things such as machines, tools or equipment","Using my hands to make or fix things","Working with plants and/or animals","Using my body to do physical work or sports","Figuring out why things happen","Learning about science","Using math to solve problems","Searching for answers to complex real-life problems","Performing in music, dance, or theatre","Creative writing (e.g. songs, stories or poems)","Designing, drawing or painting","Going to concerts, art galleries, museums, theatres or libraries","Helping others make their lives better","Trying to understand why people behave the way they do","Talking about my own feelings or those of others","Teaching or counselling others","Working in business or owning my own business","Convincing others to agree with my ideas","Taking a leadership role (e.g. within a community organization or a company)","Using law or politics as a way of solving problems","Working with details and numbers","Organizing and tracking information such as files or materials","Following orderly routines and schedules","Meeting clear and specific performance standards"],"Values":["I am rewarded for doing something that can be seen or used","I respond to problems by doing something useful, not just thinking or talking about solutions","I am physically active","I see a finished product or visible results from what I do","I develop a high level of ability in a scientific or math based field","I learn and gain knowledge for its\' own sake","I use reflection and analysis to solve problems","I have a curious approach to the world around me","I am able to work and think independently","I am free from a lot of rules so that I can use my imagination","I can express myself in creative ways","I can have beauty around me and help others see beauty in the world","I build pleasant relationships with other people","I make the world a better place for people to live in","I establish friendships and provide assistance to others","I work together with others to solve problems in a cooperative way","I have success, both financial and social","I am recognized for my achievements","I take risks to achieve a goal","I can lead and make decisions","I have accuracy and order in my work","I have stability, not a lot of change in the workplace","That I perform tasks successfully and not waste time or energy","I have predictability and a sense of routine"],"Talents":["Building things","Repairing things","Physical movement and coordination","Operating vehicles, tools or equipment","Understanding science, testing theories and predicting outcomes","Understanding mathematics","Researching information","Breaking down and understanding complex problems","Artistic activities (e.g. music, visual art, dance or drama)","Visualizing what something will look like from a drawing, diagram or blueprint","Using my imagination and having original ideas","Creative writing (e.g. poems, songs or short stories)","Understanding why people behave the way they do and helping them solve problems through discussion and listening","Speaking or writing so that others are interested and learn from me","Developing positive relationships with others","Listening to others and letting them know I understand their point of view","Public speaking","Influencing others through my words (e.g. selling or convincing others)","Motivating or leading others","Adjusting and reorganizing when faced with challenges","Organizing, collecting and keeping track of large amounts of information","Paying careful attention to details","Following specific instructions and steps","Operating computers"],"Skills":["Develop my physical abilities (strength, coordination and endurance)","Use hand/eye coordination (work with my hands/fingers) ","Understand how machines and equipment work","Find answers to questions by doing experiments","Use diagrams and manuals to build or repair things","Use math concepts","Analyze information to help solve problems","Research information","Express thoughts and feelings in artistic ways","Think up new and different ways of doing things","Draw and design visual material","Write creatively (e.g. songs, short stories or poems)","Get along well with others, individually and in groups","Solve problems and conflict through discussion and negotiation","Teach and coach others so they can develop their skills","Help and guide others so they can solve their problems","Sell products or ideas","Public speak in large or small groups","Supervise in organizations or businesses","Make decisions which affect people or organizations","Set up and keep accurate records","Manage time and money","Organize large amounts of detailed information","Operate computers to perform things like data entry and data analysis"]}'),t="https://webapi.saskpolytech.ca/",o=t+"ProgramExplorer/recommendations",a=t+"ProgramExplorer/share";var r=window.location.search.substring(1);r=r.replace(/%3D/g,"=");var i=1;let s=0;var l="interests";function c(e){let t=1;const n=setInterval(function(){t<=.1&&(clearInterval(n),e.style.display="none"),e.style.opacity=t,e.style.filter="alpha(opacity="+100*t+")",t-=.1*t},30)}function d(e,t=400){e.style.opacity=0,e.style.display="block";let n=null;window.requestAnimationFrame(function o(a){n||(n=a);const r=a-n;e.style.opacity=Math.min(r/t,1),r<t&&window.requestAnimationFrame(o)})}function u(e){for(var t,n,o=e.length;0!==o;)n=Math.floor(Math.random()*o),t=e[o-=1],e[o]=e[n],e[n]=t;return e}function m(e,t){for(var n=t.split("&"),o=0;o<n.length;o++){var a=n[o].split("=");if(a[0]==e)return a[1]}return!1}function p(e,t,n){var o="<div class='question' id='q"+n+e+"'><input type='checkbox' disabled='disabled' class='"+n+"' id='q"+e+"' name='q"+e+"' value='"+t+"' /> <label for='q"+e+"'>"+t+"</label></div>";const a=document.getElementById(n);a&&a.insertAdjacentHTML("beforeend",o)}function g(e,t){const n=document.getElementById("q"+t+e);if(n){let o=e;switch(t){case"talents":o-=24;break;case"values":o-=48;break;case"skills":o-=72}o=o/24*25;const a=document.getElementById("p"+t);a&&(a.setAttribute("aria-valuenow",o),a.style.width=o+"%"),document.getElementById(t).style.display="block",n.style.display="block";document.getElementById("backbtn").style.display=e>
11?"block":"none",document.querySelectorAll(".card").forEach(e=>{d(e,200)})}else{const e=document.querySelector(".progress");e&&(e.style.display="none");const t=document.getElementById("backbtn");t&&(t.style.display="none"),document.querySelectorAll(".answers").forEach(e=>{e.style.display="none"}),y()}}function y(){let e="",t="",n="",a="";document.querySelectorAll("input:checked").forEach(function(o){let r=o.value.replace(/,/g,"~");switch(o.className){case"interests":e+=r+";";break;case"values":t+=r+";";break;case"talents":n+=r+";";break;case"skills":a+=r+";"}}),function(e,t,n,a){document.getElementById("activeSection").innerHTML="",document.querySelectorAll(".infoSection").forEach(e=>e.style.display="none"),document.querySelectorAll(".card").forEach(e=>c(e)),document.querySelectorAll(".answers").forEach(e=>e.style.display="none"),document.getElementById("backbtn").style.display="none",document.querySelector(".progress").style.display="none",d(document.getElementById("result")),document.getElementById("resultInner").innerHTML="<h2>Crunching some numbers...</h2>";const r="&interests="+e+"&values="+t+"&talents="+n+"&skills="+a,i=JSON.stringify({interests:e,values:t,talents:n,skills:a});fetch(o,{method:"POST",headers:{"Content-Type":"application/json; charset=UTF-8"},body:i}).then(e=>{if(!e.ok)throw new Error(`HTTP error! Status: ${e.status}`);return e.json()}).then(o=>{const i=document.getElementById("resultInner");i.innerHTML=w(o);let s="s=1&r=";document.querySelectorAll(".programlink").forEach(e=>{s+=e.dataset.code+","}),s+="&a=",document.querySelectorAll(".additionalprogramlink").forEach(e=>{s+=e.dataset.code+","}),s=window.location.href+"?"+btoa(s+r),s=s.replace(/=/g,"%3D");const l=document.getElementById("id_link");l&&(l.value=s),document.querySelectorAll(".shareLink").forEach(e=>{const t=e.getAttribute("href");e.setAttribute("href",t+s)}),history.pushState(null,"Program Explorer Results",s),"undefined"!=typeof ga&&ga("send","event","Program Explorer","Submitted",s),document.getElementById("shareLinkCopy").innerHTML=s,i.insertAdjacentHTML("afterbegin","<a href='javascript:void(0)' onclick='window.print();' class='btn'>Print</a>"),i.insertAdjacentHTML("afterbegin","<a href='https://saskpolytechca.elluciancrmrecruit.com/Apply/Account/Create?f=eda28719-7d02-4fe5-8513-e038a5613877&o=0ef8fd9e-6d42-4b21-876f-86c4861be752&s=5184738e-8e2e-f111-8aa6-068f62afafba&IsInquiry=True' target='_blank' class='btn'>Connect With Us</a>"),i.insertAdjacentHTML("afterbegin","<a onclick=\"openCustomModal('shareModal')\" class='btn'>Share</a>"),document.getElementById("selections").innerHTML=f(e,t,n,a)}).catch(e=>{console.error("Fetch failed:",e),document.getElementById("resultInner").innerHTML="<h2>Sorry, something went wrong. Please try again.</h2>"})}(e,t,n,a)}function h(e,t=null){const n=document.getElementById("messages");n&&(n.style.display="block"),document.querySelectorAll(".answer").forEach(e=>{e.style.display="none"});const o=document.getElementById(e+"Info");let a="";o&&(a=o.innerHTML),a+="interests"!==e||t?"<a id='close-info-btn' class='btn' onclick='closeInfo();'>Okay</a>":"<a id='close-info-btn' class='btn get-started-program-explorer' onclick='closeInfo();'>Okay</a>",n&&(n.innerHTML=a)}function f(e,t,n,o){var a="";if(!(e&&t&&n&&o))return document.getElementById("selectionswrap").style.display="none",a;var r=e.split(";"),i=t.split(";"),s=n.split(";"),l=o.split(";");a+="<h4>Your top 5 interests</h4>";for(var c=0;c<r.length-1;c++)a+="<i class='far fa-check-square'></i> "+r[c].replace("~",",")+"<br />";a+="<h4>Your top 5 values</h4>";for(var d=0;d<i.length-1;d++)a+="<i class='far fa-check-square'></i> "+i[d].replace("~",",")+"<br />";a+="<h4>Your top 5 talents</h4>";for(var u=0;u<s.length-1;u++)a+="<i class='far fa-check-square'></i> "+s[u].replace("~",",")+"<br />";a+="<h4>Your top 5 skills</h4>";for(var m=0;m<l.length-1;m++)a+="<i class='far fa-check-square'></i> "+l[m].replace("~",",")+"<br />";return a}function w(e){let t="";try{for(let n of e)n.filename.includes("http")||(n.filename=`/programs-and-courses/programs/${n.filename.replace("pcf","aspx")}`),t+=`<div><div class='col-xs-12'><h3><a class="find-more-program-explorer" target='_blank' href='${n.filename}'>${n.name}</a></h3></div></div><div class='row-explorer'><div class='explorer-img-container'>`,n.hero.length>1&&!n.hero.includes("blank.inc")&&(t+=`<a target='_blank' href='${n.filename}' class="find-more-program-explorer"><img class='explorer-image' src='//saskpolytech.ca${n.hero}'>`),t+="</a></div><div class='col-sm-8'>",t+=`<strong>${n.cluster}</strong><br />`,t+=`<strong>Location(s):</strong>${n.location}<br />`,t+=`<strong>${n.degree}</strong><p>`,n.overview.length>200&&(n.overview=n.overview.substring(0,200)),t+=`<a href='${n.filename}' target='_blank' class='programlink find-more-program-explorer' data-code='${n.code}'>Find out more</a></p></div></div>`}catch(e){t="<p>Opps, we've encountered a problem while trying to search. Please try again.</p>"}return t}
1function b(e){document.querySelectorAll(".answer").forEach(e=>e.disabled=!0);const t=document.getElementById(l),n=t?t.querySelector("h3"):null;n&&(n.style.display="block"),t&&(t.style.display="block");const o=document.getElementById("q"+i);o&&(o.checked=e);const a=document.getElementById("q"+l+i);a&&(a.style.display="none"),i++;const r=document.getElementById("q"+i),s=r?r.className:null;if(l!==s){const e=document.querySelectorAll(`input.${l}:checked`);if(e.length>5||0===e.length){document.querySelectorAll(".answers").forEach(e=>e.style.display="none"),document.getElementById("backbtn").style.display="none";const o=document.getElementById("cntmsg");let a;o&&o.remove(),a=e.length>5?`<div id='cntmsg'><h3>Great! Now choose your top five ${l}:</h3></div>`:`<div id='cntmsg'><h3>Please choose at least one ${l.slice(0,-1)}:</h3></div>`,n&&(n.insertAdjacentHTML("afterend",a),n.style.display="none"),document.querySelectorAll(`#${l} .question`).forEach(e=>{e.style.display="none"}),(0===e.length?document.querySelectorAll(`input.${l}`):e).forEach(e=>{e.checked=!1,e.disabled=!1,e.classList.add("narrowdown"),e.parentElement&&(e.parentElement.style.display="block")}),document.querySelectorAll(".card").forEach(e=>d(e)),t.addEventListener("change",v);const r="skills"===l?"<a id='cnt' class='btn finish-program-explorer' onclick='topFive()'>Finish</a>":"<a id='cnt' class='btn' onclick='topFive()'>Next</a>";t.insertAdjacentHTML("beforeend",r)}else if(null===s)y();else{t.style.display="none";const e=document.getElementById(l+"Info");e&&e.classList.remove("shown"),n&&(n.style.display="none"),h(l=s),document.querySelectorAll(".infoSection").forEach(e=>e.style.display="block");const o=document.getElementById(l+"Info"),a=document.getElementById("activeSection");o&&(o.style.display="none"),a&&o&&(a.innerHTML=o.innerHTML);const r=document.getElementById(l),c=r?r.querySelector("h3"):null;c&&(c.style.display="block"),g(i,l),document.querySelectorAll(".answer").forEach(e=>e.disabled=!1)}}else g(i,l),document.querySelectorAll(".answer").forEach(e=>e.disabled=!1)}function v(e){if(e.target.matches(`input.${l}.narrowdown`)){const e=document.querySelectorAll(`input.${l}.narrowdown:checked`).length,t=document.querySelectorAll(`input.${l}.narrowdown:not(:checked)`);e>=5?t.forEach(e=>e.disabled=!0):t.forEach(e=>e.disabled=!1)}}function E(){if(i>1){const e=document.getElementById("q"+l+i);e&&(e.style.display="none"),i--;const t=document.getElementById("q"+i),n=t?t.className:null;if(l!==n&&null!==n){const e=document.getElementById(l);e&&(e.style.display="none",e.querySelectorAll("h3").forEach(e=>e.style.display="none"));const t=document.getElementById(l+"Info");t&&t.classList.remove("shown"),document.querySelectorAll(".infoSection").forEach(e=>e.style.display="block"),l=n;const o=document.getElementById(l+"Info"),a=document.getElementById("activeSection");o&&a&&(o.style.display="none",a.innerHTML=o.innerHTML);const r=document.querySelector(`#${l} h3`);r&&(r.style.display="block")}g(i,l)}}function k(){document.getElementById("shareLinkCopy").select(),document.execCommand("Copy")}function L(e){const t=document.getElementById(e),n=document.getElementById(e+"-backdrop");t&&n&&(t.classList.add("active"),n.classList.add("active"))}function I(e){const t=document.getElementById(e),n=document.getElementById(e+"-backdrop");t&&n&&(t.classList.remove("active"),n.classList.remove("active"))}const S=document.getElementById("introModal-close-btn"),C=document.getElementById("introModal-start-btn"),B=document.getElementById("introModal-backdrop"),q=document.getElementById("shareModal-close-btn"),A=document.getElementById("shareModal-footer-close-btn"),x=document.getElementById("shareModal-backdrop"),$=document.getElementById("infoModal-close-btn"),T=document.getElementById("infoModal-footer-close-btn"),D=document.getElementById("infoModal-backdrop");async function M(e,t,n){const o=await Promise.all(n.map(e=>function(e){return fetch(e).then(e=>e.blob()).then(e=>new Promise(t=>{const n=new FileReader;n.onloadend=()=>t(n.result),n.readAsDataURL(e)}))}(e)));e.querySelectorAll("img").forEach((e,t)=>{o[t]&&(e.src=o[t])});const a=window.open("","","left=0,top=0,width=21cm,height=auto,toolbar=0,scrollbars=0,status=0");a.opener=null;const r=a.document.createElement("style");r.textContent=t,a.document.head.appendChild(r),a.document.body.appendChild(e),a.document.close(),Promise.all(Array.from(a.document.images).map(e=>
1{return t=e.src,new Promise((e,n)=>{const o=new Image;o.onload=()=>e(o),o.onerror=n,o.src=t});var t})).then(()=>{a.focus(),a.print()})}function N(e){if(!e)return"";let t="";for(const n of e.childNodes)n.nodeType===Node.TEXT_NODE?t+=n.textContent.trim()+" ":n.nodeType===Node.ELEMENT_NODE&&("BR"===n.tagName?t+=". ":t+=N(n)+" ");return t.trim()}S&&S.addEventListener("click",()=>I("introModal")),C&&C.addEventListener("click",()=>I("introModal")),B&&B.addEventListener("click",()=>I("introModal")),q&&q.addEventListener("click",()=>I("shareModal")),A&&A.addEventListener("click",()=>I("shareModal")),x&&x.addEventListener("click",()=>I("shareModal")),$&&$.addEventListener("click",()=>I("infoModal")),T&&T.addEventListener("click",()=>I("infoModal")),D&&D.addEventListener("click",()=>I("infoModal")),window.runProgramExplorer=function(){document.getElementById("backbtn").addEventListener("click",E),document.getElementById("interestsButton").addEventListener("click",e=>h("interests",e.target)),document.getElementById("talentsButton").addEventListener("click",()=>h("talents")),document.getElementById("valuesButton").addEventListener("click",()=>h("values")),document.getElementById("skillsButton").addEventListener("click",()=>h("skills")),document.getElementById("answerYesBtn").addEventListener("click",()=>b(!0)),document.getElementById("answerNoBtn").addEventListener("click",()=>b(!1));const t=document.getElementById("div_link");t&&(t.style.display="none");const n=document.getElementById("div_emailto");n&&(n.style.display="none");const o=document.querySelector(".ou-form .ldp-hide-on-submit");o&&o.classList.add("connect-with-us-submission"),document.getElementById("copyLinkBtn").addEventListener("click",k);const y=JSON.parse(JSON.stringify(e));y.Interests=u(y.Interests),y.Talents=u(y.Talents),y.Values=u(y.Values),y.Skills=u(y.Skills);for(var v=0;v<y.Interests.length;v++)p(++s,y.Interests[v],"interests");for(var I=0;I<y.Talents.length;I++)p(++s,y.Talents[I],"talents");for(var S=0;S<y.Values.length;S++)p(++s,y.Values[S],"values");for(var C=0;C<y.Skills.length;C++)p(++s,y.Skills[C],"skills");if(r.length>1&&function(e){try{return btoa(atob(e))==e}catch(e){return!1}}(r)){var B=atob(r),q=m("r",B),A=m("interests",B),x=m("values",B),$=m("talents",B),T=m("skills",B);const e=new URL(a);e.searchParams.append("results",q),fetch(e,{method:"GET"}).then(e=>{if(!e.ok)throw new Error(`HTTP error! Status: ${e.status}`);return e.json()}).then(e=>{document.getElementById("resultInner").innerHTML=w(e),document.querySelectorAll(".infoSection").forEach(e=>e.style.display="none"),document.querySelectorAll(".card").forEach(e=>c(e)),document.querySelectorAll(".answers").forEach(e=>e.style.display="none"),document.querySelectorAll(".question-section").forEach(e=>e.style.display="none"),document.getElementById("backbtn").style.display="none",d(document.getElementById("result")),document.getElementById("shareLinkCopy").innerHTML=window.location.href,"undefined"!=typeof ga&&ga("send","event","Program Explorer","Viewed",window.location.href);const t=document.getElementById("resultInner");t.insertAdjacentHTML("afterbegin","<a href='javascript:void(0)' onclick='window.print();' class='btn'>Print</a>"),t.insertAdjacentHTML("afterbegin","<a href='https://saskpolytechca.elluciancrmrecruit.com/Apply/Account/Create?f=eda28719-7d02-4fe5-8513-e038a5613877&o=0ef8fd9e-6d42-4b21-876f-86c4861be752&s=5184738e-8e2e-f111-8aa6-068f62afafba&IsInquiry=True' target='_blank' class='btn'>Connect With Us</a>"),t.insertAdjacentHTML("afterbegin","<a onclick=\"openCustomModal('shareModal')\" class='btn'>Share</a>"),document.getElementById("selectionswrap").style.display="block",document.getElementById("selections").innerHTML=f(A,x,$,T)}).catch(e=>{console.error("There was a problem with the fetch operation:",e)})}else{L("introModal");const e=document.getElementById(l+"Info"),t=document.getElementById("activeSection");e.style.display="none",t.innerHTML=e.innerHTML,g(i,l),h(l)}},window.answerQuestion=b,window.topFive=function(){if(document.querySelectorAll(`input.${l}:checked`).length<1){const e=document.getElementById("messages");e&&(e.innerHTML="<div class='alert alert-danger'>Make sure you choose at least one.</div>")}else{const e=document.getElementById("top-navigation");e&&e.scrollIntoView({behavior:"smooth",block:"start"});const t=document.getElementById("messages");t&&(t.innerHTML=""),document.querySelectorAll(".narrowdown").forEach(e
1=>e.classList.remove("narrowdown"));const n=document.getElementById(l);n&&(n.querySelectorAll("h3").forEach(e=>e.style.display="none"),n.style.display="none");const o=document.getElementById(l+"Info");o&&o.classList.remove("shown");const a=document.getElementById("cnt");a&&a.remove();const r=document.getElementById("cntmsg");r&&r.remove(),document.querySelectorAll(`#${l} .question`).forEach(e=>e.style.display="none");const s=document.getElementById("q"+i),c=s?s.className:null;if(null===c)y();else{h(l=c);const e=document.querySelector(`#${l} h3`);e&&(e.style.display="block"),document.querySelectorAll(".infoSection").forEach(e=>e.style.display="block");const t=document.getElementById(l+"Info"),n=document.getElementById("activeSection");t&&n&&(t.style.display="none",n.innerHTML=t.innerHTML),g(i,l),document.querySelectorAll(".answer").forEach(e=>e.disabled=!1),document.querySelectorAll(".answers").forEach(e=>e.style.display="block"),document.getElementById("backbtn").style.display="block"}}},window.goBack=E,window.displayInfo=h,window.closeInfo=function(){const e=document.getElementById("close-info-btn");e&&e.classList.remove("get-started-program-explorer");const t=document.getElementById("messages");t&&(t.style.display="none"),document.querySelectorAll(".answer").forEach(e=>{e.style.display="inline-block"})},window.copyLink=k,window.openCustomModal=L,window.closeCustomModal=I,n(118),n(456),n(845),n(1),n(18),n(602),n(164),n(102),n(471),n(793),n(651),window.printAgenda=function(e,t,n,o){const a=["https://saskpolytech.ca/student-services/student-life/convocation/images/logo.png","https://saskpolytech.ca/student-services/student-life/convocation/images/header-res.jpg"],r=e.previousElementSibling.querySelector('.ceremony-agenda[style*="display:block"] tbody').children;if(n=`${moment(n).format(o).replace(":00","")}`,"content"in document.createElement("template")){const e=document.getElementById("template-main-agenda").content.cloneNode(!0),o=document.getElementById("template-events-agenda"),i=`${t} - ${n}`;e.querySelector(".ceremony-date").textContent=i;for(const t of r){const n=o.content.cloneNode(!0);let a=t.children,r=N(a[0]),i=N(a[1]);n.querySelector(".event-title").textContent=r,n.querySelector(".event-guests").textContent=i,e.querySelector(".container-events").appendChild(n)}M(e,'html,\r\nbody {\r\n width: 21cm;\r\n margin: 0;\r\n padding: 0;\r\n box-sizing: border-box;\r\n}\r\n\r\nbody {\r\n font-family: "HCo Gotham SSm", Arial, Helvetica, sans-serif;\r\n}\r\n\r\nh1,\r\nh2,\r\nh3,\r\np {\r\n margin: 0;\r\n padding: 0;\r\n}\r\n\r\np {\r\n margin: 0 0 10px;\r\n}\r\n\r\n.container-agenda {\r\n color: #fff;\r\n}\r\n\r\n.header {\r\n display: flex;\r\n align-items: center;\r\n column-gap: 1rem;\r\n padding: 1.2rem 1.2rem 1.2rem 1rem;\r\n margin-bottom: 1rem;\r\n background-image: url("https://saskpolytech.ca/student-services/student-life/convocation/images/background.jpg");\r\n -webkit-print-color-adjust: exact;\r\n -moz-print-color-adjust: exact;\r\n background-color: #3b1844;\r\n}\r\n\r\n.header-img {\r\n width: 1.25in;\r\n}\r\n\r\n.header-title {\r\n font-size: 2.5rem;\r\n font-weight: bold;\r\n color: #fff;\r\n}\r\n\r\n.container-date {\r\n margin-bottom: 1rem;\r\n}\r\n\r\n.ceremony-date {\r\n font-size: 1.5rem;\r\n padding: 5px 0 5px 1rem;\r\n color: #3b1844;\r\n}\r\n\r\n.ceremony-event {\r\n padding: 1rem;\r\n border-top: 1px solid #ddd;\r\n}\r\n\r\n.event-title {\r\n font-size: 1rem;\r\n font-weight: bold;\r\n color: #3b1844;\r\n padding-right: 5px;\r\n}\r\n\r\n.event-guests,\r\n.event-recipients {\r\n font-size: 0.9rem;\r\n color: #000;\r\n}\r\n\r\n/* stylelint-disable */\r\n@media print {\r\n @page {\r\n size: auto;\r\n margin: 1rem auto;\r\n }\r\n\r\n .header {\r\n background-image: url("/student-services/student-life/convocation/images/background.jpg");\r\n background-size: cover;\r\n }\r\n}\r\n/* stylelint-disable */\r\n',a)}},window.printGraduateList=async function(e,t,n,o,a){const r=["https://saskpolytech.ca/student-services/student-life/convocation/images/logo.png","https://saskpolytech.ca/student-services/student-life/convocation/images/header-res.jpg"],i=`${moment(o).format(a).replace(":00","")}`;let s="",l="";const c=await fetchData(`${e}?campus=${t}&year=${n}&date=${o}`);if("content"in document.createElement("template")){const e=document.getElementById("template-graduatelist--main").content.cloneNode(!0),n=document.getElementById("template-graduatelist--schools"),o=document.getElementById("template-graduatelist--programs"),a=document.getElementById("template-graduatelist--grad"),d=`${t} - ${i}`;
1e.querySelector(".ceremony-date").textContent=d,c.forEach(t=>{if(s!==t.school){s=t.school;let o=n.content.cloneNode(!0);o.querySelector(".list-school").textContent=t.school,e.appendChild(o)}if(l!==t.program){l=t.program;let n=o.content.cloneNode(!0);n.querySelector(".list-program").textContent=`${t.program} ${t.degree}`,e.querySelector(".container-list:last-child").appendChild(n)}let r,i=e.querySelectorAll(".container-list:last-child .container-name:last-child"),c=a.content.cloneNode(!0);r=t.firstName&&!t.lastName?t.firstName.trim():!t.firstName&&t.lastName?t.lastName.trim():`${t.firstName.trim()} ${t.lastName.trim()}`,c.querySelector(".graduate-name").textContent=r,i[0].appendChild(c)}),M(e,'html,\r\nbody {\r\n width: 21cm;\r\n margin: 0;\r\n padding: 0;\r\n box-sizing: border-box;\r\n}\r\n\r\nbody {\r\n font-family: "HCo Gotham SSm", Arial, Helvetica, sans-serif;\r\n}\r\n\r\nh1,\r\nh2,\r\nh3,\r\np {\r\n margin: 0;\r\n padding: 0;\r\n}\r\n\r\n.header {\r\n font-size: 2.5rem;\r\n font-weight: bold;\r\n color: #fff;\r\n display: flex;\r\n align-items: center;\r\n column-gap: 1rem;\r\n padding: 1.2rem 1rem 1.2rem 1rem;\r\n background-image: url("https://saskpolytech.ca/student-services/student-life/convocation/images/background.jpg");\r\n background-size: cover;\r\n margin-bottom: 1rem;\r\n -webkit-print-color-adjust: exact;\r\n -moz-print-color-adjust: exact;\r\n background-color: #3b1844;\r\n}\r\n\r\n.header-img {\r\n width: 1.25in;\r\n}\r\n\r\n.container-date {\r\n margin-bottom: 1rem;\r\n}\r\n\r\n.ceremony-date {\r\n font-size: 1.5rem;\r\n padding: 5px 0 5px 1rem;\r\n color: #3b1844;\r\n}\r\n\r\n.container-list {\r\n width: 21cm;\r\n}\r\n\r\n.container-list--before {\r\n break-before: page;\r\n}\r\n\r\n.list-school {\r\n font-size: 1.2rem;\r\n font-weight: bold;\r\n text-align: center;\r\n text-transform: capitalize;\r\n padding: 1rem;\r\n color: #3b1844;\r\n border-top: #000 solid 1px;\r\n}\r\n\r\n.container-list-header {\r\n padding: 0 1rem 1rem 1rem;\r\n font-size: 0.8rem;\r\n font-weight: bold;\r\n text-align: center;\r\n}\r\n\r\n.list-program {\r\n color: #3b1844;\r\n}\r\n\r\n.container-name {\r\n padding: 0 1rem 1rem 1rem;\r\n columns: 3 auto;\r\n}\r\n\r\n.graduate-name {\r\n font-size: 0.8rem;\r\n padding: 0.2rem;\r\n}\r\n\r\n/* stylelint-disable */\r\n@media print {\r\n @page {\r\n size: auto;\r\n margin: 1rem auto;\r\n }\r\n}\r\n/* stylelint-disable */\r\n',r)}document.getElementById("download-pdf").addEventListener("click",()=>{})},n(639),n(48),n(378),n(462),n(140),n(513),n(761)})()})();
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.