var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; var __generator = (this && this.__generator) || function (thisArg, body) { var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; function verb(n) { return function (v) { return step([n, v]); }; } function step(op) { if (f) throw new TypeError("Generator is already executing."); while (_) try { if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; if (y = 0, t) op = [op[0] & 2, t.value]; switch (op[0]) { case 0: case 1: t = op; break; case 4: _.label++; return { value: op[1], done: false }; case 5: _.label++; y = op[1]; op = [0]; continue; case 7: op = _.ops.pop(); _.trys.pop(); continue; default: if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } if (t[2]) _.ops.pop(); _.trys.pop(); continue; } op = body.call(thisArg, _); } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; } }; var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) { if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { if (ar || !(i in from)) { if (!ar) ar = Array.prototype.slice.call(from, 0, i); ar[i] = from[i]; } } return to.concat(ar || Array.prototype.slice.call(from)); }; (function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : typeof define === 'function' && define.amd ? define(factory) : (global.ResizeObserver = factory()); }(this, (function () { 'use strict'; var MapShim = (function () { if (typeof Map !== 'undefined') { return Map; } function getIndex(arr, key) { var result = -1; arr.some(function (entry, index) { if (entry[0] === key) { result = index; return true; } return false; }); return result; } return (function () { function anonymous() { this.__entries__ = []; } var prototypeAccessors = { size: { configurable: true } }; prototypeAccessors.size.get = function () { return this.__entries__.length; }; anonymous.prototype.get = function (key) { var index = getIndex(this.__entries__, key); var entry = this.__entries__[index]; return entry && entry[1]; }; anonymous.prototype.set = function (key, value) { var index = getIndex(this.__entries__, key); if (~index) { this.__entries__[index][1] = value; } else { this.__entries__.push([key, value]); } }; anonymous.prototype.delete = function (key) { var entries = this.__entries__; var index = getIndex(entries, key); if (~index) { entries.splice(index, 1); } }; anonymous.prototype.has = function (key) { return !!~getIndex(this.__entries__, key); }; anonymous.prototype.clear = function () { this.__entries__.splice(0); }; anonymous.prototype.forEach = function (callback, ctx) { var this$1 = this; if (ctx === void 0) ctx = null; for (var i = 0, list = this$1.__entries__; i < list.length; i += 1) { var entry = list[i]; callback.call(ctx, entry[1], entry[0]); } }; Object.defineProperties(anonymous.prototype, prototypeAccessors); return anonymous; }()); })(); var isBrowser = typeof window !== 'undefined' && typeof document !== 'undefined' && window.document === document; var global$1 = (function () { if (typeof global !== 'undefined' && global.Math === Math) { return global; } if (typeof self !== 'undefined' && self.Math === Math) { return self; } if (typeof window !== 'undefined' && window.Math === Math) { return window; } return Function('return this')(); })(); var requestAnimationFrame$1 = (function () { if (typeof requestAnimationFrame === 'function') { return requestAnimationFrame.bind(global$1); } return function (callback) { return setTimeout(function () { return callback(Date.now()); }, 1000 / 60); }; })(); var trailingTimeout = 2; var throttle = function (callback, delay) { var leadingCall = false, trailingCall = false, lastCallTime = 0; function resolvePending() { if (leadingCall) { leadingCall = false; callback(); } if (trailingCall) { proxy(); } } function timeoutCallback() { requestAnimationFrame$1(resolvePending); } function proxy() { var timeStamp = Date.now(); if (leadingCall) { if (timeStamp - lastCallTime < trailingTimeout) { return; } trailingCall = true; } else { leadingCall = true; trailingCall = false; setTimeout(timeoutCallback, delay); } lastCallTime = timeStamp; } return proxy; }; var REFRESH_DELAY = 20; var transitionKeys = ['top', 'right', 'bottom', 'left', 'width', 'height', 'size', 'weight']; var mutationObserverSupported = typeof MutationObserver !== 'undefined'; var ResizeObserverController = function () { this.connected_ = false; this.mutationEventsAdded_ = false; this.mutationsObserver_ = null; this.observers_ = []; this.onTransitionEnd_ = this.onTransitionEnd_.bind(this); this.refresh = throttle(this.refresh.bind(this), REFRESH_DELAY); }; ResizeObserverController.prototype.addObserver = function (observer) { if (!~this.observers_.indexOf(observer)) { this.observers_.push(observer); } if (!this.connected_) { this.connect_(); } }; ResizeObserverController.prototype.removeObserver = function (observer) { var observers = this.observers_; var index = observers.indexOf(observer); if (~index) { observers.splice(index, 1); } if (!observers.length && this.connected_) { this.disconnect_(); } }; ResizeObserverController.prototype.refresh = function () { var changesDetected = this.updateObservers_(); if (changesDetected) { this.refresh(); } }; ResizeObserverController.prototype.updateObservers_ = function () { var activeObservers = this.observers_.filter(function (observer) { return observer.gatherActive(), observer.hasActive(); }); activeObservers.forEach(function (observer) { return observer.broadcastActive(); }); return activeObservers.length > 0; }; ResizeObserverController.prototype.connect_ = function () { if (!isBrowser || this.connected_) { return; } document.addEventListener('transitionend', this.onTransitionEnd_); window.addEventListener('resize', this.refresh); if (mutationObserverSupported) { this.mutationsObserver_ = new MutationObserver(this.refresh); this.mutationsObserver_.observe(document, { attributes: true, childList: true, characterData: true, subtree: true }); } else { document.addEventListener('DOMSubtreeModified', this.refresh); this.mutationEventsAdded_ = true; } this.connected_ = true; }; ResizeObserverController.prototype.disconnect_ = function () { if (!isBrowser || !this.connected_) { return; } document.removeEventListener('transitionend', this.onTransitionEnd_); window.removeEventListener('resize', this.refresh); if (this.mutationsObserver_) { this.mutationsObserver_.disconnect(); } if (this.mutationEventsAdded_) { document.removeEventListener('DOMSubtreeModified', this.refresh); } this.mutationsObserver_ = null; this.mutationEventsAdded_ = false; this.connected_ = false; }; ResizeObserverController.prototype.onTransitionEnd_ = function (ref) { var propertyName = ref.propertyName; if (propertyName === void 0) propertyName = ''; var isReflowProperty = transitionKeys.some(function (key) { return !!~propertyName.indexOf(key); }); if (isReflowProperty) { this.refresh(); } }; ResizeObserverController.getInstance = function () { if (!this.instance_) { this.instance_ = new ResizeObserverController(); } return this.instance_; }; ResizeObserverController.instance_ = null; var defineConfigurable = (function (target, props) { for (var i = 0, list = Object.keys(props); i < list.length; i += 1) { var key = list[i]; Object.defineProperty(target, key, { value: props[key], enumerable: false, writable: false, configurable: true }); } return target; }); var getWindowOf = (function (target) { var ownerGlobal = target && target.ownerDocument && target.ownerDocument.defaultView; return ownerGlobal || global$1; }); var emptyRect = createRectInit(0, 0, 0, 0); function toFloat(value) { return parseFloat(value) || 0; } function getBordersSize(styles) { var positions = [], len = arguments.length - 1; while (len-- > 0) positions[len] = arguments[len + 1]; return positions.reduce(function (size, position) { var value = styles['border-' + position + '-width']; return size + toFloat(value); }, 0); } function getPaddings(styles) { var positions = ['top', 'right', 'bottom', 'left']; var paddings = {}; for (var i = 0, list = positions; i < list.length; i += 1) { var position = list[i]; var value = styles['padding-' + position]; paddings[position] = toFloat(value); } return paddings; } function getSVGContentRect(target) { var bbox = target.getBBox(); return createRectInit(0, 0, bbox.width, bbox.height); } function getHTMLElementContentRect(target) { var clientWidth = target.clientWidth; var clientHeight = target.clientHeight; if (!clientWidth && !clientHeight) { return emptyRect; } var styles = getWindowOf(target).getComputedStyle(target); var paddings = getPaddings(styles); var horizPad = paddings.left + paddings.right; var vertPad = paddings.top + paddings.bottom; var width = toFloat(styles.width), height = toFloat(styles.height); if (styles.boxSizing === 'border-box') { if (Math.round(width + horizPad) !== clientWidth) { width -= getBordersSize(styles, 'left', 'right') + horizPad; } if (Math.round(height + vertPad) !== clientHeight) { height -= getBordersSize(styles, 'top', 'bottom') + vertPad; } } if (!isDocumentElement(target)) { var vertScrollbar = Math.round(width + horizPad) - clientWidth; var horizScrollbar = Math.round(height + vertPad) - clientHeight; if (Math.abs(vertScrollbar) !== 1) { width -= vertScrollbar; } if (Math.abs(horizScrollbar) !== 1) { height -= horizScrollbar; } } return createRectInit(paddings.left, paddings.top, width, height); } var isSVGGraphicsElement = (function () { if (typeof SVGGraphicsElement !== 'undefined') { return function (target) { return target instanceof getWindowOf(target).SVGGraphicsElement; }; } return function (target) { return target instanceof getWindowOf(target).SVGElement && typeof target.getBBox === 'function'; }; })(); function isDocumentElement(target) { return target === getWindowOf(target).document.documentElement; } function getContentRect(target) { if (!isBrowser) { return emptyRect; } if (isSVGGraphicsElement(target)) { return getSVGContentRect(target); } return getHTMLElementContentRect(target); } function createReadOnlyRect(ref) { var x = ref.x; var y = ref.y; var width = ref.width; var height = ref.height; var Constr = typeof DOMRectReadOnly !== 'undefined' ? DOMRectReadOnly : Object; var rect = Object.create(Constr.prototype); defineConfigurable(rect, { x: x, y: y, width: width, height: height, top: y, right: x + width, bottom: height + y, left: x }); return rect; } function createRectInit(x, y, width, height) { return { x: x, y: y, width: width, height: height }; } var ResizeObservation = function (target) { this.broadcastWidth = 0; this.broadcastHeight = 0; this.contentRect_ = createRectInit(0, 0, 0, 0); this.target = target; }; ResizeObservation.prototype.isActive = function () { var rect = getContentRect(this.target); this.contentRect_ = rect; return rect.width !== this.broadcastWidth || rect.height !== this.broadcastHeight; }; ResizeObservation.prototype.broadcastRect = function () { var rect = this.contentRect_; this.broadcastWidth = rect.width; this.broadcastHeight = rect.height; return rect; }; var ResizeObserverEntry = function (target, rectInit) { var contentRect = createReadOnlyRect(rectInit); defineConfigurable(this, { target: target, contentRect: contentRect }); }; var ResizeObserverSPI = function (callback, controller, callbackCtx) { this.activeObservations_ = []; this.observations_ = new MapShim(); if (typeof callback !== 'function') { throw new TypeError('The callback provided as parameter 1 is not a function.'); } this.callback_ = callback; this.controller_ = controller; this.callbackCtx_ = callbackCtx; }; ResizeObserverSPI.prototype.observe = function (target) { if (!arguments.length) { throw new TypeError('1 argument required, but only 0 present.'); } if (typeof Element === 'undefined' || !(Element instanceof Object)) { return; } if (!(target instanceof getWindowOf(target).Element)) { throw new TypeError('parameter 1 is not of type "Element".'); } var observations = this.observations_; if (observations.has(target)) { return; } observations.set(target, new ResizeObservation(target)); this.controller_.addObserver(this); this.controller_.refresh(); }; ResizeObserverSPI.prototype.unobserve = function (target) { if (!arguments.length) { throw new TypeError('1 argument required, but only 0 present.'); } if (typeof Element === 'undefined' || !(Element instanceof Object)) { return; } if (!(target instanceof getWindowOf(target).Element)) { throw new TypeError('parameter 1 is not of type "Element".'); } var observations = this.observations_; if (!observations.has(target)) { return; } observations.delete(target); if (!observations.size) { this.controller_.removeObserver(this); } }; ResizeObserverSPI.prototype.disconnect = function () { this.clearActive(); this.observations_.clear(); this.controller_.removeObserver(this); }; ResizeObserverSPI.prototype.gatherActive = function () { var this$1 = this; this.clearActive(); this.observations_.forEach(function (observation) { if (observation.isActive()) { this$1.activeObservations_.push(observation); } }); }; ResizeObserverSPI.prototype.broadcastActive = function () { if (!this.hasActive()) { return; } var ctx = this.callbackCtx_; var entries = this.activeObservations_.map(function (observation) { return new ResizeObserverEntry(observation.target, observation.broadcastRect()); }); this.callback_.call(ctx, entries, ctx); this.clearActive(); }; ResizeObserverSPI.prototype.clearActive = function () { this.activeObservations_.splice(0); }; ResizeObserverSPI.prototype.hasActive = function () { return this.activeObservations_.length > 0; }; var observers = typeof WeakMap !== 'undefined' ? new WeakMap() : new MapShim(); var ResizeObserver = function (callback) { if (!(this instanceof ResizeObserver)) { throw new TypeError('Cannot call a class as a function.'); } if (!arguments.length) { throw new TypeError('1 argument required, but only 0 present.'); } var controller = ResizeObserverController.getInstance(); var observer = new ResizeObserverSPI(callback, controller, this); observers.set(this, observer); }; ['observe', 'unobserve', 'disconnect'].forEach(function (method) { ResizeObserver.prototype[method] = function () { return (ref = observers.get(this))[method].apply(ref, arguments); var ref; }; }); var index = (function () { if (typeof global$1.ResizeObserver !== 'undefined') { return global$1.ResizeObserver; } global$1.ResizeObserver = ResizeObserver; return ResizeObserver; })(); return index; }))); var Cortex; (function (Cortex) { var Components; (function (Components) { var OnePlayer; (function (OnePlayer) { OnePlayer.players = new Array(); function Init(controlId) { $(document).ready(function () { InitPlayer(); }); } OnePlayer.Init = Init; function InitPlayer() { for (var i = 0; i < OnePlayer.players.length; i++) { var thisPlayer = OnePlayer.players[i]; MsOnePlayer.render(thisPlayer.containerId, thisPlayer, function (player) { player.addPlayerEventListener(function (e) { }); }); } ; ResizeVideo(); $(window).on('resize', function () { ResizeVideo(); }); } OnePlayer.InitPlayer = InitPlayer; function ResizeVideo(containerID) { var videoContainers, x, y; videoContainers = $('.onePlayerContainer'); if (videoContainers != undefined) { videoContainers.each(function () { var thisContainer = $(this); calculateVideoResize(thisContainer, x, y); }); } } OnePlayer.ResizeVideo = ResizeVideo; function calculateVideoResize(thisContainer, x, y) { if (thisContainer.hasClass("Wide16_9")) { x = thisContainer.width(); y = x / 16 * 9; thisContainer.height(y); } else if (thisContainer.hasClass("Wide21_9")) { x = thisContainer.width(); y = x / 21 * 9; thisContainer.height(y); } else if (thisContainer.hasClass("CustomWide21_7")) { x = thisContainer.width(); y = x / 21 * 7.88; thisContainer.height(y); } else { x = thisContainer.width(); y = x / 4 * 3; thisContainer.height(y); } } OnePlayer.calculateVideoResize = calculateVideoResize; function AddVideoPlayer(title, containerId, autoplay, mute, loop, playFullScreen, market, videoId, maskLevel) { if (title === void 0) { title = ''; } var playerData = { containerId: containerId, options: { autoplay: autoplay, mute: mute, loop: loop, playFullScreen: playFullScreen, market: market, maskLevel: maskLevel }, metadata: { title: title, videoId: videoId } }; OnePlayer.players.push(playerData); } OnePlayer.AddVideoPlayer = AddVideoPlayer; function PlayVideo(el, videoId, scrollOption) { el.preventDefault(); var currentVideoId = videoId; OnePlayer.players.forEach(function (player) { if (player.containerId === currentVideoId) { player.options.autoplay = true; InitPlayer(); } }); if (scrollOption) { $('html,body').animate({ scrollTop: $('#' + videoId).offset().top - 50 }, 'slow'); } } OnePlayer.PlayVideo = PlayVideo; })(OnePlayer = Components.OnePlayer || (Components.OnePlayer = {})); var OnePlayerSwitch; (function (OnePlayerSwitch) { var tabs; function SwitchVideo(index) { var containerId = tabs[index].oneplayer.containerId; var id = containerId + "-oneplayer"; var $current = $("#".concat(containerId)); var $oneplayer = $("#".concat(id)); var src = $oneplayer.attr('src'); $oneplayer.attr('src', src); tabs.forEach(function (_a) { var containerId = _a.oneplayer.containerId; var $container = $("#".concat(containerId)); OnePlayer.players.forEach(function (_, index) { OnePlayer.players[index].options.autoplay = false; }); $container.addClass("visuallyhidden"); }); $current.removeClass("visuallyhidden"); Cortex.Components.OnePlayer.PlayVideo(new Event(''), containerId, true); } var defaultOptions = { autoplay: false, mute: false, loop: false, playFullScreen: false, market: "en-US", maskLevel: '0' }; function Init(_tabs) { function start() { tabs = _tabs; tabs.forEach(function (tab, index) { var link = tab.link, _a = tab.oneplayer, containerId = _a.containerId, _b = _a.metadata, _c = _b.title, title = _c === void 0 ? '' : _c, videoId = _b.videoId, _d = _a.options, _e = _d === void 0 ? defaultOptions : _d, _f = _e.autoplay, autoplay = _f === void 0 ? false : _f, _g = _e.mute, mute = _g === void 0 ? false : _g, _h = _e.loop, loop = _h === void 0 ? false : _h, _j = _e.playFullScreen, playFullScreen = _j === void 0 ? false : _j, _k = _e.market, market = _k === void 0 ? "en-US" : _k, _l = _e.maskLevel, maskLevel = _l === void 0 ? '0' : _l; Cortex.Components.OnePlayer.AddVideoPlayer(title, containerId, autoplay, mute, loop, playFullScreen, market, videoId, maskLevel); $("#".concat(link)).on('click', function (e) { e.preventDefault(); SwitchVideo(index); }); }); } $(document).ready(start); } OnePlayerSwitch.Init = Init; })(OnePlayerSwitch = Components.OnePlayerSwitch || (Components.OnePlayerSwitch = {})); var OfficeSignup; (function (OfficeSignup) { function Init(formID) { if ($('#' + formID).length) { $("#".concat(formID, " .c-text-field")).on('keydown', function (e) { if (e.keyCode === $.ui.keyCode.ENTER) { e.preventDefault(); e.stopPropagation(); $("#".concat(formID, " .cc-office-signup-submit")).trigger('click'); } }); $("#".concat(formID, " .cc-office-signup-submit")).on('click keyup', function (e) { e.preventDefault(); e.stopPropagation(); if (Cortex.Utilities.elementSelected(e)) { if (FormIsValid(formID)) { $("#".concat(formID)).submit(); } else { $("#".concat(formID, " .c-text-field")).focus(); } } }); } } OfficeSignup.Init = Init; function FormIsValid(formID) { var valid = true; $("#".concat(formID, " .pmgJS-EmailValidationError")).hide(); $("#".concat(formID, " .pmgJS-EmailDomainError")).hide(); var emailBox = $("#".concat(formID, " .c-text-field")); var reg = new RegExp("^(?!^[.])([-'a-zA-Z0-9_]+\\.)*[-'a-zA-Z0-9_]+@(?!\\.+)([-a-zA-Z0-9]+\\.)+[a-zA-Z]{2,}$"); if (emailBox.val().length == 0) { valid = false; $("#".concat(formID, " .pmgJS-EmailDomainError")).show(); } if (!reg.test(emailBox.val())) { valid = false; $("#".concat(formID, " .pmgJS-EmailValidationError")).show(); } return valid; } OfficeSignup.FormIsValid = FormIsValid; })(OfficeSignup = Components.OfficeSignup || (Components.OfficeSignup = {})); function IframeDemo() { var iframe = document.querySelector("#teams-demo-frame"); if (iframe === null) { return; } var iwindow = window.innerWidth; var height = (iwindow * 16 / 9); height -= (height / 100 * 1); iframe.height = (iwindow / 16 * 9).toString(); } Components.IframeDemo = IframeDemo; var HowToBuyModule; (function (HowToBuyModule) { var previousWidth, currentWidth; function init() { if ($('.Ctex-HowToBuy-Expanding-Products').length > 0) { previousWidth = $(window).width(); findTextHeight(); $(window).resize(function () { currentWidth = $(window).width(); if (currentWidth !== previousWidth) { previousWidth = currentWidth; resizeHowToBuy(); } }); $('my-app .ng-valid').on("click keypress", function () { setTimeout(function () { $('my-app .c-action-trigger, my-app .c-button:not(.active .c-button), #DevicesClearAllButton, #DevicesFilterButton, my-app .ng-valid').on("click keypress", function () { $('.Ctex-HowToBuy-Expanding-Products > div > div div > a, .Ctex-HowToBuy-Expanding-Products .closeButton').off("click keypress", encapsulateHTBModule); $('.Ctex-HowToBuy-Expanding-Products > div > div div > a, .Ctex-HowToBuy-Expanding-Products .closeButton').on("click keypress", encapsulateHTBModule); }); }, 500); }); $(document).on("click keypress", ".Ctex-HowToBuy-Expanding-Products > div > div div > a, .Ctex-HowToBuy-Expanding-Products .closeButton", encapsulateHTBModule); function encapsulateHTBModule(e) { var code = e.keyCode || e.which, listItems = $('.Ctex-HowToBuy-Expanding-Products > div > div'), hiddenItems = $('.Ctex-HowToBuy-Expanding-Products > div > div [data-grid="col-12"]:last-of-type'), thisGrandParent = $(this).parent().parent(), thisLiCount = thisGrandParent.index(); if (code == 13 || code == 1) { listItems.removeClass('ActiveItem'); thisGrandParent.addClass("ActiveItem"); $(".whiteCoverUp").css("background-color", "rgba(0,0,0,0)"); $(this).parent().find(".whiteCoverUp").css("background-color", "#fff"); if ($(this).hasClass('activeAnchor') || $(this).hasClass("closeButton")) { if ($(this).hasClass("closeButton")) { thisGrandParent.slideUp(400, function () { listItems.height(''); $(this).removeClass("active").addClass("hidden"); $(".whiteCoverUp").css("background-color", "rgba(0,0,0,0)"); }).parent().find("a").attr("aria-expanded", "false")[0].focus(); thisGrandParent.parent().find(".show-details-link p").text("SHOW DETAILS"); thisGrandParent.parent().find(".show-details-link p").toggleClass("ctex-glyph-downArrow"); thisGrandParent.parent().find(".show-details-link p").toggleClass("ctex-glyph-upArrow"); thisGrandParent.parent().find(".show-details-link p").css("display", "block"); } else { if (thisGrandParent.find('.active').attr("id") === "DevicesClearAllButton") { $('.device-properties').find('.active').slideUp(400, function () { listItems.height(''); $(this).removeClass("active").addClass("hidden"); $(".whiteCoverUp").css("background-color", "rgba(0,0,0,0)"); }); $(this).attr("aria-expanded", "false"); } thisGrandParent.find(".active").slideUp(400, function () { listItems.height(''); $(this).removeClass("active").addClass("hidden"); $(".whiteCoverUp").css("background-color", "rgba(0,0,0,0)"); }); $(this).attr("aria-expanded", "false"); } listItems.removeClass('ActiveItem').find('a').removeClass("activeAnchor"); $(this).parent().find(".show-details-link p").text("SHOW DETAILS"); $(this).parent().find(".show-details-link p").toggleClass("ctex-glyph-downArrow"); $(this).parent().find(".show-details-link p").toggleClass("ctex-glyph-upArrow"); $(this).parent().find(".show-details-link p").css("display", "block"); } else { listItems.find('a').removeClass("activeAnchor"); $(this).addClass("activeAnchor"); $(this).attr("aria-expanded", "true"); hiddenItems.addClass("hidden").removeClass("active"); listItems.height(''); hiddenItems.hide(); var heightToOffset = $('.Ctex-HowToBuy-Expanding-Products').offset().top - $(this).offset().top, activeElement = $('.Ctex-HowToBuy-Expanding-Products > div > div a.activeAnchor'); sliceHowToBuy($(this), thisLiCount, listItems, thisGrandParent, activeElement.parent().parent().find('.hidden').height() + activeElement.height()); thisGrandParent.find(".hidden").removeClass("hidden").addClass("active").slideDown(400, function () { $(this).parent().find(".whiteCoverUp").css("background-color", "#fff"); }); htbSetHeight(heightToOffset, activeElement, false); $(this)[0].scrollIntoView(); $(".show-details-link p").each(function () { $(this).text("SHOW DETAILS"); if ($(this).hasClass("ctex-glyph-upArrow")) { $(this).removeClass("ctex-glyph-upArrow"); } $(this).addClass("ctex-glyph-downArrow"); }); $(this).parent().find(".show-details-link p").text("HIDE DETAILS"); $(this).parent().find(".show-details-link p").toggleClass("ctex-glyph-downArrow"); $(this).parent().find(".show-details-link p").toggleClass("ctex-glyph-upArrow"); $(this).parent().find(".show-details-link p").css("display", "block"); } } } ; function resizeHowToBuy() { var maxDivHeight = 0, maxActiveHeight = 0, getScreenWidth = window.innerWidth; findTextHeight(); $('.Ctex-HowToBuy-Expanding-Products > div > div').each(function () { if ($(this).attr('style')) { if ($(this).find('a').height() > maxDivHeight) { maxDivHeight = $(this).find('a').height(); } if ($(this).find('.active').height() > maxActiveHeight) { maxActiveHeight = $(this).find('.active').height(); } $(this).height(maxDivHeight + maxActiveHeight); } }); $('.Ctex-HowToBuy-Expanding-Products li:not(.ActiveItem)').height(''); var thisItem = $('.Ctex-HowToBuy-Expanding-Products > div > div.ActiveItem div:first-of-type a'), thisLiCount = $('.Ctex-HowToBuy-Expanding-Products > div > div.ActiveItem').index(), listItems = $('.Ctex-HowToBuy-Expanding-Products > div > div'), thisGrandParent = $('.Ctex-HowToBuy-Expanding-Products > div > div.ActiveItem'); sliceHowToBuy(thisItem, thisLiCount, listItems, thisGrandParent, maxDivHeight + maxActiveHeight); htbSetHeight(null, null, true); } ; function htbSetHeight(heightToOffset, activeElement, isResize) { var activeElementOffset = $('.Ctex-HowToBuy-Expanding-Products > div > div a.activeAnchor').offset(), activeElementHeight = $('.Ctex-HowToBuy-Expanding-Products > div > div a.activeAnchor').height(); if (isResize && activeElementOffset != null) { var heightToOffsetResize = activeElementOffset.top - $('.Ctex-HowToBuy-Expanding-Products').offset().top, activeElementResize = $('.Ctex-HowToBuy-Expanding-Products > div > div a.activeAnchor'); activeElementResize.parent().parent().find('.active').css("top", heightToOffsetResize + activeElementHeight + 1); } else if (activeElementOffset != null) { heightToOffset = activeElementOffset.top - $('.Ctex-HowToBuy-Expanding-Products').offset().top; activeElement.parent().parent().find('.active').css("top", heightToOffset + activeElementHeight + 1); } } function findTextHeight() { var textHeight = 0, textItems = $('.Ctex-HowToBuy-Expanding-Products > div > div > div > a > h3'); textItems.each(function () { $(this).css('height', ''); if ($(this).outerHeight() > textHeight) { textHeight = $(this).outerHeight(); } }); textItems.each(function () { $(this).css('height', textHeight); }); } function sliceHowToBuy(thisItem, thisLiCount, listItems, thisGrandParent, tempHeight) { var getScreenWidth = window.innerWidth; if ($('.Ctex-HowToBuy-Expanding-Products > .device-properties > div').find('a').hasClass("activeAnchor")) { if (getScreenWidth <= 550 && getScreenWidth <= 1024) { if (thisLiCount < 1) { listItems.slice(0, 1).height(tempHeight + 100); } else if (thisLiCount >= 1 && thisLiCount < 2) { listItems.slice(1, 2).height(tempHeight + 100); } else if (thisLiCount >= 2 && thisLiCount < 3) { listItems.slice(2, 3).height(tempHeight + 100); } else if (thisLiCount >= 3 && thisLiCount < 4) { listItems.slice(3, 4).height(tempHeight + 100); } else if (thisLiCount >= 4 && thisLiCount < 5) { listItems.slice(4, 5).height(tempHeight + 100); } else if (thisLiCount >= 5 && thisLiCount < 6) { listItems.slice(5, 6).height(tempHeight + 100); } else if (thisLiCount >= 6 && thisLiCount < 7) { listItems.slice(6, 7).height(tempHeight + 100); } else if (thisLiCount >= 7 && thisLiCount < 8) { listItems.slice(7, 8).height(tempHeight + 100); } else if (thisLiCount >= 8 && thisLiCount < 9) { listItems.slice(8, 9).height(tempHeight + 100); } else if (thisLiCount >= 9 && thisLiCount < 10) { listItems.slice(9, 10).height(tempHeight + 100); } else if (thisLiCount >= 10 && thisLiCount < 11) { listItems.slice(10, 11).height(tempHeight + 100); } else if (thisLiCount >= 11 && thisLiCount < 12) { listItems.slice(11, 12).height(tempHeight + 100); } else if (thisLiCount >= 12 && thisLiCount < 13) { listItems.slice(12, 15).height(tempHeight + 100); } } else if (getScreenWidth >= 550 && getScreenWidth <= 1024) { if (thisLiCount < 2) { listItems.slice(0, 2).height(tempHeight + 100); } else if (thisLiCount >= 2 && thisLiCount < 4) { listItems.slice(2, 4).height(tempHeight + 100); } else if (thisLiCount >= 4 && thisLiCount < 6) { listItems.slice(4, 6).height(tempHeight + 100); } else if (thisLiCount >= 6 && thisLiCount < 8) { listItems.slice(6, 8).height(tempHeight + 100); } else if (thisLiCount >= 8 && thisLiCount < 10) { listItems.slice(8, 10).height(tempHeight + 100); } else if (thisLiCount >= 10 && thisLiCount < 12) { listItems.slice(10, 12).height(tempHeight + 100); } else if (thisLiCount >= 12 && thisLiCount < 14) { listItems.slice(12, 14).height(tempHeight + 100); } } else { if (thisLiCount < 3) { listItems.slice(0, 3).height(tempHeight + 50); } else if (thisLiCount >= 3 && thisLiCount < 6) { listItems.slice(3, 6).height(tempHeight + 50); } else if (thisLiCount >= 6 && thisLiCount < 9) { listItems.slice(6, 9).height(tempHeight + 50); } else if (thisLiCount >= 9 && thisLiCount < 12) { listItems.slice(9, 12).height(tempHeight + 50); } else if (thisLiCount >= 12 && thisLiCount < 15) { listItems.slice(12, 15).height(tempHeight + 50); } else if (thisLiCount >= 15 && thisLiCount < 18) { listItems.slice(15, 18).height(tempHeight + 50); } else if (thisLiCount >= 18 && thisLiCount < 21) { listItems.slice(18, 21).height(tempHeight + 50); } } } else if ($('.Ctex-HowToBuy-Expanding-Products > div > div').find('a').hasClass("activeAnchor")) { if (getScreenWidth <= 768) { if (thisLiCount < 2) { listItems.slice(0, 2).height(tempHeight + 100); } else if (thisLiCount >= 2 && thisLiCount < 4) { listItems.slice(2, 4).height(tempHeight + 100); } else if (thisLiCount >= 4 && thisLiCount < 6) { listItems.slice(4, 6).height(tempHeight + 100); } else if (thisLiCount >= 6 && thisLiCount < 8) { listItems.slice(6, 8).height(tempHeight + 100); } else if (thisLiCount >= 8 && thisLiCount < 10) { listItems.slice(8, 10).height(tempHeight + 100); } else if (thisLiCount >= 10 && thisLiCount < 12) { listItems.slice(10, 12).height(tempHeight + 100); } else if (thisLiCount >= 12 && thisLiCount < 13) { listItems.slice(12, 14).height(tempHeight + 100); } } else if (getScreenWidth <= 940 && getScreenWidth >= 769) { if (thisLiCount < 3) { listItems.slice(0, 3).height(tempHeight + 50); } else if (thisLiCount >= 3 && thisLiCount < 6) { listItems.slice(3, 6).height(tempHeight + 50); } else if (thisLiCount >= 6 && thisLiCount < 9) { listItems.slice(6, 9).height(tempHeight + 50); } else if (thisLiCount >= 9 && thisLiCount < 12) { listItems.slice(9, 12).height(tempHeight + 50); } else if (thisLiCount >= 12 && thisLiCount < 15) { listItems.slice(12, 15).height(tempHeight + 50); } } else { if (thisLiCount < 4) { listItems.slice(0, 4).height(tempHeight + 50); } else if (thisLiCount >= 4 && thisLiCount < 8) { listItems.slice(4, 8).height(tempHeight + 50); } else if (thisLiCount >= 8 && thisLiCount < 12) { listItems.slice(8, 12).height(tempHeight + 50); } else if (thisLiCount >= 12 && thisLiCount < 15) { listItems.slice(12, 16).height(tempHeight + 50); } else if (thisLiCount >= 15 && thisLiCount < 19) { listItems.slice(16, 20).height(tempHeight + 50); } } } } } } HowToBuyModule.init = init; })(HowToBuyModule = Components.HowToBuyModule || (Components.HowToBuyModule = {})); var TeamsDemoParser; (function (TeamsDemoParser) { function Init(location) { var _a; if (location === void 0) { location = window.location.pathname; } var $iframe = document.getElementById("teams-demo-frame"); if ($iframe === null) { return; } var base = "https://octe.azurewebsites.net/Microsoft/viewer/394/index.html#"; var returnUrl; location = location .replace(/^\/en-us\/education\/interactive-demos\//, '') .replace(/default.aspx/, ''); var keys = { "reading-progress-introduction": "/1/9", "inform-instruction-insights": "/1/7", "data-driven-insights": "/1/8", "personalized-guidance-students": "/1/6", "explore-inclusive-classroom": "/1/4", "online-learning-microsoft-edge": "/1/5", "educators-microsoft-teams": "/1/0", "students-microsoft-teams": "/1/1", "collaboration-engagement": "/1/2", "manage-school-technology": "/1/3", "migrate-identities-to-cloud": "/1/10", "set-up-microsoft-365": "/1/11", "enroll-devices-at-scale": "/1/12", "deploy-apps-and-policies": "/1/13", "microsoft-learn-demo": "/1/14", "education-equity": "/1/15", }; returnUrl = base + ((_a = keys[location]) !== null && _a !== void 0 ? _a : ''); $iframe.src = returnUrl; } TeamsDemoParser.Init = Init; })(TeamsDemoParser = Components.TeamsDemoParser || (Components.TeamsDemoParser = {})); var GenericIFrameDemoParser; (function (GenericIFrameDemoParser) { function Init(location) { var _a; if (location === void 0) { location = window.location.pathname; } var $iframe = document.querySelector("iframe[data-demo-parser]"); if ($iframe === null) return; location = location .replace(/^\/en-us\/education\/interactive-demos\//, '') .replace(/default.aspx/, ''); var keys = { "improve-reading-fluency": "2102/1-reading-progress/index.html#/0/0", "remote-learning-for-educators": "2067/2-hybrid-meetings-for-teachers/index.html#/0/0", "microsoft-teams-for-educators": "2068/3-teams-conversations-and-files-for-teachers/index.html#/0/0", "onenote-class-notebook-for-educators": "2071/4-onenote-for-teachers-and-students/index.html#/0/0", "assignments-and-grades-for-educators": "2072/5-assignments-and-grades-for-teachers-and-students/index.html#/0/0", "enhance-your-classroom-with-moodle": "2069/6-moodle-integration-for-teachers/index.html#/0/0", "microsoft-teams-for-parents-and-guardians": "2073/7-teams-for-students/index.html#/0/0", "hybrid-learning-for-students": "2074/8-hybrid-meetings-for-students/index.html#/0/0", "improve-reading-comprehension": "2075/11-immersive-reader/index.html#/0/0", "students-moodle-integration": "2097/10-moodle-for-students/index.html#/0/0", "windows-11-inclusive-design": "2089/12-supporting-hearing-vision-and-interaction/index.html#/0/0", "immersive-reader-and-dictation": "2077/13-immersive-reader-in-edge/index.html#/0/0", "support-student-well-being-with-reflect": "2078/14-reflect/index.html#/0/0", "class-insights-for-educators": "2079/15-class-insights-for-teachers/index.html#/0/0", "support-creative-teaching-and-learning-with-whiteboard": "2082/16-whiteboard/index.html#/0/0", "safeguard-your-school-with-smartscreen": "2081/17-smartscreen/index.html#/0/0", "engage-your-students-with-microsoft-teams": "2086/18-collaboration-with-powerpoint-in-teams/index.html#/0/0", "minecraft-education-edition": "2085/19-minecraft/index.html#/0/0", "education-insights-for-educators": "2104/20-edu-insights-teachers/index.html#/0/0", "education-insights-for-school-leaders": "2105/21-edu-insights-for-school-leaders/index.html#/0/0", "accessiblity-microsoft-teams": "2087/22-accessibility-in-microsoft-teams/index.html#/0/0", "accessiblity-power-point-live": "2088/23-accessibility-in-powerpoint-live/index.html#/0/0", "microsoft-accessiblity-tools-for-reading": "2090/25-accessibility-with-reading-skills/index.html#/0/0", "microsoft-accessiblity-tools-for-writing": "2091/26-accessibility-with-writing-skills/index.html#/0/0", "enhance-your-skills-with-microsoft-learn": "2106/27-ms-learn/index.html#/0/0", "migrate-identities-to-the-cloud": "2092/28-set-up-azure-ad-connect/index.html#/0/0", "school-data-sync": "2093/29-school-data-sync-sds/index.html#/0/0", "add-domain-to-m365": "2094/30-add-domains/index.html#/0/0", "configure-admin-and-security-settings": "2095/31-configure-admin-and-security-settings/index.html#/0/0", "migrate-storage-to-onedrive": "2096/32-migrate-storage-to-onedrive/index.html#/0/0", "enroll-devices-at-scale": "2107/34-enroll-devices-at-scale/index.html#/0/0", "intune-for-education": "2108/33-deploy-the-right-apps-and-policies-to-all-devices-with-intune-for-education/index.html#/0/0", "inclusively-designed": "1738/inclusive-design/index.html#/0/0", "accelerated-learning": "1758/accelerate-learning/index.html#/0/0", "foster-well-being": "1757/foster-well-being/index.html#/0/0", "simplified-secure-it": "1874/secure-and-future-proof-it/index.html#/0/0", "edu-storage-management-it-admin": "2308/edu-storage-management-for-it-admins/index.html#/0/0", "edu-storage-management-end-user": "2307/edu-storage-management-for-end-users/index.html#/0/0", "customer-journey": "394/live-home-experience/index.html#/6/0" }; var extension = (_a = keys[location]) !== null && _a !== void 0 ? _a : '2102/1-reading-progress/index.html#/0/0'; var returnUrl = "https://regale.cloud/Microsoft/viewer/".concat(extension); $iframe.src = returnUrl; } GenericIFrameDemoParser.Init = Init; })(GenericIFrameDemoParser = Components.GenericIFrameDemoParser || (Components.GenericIFrameDemoParser = {})); var QueryString; (function (QueryString) { function GetValue(name, url) { if (!url) url = window.location.href; name = name.replace(/[\[\]]/g, '\\$&'); var regex = new RegExp('[?&]' + name + '(=([^&#]*)|&|#|$)'), results = regex.exec(url); if (!results) return null; if (!results[2]) return ''; return decodeURIComponent(results[2].replace(/\+/g, ' ')); } QueryString.GetValue = GetValue; })(QueryString = Components.QueryString || (Components.QueryString = {})); var Cookies; (function (Cookies) { function CreateCookie(name, value, days) { var expires; if (days) { var date = new Date(); date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000)); expires = "; expires=" + date.toUTCString(); } else { expires = ""; } document.cookie = name + "=" + value + expires + "; path=/"; } Cookies.CreateCookie = CreateCookie; function GetCookie(c_name) { if (document.cookie.length > 0) { var c_start = document.cookie.indexOf(c_name + "="); if (c_start != -1) { c_start = c_start + c_name.length + 1; var c_end = document.cookie.indexOf(";", c_start); if (c_end == -1) { c_end = document.cookie.length; } return unescape(document.cookie.substring(c_start, c_end)); } } return ""; } Cookies.GetCookie = GetCookie; })(Cookies = Components.Cookies || (Components.Cookies = {})); var SuperMosaic; (function (SuperMosaic) { function mobileTextBoxSwap() { var screensize = $(window).width(); $(".topAlign").each(function (count, element) { if (screensize <= 768) { var container = $(element).parent(); var textBox = $(element); $(element).remove(); container.prepend(textBox); } else { var container = $(element).parent(); var textBox = $(element); $(element).remove(); container.append(textBox); } }); } SuperMosaic.mobileTextBoxSwap = mobileTextBoxSwap; function superMosaicInit() { $(document).ready(function () { mobileTextBoxSwap(); $(window).resize(function () { mobileTextBoxSwap(); }); }); } SuperMosaic.superMosaicInit = superMosaicInit; })(SuperMosaic = Components.SuperMosaic || (Components.SuperMosaic = {})); var FeedHero; (function (FeedHero) { function Init() { $(".m-feed-hero-item").on("click", function () { var target = getFeedHeroLinkTarget(".m-feed-hero-item a"); window.open($(".m-feed-hero-item a").prop("href"), target); }); $(".f-active .m-feed-hero-item").on("click", function () { var target = getFeedHeroLinkTarget(".m-feed-hero-item a"); window.open($(".f-active .m-feed-hero-item a").prop("href"), target); }); $(".m-feed-hero-item a").on("click", function (e) { e.stopPropagation(); return true; }); function getFeedHeroLinkTarget(selector) { var target = $(selector).prop("target"); var validatedTarget = target ? target : "_self"; return validatedTarget; } } FeedHero.Init = Init; })(FeedHero = Components.FeedHero || (Components.FeedHero = {})); var ResourceCenterPivot; (function (ResourceCenterPivot) { function Init() { $('#ResourceCenterPivotTabHeaderItem3').on("click", function () { OpenNewTabOnSchoolStoriesTabClick(); }); $('#ResourceCenterPivotTabHeaderItem3').keydown(function (e) { if (e.which == 13) { OpenNewTabOnSchoolStoriesTabClick(); } }); function OpenNewTabOnSchoolStoriesTabClick() { window.open('https://customers.microsoft.com/en-us/search?sq=&ff=story_industry_friendlyname%26%3EPrimary%20and%20Secondary%20Education&p=0&so=story_publish_date%20desc', '_blank'); } } ResourceCenterPivot.Init = Init; })(ResourceCenterPivot = Components.ResourceCenterPivot || (Components.ResourceCenterPivot = {})); var IframeEmbed; (function (IframeEmbed) { function DynamicallyResizeIframe() { var components = Array.from(document.querySelectorAll(".iframe-embed")); if (components.length > 0) { components.forEach(function (component) { var container = component.querySelector(".iframe-container"), iframe = container.querySelector("iframe"); var ratio = parseInt(iframe.height) / parseInt(iframe.width), width = container.offsetWidth; iframe.width = width.toString(); iframe.height = (width * ratio).toString(); window.addEventListener("resize", function () { var width = container.offsetWidth; iframe.width = width.toString(); iframe.height = (width * ratio).toString(); }); }); } } IframeEmbed.DynamicallyResizeIframe = DynamicallyResizeIframe; })(IframeEmbed = Components.IframeEmbed || (Components.IframeEmbed = {})); })(Components = Cortex.Components || (Cortex.Components = {})); })(Cortex || (Cortex = {})); var Cortex; (function (Cortex) { var Generic; (function (Generic) { function checkCanonical() { $(document).ready(function () { var _a; var hasCanon = document.head.querySelector("link[rel=canonical]") != null, hasNoIndex = (_a = document.head.querySelector("meta[name=robots]")) === null || _a === void 0 ? void 0 : _a.getAttribute("content").includes("noindex"), link = document.createElement("link"), defaultOrTrailingSlash = /(\/default.aspx)|(\/$)/gmi, linkHref = 'https://' + window.location.host + window.location.pathname.replace(defaultOrTrailingSlash, ""); if (!hasCanon && !hasNoIndex) { link.rel = "canonical"; link.href = linkHref.toLowerCase(); document.head.appendChild(link); } else if (hasCanon && hasNoIndex) { document.head.querySelector("link[rel=canonical]").remove(); } }); } Generic.checkCanonical = checkCanonical; function calculateComponentLength() { var contentPlacements = document.getElementsByClassName('ctex-flex-container'); if (contentPlacements.length > 0) { for (var i = 0; i < contentPlacements.length; i++) { var count = contentPlacements[i].childElementCount; contentPlacements[i].classList.add('ctex-' + count.toString() + 'up'); } } var expandingTileContentPlacements = Array.prototype.slice.call(document.querySelectorAll('.Ctex-HowToBuy-Expanding-Products .ctex-flex-container')); if (expandingTileContentPlacements.length) { expandingTileContentPlacements.forEach(function (item) { item.classList.add('wrap-exempt'); }); } } Generic.calculateComponentLength = calculateComponentLength; function fixFeatureBleed() { var maxHeight = 0, featureIsStacked, currentWidth = window.innerWidth, stackBreakpoint, elemHeight = 0; $('.m-feature.ctex-feature-bleed-fix, .c-feature.ctex-feature-bleed-fix').each(function (indexFeature) { var isVideo = false; if ($(this).hasClass("f-align-center")) { return; } if ($(this).hasClass('c-feature')) { stackBreakpoint = 1084; } else if ($(this).hasClass('m-feature')) { stackBreakpoint = 768; } maxHeight = 0; if ($(this).find('.m-ambient-video').height() != null) { elemHeight = $(this).find('.m-ambient-video').height(); isVideo = true; } else { elemHeight = $(this).children('picture').find('img').height(); } var contentHeight = $(this).children('div:not(.m-ambient-video)').height(); maxHeight = elemHeight < contentHeight ? contentHeight : elemHeight; $(this).find('picture img, .m-ambient-video').removeClass('force-vertical-align').addClass('force-vertical-align'); $(this).find('picture').css({ 'height': 'inherit', 'position': 'relative' }); featureIsStacked = currentWidth < stackBreakpoint ? true : false; $(this).children().each(function (childIndex) { if (featureIsStacked) { maxHeight = '100%'; if (isVideo) { $(this).removeClass('force-vertical-align'); } else { $(this).find('img').removeClass('force-vertical-align'); } } }).parent().height(maxHeight); }); } Generic.fixFeatureBleed = fixFeatureBleed; function setLinkTargets() { $(document).ready(function () { var main = document.querySelector('main'), links = main.querySelectorAll('a'); var sameDomains = /(microsoft.com\/education|\/[a-zA-Z]{2}-[a-zA-Z]{2}\/education\/|localhost|ms-p9-s3-|ms-p1-s3-|ms-p9-s2-)/; Array.prototype.slice.call(links).forEach(function (link) { if (link.closest('.help-me-choose')) return; if (!link.href.match(sameDomains)) { if (link.href !== '#' && !link.href.includes("footnote")) { link.setAttribute('target', '_blank'); } else { link.removeAttribute('target'); } } else { var linkURL = new URL(link.href).pathname.substring(1, 6); if (document.body.dataset['locale'].toLowerCase() !== linkURL.toLowerCase() && !link.href.includes("footnote")) { link.setAttribute('target', '_blank'); } else { link.removeAttribute('target'); } } }); }); } Generic.setLinkTargets = setLinkTargets; function stripEmptyAttrs() { var main = document.querySelector("main"), els = main.querySelectorAll("img, a, button"), attrs = ["id", "aria-label", "onclick"], elArr; if (els.length) { elArr = Array.prototype.slice.call(els); elArr.forEach(function (el) { attrs.forEach(function (attr) { if (el.hasAttribute(attr) && el.attributes[attr].value == "") { el.removeAttribute(attr); } }); }); } } Generic.stripEmptyAttrs = stripEmptyAttrs; function multiFeatureHandler() { if ($('.c-pivot ul li').length > 0) { var firstItem = $('.c-pivot ul li:first-of-type').attr("aria-controls").split(" "); firstItem.forEach(function (item) { $("#" + item).attr("aria-hidden", "false"); }); } $('.c-pivot ul li').on("click keypress", function () { var targets = $(this).attr("aria-controls").split(" "); targets.forEach(function (target) { $('.c-pivot span section').attr("aria-hidden", "true"); $("#" + target).attr("aria-hidden", "false"); }); }); $('.f-multi-slide .c-flipper').on("click", function () { if ($('.c-pivot ul li').length) { var targets = $('.c-pivot ul li.f-active').attr("aria-controls").split(" "); targets.forEach(function (target) { $('.c-pivot span section').attr("aria-hidden", "true"); $("#" + target).attr("aria-hidden", "false"); }); } }); } Generic.multiFeatureHandler = multiFeatureHandler; function MultiSlideCarousel() { if ($('.c-carousel.f-multi-slide')) { $('.c-carousel.f-multi-slide li:not(:first)').removeClass("f-active"); } } Generic.MultiSlideCarousel = MultiSlideCarousel; function tabbedFeatureHandler() { $(document).ready(function () { var multifeatures = Array.prototype.slice.call(document.querySelectorAll('.m-multi-feature')); if (multifeatures.length > 0) { multifeatures.forEach(function (multifeature) { var uls = Array.prototype.slice.call(multifeature.querySelectorAll('ul')); uls.forEach(function (ul) { var lis = Array.prototype.slice.call(ul.querySelectorAll('li + li')); lis.forEach(function (li) { li.classList.remove('f-active'); var anchors = li.querySelectorAll('a'); if (anchors.length > 0) { anchors.forEach(function (anchor) { anchor.classList.remove('f-active'); }); } }); }); }); } }); } Generic.tabbedFeatureHandler = tabbedFeatureHandler; function navContentPlacementAccessibilityHandler() { var navContentPlacements = Array.prototype.slice.call(document.querySelectorAll('.nav-contentplacement')); if (navContentPlacements.length > 0) { navContentPlacements.forEach(function (navContentPlacement) { var links = Array.prototype.slice.call(navContentPlacement.querySelectorAll('a')); if (links.length > 0) { links.forEach(function (link) { link.setAttribute('aria-setsize', links.length); link.setAttribute('aria-posinset', links.indexOf(link) + 1); }); } }); } } Generic.navContentPlacementAccessibilityHandler = navContentPlacementAccessibilityHandler; function bettCampaignPopup() { if ($(".pop-up")) { var width = window.innerWidth, imgTarget = $('.pop-up picture img, .pop-up picture source'), LargeImage = "https://cortexonemsedu.azureedge.net/assets/geo-triggered-banner-1920/1/1920_ad_geotargeted-bett.jpg", smallImage = "https://forrit-one-msedu-p1-consumables.azureedge.net/media/cd881d31-482c-4b06-802d-cbcc9b6e3183/539_ad_geotargeted-bett.jpg"; window.onresize = function () { width = window.innerWidth; if (width <= 539) { imgTarget.attr("src", smallImage); imgTarget.attr("srcset", smallImage); } else { imgTarget.attr("src", LargeImage); imgTarget.attr("srcset", LargeImage); } }; } } Generic.bettCampaignPopup = bettCampaignPopup; function addHreflangTag() { var _a; var locale = (_a = document.head .querySelector('meta[name=\'og:locale\']')) === null || _a === void 0 ? void 0 : _a.getAttribute('content').toLowerCase(); var link = document.createElement('link'); link.rel = 'alternate'; link.hreflang = locale; link.href = window.location.href; document.head.appendChild(link); } Generic.addHreflangTag = addHreflangTag; function addHighContrastClass() { var isHighContrastModeEnabled = window.matchMedia('(forced-colors: active)').matches; var isDarkModeEnabled = window.matchMedia('(prefers-color-scheme: dark)').matches; if (isHighContrastModeEnabled) { document.querySelector('html').classList.add('hc-active'); if (isDarkModeEnabled) { document.querySelector('html').classList.add('hc-dark'); } } } Generic.addHighContrastClass = addHighContrastClass; function backstopLogHook() { window.addEventListener("DOMContentLoaded", function () { console.log("DOMContentLoaded"); }); } Generic.backstopLogHook = backstopLogHook; function addCorporationWebSiteSchema(type, name, url) { var script = document.createElement('script'); script.type = 'application/ld+json'; var schema = createCorporationWebSiteSchemaObject(type, name, url); script.innerHTML = JSON.stringify(schema); document.head.appendChild(script); function createCorporationWebSiteSchemaObject(type, name, url) { return { '@context': 'https://schema.org/', '@type': type, 'name': name, 'url': url, 'potentialAction': { '@type': 'SearchAction', 'target': '{search_term_string}', 'query-input': 'required name=search_term_string' } }; } } Generic.addCorporationWebSiteSchema = addCorporationWebSiteSchema; function addVideoSchema(name, url, thumbnailURL) { var script = document.createElement('script'); script.type = 'application/ld+json'; var schema = createVideoSchemaObject(name, url, thumbnailURL); script.innerHTML = JSON.stringify(schema); document.head.appendChild(script); function createVideoSchemaObject(name, url, thumbnailUrl) { return { '@context': 'https://schema.org/', '@type': 'VideoObject', 'name': name, 'description': '', 'thumbnailUrl': thumbnailUrl, 'uploadDate': '', 'contentUrl': url }; } } Generic.addVideoSchema = addVideoSchema; ; function addFaqSchema() { var script = document.createElement('script'); script.type = 'application/ld+json'; var schema = createFaqSchemaObject(); script.innerHTML = JSON.stringify(schema); document.head.appendChild(script); function createFaqSchemaObject() { var faqItemObjs = []; $('.c-drawer').each(function () { var name; var text; if (document.querySelector("meta[mwf-v2-framework='true']")) { name = $(this).find(".c-drawer-toggle h1,h2,h3,h4,h5,h6").text(); text = $(this).find("div.c-drawer-panel p").prop("outerHTML"); } else { name = $(this).find("button span").text(); text = $(this).find("div p").prop("outerHTML"); } faqItemObjs.push({ '@type': 'Question', 'name': name, 'acceptedAnswer': { '@type': 'Answer', 'text': text } }); }); return { '@context': 'https://schema.org/', '@type': 'FAQPage', 'mainEntity': faqItemObjs }; } } Generic.addFaqSchema = addFaqSchema; function addBreadcrumbSchema() { var script = document.createElement('script'); script.type = 'application/ld+json'; var SchemaObj = createBreadcrumbSchemaObj(); script.innerHTML = JSON.stringify(SchemaObj); document.head.appendChild(script); function createBreadcrumbSchemaObj() { var breadcrumbItems = $('.c-breadcrumb li a').length; var position = 1; var breadcrumbObjs = []; $('.c-breadcrumb li a').each(function () { if (position != breadcrumbItems) { breadcrumbObjs.push({ '@type': 'ListItem', 'position': position, 'name': this.innerHTML, 'item': $(this).attr('href') }); } else { breadcrumbObjs.push({ '@type': 'ListItem', 'position': position, 'name': this.innerHTML }); } position++; }); return { '@context': 'https://schema.org/', '@type': 'BreadcrumbList', 'ItemListElement': breadcrumbObjs }; } } Generic.addBreadcrumbSchema = addBreadcrumbSchema; function handleLinksBelowHeader() { document.addEventListener('focusin', function (e) { var $activeElement = e.target; var $mainElement = document.querySelector('#mainContent'); if ($mainElement === document.activeElement) return; var rect = $activeElement.getBoundingClientRect(); var header = document.querySelector('.navContainer'); var headerRect = header.getBoundingClientRect(); if (rect.top < headerRect.bottom) { var offset = headerRect.bottom + rect.top - 150; window.scrollBy({ top: offset, behavior: 'smooth' }); } }); } Generic.handleLinksBelowHeader = handleLinksBelowHeader; })(Generic = Cortex.Generic || (Cortex.Generic = {})); })(Cortex || (Cortex = {})); var Cortex; (function (Cortex) { var LiveChatV2; (function (LiveChatV2) { function ValidateLiveChatConditions() { GetAgentAvailablityStatus() .done(function (response) { if (response.toUpperCase() == 'YES') { console.log('Live Chat - agents availabile.'); $.ajax({ type: 'GET', url: validateClientsLocationUrl, success: function (result) { if (result == 'US') { console.log('Live Chat - available in region.'); console.log('Live Chat - initiate.'); Init(); console.log('Live Chat - initiated.'); } else { console.log('Live Chat - not available in region.'); } }, error: function (xhr) { console.log('Live Chat - failed to retrieve client location.'); } }); } else { console.log('Live Chat - agents not availabile.'); } }) .fail(function (x) { console.log('Live Chat - failed to retrieve messaging agent availability.'); }); } LiveChatV2.ValidateLiveChatConditions = ValidateLiveChatConditions; function Init() { var iframe = document.getElementById('iFrameLiveChat'); var sendMessage = function sendMessage(msg) { iframe.contentWindow.postMessage(msg, '*'); }; sendMessage({ lpcurl: location.href }); window.addEventListener('message', function (msg) { if (msg.data.window) { switch (msg.data.window) { case 'ready': console.log('Live Chat - ready'); sendMessage({ lpcurl: location.href }); iframe.style.width = msg.data.width; iframe.style.height = msg.data.height; break; case 'maximized': console.log('Live Chat - maximized'); $('#lpChatCta').addClass('hide-live-chat'); iframe.style.width = msg.data.width; iframe.style.height = msg.data.height; if (msg.data.height === '100vh') { iframe.style.position = 'absolute'; iframe.style.right = '0px'; } else { iframe.style.position = 'fixed'; iframe.style.bottom = '0'; iframe.style.right = '0px'; iframe.style.boxShadow = '0 0 6px rgb(214, 214, 214)'; } break; case 'minimized': console.log('Live Chat - minimized'); $('#lpChatCta').addClass('hide-live-chat'); iframe.style.width = msg.data.width; iframe.style.height = msg.data.height; iframe.style.position = 'fixed'; iframe.style.bottom = '0'; iframe.style.right = '0'; iframe.style.boxShadow = '0 0 6px rgb(214, 214, 214)'; break; case 'closed': console.log('Live Chat - closed'); $('#lpChatCta').removeClass('hide-live-chat'); iframe.style.width = msg.data.width; iframe.style.height = msg.data.height; break; case 'opened': console.log('Live Chat - opened'); iframe.style.width = msg.data.width; iframe.style.height = msg.data.height; break; case 'loading': console.log('Live Chat - loading'); iframe.style.width = msg.data.width; iframe.style.height = msg.data.height; break; default: console.log('msg not in case'); break; } } if (msg.data.engagement) { switch (msg.data.engagement) { case 'buttonReady': sendMessage({ action: 'initializeLP' }); $('.chatContainer, #lpChatCta').removeClass('hide-live-chat'); if ($('.support-content-placement-one-item.hide-live-chat').length) { $('.support-content-placement-one-item.hide-live-chat').removeClass('hide-live-chat'); $('.support-content-placement-one-item').removeClass('support-content-placement-one-item'); $('#support-mwfContentPlacement-liveChatNow').removeAttr('href'); } break; default: break; } } }); window.addEventListener('resize', function (el) { sendMessage({ action: 'parentsize', Height: window.innerHeight, PixelRatio: 1, Width: window.innerWidth, }); }); $('#lpChatButton, #liveChatStickyButtonLink, #support-mwfContentPlacement-liveChatNow').on('click', function () { sendMessage({ action: 'open' }); InitiateLiveChatConfigs(); }); function InitiateLiveChatConfigs() { sendMessage({ Topic: 'Education' }); sendMessage({ action: 'parentsize', Height: window.innerHeight, PixelRatio: 1, Width: window.innerWidth }); } } LiveChatV2.Init = Init; function GetAgentAvailablityStatus() { return $.ajax({ type: 'GET', url: getAgentAvailablityStatusUrl }); } })(LiveChatV2 = Cortex.LiveChatV2 || (Cortex.LiveChatV2 = {})); })(Cortex || (Cortex = {})); var cpmApiURL; var Cortex; (function (Cortex) { var CpmApi; (function (CpmApi) { function CpmEmailAjax(newsletterType, emailAddress, country, optInType) { var newsletterClasses; var isItProsNewsletter = newsletterType == NewsletterType.itPros || newsletterType == NewsletterType.itProsPopUp; switch (newsletterType) { case NewsletterType.itPros: newsletterClasses = '.newsletter-2up.it-pros'; break; case NewsletterType.educator: newsletterClasses = '.newsletter-2up.educator'; break; case NewsletterType.itProsPopUp: newsletterClasses = '.newsletter-pop-up.it-pros-pop-up'; break; } $.ajax({ type: "POST", url: cpmApiURL, data: { emailAddress: emailAddress, country: country, optInState: optInType, isItProsNewsletter: isItProsNewsletter }, beforeSend: function () { $("".concat(newsletterClasses, " .cpm-form .success-message, ").concat(newsletterClasses, " .cpm-form .fail-message")).hide(); }, success: function () { $("".concat(newsletterClasses, " .cpm-form input:submit")).prop('disabled', true); $("".concat(newsletterClasses, " .cpm-form :input")).prop('disabled', true); $("".concat(newsletterClasses, " .cpm-form select")).prop('disabled', true); $("".concat(newsletterClasses, " .cpm-form input:submit")).hide(); $("".concat(newsletterClasses, " .cpm-form .success-message")).show(); setTimeout(function () { $('.newsletter-pop-up').fadeOut(); }, 5000); }, error: function () { $("".concat(newsletterClasses, " .cpm-form #fail")).show(); } }); } CpmApi.CpmEmailAjax = CpmEmailAjax; })(CpmApi = Cortex.CpmApi || (Cortex.CpmApi = {})); })(Cortex || (Cortex = {})); var eduLevelList = []; var topicList = []; var prodIntegrationList = []; var InstitutonSizeList = []; var regionList = []; var countryList = []; var languageList = []; var searchList = []; var checkedItemList = []; var allRegions = [ 'africa', 'asia', 'caribbean', 'europe', 'latin america', 'middle east', 'north america', 'oceania', ]; var africanRegions = []; var asianRegions = [ 'en-id', 'en-ph', 'en-sg', 'id-id', 'ja-jp', 'ko-kr', 'vi-vn', 'zh-cn', 'zh-hk', 'zh-tw', ]; var caribbeanRegions = []; var europeRegions = [ 'cs-cz', 'da-dk', 'de-at', 'de-ch', 'de-de', 'en-gb', 'en-ie', 'es-es', 'fi-fi', 'fr-be', 'fr-fr', 'hu-hu', 'it-it', 'nb-no', 'nl-be', 'nl-nl', 'pl-pl', 'pt-pt', 'ro-ro', 'ru-ru', 'sv-se', 'tr-tr', 'uk-ua', ]; var latinAmericanRegions = ['es-xl', 'es-mx', 'pt-br']; var middleEasternRegions = ['ar-ae', 'ar-gulf', 'ar-sa']; var northAmericanRegions = ['en-ca', 'en-us', 'fr-ca']; var oceanicRegions = ['en-au', 'en-nz']; var selectedRegion = 'All regions'; var partialRequest; var api; var currentLocale; function encode(key) { var reg = /[^a-zA-Z\d]|\s|\/|\./gmi; var id = escapeHtml(key .replace(reg, "-") .toLowerCase()); return id; } function searchResults(event, currentPage) { var key = event.which || event.keyCode || 0; if (key === 13) { event === null || event === void 0 ? void 0 : event.preventDefault(); var searchVal = $('#search-field').val(); updateSelectedFiltersList('src', searchVal.toString(), searchVal.toString(), currentPage, event); $('#search-field').val(''); } } function searchResultsClick(event, currentPage) { event === null || event === void 0 ? void 0 : event.preventDefault(); var searchVal = $('#search-field').val(); updateSelectedFiltersList('src', searchVal.toString(), encode(searchVal.toString()), currentPage, event); $('#search-field').val(''); } function initCustomerStories(partial, _api, culture) { partialRequest = partial; api = _api; currentLocale = culture; if (document.getElementById('customer-stories-results') === null) { return; } ; $.get(partial) .done(function loadPartial(data) { $('#customer-stories-results').html(data); }) .fail(function () { console.log('Failed request'); }); } function expandDevices() { var $button = document.getElementById('DevicesFilterButton'); $button.classList.toggle('ctex-glyph-downArrow'); $button.classList.toggle('ctex-glyph-upArrow'); document.querySelector('.showStories').classList.toggle('ctex-hidden'); document.querySelector('.hideStories').classList.toggle('ctex-hidden'); document.getElementById('expanding-content').classList.toggle('display-none'); } function updateCustomerStories(currentPage, isFirst, e) { e === null || e === void 0 ? void 0 : e.preventDefault(); var requestParams = { edulvl: eduLevelList.join(','), Top: topicList.join(','), prod: prodIntegrationList.join(','), ISize: InstitutonSizeList.join(','), reg: regionList.join(','), clo: currentLocale, q: searchList.join(','), p: currentPage, i: isFirst, lang: currentLocale, }; $.ajaxSetup({ cache: false, }); $.get(api, requestParams) .done(function loadAPI(data) { if (isFirst) { testLocaleGet(); checkedItemList = []; eduLevelList = []; topicList = []; regionList = []; prodIntegrationList = []; InstitutonSizeList = []; searchList = []; if (!currentLocale) { selectedRegion = 'All Regions'; } else { var test = selectedRegion.toLowerCase(); updateSelectedFiltersList('reg', selectedRegion, test, currentPage, e); } } var ResultList = data.ResultList, _a = data.Pager, CurrentPage = _a.CurrentPage, StartPage = _a.StartPage, EndPage = _a.EndPage, TotalPages = _a.TotalPages, SelectedFilterList = data.SelectedFilterList, totalResults = data.totalResults, EducationLevelDictionary = data.EducationLevelDictionary, TopicDictionary = data.TopicDictionary, InstitutionDictionary = data.InstitutionDictionary, ProductIntegrationDictionary = data.ProductIntegrationDictionary; var updateCounters = function (fields) { Object.entries(fields).forEach(function (field) { var id = field[0], count = field[1]; var key = encode(id); var $input = document.querySelector("input#input-".concat(key)); if ($input !== null) { $input.disabled = count === 0; } var $count = document.querySelector("span#count-".concat(key)); if ($count !== null) { $count.textContent = count.toString(); } }); }; updateCounters(EducationLevelDictionary); updateCounters(TopicDictionary); updateCounters(InstitutionDictionary); updateCounters(ProductIntegrationDictionary); $('#total-results').text(totalResults); var $previousWrapper = $('#pager-previous-wrapper'); $previousWrapper.toggleClass('display-none', CurrentPage === 1); $('a[data-id="pager-previous"]').attr('data-previous', CurrentPage - 1); $('#pager-next-wrapper').toggleClass('display-none', TotalPages === 1 || CurrentPage + 1 === TotalPages); $('a[data-id="pager-next"]').attr('data-next', CurrentPage + 1); $('li[data-id^="pager-"]').remove(); var range = function (start, end) { return Array.from({ length: (end - start) }, function (_, k) { return k + start; }); }; var newPagers = range(StartPage, EndPage).map(function (page) { return pagerNumberHTML(page, data); }); $previousWrapper.after(newPagers); $('.m-pagination .f-active').removeClass('f-active'); $(".m-pagination li[data-id='pager-".concat(CurrentPage, "']")).addClass('f-active'); var selectedFiltersHTML = selectedFilters(SelectedFilterList); $('#currentSelections > li:not(:nth-child(1))').remove(); $('#currentSelections > li').after(selectedFiltersHTML); $('#clear-all').toggleClass('display-none', SelectedFilterList.length === 0); var results = ResultList.map(resultsHTML); $('.customer-stories').html(results); }) .fail(function () { console.log('Failed request'); }); } function removeFilter(from, key) { if (from === 'src') { searchList = searchList.filter(function (x) { return x !== key; }); updateCustomerStories(1, false, null); } else { var $target = document.getElementById("input-".concat(key)); switch ($target.tagName) { case 'OPTION': var option = $target; var select = option.parentElement; select.selectedIndex = 0; select.value = selectedRegion = 'All Regions'; regionList = regionList.filter(function (x) { return encode(x) !== key; }); updateCustomerStories(1, false, null); break; case 'INPUT': var input = $target; input.checked = false; checkedItemList = checkedItemList.filter(function (c) { return c !== 'input-' + key; }); var event_1 = new Event('change'); $target.dispatchEvent(event_1); } } } function updateSelectedFiltersList(from, categName, id, currentPage, e) { var index = checkedItemList.indexOf('input-' + id); if (index > -1) { checkedItemList.splice(index, 1); } else { checkedItemList.push(id); } if (allRegions.includes(id)) { selectedRegion = categName; } switch (from) { case 'edulvl': updateFilterList(eduLevelList, categName); break; case 'Top': updateFilterList(topicList, categName); break; case 'ISize': updateFilterList(InstitutonSizeList, categName); break; case 'prod': updateFilterList(prodIntegrationList, categName); break; case 'src': updateFilterList(searchList, categName); break; case 'reg': updateFilterList(regionList, categName); break; } updateCustomerStories(currentPage, false, null); } function updateFilterList(currList, itemName) { if ($.inArray(itemName, currList) === -1) { currList.push(itemName); } else { removefromList(currList, itemName); } } function removefromList(arr, item) { for (var i = arr.length; i--;) { if (arr[i] === item) { arr.splice(i, 1); } } } function clearAllFilters(currentPage) { checkedItemList.forEach(function (listItem) { var checkSelection = document.getElementById(listItem); if (checkSelection) { checkSelection.checked = false; setTimeout(function () { }, 0); } }); checkedItemList = []; eduLevelList = []; topicList = []; prodIntegrationList = []; InstitutonSizeList = []; regionList = []; searchList = []; selectedRegion = 'All regions'; var select = document.getElementById('sltRegion'); select.selectedIndex = 0; updateCustomerStories(currentPage, false, null); } function selectChange(e) { regionList = []; var regionId = e.target.selectedOptions[0].value; var text = e.target.selectedOptions[0].text; selectedRegion = text; updateSelectedFiltersList('reg', text, regionId, 1, e); } var entityMap = { '&': '-', '<': '-', '>': '-', '"': '-', "'": '-', '/': '-', ' ': '-', }; function escapeHtml(string) { return String(string).replace(/[&<>"'\/]/g, function (s) { return entityMap[s]; }); } function resizeContainers() { $('.item-container').height('auto'); $('[id^="row-"]').each(function () { var highestBox = 0; $('.item-container', this).each(function () { if ($(this).height() > highestBox) { highestBox = $(this).height(); } }); $('.item-container', this).height(highestBox + 80); }); } function testLocaleGet() { if (africanRegions.includes(currentLocale)) { selectedRegion = 'Africa'; } else if (asianRegions.includes(currentLocale)) { selectedRegion = 'Asia'; } else if (caribbeanRegions.includes(currentLocale)) { selectedRegion = 'Caribbean'; } else if (europeRegions.includes(currentLocale)) { selectedRegion = 'Europe'; } else if (latinAmericanRegions.includes(currentLocale)) { selectedRegion = 'Latin America'; } else if (middleEasternRegions.includes(currentLocale)) { selectedRegion = 'Middle East'; } else if (northAmericanRegions.includes(currentLocale)) { selectedRegion = 'North America'; } else if (oceanicRegions.includes(currentLocale)) { selectedRegion = 'Oceania'; } else if (!currentLocale) { selectedRegion = ''; } } var pagerNumberHTML = function (page, data) { var CurrentPage = data.Pager.CurrentPage; return "\n
  • \n \n \n ").concat(page, "\n \n \n
  • \n "); }; var resultsHTML = function (item, index) { var _a; var image = (!(item.ImageUrl === null || item.ImageUrl === "") && item.ImageUrl != "0") ? item.ImageUrl : "https://msp7l1170302145284.blob.core.windows.net/ms-p7-l1-170302-1453-24-assets/1399_Panel13_2up_Technology.jpg"; var imageAria = (_a = item.ImageAria) !== null && _a !== void 0 ? _a : item.SchoolName; var ShortStory = item.StorySummary.substring(0, Math.min(160, item.StorySummary.length)) + "..."; var ShortDesc = item.ShortDescription.substring(0, Math.min(70, item.ShortDescription.length)) + "..."; return "\n
  • \n \"".concat(imageAria,\n
    \n

    ").concat(item.SchoolName, "

    \n

    ").concat(ShortDesc, "

    \n

    ").concat(ShortStory, "

    \n \n \n Read the Story\n \n
    \n
  • \n "); }; var selectedFilters = function (SelectedFilterList) { return SelectedFilterList.map(function (_a) { var From = _a.From, Name = _a.Name, Key = _a.Key; return "\n
  • \n \n ").concat(Name, "\n \n \n
  • "); }); }; var Cortex; (function (Cortex) { var EdgeApi; (function (EdgeApi) { var apiReleaseData; var productsUrl = '/api/edgeproducts/getalledgeproducts'; var productsDataType = 'json'; function Init() { if (window.location.hostname.toLowerCase() == 'www.microsoft.com') { productsUrl = 'https://eduv2.msftedu.com' + productsUrl; } $.ajax({ dataType: productsDataType, url: productsUrl, method: 'GET', headers: { 'x-requested-with': 'xhr', }, }) .done(function (productsData) { for (var i = 0; i < productsData.length; i++) { if (productsData[i].product === 'Stable') { apiReleaseData = productsData[i].releases; GetDropDownItems('Version'); GetDropDownItems('Build'); GetDropDownItems('Platform'); } } }) .fail(function () { addEdgeError("Failed to retrieve Edge product data."); }); function GetDropDownItems(category) { var dropDownItems = []; for (var i = 0; i < apiReleaseData.length; i++) { if (category == 'Version') { if (dropDownItems.indexOf(apiReleaseData[i].productVersion) == -1) { dropDownItems.push(apiReleaseData[i].productVersion); } } else if (category == 'Build') { if (dropDownItems.indexOf(apiReleaseData[i].architecture) == -1) { dropDownItems.push(apiReleaseData[i].architecture); } } else if (category == 'Platform') { if (dropDownItems.indexOf(apiReleaseData[i].platform) == -1) { dropDownItems.push(apiReleaseData[i].platform); } } } PopulateDropDown(dropDownItems, category); } function PopulateDropDown(list, category) { var id = '#edge' + category + 'DropDown'; var dropDiv = document.querySelector(id); for (var i = 0; i < list.length; i++) { dropDiv.innerHTML += "