{"version":3,"sources":["require.js"],"names":["requirejs","require","define","global","isFunction","it","ostring","call","isArray","each","ary","func","i","length","eachReverse","hasProp","obj","prop","hasOwn","getOwn","eachProp","mixin","target","source","force","deepStringMixin","value","RegExp","bind","fn","apply","arguments","scripts","document","getElementsByTagName","defaultOnError","err","getGlobal","g","split","part","makeError","id","msg","requireModules","e","Error","requireType","originalError","newContext","contextName","trimDots","splice","normalize","name","baseName","applyMap","pkgMain","mapValue","nameParts","j","nameSegment","lastIndex","foundMap","foundI","foundStarMap","starI","normalizedBaseParts","baseParts","map","config","starMap","nodeIdCompat","jsSuffixRegExp","test","replace","charAt","slice","concat","join","outerLoop","pkgs","removeScript","isBrowser","scriptNode","getAttribute","context","parentNode","removeChild","hasPathFallback","pathConfig","paths","shift","undef","makeRequire","skipMap","splitPrefix","prefix","index","indexOf","substring","makeModuleMap","parentModuleMap","isNormalized","url","pluginModule","suffix","parentName","originalName","isDefine","normalizedName","requireCounter","defined","nameToUrl","unnormalizedCounter","parentMap","unnormalized","getModule","depMap","mod","registry","Module","on","defineEmitComplete","error","onError","errback","ids","notified","events","emit","req","takeGlobalQueue","globalDefQueue","apsp","defQueue","cleanRegistry","enabledRegistry","breakCycle","traced","processed","depMaps","depId","dep","depMatched","defineDep","check","checkLoaded","usingPathFallback","waitInterval","waitSeconds","expired","startTime","Date","getTime","noLoads","reqCalls","stillLoading","needCycleCheck","inCheckLoaded","modId","enabled","push","inited","fetched","isWebWorker","checkLoadedTimeoutId","setTimeout","callGetModule","args","init","removeListener","node","ieName","detachEvent","isOpera","removeEventListener","getScriptData","evt","currentTarget","srcElement","onScriptLoad","onScriptError","intakeDefines","handlers","baseUrl","bundles","shim","undefEvents","urlFetched","bundlesMap","exports","usingExports","module","uri","this","depExports","pluginMaps","depCount","prototype","factory","options","ignore","enable","fetch","enableBuildCallback","deps","callPlugin","load","enabling","cjsModule","defining","execCb","undefined","requireMap","onResourceLoad","defineEmitted","pluginMap","plugin","normalizedMap","normalizedMod","bundleId","localRequire","fromText","text","textAlt","moduleName","moduleMap","hasInteractive","useInteractive","exec","completeLoad","handler","cb","cbs","nextTick","configure","cfg","objs","v","exportsFn","makeShimExports","packages","pkgObj","location","main","currDirRegExp","callback","ret","relMap","requireMod","__requireJsBuild","get","toUrl","moduleNamePlusExt","ext","lastIndexOf","segment","isRelative","specified","found","shExports","enforceDefine","skipExt","syms","parentModule","parentPath","jsExtRegExp","match","urlArgs","type","readyRegExp","readyState","interactiveScript","data","getInteractiveScript","script","s","head","baseElement","dataMain","src","currentlyAddingScript","mainScript","subPath","version","commentRegExp","cjsRequireRegExp","op","Object","toString","hasOwnProperty","ap","Array","window","navigator","importScripts","platform","defContextName","opera","contexts","optional","ctx","createNode","xhtml","createElementNS","createElement","scriptType","charset","async","setAttribute","attachEvent","addEventListener","insertBefore","appendChild","skipDataMain","pop","amd","jQuery","eval"],"mappings":"AAUA,GAAIA,WAAWC,QAASC,QACvB,SAAUC,QA6BP,QAASC,YAAWC,GAChB,MAA4B,sBAArBC,QAAQC,KAAKF,GAGxB,QAASG,SAAQH,GACb,MAA4B,mBAArBC,QAAQC,KAAKF,GAOxB,QAASI,MAAKC,EAAKC,GACf,GAAID,EAAK,CACL,GAAIE,EACJ,KAAKA,EAAI,EAAGA,EAAIF,EAAIG,UACZH,EAAIE,KAAMD,EAAKD,EAAIE,GAAIA,EAAGF,IADNE,GAAK,KAYzC,QAASE,aAAYJ,EAAKC,GACtB,GAAID,EAAK,CACL,GAAIE,EACJ,KAAKA,EAAIF,EAAIG,OAAS,EAAGD,QACjBF,EAAIE,KAAMD,EAAKD,EAAIE,GAAIA,EAAGF,IADDE,GAAK,KAQ9C,QAASG,SAAQC,EAAKC,GAClB,MAAOC,QAAOX,KAAKS,EAAKC,GAG5B,QAASE,QAAOH,EAAKC,GACjB,MAAOF,SAAQC,EAAKC,IAASD,EAAIC,GAQrC,QAASG,UAASJ,EAAKL,GACnB,GAAIM,EACJ,KAAKA,IAAQD,GACT,GAAID,QAAQC,EA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hB7F,IAAI0G,OACN1C","file":"require.min.js","sourcesContent":["/** vim: et:ts=4:sw=4:sts=4\r\n * @license RequireJS 2.1.14 Copyright (c) 2010-2014, The Dojo Foundation All Rights Reserved.\r\n * Available via the MIT or new BSD license.\r\n * see: http://github.com/jrburke/requirejs for details\r\n */\r\n//Not using strict: uneven strict support in browsers, #392, and causes\r\n//problems with requirejs.exec()/transpiler plugins that may not be strict.\r\n/*jslint regexp: true, nomen: true, sloppy: true */\r\n/*global window, navigator, document, importScripts, setTimeout, opera */\r\n\r\nvar requirejs, require, define;\r\n(function (global) {\r\n var req, s, head, baseElement, dataMain, src,\r\n interactiveScript, currentlyAddingScript, mainScript, subPath,\r\n version = '2.1.14',\r\n commentRegExp = /(\\/\\*([\\s\\S]*?)\\*\\/|([^:]|^)\\/\\/(.*)$)/mg,\r\n cjsRequireRegExp = /[^.]\\s*require\\s*\\(\\s*[\"']([^'\"\\s]+)[\"']\\s*\\)/g,\r\n jsSuffixRegExp = /\\.js$/,\r\n currDirRegExp = /^\\.\\//,\r\n op = Object.prototype,\r\n ostring = op.toString,\r\n hasOwn = op.hasOwnProperty,\r\n ap = Array.prototype,\r\n apsp = ap.splice,\r\n isBrowser = !!(typeof window !== 'undefined' && typeof navigator !== 'undefined' && window.document),\r\n isWebWorker = !isBrowser && typeof importScripts !== 'undefined',\r\n //PS3 indicates loaded and complete, but need to wait for complete\r\n //specifically. Sequence is 'loading', 'loaded', execution,\r\n // then 'complete'. The UA check is unfortunate, but not sure how\r\n //to feature test w/o causing perf issues.\r\n readyRegExp = isBrowser && navigator.platform === 'PLAYSTATION 3' ?\r\n /^complete$/ : /^(complete|loaded)$/,\r\n defContextName = '_',\r\n //Oh the tragedy, detecting opera. See the usage of isOpera for reason.\r\n isOpera = typeof opera !== 'undefined' && opera.toString() === '[object Opera]',\r\n contexts = {},\r\n cfg = {},\r\n globalDefQueue = [],\r\n useInteractive = false;\r\n\r\n function isFunction(it) {\r\n return ostring.call(it) === '[object Function]';\r\n }\r\n\r\n function isArray(it) {\r\n return ostring.call(it) === '[object Array]';\r\n }\r\n\r\n /**\r\n * Helper function for iterating over an array. If the func returns\r\n * a true value, it will break out of the loop.\r\n */\r\n function each(ary, func) {\r\n if (ary) {\r\n var i;\r\n for (i = 0; i < ary.length; i += 1) {\r\n if (ary[i] && func(ary[i], i, ary)) {\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Helper function for iterating over an array backwards. If the func\r\n * returns a true value, it will break out of the loop.\r\n */\r\n function eachReverse(ary, func) {\r\n if (ary) {\r\n var i;\r\n for (i = ary.length - 1; i > -1; i -= 1) {\r\n if (ary[i] && func(ary[i], i, ary)) {\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n\r\n function hasProp(obj, prop) {\r\n return hasOwn.call(obj, prop);\r\n }\r\n\r\n function getOwn(obj, prop) {\r\n return hasProp(obj, prop) && obj[prop];\r\n }\r\n\r\n /**\r\n * Cycles over properties in an object and calls a function for each\r\n * property value. If the function returns a truthy value, then the\r\n * iteration is stopped.\r\n */\r\n function eachProp(obj, func) {\r\n var prop;\r\n for (prop in obj) {\r\n if (hasProp(obj, prop)) {\r\n if (func(obj[prop], prop)) {\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Simple function to mix in properties from source into target,\r\n * but only if target does not already have a property of the same name.\r\n */\r\n function mixin(target, source, force, deepStringMixin) {\r\n if (source) {\r\n eachProp(source, function (value, prop) {\r\n if (force || !hasProp(target, prop)) {\r\n if (deepStringMixin && typeof value === 'object' && value &&\r\n !isArray(value) && !isFunction(value) &&\r\n !(value instanceof RegExp)) {\r\n\r\n if (!target[prop]) {\r\n target[prop] = {};\r\n }\r\n mixin(target[prop], value, force, deepStringMixin);\r\n } else {\r\n target[prop] = value;\r\n }\r\n }\r\n });\r\n }\r\n return target;\r\n }\r\n\r\n //Similar to Function.prototype.bind, but the 'this' object is specified\r\n //first, since it is easier to read/figure out what 'this' will be.\r\n function bind(obj, fn) {\r\n return function () {\r\n return fn.apply(obj, arguments);\r\n };\r\n }\r\n\r\n function scripts() {\r\n return document.getElementsByTagName('script');\r\n }\r\n\r\n function defaultOnError(err) {\r\n throw err;\r\n }\r\n\r\n //Allow getting a global that is expressed in\r\n //dot notation, like 'a.b.c'.\r\n function getGlobal(value) {\r\n if (!value) {\r\n return value;\r\n }\r\n var g = global;\r\n each(value.split('.'), function (part) {\r\n g = g[part];\r\n });\r\n return g;\r\n }\r\n\r\n /**\r\n * Constructs an error with a pointer to an URL with more information.\r\n * @param {String} id the error ID that maps to an ID on a web page.\r\n * @param {String} message human readable error.\r\n * @param {Error} [err] the original error, if there is one.\r\n *\r\n * @returns {Error}\r\n */\r\n function makeError(id, msg, err, requireModules) {\r\n var e = new Error(msg + '\\nhttp://requirejs.org/docs/errors.html#' + id);\r\n e.requireType = id;\r\n e.requireModules = requireModules;\r\n if (err) {\r\n e.originalError = err;\r\n }\r\n return e;\r\n }\r\n\r\n if (typeof define !== 'undefined') {\r\n //If a define is already in play via another AMD loader,\r\n //do not overwrite.\r\n return;\r\n }\r\n\r\n if (typeof requirejs !== 'undefined') {\r\n if (isFunction(requirejs)) {\r\n //Do not overwrite an existing requirejs instance.\r\n return;\r\n }\r\n cfg = requirejs;\r\n requirejs = undefined;\r\n }\r\n\r\n //Allow for a require config object\r\n if (typeof require !== 'undefined' && !isFunction(require)) {\r\n //assume it is a config object.\r\n cfg = require;\r\n require = undefined;\r\n }\r\n\r\n function newContext(contextName) {\r\n var inCheckLoaded, Module, context, handlers,\r\n checkLoadedTimeoutId,\r\n config = {\r\n //Defaults. Do not set a default for map\r\n //config to speed up normalize(), which\r\n //will run faster if there is no default.\r\n waitSeconds: 7,\r\n baseUrl: './',\r\n paths: {},\r\n bundles: {},\r\n pkgs: {},\r\n shim: {},\r\n config: {}\r\n },\r\n registry = {},\r\n //registry of just enabled modules, to speed\r\n //cycle breaking code when lots of modules\r\n //are registered, but not activated.\r\n enabledRegistry = {},\r\n undefEvents = {},\r\n defQueue = [],\r\n defined = {},\r\n urlFetched = {},\r\n bundlesMap = {},\r\n requireCounter = 1,\r\n unnormalizedCounter = 1;\r\n\r\n /**\r\n * Trims the . and .. from an array of path segments.\r\n * It will keep a leading path segment if a .. will become\r\n * the first path segment, to help with module name lookups,\r\n * which act like paths, but can be remapped. But the end result,\r\n * all paths that use this function should look normalized.\r\n * NOTE: this method MODIFIES the input array.\r\n * @param {Array} ary the array of path segments.\r\n */\r\n function trimDots(ary) {\r\n var i, part;\r\n for (i = 0; i < ary.length; i++) {\r\n part = ary[i];\r\n if (part === '.') {\r\n ary.splice(i, 1);\r\n i -= 1;\r\n } else if (part === '..') {\r\n // If at the start, or previous value is still ..,\r\n // keep them so that when converted to a path it may\r\n // still work when converted to a path, even though\r\n // as an ID it is less than ideal. In larger point\r\n // releases, may be better to just kick out an error.\r\n if (i === 0 || (i == 1 && ary[2] === '..') || ary[i - 1] === '..') {\r\n continue;\r\n } else if (i > 0) {\r\n ary.splice(i - 1, 2);\r\n i -= 2;\r\n }\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Given a relative module name, like ./something, normalize it to\r\n * a real name that can be mapped to a path.\r\n * @param {String} name the relative name\r\n * @param {String} baseName a real name that the name arg is relative\r\n * to.\r\n * @param {Boolean} applyMap apply the map config to the value. Should\r\n * only be done if this normalization is for a dependency ID.\r\n * @returns {String} normalized name\r\n */\r\n function normalize(name, baseName, applyMap) {\r\n var pkgMain, mapValue, nameParts, i, j, nameSegment, lastIndex,\r\n foundMap, foundI, foundStarMap, starI, normalizedBaseParts,\r\n baseParts = (baseName && baseName.split('/')),\r\n map = config.map,\r\n starMap = map && map['*'];\r\n\r\n //Adjust any relative paths.\r\n if (name) {\r\n name = name.split('/');\r\n lastIndex = name.length - 1;\r\n\r\n // If wanting node ID compatibility, strip .js from end\r\n // of IDs. Have to do this here, and not in nameToUrl\r\n // because node allows either .js or non .js to map\r\n // to same file.\r\n if (config.nodeIdCompat && jsSuffixRegExp.test(name[lastIndex])) {\r\n name[lastIndex] = name[lastIndex].replace(jsSuffixRegExp, '');\r\n }\r\n\r\n // Starts with a '.' so need the baseName\r\n if (name[0].charAt(0) === '.' && baseParts) {\r\n //Convert baseName to array, and lop off the last part,\r\n //so that . matches that 'directory' and not name of the baseName's\r\n //module. For instance, baseName of 'one/two/three', maps to\r\n //'one/two/three.js', but we want the directory, 'one/two' for\r\n //this normalization.\r\n normalizedBaseParts = baseParts.slice(0, baseParts.length - 1);\r\n name = normalizedBaseParts.concat(name);\r\n }\r\n\r\n trimDots(name);\r\n name = name.join('/');\r\n }\r\n\r\n //Apply map config if available.\r\n if (applyMap && map && (baseParts || starMap)) {\r\n nameParts = name.split('/');\r\n\r\n outerLoop: for (i = nameParts.length; i > 0; i -= 1) {\r\n nameSegment = nameParts.slice(0, i).join('/');\r\n\r\n if (baseParts) {\r\n //Find the longest baseName segment match in the config.\r\n //So, do joins on the biggest to smallest lengths of baseParts.\r\n for (j = baseParts.length; j > 0; j -= 1) {\r\n mapValue = getOwn(map, baseParts.slice(0, j).join('/'));\r\n\r\n //baseName segment has config, find if it has one for\r\n //this name.\r\n if (mapValue) {\r\n mapValue = getOwn(mapValue, nameSegment);\r\n if (mapValue) {\r\n //Match, update name to the new value.\r\n foundMap = mapValue;\r\n foundI = i;\r\n break outerLoop;\r\n }\r\n }\r\n }\r\n }\r\n\r\n //Check for a star map match, but just hold on to it,\r\n //if there is a shorter segment match later in a matching\r\n //config, then favor over this star map.\r\n if (!foundStarMap && starMap && getOwn(starMap, nameSegment)) {\r\n foundStarMap = getOwn(starMap, nameSegment);\r\n starI = i;\r\n }\r\n }\r\n\r\n if (!foundMap && foundStarMap) {\r\n foundMap = foundStarMap;\r\n foundI = starI;\r\n }\r\n\r\n if (foundMap) {\r\n nameParts.splice(0, foundI, foundMap);\r\n name = nameParts.join('/');\r\n }\r\n }\r\n\r\n // If the name points to a package's name, use\r\n // the package main instead.\r\n pkgMain = getOwn(config.pkgs, name);\r\n\r\n return pkgMain ? pkgMain : name;\r\n }\r\n\r\n function removeScript(name) {\r\n if (isBrowser) {\r\n each(scripts(), function (scriptNode) {\r\n if (scriptNode.getAttribute('data-requiremodule') === name &&\r\n scriptNode.getAttribute('data-requirecontext') === context.contextName) {\r\n scriptNode.parentNode.removeChild(scriptNode);\r\n return true;\r\n }\r\n });\r\n }\r\n }\r\n\r\n function hasPathFallback(id) {\r\n var pathConfig = getOwn(config.paths, id);\r\n if (pathConfig && isArray(pathConfig) && pathConfig.length > 1) {\r\n //Pop off the first array value, since it failed, and\r\n //retry\r\n pathConfig.shift();\r\n context.require.undef(id);\r\n\r\n //Custom require that does not do map translation, since\r\n //ID is \"absolute\", already mapped/resolved.\r\n context.makeRequire(null, {\r\n skipMap: true\r\n })([id]);\r\n\r\n return true;\r\n }\r\n }\r\n\r\n //Turns a plugin!resource to [plugin, resource]\r\n //with the plugin being undefined if the name\r\n //did not have a plugin prefix.\r\n function splitPrefix(name) {\r\n var prefix,\r\n index = name ? name.indexOf('!') : -1;\r\n if (index > -1) {\r\n prefix = name.substring(0, index);\r\n name = name.substring(index + 1, name.length);\r\n }\r\n return [prefix, name];\r\n }\r\n\r\n /**\r\n * Creates a module mapping that includes plugin prefix, module\r\n * name, and path. If parentModuleMap is provided it will\r\n * also normalize the name via require.normalize()\r\n *\r\n * @param {String} name the module name\r\n * @param {String} [parentModuleMap] parent module map\r\n * for the module name, used to resolve relative names.\r\n * @param {Boolean} isNormalized: is the ID already normalized.\r\n * This is true if this call is done for a define() module ID.\r\n * @param {Boolean} applyMap: apply the map config to the ID.\r\n * Should only be true if this map is for a dependency.\r\n *\r\n * @returns {Object}\r\n */\r\n function makeModuleMap(name, parentModuleMap, isNormalized, applyMap) {\r\n var url, pluginModule, suffix, nameParts,\r\n prefix = null,\r\n parentName = parentModuleMap ? parentModuleMap.name : null,\r\n originalName = name,\r\n isDefine = true,\r\n normalizedName = '';\r\n\r\n //If no name, then it means it is a require call, generate an\r\n //internal name.\r\n if (!name) {\r\n isDefine = false;\r\n name = '_@r' + (requireCounter += 1);\r\n }\r\n\r\n nameParts = splitPrefix(name);\r\n prefix = nameParts[0];\r\n name = nameParts[1];\r\n\r\n if (prefix) {\r\n prefix = normalize(prefix, parentName, applyMap);\r\n pluginModule = getOwn(defined, prefix);\r\n }\r\n\r\n //Account for relative paths if there is a base name.\r\n if (name) {\r\n if (prefix) {\r\n if (pluginModule && pluginModule.normalize) {\r\n //Plugin is loaded, use its normalize method.\r\n normalizedName = pluginModule.normalize(name, function (name) {\r\n return normalize(name, parentName, applyMap);\r\n });\r\n } else {\r\n // If nested plugin references, then do not try to\r\n // normalize, as it will not normalize correctly. This\r\n // places a restriction on resourceIds, and the longer\r\n // term solution is not to normalize until plugins are\r\n // loaded and all normalizations to allow for async\r\n // loading of a loader plugin. But for now, fixes the\r\n // common uses. Details in #1131\r\n normalizedName = name.indexOf('!') === -1 ?\r\n normalize(name, parentName, applyMap) :\r\n name;\r\n }\r\n } else {\r\n //A regular module.\r\n normalizedName = normalize(name, parentName, applyMap);\r\n\r\n //Normalized name may be a plugin ID due to map config\r\n //application in normalize. The map config values must\r\n //already be normalized, so do not need to redo that part.\r\n nameParts = splitPrefix(normalizedName);\r\n prefix = nameParts[0];\r\n normalizedName = nameParts[1];\r\n isNormalized = true;\r\n\r\n url = context.nameToUrl(normalizedName);\r\n }\r\n }\r\n\r\n //If the id is a plugin id that cannot be determined if it needs\r\n //normalization, stamp it with a unique ID so two matching relative\r\n //ids that may conflict can be separate.\r\n suffix = prefix && !pluginModule && !isNormalized ?\r\n '_unnormalized' + (unnormalizedCounter += 1) :\r\n '';\r\n\r\n return {\r\n prefix: prefix,\r\n name: normalizedName,\r\n parentMap: parentModuleMap,\r\n unnormalized: !!suffix,\r\n url: url,\r\n originalName: originalName,\r\n isDefine: isDefine,\r\n id: (prefix ?\r\n prefix + '!' + normalizedName :\r\n normalizedName) + suffix\r\n };\r\n }\r\n\r\n function getModule(depMap) {\r\n var id = depMap.id,\r\n mod = getOwn(registry, id);\r\n\r\n if (!mod) {\r\n mod = registry[id] = new context.Module(depMap);\r\n }\r\n\r\n return mod;\r\n }\r\n\r\n function on(depMap, name, fn) {\r\n var id = depMap.id,\r\n mod = getOwn(registry, id);\r\n\r\n if (hasProp(defined, id) &&\r\n (!mod || mod.defineEmitComplete)) {\r\n if (name === 'defined') {\r\n fn(defined[id]);\r\n }\r\n } else {\r\n mod = getModule(depMap);\r\n if (mod.error && name === 'error') {\r\n fn(mod.error);\r\n } else {\r\n mod.on(name, fn);\r\n }\r\n }\r\n }\r\n\r\n function onError(err, errback) {\r\n var ids = err.requireModules,\r\n notified = false;\r\n\r\n if (errback) {\r\n errback(err);\r\n } else {\r\n each(ids, function (id) {\r\n var mod = getOwn(registry, id);\r\n if (mod) {\r\n //Set error on module, so it skips timeout checks.\r\n mod.error = err;\r\n if (mod.events.error) {\r\n notified = true;\r\n mod.emit('error', err);\r\n }\r\n }\r\n });\r\n\r\n if (!notified) {\r\n req.onError(err);\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Internal method to transfer globalQueue items to this context's\r\n * defQueue.\r\n */\r\n function takeGlobalQueue() {\r\n //Push all the globalDefQueue items into the context's defQueue\r\n if (globalDefQueue.length) {\r\n //Array splice in the values since the context code has a\r\n //local var ref to defQueue, so cannot just reassign the one\r\n //on context.\r\n apsp.apply(defQueue,\r\n [defQueue.length, 0].concat(globalDefQueue));\r\n globalDefQueue = [];\r\n }\r\n }\r\n\r\n handlers = {\r\n 'require': function (mod) {\r\n if (mod.require) {\r\n return mod.require;\r\n } else {\r\n return (mod.require = context.makeRequire(mod.map));\r\n }\r\n },\r\n 'exports': function (mod) {\r\n mod.usingExports = true;\r\n if (mod.map.isDefine) {\r\n if (mod.exports) {\r\n return (defined[mod.map.id] = mod.exports);\r\n } else {\r\n return (mod.exports = defined[mod.map.id] = {});\r\n }\r\n }\r\n },\r\n 'module': function (mod) {\r\n if (mod.module) {\r\n return mod.module;\r\n } else {\r\n return (mod.module = {\r\n id: mod.map.id,\r\n uri: mod.map.url,\r\n config: function () {\r\n return getOwn(config.config, mod.map.id) || {};\r\n },\r\n exports: mod.exports || (mod.exports = {})\r\n });\r\n }\r\n }\r\n };\r\n\r\n function cleanRegistry(id) {\r\n //Clean up machinery used for waiting modules.\r\n delete registry[id];\r\n delete enabledRegistry[id];\r\n }\r\n\r\n function breakCycle(mod, traced, processed) {\r\n var id = mod.map.id;\r\n\r\n if (mod.error) {\r\n mod.emit('error', mod.error);\r\n } else {\r\n traced[id] = true;\r\n each(mod.depMaps, function (depMap, i) {\r\n var depId = depMap.id,\r\n dep = getOwn(registry, depId);\r\n\r\n //Only force things that have not completed\r\n //being defined, so still in the registry,\r\n //and only if it has not been matched up\r\n //in the module already.\r\n if (dep && !mod.depMatched[i] && !processed[depId]) {\r\n if (getOwn(traced, depId)) {\r\n mod.defineDep(i, defined[depId]);\r\n mod.check(); //pass false?\r\n } else {\r\n breakCycle(dep, traced, processed);\r\n }\r\n }\r\n });\r\n processed[id] = true;\r\n }\r\n }\r\n\r\n function checkLoaded() {\r\n var err, usingPathFallback,\r\n waitInterval = config.waitSeconds * 1000,\r\n //It is possible to disable the wait interval by using waitSeconds of 0.\r\n expired = waitInterval && (context.startTime + waitInterval) < new Date().getTime(),\r\n noLoads = [],\r\n reqCalls = [],\r\n stillLoading = false,\r\n needCycleCheck = true;\r\n\r\n //Do not bother if this call was a result of a cycle break.\r\n if (inCheckLoaded) {\r\n return;\r\n }\r\n\r\n inCheckLoaded = true;\r\n\r\n //Figure out the state of all the modules.\r\n eachProp(enabledRegistry, function (mod) {\r\n var map = mod.map,\r\n modId = map.id;\r\n\r\n //Skip things that are not enabled or in error state.\r\n if (!mod.enabled) {\r\n return;\r\n }\r\n\r\n if (!map.isDefine) {\r\n reqCalls.push(mod);\r\n }\r\n\r\n if (!mod.error) {\r\n //If the module should be executed, and it has not\r\n //been inited and time is up, remember it.\r\n if (!mod.inited && expired) {\r\n if (hasPathFallback(modId)) {\r\n usingPathFallback = true;\r\n stillLoading = true;\r\n } else {\r\n noLoads.push(modId);\r\n removeScript(modId);\r\n }\r\n } else if (!mod.inited && mod.fetched && map.isDefine) {\r\n stillLoading = true;\r\n if (!map.prefix) {\r\n //No reason to keep looking for unfinished\r\n //loading. If the only stillLoading is a\r\n //plugin resource though, keep going,\r\n //because it may be that a plugin resource\r\n //is waiting on a non-plugin cycle.\r\n return (needCycleCheck = false);\r\n }\r\n }\r\n }\r\n });\r\n\r\n if (expired && noLoads.length) {\r\n //If wait time expired, throw error of unloaded modules.\r\n err = makeError('timeout', 'Load timeout for modules: ' + noLoads, null, noLoads);\r\n err.contextName = context.contextName;\r\n return onError(err);\r\n }\r\n\r\n //Not expired, check for a cycle.\r\n if (needCycleCheck) {\r\n each(reqCalls, function (mod) {\r\n breakCycle(mod, {}, {});\r\n });\r\n }\r\n\r\n //If still waiting on loads, and the waiting load is something\r\n //other than a plugin resource, or there are still outstanding\r\n //scripts, then just try back later.\r\n if ((!expired || usingPathFallback) && stillLoading) {\r\n //Something is still waiting to load. Wait for it, but only\r\n //if a timeout is not already in effect.\r\n if ((isBrowser || isWebWorker) && !checkLoadedTimeoutId) {\r\n checkLoadedTimeoutId = setTimeout(function () {\r\n checkLoadedTimeoutId = 0;\r\n checkLoaded();\r\n }, 50);\r\n }\r\n }\r\n\r\n inCheckLoaded = false;\r\n }\r\n\r\n Module = function (map) {\r\n this.events = getOwn(undefEvents, map.id) || {};\r\n this.map = map;\r\n this.shim = getOwn(config.shim, map.id);\r\n this.depExports = [];\r\n this.depMaps = [];\r\n this.depMatched = [];\r\n this.pluginMaps = {};\r\n this.depCount = 0;\r\n\r\n /* this.exports this.factory\r\n this.depMaps = [],\r\n this.enabled, this.fetched\r\n */\r\n };\r\n\r\n Module.prototype = {\r\n init: function (depMaps, factory, errback, options) {\r\n options = options || {};\r\n\r\n //Do not do more inits if already done. Can happen if there\r\n //are multiple define calls for the same module. That is not\r\n //a normal, common case, but it is also not unexpected.\r\n if (this.inited) {\r\n return;\r\n }\r\n\r\n this.factory = factory;\r\n\r\n if (errback) {\r\n //Register for errors on this module.\r\n this.on('error', errback);\r\n } else if (this.events.error) {\r\n //If no errback already, but there are error listeners\r\n //on this module, set up an errback to pass to the deps.\r\n errback = bind(this, function (err) {\r\n this.emit('error', err);\r\n });\r\n }\r\n\r\n //Do a copy of the dependency array, so that\r\n //source inputs are not modified. For example\r\n //\"shim\" deps are passed in here directly, and\r\n //doing a direct modification of the depMaps array\r\n //would affect that config.\r\n this.depMaps = depMaps && depMaps.slice(0);\r\n\r\n this.errback = errback;\r\n\r\n //Indicate this module has be initialized\r\n this.inited = true;\r\n\r\n this.ignore = options.ignore;\r\n\r\n //Could have option to init this module in enabled mode,\r\n //or could have been previously marked as enabled. However,\r\n //the dependencies are not known until init is called. So\r\n //if enabled previously, now trigger dependencies as enabled.\r\n if (options.enabled || this.enabled) {\r\n //Enable this module and dependencies.\r\n //Will call this.check()\r\n this.enable();\r\n } else {\r\n this.check();\r\n }\r\n },\r\n\r\n defineDep: function (i, depExports) {\r\n //Because of cycles, defined callback for a given\r\n //export can be called more than once.\r\n if (!this.depMatched[i]) {\r\n this.depMatched[i] = true;\r\n this.depCount -= 1;\r\n this.depExports[i] = depExports;\r\n }\r\n },\r\n\r\n fetch: function () {\r\n if (this.fetched) {\r\n return;\r\n }\r\n this.fetched = true;\r\n\r\n context.startTime = (new Date()).getTime();\r\n\r\n var map = this.map;\r\n\r\n //If the manager is for a plugin managed resource,\r\n //ask the plugin to load it now.\r\n if (this.shim) {\r\n context.makeRequire(this.map, {\r\n enableBuildCallback: true\r\n })(this.shim.deps || [], bind(this, function () {\r\n return map.prefix ? this.callPlugin() : this.load();\r\n }));\r\n } else {\r\n //Regular dependency.\r\n return map.prefix ? this.callPlugin() : this.load();\r\n }\r\n },\r\n\r\n load: function () {\r\n var url = this.map.url;\r\n\r\n //Regular dependency.\r\n if (!urlFetched[url]) {\r\n urlFetched[url] = true;\r\n context.load(this.map.id, url);\r\n }\r\n },\r\n\r\n /**\r\n * Checks if the module is ready to define itself, and if so,\r\n * define it.\r\n */\r\n check: function () {\r\n if (!this.enabled || this.enabling) {\r\n return;\r\n }\r\n\r\n var err, cjsModule,\r\n id = this.map.id,\r\n depExports = this.depExports,\r\n exports = this.exports,\r\n factory = this.factory;\r\n\r\n if (!this.inited) {\r\n this.fetch();\r\n } else if (this.error) {\r\n this.emit('error', this.error);\r\n } else if (!this.defining) {\r\n //The factory could trigger another require call\r\n //that would result in checking this module to\r\n //define itself again. If already in the process\r\n //of doing that, skip this work.\r\n this.defining = true;\r\n\r\n if (this.depCount < 1 && !this.defined) {\r\n if (isFunction(factory)) {\r\n //If there is an error listener, favor passing\r\n //to that instead of throwing an error. However,\r\n //only do it for define()'d modules. require\r\n //errbacks should not be called for failures in\r\n //their callbacks (#699). However if a global\r\n //onError is set, use that.\r\n if ((this.events.error && this.map.isDefine) ||\r\n req.onError !== defaultOnError) {\r\n try {\r\n exports = context.execCb(id, factory, depExports, exports);\r\n } catch (e) {\r\n err = e;\r\n }\r\n } else {\r\n exports = context.execCb(id, factory, depExports, exports);\r\n }\r\n\r\n // Favor return value over exports. If node/cjs in play,\r\n // then will not have a return value anyway. Favor\r\n // module.exports assignment over exports object.\r\n if (this.map.isDefine && exports === undefined) {\r\n cjsModule = this.module;\r\n if (cjsModule) {\r\n exports = cjsModule.exports;\r\n } else if (this.usingExports) {\r\n //exports already set the defined value.\r\n exports = this.exports;\r\n }\r\n }\r\n\r\n if (err) {\r\n err.requireMap = this.map;\r\n err.requireModules = this.map.isDefine ? [this.map.id] : null;\r\n err.requireType = this.map.isDefine ? 'define' : 'require';\r\n return onError((this.error = err));\r\n }\r\n\r\n } else {\r\n //Just a literal value\r\n exports = factory;\r\n }\r\n\r\n this.exports = exports;\r\n\r\n if (this.map.isDefine && !this.ignore) {\r\n defined[id] = exports;\r\n\r\n if (req.onResourceLoad) {\r\n req.onResourceLoad(context, this.map, this.depMaps);\r\n }\r\n }\r\n\r\n //Clean up\r\n cleanRegistry(id);\r\n\r\n this.defined = true;\r\n }\r\n\r\n //Finished the define stage. Allow calling check again\r\n //to allow define notifications below in the case of a\r\n //cycle.\r\n this.defining = false;\r\n\r\n if (this.defined && !this.defineEmitted) {\r\n this.defineEmitted = true;\r\n this.emit('defined', this.exports);\r\n this.defineEmitComplete = true;\r\n }\r\n\r\n }\r\n },\r\n\r\n callPlugin: function () {\r\n var map = this.map,\r\n id = map.id,\r\n //Map already normalized the prefix.\r\n pluginMap = makeModuleMap(map.prefix);\r\n\r\n //Mark this as a dependency for this plugin, so it\r\n //can be traced for cycles.\r\n this.depMaps.push(pluginMap);\r\n\r\n on(pluginMap, 'defined', bind(this, function (plugin) {\r\n var load, normalizedMap, normalizedMod,\r\n bundleId = getOwn(bundlesMap, this.map.id),\r\n name = this.map.name,\r\n parentName = this.map.parentMap ? this.map.parentMap.name : null,\r\n localRequire = context.makeRequire(map.parentMap, {\r\n enableBuildCallback: true\r\n });\r\n\r\n //If current map is not normalized, wait for that\r\n //normalized name to load instead of continuing.\r\n if (this.map.unnormalized) {\r\n //Normalize the ID if the plugin allows it.\r\n if (plugin.normalize) {\r\n name = plugin.normalize(name, function (name) {\r\n return normalize(name, parentName, true);\r\n }) || '';\r\n }\r\n\r\n //prefix and name should already be normalized, no need\r\n //for applying map config again either.\r\n normalizedMap = makeModuleMap(map.prefix + '!' + name,\r\n this.map.parentMap);\r\n on(normalizedMap,\r\n 'defined', bind(this, function (value) {\r\n this.init([], function () { return value; }, null, {\r\n enabled: true,\r\n ignore: true\r\n });\r\n }));\r\n\r\n normalizedMod = getOwn(registry, normalizedMap.id);\r\n if (normalizedMod) {\r\n //Mark this as a dependency for this plugin, so it\r\n //can be traced for cycles.\r\n this.depMaps.push(normalizedMap);\r\n\r\n if (this.events.error) {\r\n normalizedMod.on('error', bind(this, function (err) {\r\n this.emit('error', err);\r\n }));\r\n }\r\n normalizedMod.enable();\r\n }\r\n\r\n return;\r\n }\r\n\r\n //If a paths config, then just load that file instead to\r\n //resolve the plugin, as it is built into that paths layer.\r\n if (bundleId) {\r\n this.map.url = context.nameToUrl(bundleId);\r\n this.load();\r\n return;\r\n }\r\n\r\n load = bind(this, function (value) {\r\n this.init([], function () { return value; }, null, {\r\n enabled: true\r\n });\r\n });\r\n\r\n load.error = bind(this, function (err) {\r\n this.inited = true;\r\n this.error = err;\r\n err.requireModules = [id];\r\n\r\n //Remove temp unnormalized modules for this module,\r\n //since they will never be resolved otherwise now.\r\n eachProp(registry, function (mod) {\r\n if (mod.map.id.indexOf(id + '_unnormalized') === 0) {\r\n cleanRegistry(mod.map.id);\r\n }\r\n });\r\n\r\n onError(err);\r\n });\r\n\r\n //Allow plugins to load other code without having to know the\r\n //context or how to 'complete' the load.\r\n load.fromText = bind(this, function (text, textAlt) {\r\n /*jslint evil: true */\r\n var moduleName = map.name,\r\n moduleMap = makeModuleMap(moduleName),\r\n hasInteractive = useInteractive;\r\n\r\n //As of 2.1.0, support just passing the text, to reinforce\r\n //fromText only being called once per resource. Still\r\n //support old style of passing moduleName but discard\r\n //that moduleName in favor of the internal ref.\r\n if (textAlt) {\r\n text = textAlt;\r\n }\r\n\r\n //Turn off interactive script matching for IE for any define\r\n //calls in the text, then turn it back on at the end.\r\n if (hasInteractive) {\r\n useInteractive = false;\r\n }\r\n\r\n //Prime the system by creating a module instance for\r\n //it.\r\n getModule(moduleMap);\r\n\r\n //Transfer any config to this other module.\r\n if (hasProp(config.config, id)) {\r\n config.config[moduleName] = config.config[id];\r\n }\r\n\r\n try {\r\n req.exec(text);\r\n } catch (e) {\r\n return onError(makeError('fromtexteval',\r\n 'fromText eval for ' + id +\r\n ' failed: ' + e,\r\n e,\r\n [id]));\r\n }\r\n\r\n if (hasInteractive) {\r\n useInteractive = true;\r\n }\r\n\r\n //Mark this as a dependency for the plugin\r\n //resource\r\n this.depMaps.push(moduleMap);\r\n\r\n //Support anonymous modules.\r\n context.completeLoad(moduleName);\r\n\r\n //Bind the value of that module to the value for this\r\n //resource ID.\r\n localRequire([moduleName], load);\r\n });\r\n\r\n //Use parentName here since the plugin's name is not reliable,\r\n //could be some weird string with no path that actually wants to\r\n //reference the parentName's path.\r\n plugin.load(map.name, localRequire, load, config);\r\n }));\r\n\r\n context.enable(pluginMap, this);\r\n this.pluginMaps[pluginMap.id] = pluginMap;\r\n },\r\n\r\n enable: function () {\r\n enabledRegistry[this.map.id] = this;\r\n this.enabled = true;\r\n\r\n //Set flag mentioning that the module is enabling,\r\n //so that immediate calls to the defined callbacks\r\n //for dependencies do not trigger inadvertent load\r\n //with the depCount still being zero.\r\n this.enabling = true;\r\n\r\n //Enable each dependency\r\n each(this.depMaps, bind(this, function (depMap, i) {\r\n var id, mod, handler;\r\n\r\n if (typeof depMap === 'string') {\r\n //Dependency needs to be converted to a depMap\r\n //and wired up to this module.\r\n depMap = makeModuleMap(depMap,\r\n (this.map.isDefine ? this.map : this.map.parentMap),\r\n false,\r\n !this.skipMap);\r\n this.depMaps[i] = depMap;\r\n\r\n handler = getOwn(handlers, depMap.id);\r\n\r\n if (handler) {\r\n this.depExports[i] = handler(this);\r\n return;\r\n }\r\n\r\n this.depCount += 1;\r\n\r\n on(depMap, 'defined', bind(this, function (depExports) {\r\n this.defineDep(i, depExports);\r\n this.check();\r\n }));\r\n\r\n if (this.errback) {\r\n on(depMap, 'error', bind(this, this.errback));\r\n }\r\n }\r\n\r\n id = depMap.id;\r\n mod = registry[id];\r\n\r\n //Skip special modules like 'require', 'exports', 'module'\r\n //Also, don't call enable if it is already enabled,\r\n //important in circular dependency cases.\r\n if (!hasProp(handlers, id) && mod && !mod.enabled) {\r\n context.enable(depMap, this);\r\n }\r\n }));\r\n\r\n //Enable each plugin that is used in\r\n //a dependency\r\n eachProp(this.pluginMaps, bind(this, function (pluginMap) {\r\n var mod = getOwn(registry, pluginMap.id);\r\n if (mod && !mod.enabled) {\r\n context.enable(pluginMap, this);\r\n }\r\n }));\r\n\r\n this.enabling = false;\r\n\r\n this.check();\r\n },\r\n\r\n on: function (name, cb) {\r\n var cbs = this.events[name];\r\n if (!cbs) {\r\n cbs = this.events[name] = [];\r\n }\r\n cbs.push(cb);\r\n },\r\n\r\n emit: function (name, evt) {\r\n each(this.events[name], function (cb) {\r\n cb(evt);\r\n });\r\n if (name === 'error') {\r\n //Now that the error handler was triggered, remove\r\n //the listeners, since this broken Module instance\r\n //can stay around for a while in the registry.\r\n delete this.events[name];\r\n }\r\n }\r\n };\r\n\r\n function callGetModule(args) {\r\n //Skip modules already defined.\r\n if (!hasProp(defined, args[0])) {\r\n getModule(makeModuleMap(args[0], null, true)).init(args[1], args[2]);\r\n }\r\n }\r\n\r\n function removeListener(node, func, name, ieName) {\r\n //Favor detachEvent because of IE9\r\n //issue, see attachEvent/addEventListener comment elsewhere\r\n //in this file.\r\n if (node.detachEvent && !isOpera) {\r\n //Probably IE. If not it will throw an error, which will be\r\n //useful to know.\r\n if (ieName) {\r\n node.detachEvent(ieName, func);\r\n }\r\n } else {\r\n node.removeEventListener(name, func, false);\r\n }\r\n }\r\n\r\n /**\r\n * Given an event from a script node, get the requirejs info from it,\r\n * and then removes the event listeners on the node.\r\n * @param {Event} evt\r\n * @returns {Object}\r\n */\r\n function getScriptData(evt) {\r\n //Using currentTarget instead of target for Firefox 2.0's sake. Not\r\n //all old browsers will be supported, but this one was easy enough\r\n //to support and still makes sense.\r\n var node = evt.currentTarget || evt.srcElement;\r\n\r\n //Remove the listeners once here.\r\n removeListener(node, context.onScriptLoad, 'load', 'onreadystatechange');\r\n removeListener(node, context.onScriptError, 'error');\r\n\r\n return {\r\n node: node,\r\n id: node && node.getAttribute('data-requiremodule')\r\n };\r\n }\r\n\r\n function intakeDefines() {\r\n var args;\r\n\r\n //Any defined modules in the global queue, intake them now.\r\n takeGlobalQueue();\r\n\r\n //Make sure any remaining defQueue items get properly processed.\r\n while (defQueue.length) {\r\n args = defQueue.shift();\r\n if (args[0] === null) {\r\n return onError(makeError('mismatch', 'Mismatched anonymous define() module: ' + args[args.length - 1]));\r\n } else {\r\n //args are id, deps, factory. Should be normalized by the\r\n //define() function.\r\n callGetModule(args);\r\n }\r\n }\r\n }\r\n\r\n context = {\r\n config: config,\r\n contextName: contextName,\r\n registry: registry,\r\n defined: defined,\r\n urlFetched: urlFetched,\r\n defQueue: defQueue,\r\n Module: Module,\r\n makeModuleMap: makeModuleMap,\r\n nextTick: req.nextTick,\r\n onError: onError,\r\n\r\n /**\r\n * Set a configuration for the context.\r\n * @param {Object} cfg config object to integrate.\r\n */\r\n configure: function (cfg) {\r\n //Make sure the baseUrl ends in a slash.\r\n if (cfg.baseUrl) {\r\n if (cfg.baseUrl.charAt(cfg.baseUrl.length - 1) !== '/') {\r\n cfg.baseUrl += '/';\r\n }\r\n }\r\n\r\n //Save off the paths since they require special processing,\r\n //they are additive.\r\n var shim = config.shim,\r\n objs = {\r\n paths: true,\r\n bundles: true,\r\n config: true,\r\n map: true\r\n };\r\n\r\n eachProp(cfg, function (value, prop) {\r\n if (objs[prop]) {\r\n if (!config[prop]) {\r\n config[prop] = {};\r\n }\r\n mixin(config[prop], value, true, true);\r\n } else {\r\n config[prop] = value;\r\n }\r\n });\r\n\r\n //Reverse map the bundles\r\n if (cfg.bundles) {\r\n eachProp(cfg.bundles, function (value, prop) {\r\n each(value, function (v) {\r\n if (v !== prop) {\r\n bundlesMap[v] = prop;\r\n }\r\n });\r\n });\r\n }\r\n\r\n //Merge shim\r\n if (cfg.shim) {\r\n eachProp(cfg.shim, function (value, id) {\r\n //Normalize the structure\r\n if (isArray(value)) {\r\n value = {\r\n deps: value\r\n };\r\n }\r\n if ((value.exports || value.init) && !value.exportsFn) {\r\n value.exportsFn = context.makeShimExports(value);\r\n }\r\n shim[id] = value;\r\n });\r\n config.shim = shim;\r\n }\r\n\r\n //Adjust packages if necessary.\r\n if (cfg.packages) {\r\n each(cfg.packages, function (pkgObj) {\r\n var location, name;\r\n\r\n pkgObj = typeof pkgObj === 'string' ? { name: pkgObj } : pkgObj;\r\n\r\n name = pkgObj.name;\r\n location = pkgObj.location;\r\n if (location) {\r\n config.paths[name] = pkgObj.location;\r\n }\r\n\r\n //Save pointer to main module ID for pkg name.\r\n //Remove leading dot in main, so main paths are normalized,\r\n //and remove any trailing .js, since different package\r\n //envs have different conventions: some use a module name,\r\n //some use a file name.\r\n config.pkgs[name] = pkgObj.name + '/' + (pkgObj.main || 'main')\r\n .replace(currDirRegExp, '')\r\n .replace(jsSuffixRegExp, '');\r\n });\r\n }\r\n\r\n //If there are any \"waiting to execute\" modules in the registry,\r\n //update the maps for them, since their info, like URLs to load,\r\n //may have changed.\r\n eachProp(registry, function (mod, id) {\r\n //If module already has init called, since it is too\r\n //late to modify them, and ignore unnormalized ones\r\n //since they are transient.\r\n if (!mod.inited && !mod.map.unnormalized) {\r\n mod.map = makeModuleMap(id);\r\n }\r\n });\r\n\r\n //If a deps array or a config callback is specified, then call\r\n //require with those args. This is useful when require is defined as a\r\n //config object before require.js is loaded.\r\n if (cfg.deps || cfg.callback) {\r\n context.require(cfg.deps || [], cfg.callback);\r\n }\r\n },\r\n\r\n makeShimExports: function (value) {\r\n function fn() {\r\n var ret;\r\n if (value.init) {\r\n ret = value.init.apply(global, arguments);\r\n }\r\n return ret || (value.exports && getGlobal(value.exports));\r\n }\r\n return fn;\r\n },\r\n\r\n makeRequire: function (relMap, options) {\r\n options = options || {};\r\n\r\n function localRequire(deps, callback, errback) {\r\n var id, map, requireMod;\r\n\r\n if (options.enableBuildCallback && callback && isFunction(callback)) {\r\n callback.__requireJsBuild = true;\r\n }\r\n\r\n if (typeof deps === 'string') {\r\n if (isFunction(callback)) {\r\n //Invalid call\r\n return onError(makeError('requireargs', 'Invalid require call'), errback);\r\n }\r\n\r\n //If require|exports|module are requested, get the\r\n //value for them from the special handlers. Caveat:\r\n //this only works while module is being defined.\r\n if (relMap && hasProp(handlers, deps)) {\r\n return handlers[deps](registry[relMap.id]);\r\n }\r\n\r\n //Synchronous access to one module. If require.get is\r\n //available (as in the Node adapter), prefer that.\r\n if (req.get) {\r\n return req.get(context, deps, relMap, localRequire);\r\n }\r\n\r\n //Normalize module name, if it contains . or ..\r\n map = makeModuleMap(deps, relMap, false, true);\r\n id = map.id;\r\n\r\n if (!hasProp(defined, id)) {\r\n return onError(makeError('notloaded', 'Module name \"' +\r\n id +\r\n '\" has not been loaded yet for context: ' +\r\n contextName +\r\n (relMap ? '' : '. Use require([])')));\r\n }\r\n return defined[id];\r\n }\r\n\r\n //Grab defines waiting in the global queue.\r\n intakeDefines();\r\n\r\n //Mark all the dependencies as needing to be loaded.\r\n context.nextTick(function () {\r\n //Some defines could have been added since the\r\n //require call, collect them.\r\n intakeDefines();\r\n\r\n requireMod = getModule(makeModuleMap(null, relMap));\r\n\r\n //Store if map config should be applied to this require\r\n //call for dependencies.\r\n requireMod.skipMap = options.skipMap;\r\n\r\n requireMod.init(deps, callback, errback, {\r\n enabled: true\r\n });\r\n\r\n checkLoaded();\r\n });\r\n\r\n return localRequire;\r\n }\r\n\r\n mixin(localRequire, {\r\n isBrowser: isBrowser,\r\n\r\n /**\r\n * Converts a module name + .extension into an URL path.\r\n * *Requires* the use of a module name. It does not support using\r\n * plain URLs like nameToUrl.\r\n */\r\n toUrl: function (moduleNamePlusExt) {\r\n var ext,\r\n index = moduleNamePlusExt.lastIndexOf('.'),\r\n segment = moduleNamePlusExt.split('/')[0],\r\n isRelative = segment === '.' || segment === '..';\r\n\r\n //Have a file extension alias, and it is not the\r\n //dots from a relative path.\r\n if (index !== -1 && (!isRelative || index > 1)) {\r\n ext = moduleNamePlusExt.substring(index, moduleNamePlusExt.length);\r\n moduleNamePlusExt = moduleNamePlusExt.substring(0, index);\r\n }\r\n\r\n return context.nameToUrl(normalize(moduleNamePlusExt,\r\n relMap && relMap.id, true), ext, true);\r\n },\r\n\r\n defined: function (id) {\r\n return hasProp(defined, makeModuleMap(id, relMap, false, true).id);\r\n },\r\n\r\n specified: function (id) {\r\n id = makeModuleMap(id, relMap, false, true).id;\r\n return hasProp(defined, id) || hasProp(registry, id);\r\n }\r\n });\r\n\r\n //Only allow undef on top level require calls\r\n if (!relMap) {\r\n localRequire.undef = function (id) {\r\n //Bind any waiting define() calls to this context,\r\n //fix for #408\r\n takeGlobalQueue();\r\n\r\n var map = makeModuleMap(id, relMap, true),\r\n mod = getOwn(registry, id);\r\n\r\n removeScript(id);\r\n\r\n delete defined[id];\r\n delete urlFetched[map.url];\r\n delete undefEvents[id];\r\n\r\n //Clean queued defines too. Go backwards\r\n //in array so that the splices do not\r\n //mess up the iteration.\r\n eachReverse(defQueue, function(args, i) {\r\n if(args[0] === id) {\r\n defQueue.splice(i, 1);\r\n }\r\n });\r\n\r\n if (mod) {\r\n //Hold on to listeners in case the\r\n //module will be attempted to be reloaded\r\n //using a different config.\r\n if (mod.events.defined) {\r\n undefEvents[id] = mod.events;\r\n }\r\n\r\n cleanRegistry(id);\r\n }\r\n };\r\n }\r\n\r\n return localRequire;\r\n },\r\n\r\n /**\r\n * Called to enable a module if it is still in the registry\r\n * awaiting enablement. A second arg, parent, the parent module,\r\n * is passed in for context, when this method is overridden by\r\n * the optimizer. Not shown here to keep code compact.\r\n */\r\n enable: function (depMap) {\r\n var mod = getOwn(registry, depMap.id);\r\n if (mod) {\r\n getModule(depMap).enable();\r\n }\r\n },\r\n\r\n /**\r\n * Internal method used by environment adapters to complete a load event.\r\n * A load event could be a script load or just a load pass from a synchronous\r\n * load call.\r\n * @param {String} moduleName the name of the module to potentially complete.\r\n */\r\n completeLoad: function (moduleName) {\r\n var found, args, mod,\r\n shim = getOwn(config.shim, moduleName) || {},\r\n shExports = shim.exports;\r\n\r\n takeGlobalQueue();\r\n\r\n while (defQueue.length) {\r\n args = defQueue.shift();\r\n if (args[0] === null) {\r\n args[0] = moduleName;\r\n //If already found an anonymous module and bound it\r\n //to this name, then this is some other anon module\r\n //waiting for its completeLoad to fire.\r\n if (found) {\r\n break;\r\n }\r\n found = true;\r\n } else if (args[0] === moduleName) {\r\n //Found matching define call for this script!\r\n found = true;\r\n }\r\n\r\n callGetModule(args);\r\n }\r\n\r\n //Do this after the cycle of callGetModule in case the result\r\n //of those calls/init calls changes the registry.\r\n mod = getOwn(registry, moduleName);\r\n\r\n if (!found && !hasProp(defined, moduleName) && mod && !mod.inited) {\r\n if (config.enforceDefine && (!shExports || !getGlobal(shExports))) {\r\n if (hasPathFallback(moduleName)) {\r\n return;\r\n } else {\r\n return onError(makeError('nodefine',\r\n 'No define call for ' + moduleName,\r\n null,\r\n [moduleName]));\r\n }\r\n } else {\r\n //A script that does not call define(), so just simulate\r\n //the call for it.\r\n callGetModule([moduleName, (shim.deps || []), shim.exportsFn]);\r\n }\r\n }\r\n\r\n checkLoaded();\r\n },\r\n\r\n /**\r\n * Converts a module name to a file path. Supports cases where\r\n * moduleName may actually be just an URL.\r\n * Note that it **does not** call normalize on the moduleName,\r\n * it is assumed to have already been normalized. This is an\r\n * internal API, not a public one. Use toUrl for the public API.\r\n */\r\n nameToUrl: function (moduleName, ext, skipExt) {\r\n var paths, syms, i, parentModule, url,\r\n parentPath, bundleId,\r\n pkgMain = getOwn(config.pkgs, moduleName);\r\n\r\n if (pkgMain) {\r\n moduleName = pkgMain;\r\n }\r\n\r\n bundleId = getOwn(bundlesMap, moduleName);\r\n\r\n if (bundleId) {\r\n return context.nameToUrl(bundleId, ext, skipExt);\r\n }\r\n\r\n //If a colon is in the URL, it indicates a protocol is used and it is just\r\n //an URL to a file, or if it starts with a slash, contains a query arg (i.e. ?)\r\n //or ends with .js, then assume the user meant to use an url and not a module id.\r\n //The slash is important for protocol-less URLs as well as full paths.\r\n if (req.jsExtRegExp.test(moduleName)) {\r\n //Just a plain path, not module name lookup, so just return it.\r\n //Add extension if it is included. This is a bit wonky, only non-.js things pass\r\n //an extension, this method probably needs to be reworked.\r\n url = moduleName + (ext || '');\r\n } else {\r\n //A module that needs to be converted to a path.\r\n paths = config.paths;\r\n\r\n syms = moduleName.split('/');\r\n //For each module name segment, see if there is a path\r\n //registered for it. Start with most specific name\r\n //and work up from it.\r\n for (i = syms.length; i > 0; i -= 1) {\r\n parentModule = syms.slice(0, i).join('/');\r\n\r\n parentPath = getOwn(paths, parentModule);\r\n if (parentPath) {\r\n //If an array, it means there are a few choices,\r\n //Choose the one that is desired\r\n if (isArray(parentPath)) {\r\n parentPath = parentPath[0];\r\n }\r\n syms.splice(0, i, parentPath);\r\n break;\r\n }\r\n }\r\n\r\n //Join the path parts together, then figure out if baseUrl is needed.\r\n url = syms.join('/');\r\n url += (ext || (/^data\\:|\\?/.test(url) || skipExt ? '' : '.js'));\r\n url = (url.charAt(0) === '/' || url.match(/^[\\w\\+\\.\\-]+:/) ? '' : config.baseUrl) + url;\r\n }\r\n\r\n return config.urlArgs ? url +\r\n ((url.indexOf('?') === -1 ? '?' : '&') +\r\n config.urlArgs) : url;\r\n },\r\n\r\n //Delegates to req.load. Broken out as a separate function to\r\n //allow overriding in the optimizer.\r\n load: function (id, url) {\r\n req.load(context, id, url);\r\n },\r\n\r\n /**\r\n * Executes a module callback function. Broken out as a separate function\r\n * solely to allow the build system to sequence the files in the built\r\n * layer in the right sequence.\r\n *\r\n * @private\r\n */\r\n execCb: function (name, callback, args, exports) {\r\n return callback.apply(exports, args);\r\n },\r\n\r\n /**\r\n * callback for script loads, used to check status of loading.\r\n *\r\n * @param {Event} evt the event from the browser for the script\r\n * that was loaded.\r\n */\r\n onScriptLoad: function (evt) {\r\n //Using currentTarget instead of target for Firefox 2.0's sake. Not\r\n //all old browsers will be supported, but this one was easy enough\r\n //to support and still makes sense.\r\n if (evt.type === 'load' ||\r\n (readyRegExp.test((evt.currentTarget || evt.srcElement).readyState))) {\r\n //Reset interactive script so a script node is not held onto for\r\n //to long.\r\n interactiveScript = null;\r\n\r\n //Pull out the name of the module and the context.\r\n var data = getScriptData(evt);\r\n context.completeLoad(data.id);\r\n }\r\n },\r\n\r\n /**\r\n * Callback for script errors.\r\n */\r\n onScriptError: function (evt) {\r\n var data = getScriptData(evt);\r\n if (!hasPathFallback(data.id)) {\r\n return onError(makeError('scripterror', 'Script error for: ' + data.id, evt, [data.id]));\r\n }\r\n }\r\n };\r\n\r\n context.require = context.makeRequire();\r\n return context;\r\n }\r\n\r\n /**\r\n * Main entry point.\r\n *\r\n * If the only argument to require is a string, then the module that\r\n * is represented by that string is fetched for the appropriate context.\r\n *\r\n * If the first argument is an array, then it will be treated as an array\r\n * of dependency string names to fetch. An optional function callback can\r\n * be specified to execute when all of those dependencies are available.\r\n *\r\n * Make a local req variable to help Caja compliance (it assumes things\r\n * on a require that are not standardized), and to give a short\r\n * name for minification/local scope use.\r\n */\r\n req = requirejs = function (deps, callback, errback, optional) {\r\n\r\n //Find the right context, use default\r\n var context, config,\r\n contextName = defContextName;\r\n\r\n // Determine if have config object in the call.\r\n if (!isArray(deps) && typeof deps !== 'string') {\r\n // deps is a config object\r\n config = deps;\r\n if (isArray(callback)) {\r\n // Adjust args if there are dependencies\r\n deps = callback;\r\n callback = errback;\r\n errback = optional;\r\n } else {\r\n deps = [];\r\n }\r\n }\r\n\r\n if (config && config.context) {\r\n contextName = config.context;\r\n }\r\n\r\n context = getOwn(contexts, contextName);\r\n if (!context) {\r\n context = contexts[contextName] = req.s.newContext(contextName);\r\n }\r\n\r\n if (config) {\r\n context.configure(config);\r\n }\r\n\r\n return context.require(deps, callback, errback);\r\n };\r\n\r\n /**\r\n * Support require.config() to make it easier to cooperate with other\r\n * AMD loaders on globally agreed names.\r\n */\r\n req.config = function (config) {\r\n return req(config);\r\n };\r\n\r\n /**\r\n * Execute something after the current tick\r\n * of the event loop. Override for other envs\r\n * that have a better solution than setTimeout.\r\n * @param {Function} fn function to execute later.\r\n */\r\n req.nextTick = typeof setTimeout !== 'undefined' ? function (fn) {\r\n setTimeout(fn, 4);\r\n } : function (fn) { fn(); };\r\n\r\n /**\r\n * Export require as a global, but only if it does not already exist.\r\n */\r\n if (!require) {\r\n require = req;\r\n }\r\n\r\n req.version = version;\r\n\r\n //Used to filter out dependencies that are already paths.\r\n req.jsExtRegExp = /^\\/|:|\\?|\\.js$/;\r\n req.isBrowser = isBrowser;\r\n s = req.s = {\r\n contexts: contexts,\r\n newContext: newContext\r\n };\r\n\r\n //Create default context.\r\n req({});\r\n\r\n //Exports some context-sensitive methods on global require.\r\n each([\r\n 'toUrl',\r\n 'undef',\r\n 'defined',\r\n 'specified'\r\n ], function (prop) {\r\n //Reference from contexts instead of early binding to default context,\r\n //so that during builds, the latest instance of the default context\r\n //with its config gets used.\r\n req[prop] = function () {\r\n var ctx = contexts[defContextName];\r\n return ctx.require[prop].apply(ctx, arguments);\r\n };\r\n });\r\n\r\n if (isBrowser) {\r\n head = s.head = document.getElementsByTagName('head')[0];\r\n //If BASE tag is in play, using appendChild is a problem for IE6.\r\n //When that browser dies, this can be removed. Details in this jQuery bug:\r\n //http://dev.jquery.com/ticket/2709\r\n baseElement = document.getElementsByTagName('base')[0];\r\n if (baseElement) {\r\n head = s.head = baseElement.parentNode;\r\n }\r\n }\r\n\r\n /**\r\n * Any errors that require explicitly generates will be passed to this\r\n * function. Intercept/override it if you want custom error handling.\r\n * @param {Error} err the error object.\r\n */\r\n req.onError = defaultOnError;\r\n\r\n /**\r\n * Creates the node for the load command. Only used in browser envs.\r\n */\r\n req.createNode = function (config, moduleName, url) {\r\n var node = config.xhtml ?\r\n document.createElementNS('http://www.w3.org/1999/xhtml', 'html:script') :\r\n document.createElement('script');\r\n node.type = config.scriptType || 'text/javascript';\r\n node.charset = 'utf-8';\r\n node.async = true;\r\n return node;\r\n };\r\n\r\n /**\r\n * Does the request to load a module for the browser case.\r\n * Make this a separate function to allow other environments\r\n * to override it.\r\n *\r\n * @param {Object} context the require context to find state.\r\n * @param {String} moduleName the name of the module.\r\n * @param {Object} url the URL to the module.\r\n */\r\n req.load = function (context, moduleName, url) {\r\n var config = (context && context.config) || {},\r\n node;\r\n if (isBrowser) {\r\n //In the browser so use a script tag\r\n node = req.createNode(config, moduleName, url);\r\n\r\n node.setAttribute('data-requirecontext', context.contextName);\r\n node.setAttribute('data-requiremodule', moduleName);\r\n\r\n //Set up load listener. Test attachEvent first because IE9 has\r\n //a subtle issue in its addEventListener and script onload firings\r\n //that do not match the behavior of all other browsers with\r\n //addEventListener support, which fire the onload event for a\r\n //script right after the script execution. See:\r\n //https://connect.microsoft.com/IE/feedback/details/648057/script-onload-event-is-not-fired-immediately-after-script-execution\r\n //UNFORTUNATELY Opera implements attachEvent but does not follow the script\r\n //script execution mode.\r\n if (node.attachEvent &&\r\n //Check if node.attachEvent is artificially added by custom script or\r\n //natively supported by browser\r\n //read https://github.com/jrburke/requirejs/issues/187\r\n //if we can NOT find [native code] then it must NOT natively supported.\r\n //in IE8, node.attachEvent does not have toString()\r\n //Note the test for \"[native code\" with no closing brace, see:\r\n //https://github.com/jrburke/requirejs/issues/273\r\n !(node.attachEvent.toString && node.attachEvent.toString().indexOf('[native code') < 0) &&\r\n !isOpera) {\r\n //Probably IE. IE (at least 6-8) do not fire\r\n //script onload right after executing the script, so\r\n //we cannot tie the anonymous define call to a name.\r\n //However, IE reports the script as being in 'interactive'\r\n //readyState at the time of the define call.\r\n useInteractive = true;\r\n\r\n node.attachEvent('onreadystatechange', context.onScriptLoad);\r\n //It would be great to add an error handler here to catch\r\n //404s in IE9+. However, onreadystatechange will fire before\r\n //the error handler, so that does not help. If addEventListener\r\n //is used, then IE will fire error before load, but we cannot\r\n //use that pathway given the connect.microsoft.com issue\r\n //mentioned above about not doing the 'script execute,\r\n //then fire the script load event listener before execute\r\n //next script' that other browsers do.\r\n //Best hope: IE10 fixes the issues,\r\n //and then destroys all installs of IE 6-9.\r\n //node.attachEvent('onerror', context.onScriptError);\r\n } else {\r\n node.addEventListener('load', context.onScriptLoad, false);\r\n node.addEventListener('error', context.onScriptError, false);\r\n }\r\n node.src = url;\r\n\r\n //For some cache cases in IE 6-8, the script executes before the end\r\n //of the appendChild execution, so to tie an anonymous define\r\n //call to the module name (which is stored on the node), hold on\r\n //to a reference to this node, but clear after the DOM insertion.\r\n currentlyAddingScript = node;\r\n if (baseElement) {\r\n head.insertBefore(node, baseElement);\r\n } else {\r\n head.appendChild(node);\r\n }\r\n currentlyAddingScript = null;\r\n\r\n return node;\r\n } else if (isWebWorker) {\r\n try {\r\n //In a web worker, use importScripts. This is not a very\r\n //efficient use of importScripts, importScripts will block until\r\n //its script is downloaded and evaluated. However, if web workers\r\n //are in play, the expectation that a build has been done so that\r\n //only one script needs to be loaded anyway. This may need to be\r\n //reevaluated if other use cases become common.\r\n importScripts(url);\r\n\r\n //Account for anonymous modules\r\n context.completeLoad(moduleName);\r\n } catch (e) {\r\n context.onError(makeError('importscripts',\r\n 'importScripts failed for ' +\r\n moduleName + ' at ' + url,\r\n e,\r\n [moduleName]));\r\n }\r\n }\r\n };\r\n\r\n function getInteractiveScript() {\r\n if (interactiveScript && interactiveScript.readyState === 'interactive') {\r\n return interactiveScript;\r\n }\r\n\r\n eachReverse(scripts(), function (script) {\r\n if (script.readyState === 'interactive') {\r\n return (interactiveScript = script);\r\n }\r\n });\r\n return interactiveScript;\r\n }\r\n\r\n //Look for a data-main script attribute, which could also adjust the baseUrl.\r\n if (isBrowser && !cfg.skipDataMain) {\r\n //Figure out baseUrl. Get it from the script tag with require.js in it.\r\n eachReverse(scripts(), function (script) {\r\n //Set the 'head' where we can append children by\r\n //using the script's parent.\r\n if (!head) {\r\n head = script.parentNode;\r\n }\r\n\r\n //Look for a data-main attribute to set main script for the page\r\n //to load. If it is there, the path to data main becomes the\r\n //baseUrl, if it is not already set.\r\n dataMain = script.getAttribute('data-main');\r\n if (dataMain) {\r\n //Preserve dataMain in case it is a path (i.e. contains '?')\r\n mainScript = dataMain;\r\n\r\n //Set final baseUrl if there is not already an explicit one.\r\n if (!cfg.baseUrl) {\r\n //Pull off the directory of data-main for use as the\r\n //baseUrl.\r\n src = mainScript.split('/');\r\n mainScript = src.pop();\r\n subPath = src.length ? src.join('/') + '/' : './';\r\n\r\n cfg.baseUrl = subPath;\r\n }\r\n\r\n //Strip off any trailing .js since mainScript is now\r\n //like a module name.\r\n mainScript = mainScript.replace(jsSuffixRegExp, '');\r\n\r\n //If mainScript is still a path, fall back to dataMain\r\n if (req.jsExtRegExp.test(mainScript)) {\r\n mainScript = dataMain;\r\n }\r\n\r\n //Put the data-main script in the files to load.\r\n cfg.deps = cfg.deps ? cfg.deps.concat(mainScript) : [mainScript];\r\n\r\n return true;\r\n }\r\n });\r\n }\r\n\r\n /**\r\n * The function that handles definitions of modules. Differs from\r\n * require() in that a string for the module should be the first argument,\r\n * and the function to execute after dependencies are loaded should\r\n * return a value to define the module corresponding to the first argument's\r\n * name.\r\n */\r\n define = function (name, deps, callback) {\r\n var node, context;\r\n\r\n //Allow for anonymous modules\r\n if (typeof name !== 'string') {\r\n //Adjust args appropriately\r\n callback = deps;\r\n deps = name;\r\n name = null;\r\n }\r\n\r\n //This module may not have dependencies\r\n if (!isArray(deps)) {\r\n callback = deps;\r\n deps = null;\r\n }\r\n\r\n //If no name, and callback is a function, then figure out if it a\r\n //CommonJS thing with dependencies.\r\n if (!deps && isFunction(callback)) {\r\n deps = [];\r\n //Remove comments from the callback string,\r\n //look for require calls, and pull them into the dependencies,\r\n //but only if there are function args.\r\n if (callback.length) {\r\n callback\r\n .toString()\r\n .replace(commentRegExp, '')\r\n .replace(cjsRequireRegExp, function (match, dep) {\r\n deps.push(dep);\r\n });\r\n\r\n //May be a CommonJS thing even without require calls, but still\r\n //could use exports, and module. Avoid doing exports and module\r\n //work though if it just needs require.\r\n //REQUIRES the function to expect the CommonJS variables in the\r\n //order listed below.\r\n deps = (callback.length === 1 ? ['require'] : ['require', 'exports', 'module']).concat(deps);\r\n }\r\n }\r\n\r\n //If in IE 6-8 and hit an anonymous define() call, do the interactive\r\n //work.\r\n if (useInteractive) {\r\n node = currentlyAddingScript || getInteractiveScript();\r\n if (node) {\r\n if (!name) {\r\n name = node.getAttribute('data-requiremodule');\r\n }\r\n context = contexts[node.getAttribute('data-requirecontext')];\r\n }\r\n }\r\n\r\n //Always save off evaluating the def call until the script onload handler.\r\n //This allows multiple modules to be in a file without prematurely\r\n //tracing dependencies, and allows for anonymous module support,\r\n //where the module name is not known until the script onload event\r\n //occurs. If no context, use the global queue, and get it processed\r\n //in the onscript load callback.\r\n (context ? context.defQueue : globalDefQueue).push([name, deps, callback]);\r\n };\r\n\r\n define.amd = {\r\n jQuery: true\r\n };\r\n\r\n\r\n /**\r\n * Executes the text. Normally just uses eval, but can be modified\r\n * to use a better, environment-specific call. Only used for transpiling\r\n * loader plugins, not for plain JS modules.\r\n * @param {String} text the text to execute/evaluate.\r\n */\r\n req.exec = function (text) {\r\n /*jslint evil: true */\r\n return eval(text);\r\n };\r\n\r\n //Set up with config info.\r\n req(cfg);\r\n}(this));\r\n"]}