( function() {  var mapping = [{"appname":"", "appid":"uart_i2c_factory_bootloader_pic32cm_sg_gc", "path":"GUID-4E9DA3C2-EF91-4D52-B49A-C387F4539089.html"},{"appname":"", "appid":"uart_i2c_bootloader_pin_configurations_pic32cm_sg_gc", "path":"GUID-FE729483-15BE-436D-A90C-26C0F0FFD237.html"},{"appname":"", "appid":"uart_i2c_bootloader_entry_mechanism_pic32cm_sg_gc", "path":"GUID-B75FCE70-5A4D-49E7-BFE6-DB3BBD327004.html"},{"appname":"", "appid":"uart_i2c_bootloader_fuse_configurations_pic32cm_sg_gc", "path":"GUID-4BDB4DFB-6037-4C3C-B41F-996A85565C59.html"},{"appname":"", "appid":"uart_i2c_bootloader_tools_references_pic32cm_sg_gc", "path":"GUID-F7CAF811-B968-4585-9E92-AF60E9F68021.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
              });

        })();