( function() {  var mapping = [{"appname":"", "appid":"CORE_APPS_PIC32CXBZ2_WBZ45_INTRODUCTION", "path":"GUID-DE87D9AC-7A69-4986-96C0-5BE59D03B5AF.html"},{"appname":"", "appid":"CORE_APPS_PIC32CXBZ2_WBZ45_CONSOLE_DEBUG_SYSTEM_SERVICE_USING_UART", "path":"GUID-331B5749-5C5B-4E1E-BB68-A473A246EED8.html"},{"appname":"", "appid":"CORE_APPS_PIC32CXBZ2_WBZ45_FAT_FILESYSTEM_USING_NVM_MEDIA", "path":"GUID-48777F30-3D8A-4B72-8A5F-8F4C38A61235.html"},{"appname":"", "appid":"CORE_APPS_PIC32CXBZ2_WBZ45_FAT_FILESYSTEM_USING_SD_CARD_MEDIA", "path":"GUID-69642D9E-0539-48B3-AE7C-8ED25F28C21D.html"},{"appname":"", "appid":"CORE_APPS_PIC32CXBZ2_WBZ45_FREERTOS_BASIC", "path":"GUID-314C1DC8-FD82-4BF9-A37F-85F9DB29F8A2.html"},{"appname":"", "appid":"CORE_APPS_PIC32CXBZ2_WBZ45_I2C_DRIVER_ASYNCHRONOUS_I2C_EEPROM", "path":"GUID-B1C88CF1-B2B6-43CD-B91D-5E698E9E5927.html"},{"appname":"", "appid":"CORE_APPS_PIC32CXBZ2_WBZ45_SPI_DRIVER_ASYNCHRONOUS_SELF_LOOPBACK_MULTI_CLIENT", "path":"GUID-6CDA43FE-A152-4ADC-9D54-5747FA41D241.html"},{"appname":"", "appid":"CORE_APPS_PIC32CXBZ2_WBZ45_TIME_SYSTEM_SERVICE_MULTI_CLIENT", "path":"GUID-01AAE661-EFBF-48AF-80BD-009C8FBB294C.html"},{"appname":"", "appid":"CORE_APPS_PIC32CXBZ2_WBZ45_USART_DRIVER_ASYNCHRONOUS_USART_ECHO", "path":"GUID-1379CB0B-B1F8-4315-B049-76EFB662A164.html"},{"appname":"", "appid":"CORE_APPS_PIC32CXBZ2_WBZ45_USART_DRIVER_SYNCHRONOUS_USART_ECHO", "path":"GUID-0282227F-512D-4674-9E50-2D047BED25C9.html"}];
            var mchp = (function (mchp) {
                var mchp = mchp || {};
                var mapping = [];
        
                mchp.utils = {};
        
                mchp.utils.getQueryParam = function (name, 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, " "));
                };

                mchp.utils.isFirefox = typeof InstallTrigger !== 'undefined';
        
                mchp.init = function (options) {
                  mchp.mapping = options.mapping || [];
                  mchp.bindEvents();
                };
        
                mchp.bindEvents = function () {
                    if (mchp.utils.isFirefox) {
                      window.onload = mchp.checkRedirect;
                    } else {
                      document.onreadystatechange = mchp.checkRedirect;
                    }
                };

                mchp.checkRedirect = function() {
                  var contextId = mchp.utils.getQueryParam("contextId") || "";
                  if (contextId && contextId != undefined) {
                    var record = mchp.mapping.find(function(x){
                      return x.appid && x.appid.toLowerCase() == contextId.toLowerCase();
                    });
                    if (record && record.path) {
                      window.stop();
                      window.location = record.path;
                    }
                  }
                };
        
                return {
                  init: mchp.init,
                };
              })();
        
              mchp.init({
                mapping: mapping
              });

        })();