diff --git a/main.js b/main.js index 1d3b0b991..ba2877884 100644 --- a/main.js +++ b/main.js @@ -3378,7 +3378,21 @@ function cjs(loader) { '\n}).call(_g.exports, _g.global, _g.exports, _g.module, _g.require, _g.__filename, _g.__dirname);})();', address: load.address }; - loader.__exec(execLoad); + try { + loader.__exec(execLoad); + } catch(ex) { + if(loader.StackTrace) { + var st = loader.StackTrace.parse(ex); + if(!st) { + ex.stack = new loader.StackTrace(ex.message, [ + loader.StackTrace.item("", load.address, 1, 0) + ]).toString(); + } + } + + throw ex; + } + loader.global.define = define; diff --git a/src/base/base.js b/src/base/base.js index 7d89ec081..e59440b5c 100644 --- a/src/base/base.js +++ b/src/base/base.js @@ -1405,7 +1405,21 @@ function cjs(loader) { '\n}).call(_g.exports, _g.global, _g.exports, _g.module, _g.require, _g.__filename, _g.__dirname);})();', address: load.address }; - loader.__exec(execLoad); + try { + loader.__exec(execLoad); + } catch(ex) { + if(loader.StackTrace) { + var st = loader.StackTrace.parse(ex); + if(!st) { + ex.stack = new loader.StackTrace(ex.message, [ + loader.StackTrace.item("", load.address, 1, 0) + ]).toString(); + } + } + + throw ex; + } + loader.global.define = define; diff --git a/src/base/lib/extension-cjs.js b/src/base/lib/extension-cjs.js index 8b7e83d8a..df765580a 100644 --- a/src/base/lib/extension-cjs.js +++ b/src/base/lib/extension-cjs.js @@ -120,7 +120,21 @@ function cjs(loader) { '\n}).call(_g.exports, _g.global, _g.exports, _g.module, _g.require, _g.__filename, _g.__dirname);})();', address: load.address }; - loader.__exec(execLoad); + try { + loader.__exec(execLoad); + } catch(ex) { + if(loader.StackTrace) { + var st = loader.StackTrace.parse(ex); + if(!st) { + ex.stack = new loader.StackTrace(ex.message, [ + loader.StackTrace.item("", load.address, 1, 0) + ]).toString(); + } + } + + throw ex; + } + loader.global.define = define; diff --git a/src/loader/lib/transpiler.js b/src/loader/lib/transpiler.js index 8d277e1ad..91a539de9 100644 --- a/src/loader/lib/transpiler.js +++ b/src/loader/lib/transpiler.js @@ -523,6 +523,7 @@ var babelVersion = getBabelVersion(babel); var options = getBabelOptions.call(this, load, babel); + var loader = this; return Promise.all([ processBabelPlugins.call(this, babel, options), @@ -537,12 +538,25 @@ options.presets = results[1]; } - var result = babel.transform(load.source, options); - var source = result.code; - - // add "!eval" to end of Babel sourceURL - // I believe this does something? - return source + '\n//# sourceURL=' + load.address + '!eval'; + try { + var result = babel.transform(load.source, options); + var source = result.code; + + // add "!eval" to end of Babel sourceURL + // I believe this does something? + return source + '\n//# sourceURL=' + load.address + '!eval'; + } catch(ex) { + if(ex instanceof SyntaxError) { + var newError = new SyntaxError(ex.message); + var stack = new loader.StackTrace(ex.message, [ + loader.StackTrace.item("", load.address, + ex.loc.line, ex.loc.column) + ]); + newError.stack = stack.toString(); + return Promise.reject(newError); + } + return Promise.reject(ex); + } }); } diff --git a/src/loader/loader-sans-promises.js b/src/loader/loader-sans-promises.js index d1f8bf292..7368565a1 100644 --- a/src/loader/loader-sans-promises.js +++ b/src/loader/loader-sans-promises.js @@ -1758,6 +1758,7 @@ function logloads(loads) { var babelVersion = getBabelVersion(babel); var options = getBabelOptions.call(this, load, babel); + var loader = this; return Promise.all([ processBabelPlugins.call(this, babel, options), @@ -1772,12 +1773,25 @@ function logloads(loads) { options.presets = results[1]; } - var result = babel.transform(load.source, options); - var source = result.code; - - // add "!eval" to end of Babel sourceURL - // I believe this does something? - return source + '\n//# sourceURL=' + load.address + '!eval'; + try { + var result = babel.transform(load.source, options); + var source = result.code; + + // add "!eval" to end of Babel sourceURL + // I believe this does something? + return source + '\n//# sourceURL=' + load.address + '!eval'; + } catch(ex) { + if(ex instanceof SyntaxError) { + var newError = new SyntaxError(ex.message); + var stack = new loader.StackTrace(ex.message, [ + loader.StackTrace.item("", load.address, + ex.loc.line, ex.loc.column) + ]); + newError.stack = stack.toString(); + return Promise.reject(newError); + } + return Promise.reject(ex); + } }); } diff --git a/src/loader/loader.js b/src/loader/loader.js index a16d2e0d0..215d1cdff 100644 --- a/src/loader/loader.js +++ b/src/loader/loader.js @@ -3028,6 +3028,7 @@ function logloads(loads) { var babelVersion = getBabelVersion(babel); var options = getBabelOptions.call(this, load, babel); + var loader = this; return Promise.all([ processBabelPlugins.call(this, babel, options), @@ -3042,12 +3043,25 @@ function logloads(loads) { options.presets = results[1]; } - var result = babel.transform(load.source, options); - var source = result.code; - - // add "!eval" to end of Babel sourceURL - // I believe this does something? - return source + '\n//# sourceURL=' + load.address + '!eval'; + try { + var result = babel.transform(load.source, options); + var source = result.code; + + // add "!eval" to end of Babel sourceURL + // I believe this does something? + return source + '\n//# sourceURL=' + load.address + '!eval'; + } catch(ex) { + if(ex instanceof SyntaxError) { + var newError = new SyntaxError(ex.message); + var stack = new loader.StackTrace(ex.message, [ + loader.StackTrace.item("", load.address, + ex.loc.line, ex.loc.column) + ]); + newError.stack = stack.toString(); + return Promise.reject(newError); + } + return Promise.reject(ex); + } }); } diff --git a/steal-sans-promises.js b/steal-sans-promises.js index 00e76fd2d..433ba9762 100644 --- a/steal-sans-promises.js +++ b/steal-sans-promises.js @@ -1758,6 +1758,7 @@ function logloads(loads) { var babelVersion = getBabelVersion(babel); var options = getBabelOptions.call(this, load, babel); + var loader = this; return Promise.all([ processBabelPlugins.call(this, babel, options), @@ -1772,12 +1773,25 @@ function logloads(loads) { options.presets = results[1]; } - var result = babel.transform(load.source, options); - var source = result.code; - - // add "!eval" to end of Babel sourceURL - // I believe this does something? - return source + '\n//# sourceURL=' + load.address + '!eval'; + try { + var result = babel.transform(load.source, options); + var source = result.code; + + // add "!eval" to end of Babel sourceURL + // I believe this does something? + return source + '\n//# sourceURL=' + load.address + '!eval'; + } catch(ex) { + if(ex instanceof SyntaxError) { + var newError = new SyntaxError(ex.message); + var stack = new loader.StackTrace(ex.message, [ + loader.StackTrace.item("", load.address, + ex.loc.line, ex.loc.column) + ]); + newError.stack = stack.toString(); + return Promise.reject(newError); + } + return Promise.reject(ex); + } }); } @@ -3588,7 +3602,21 @@ function cjs(loader) { '\n}).call(_g.exports, _g.global, _g.exports, _g.module, _g.require, _g.__filename, _g.__dirname);})();', address: load.address }; - loader.__exec(execLoad); + try { + loader.__exec(execLoad); + } catch(ex) { + if(loader.StackTrace) { + var st = loader.StackTrace.parse(ex); + if(!st) { + ex.stack = new loader.StackTrace(ex.message, [ + loader.StackTrace.item("", load.address, 1, 0) + ]).toString(); + } + } + + throw ex; + } + loader.global.define = define; diff --git a/steal-sans-promises.production.js b/steal-sans-promises.production.js index 1d44ddc8c..7539f5942 100644 --- a/steal-sans-promises.production.js +++ b/steal-sans-promises.production.js @@ -4,4 +4,4 @@ * Copyright (c) 2018 Bitovi; Licensed MIT */ -!function(__global){function __eval(__source,__global,__load){try{eval('(function() { var __moduleName = "'+(__load.name||"").replace('"','"')+'"; '+__source+" \n }).call(__global);")}catch(e){throw"SyntaxError"!=e.name&&"TypeError"!=e.name||(e.message="Evaluating "+(__load.name||load.address)+"\n\t"+e.message),e}}var isWorker="undefined"!=typeof self&&"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope,isBrowser="undefined"!=typeof window&&!isWorker;__global.$__Object$getPrototypeOf=Object.getPrototypeOf||function(e){return e.__proto__};var $__Object$defineProperty;!function(){try{Object.defineProperty({},"a",{})&&($__Object$defineProperty=Object.defineProperty)}catch(e){$__Object$defineProperty=function(e,t,n){try{e[t]=n.value||n.get.call(e)}catch(e){}}}}(),__global.$__Object$create=Object.create||function(e,t){function n(){}if(n.prototype=e,"object"==typeof t)for(prop in t)t.hasOwnProperty(prop)&&(n[prop]=t[prop]);return new n},function(){function e(e){return{status:"loading",name:e,linkSets:[],dependencies:[],metadata:{}}}function t(e,t,n){return new L(i({step:n.address?"fetch":"locate",loader:e,moduleName:t,moduleMetadata:n&&n.metadata||{},moduleSource:n.source,moduleAddress:n.address}))}function n(t,n,a,o){return new L(function(e,r){e(t.loaderObj.normalize(n,a,o))}).then(function(n){var a;if(t.modules[n])return a=e(n),a.status="linked",a.module=t.modules[n],a;for(var o=0,i=t.loads.length;o",t.isDeclarative=!0,e.loaderObj.transpile(t).then(function(e){var n=__global.System,r=n.register;n.register=function(e,n,r){var a=r,o=n;"string"!=typeof e&&(a=o,o=e),t.declare=a,t.depsList=o},__eval(e,__global,t),n.register=r});if("object"!=typeof n)throw TypeError("Invalid instantiate return value");t.depsList=n.deps||[],t.execute=n.execute,t.isDeclarative=!1}}).then(function(){if("loading"==t.status){t.dependencies=[];for(var r=t.depsList,a=[],o=0,i=r.length;o0)){var n=e.startingLoad;if(!1===e.loader.loaderObj.execute){for(var r=[].concat(e.loads),a=0,o=r.length;a=0;i--){for(var s=r[i],l=0;l=0;r-=1){var a=n[r];-1===t.indexOf(a)&&t.unshift(a)}else t=["es2015-no-commonjs","react","stage-0"];return t}function d(e){return(e.version?+e.version.split(".")[0]:6)||6}function c(e,t){var n=this.babelOptions||{};return n.sourceMap="inline",n.filename=e.address,n.code=!0,n.ast=!1,d(t)>=6?(delete n.optional,delete n.whitelist,delete n.blacklist,n.presets=u(n.presets),n.plugins=l(n.plugins)):(n.modules="system",n.blacklist||(n.blacklist=["react"])),n}function f(e){var t=e.types;return{visitor:{Program:function(e,n){e.unshiftContainer("body",[t.exportNamedDeclaration(null,[t.exportSpecifier(t.identifier("true"),t.identifier("__esModule"))])])}}}}function p(e){return e.metadata.importSpecifiers=Object.create(null),function(t){t.types;return{visitor:{ImportDeclaration:function(t,n){var r=t.node,a=r.source.value,o=r.source.loc;e.metadata.importSpecifiers[a]=o}}}}}function m(e,t){var n=t.Babel||t.babel||t,r=d(n),a=c.call(this,e,n);return Promise.all([g.call(this,n,a),b.call(this,n,a)]).then(function(t){return r>=6&&(a.plugins=[p(e),f].concat(t[0]),a.presets=t[1]),n.transform(e.source,a).code+"\n//# sourceURL="+e.address+"!eval"})}var h=__global,v="undefined"==typeof self&&"undefined"!=typeof process&&"[object process]"==={}.toString.call(process);e.prototype.transpiler="babel",e.prototype.transpile=function(e){var n=this;return n.transpilerHasRun||(h.traceur&&!n.has("traceur")&&n.set("traceur",t(n,"traceur")),h.Babel&&!n.has("babel")&&n.set("babel",t(n,"Babel")),n.transpilerHasRun=!0),n.import(n.transpiler).then(function(t){var a=t;return a.__useDefault&&(a=a.default),(a.Compiler?r:m).call(n,e,a)}).then(function(t){return'var __moduleAddress = "'+e.address+'";'+t})},e.prototype.instantiate=function(e){var r=this;return Promise.resolve(r.normalize(r.transpiler)).then(function(a){if(e.name===a)return{deps:[],execute:function(){var a=h.System,o=h.Reflect.Loader;return __eval("(function(require,exports,module){"+e.source+"})();",h,e),h.System=a,h.Reflect.Loader=o,t(r,n(e.name))}}})};var g=function(){function e(e,r){var a=[];return(r||[]).forEach(function(r){var o=i(r);if(!s(r)||t(e,o))a.push(r);else if(!t(e,o)){var l=this.configMain||"package.json!npm",u=n(o);a.push(this.import(u,{name:l}).then(function(e){var t=e.__esModule?e.default:e;return"string"==typeof r?t:[t,r[1]]}))}},this),Promise.all(a)}function t(e,t){var n=/^(?:babel-plugin-)/;return!!(e.availablePlugins||{})[n.test(t)?t.replace("babel-plugin-",""):t]}function n(e){var t=/^(?:babel-plugin-)/;return/\//.test(e)||t.test(e)?e:"babel-plugin-"+e}return function(t,n){var r=o.call(this),a=n.env||{},i=[e.call(this,t,n.plugins)];for(var s in a)if(r===s){var l=a[s].plugins||[];i.push(e.call(this,t,l))}return Promise.all(i).then(function(e){var t=[];return e.forEach(function(e){t=t.concat(e)}),t})}}(),b=function(){function e(e,r){var a=[];return(r||[]).forEach(function(r){var o=i(r);if(!s(r)||t(e,o))a.push(r);else if(!t(e,o)){var l=this.configMain||"package.json!npm",u=n(o);a.push(this.import(u,{name:l}).then(function(e){var t=e.__esModule?e.default:e;return"string"==typeof r?t:[t,r[1]]}))}},this),Promise.all(a)}function t(e,t){var n=/^(?:babel-preset-)/;return!!(e.availablePresets||{})[n.test(t)?t.replace("babel-preset-",""):t]}function n(e){var t=/^(?:babel-preset-)/;return/\//.test(e)||t.test(e)?e:"babel-preset-"+e}return function(t,n){var r=o.call(this),a=n.env||{},i=[e.call(this,t,n.presets)];for(var s in a)if(r===s){var l=a[s].presets||[];i.push(e.call(this,t,l))}return Promise.all(i).then(function(e){var t=[];return e.forEach(function(e){t=t.concat(e)}),t})}}()}(__global.LoaderPolyfill),function(){function e(e){var t=String(e).replace(/^\s+|\s+$/g,"").match(/^([^:\/?#]+:)?(\/\/(?:[^:@\/?#]*(?::[^:@\/?#]*)?@)?(([^:\/?#]*)(?::(\d*))?))?([^?#]*)(\?[^#]*)?(#[\s\S]*)?/);return t?{href:t[0]||"",protocol:t[1]||"",authority:t[2]||"",host:t[3]||"",hostname:t[4]||"",port:t[5]||"",pathname:t[6]||"",search:t[7]||"",hash:t[8]||""}:null}function t(e){var t=[];return e.replace(/^(\.\.?(\/|$))+/,"").replace(/\/(\.(\/|$))+/g,"/").replace(/\/\.\.$/,"/../").replace(/\/?[^\/]*/g,function(e){"/.."===e?t.pop():t.push(e)}),t.join("").replace(/^\//,"/"===e.charAt(0)?"/":"")}function n(n,r){var a=r,i=n;return o&&(a=a.replace(/\\/g,"/")),a=e(a||""),i=e(i||""),a&&i?(a.protocol||i.protocol)+(a.protocol||a.authority?a.authority:i.authority)+t(a.protocol||a.authority||"/"===a.pathname.charAt(0)?a.pathname:a.pathname?(i.authority&&!i.pathname?"/":"")+i.pathname.slice(0,i.pathname.lastIndexOf("/")+1)+a.pathname:i.pathname)+(a.protocol||a.authority||a.pathname?a.search:a.search||i.search)+a.hash:null}function r(e,t,n){if(void 0===n.getDependants)return i.resolve();var r=n.getDependants(t.name);if(Array.isArray(r)&&r.length){var a=n.StackTrace,o=n.isEnv("production");return i.resolve().then(function(){return o?i.resolve():n.import("@@babel-code-frame")}).then(function(i){var s=n.getModuleLoad(r[0]),l=n.getImportSpecifier(t.name,s)||{line:1,column:0},u="The module ["+n.prettyName(t)+"] couldn't be fetched.\nClicking the link in the stack trace below takes you to the import.\nSee https://stealjs.com/docs/StealJS.error-messages.html#404-not-found for more information.\n",d=e.message+"\n"+u;o||(d+="\n"+i(s.metadata.originalSource||s.source,l.line,l.column)+"\n"),e.message=d;var c=new a(d,[a.item(null,s.address,l.line,l.column)]);e.stack=c.toString()})}return i.resolve()}var a,o="undefined"!=typeof process&&!!process.platform.match(/^win/),i=__global.Promise||require("when/es6-shim/Promise");if("undefined"!=typeof XMLHttpRequest)a=function(e,t,n){function r(){t(o.responseText)}function a(){var t=o.status,r=t+" "+o.statusText+": "+e+"\n"||"XHR error",a=new Error(r);a.url=e,a.statusCode=t,n(a)}var o=new XMLHttpRequest,i=!0,s=!1;if(!("withCredentials"in o)){var l=/^(\w+:)?\/\/([^\/]+)/.exec(e);l&&(i=l[2]===window.location.host,l[1]&&(i&=l[1]===window.location.protocol))}i||"undefined"==typeof XDomainRequest||((o=new XDomainRequest).onload=r,o.onerror=a,o.ontimeout=a,o.onprogress=function(){},o.timeout=0,s=!0),o.onreadystatechange=function(){4===o.readyState&&(200===o.status||0==o.status&&o.responseText?r():a())},o.open("GET",e,!0),s&&setTimeout(function(){o.send()},0),o.send(null)};else if("undefined"!=typeof require){var s,l=/ENOENT/;a=function(e,t,n){if("file:"!=e.substr(0,5))throw"Only file URLs of the form file: allowed running in Node.";s=s||require("fs");var r=e.substr(5);return o&&(r=r.replace(/\//g,"\\")),s.readFile(r,function(r,a){if(r)return l.test(r.message)&&(r.statusCode=404,r.url=e),n(r);t(a+"")})}}else{if("function"!=typeof fetch)throw new TypeError("No environment fetch API available.");a=function(e,t,n){fetch(e).then(function(e){return e.text()}).then(function(e){t(e)}).then(null,function(e){n(e)})}}var u=new(function(e){function t(t){if(e.call(this,t||{}),"undefined"!=typeof location&&location.href){var n=__global.location.href.split("#")[0].split("?")[0];this.baseURL=n.substring(0,n.lastIndexOf("/")+1)}else{if("undefined"==typeof process||!process.cwd)throw new TypeError("No environment baseURL");this.baseURL="file:"+process.cwd()+"/",o&&(this.baseURL=this.baseURL.replace(/\\/g,"/"))}this.paths={"*":"*.js"}}return t.__proto__=null!==e?e:Function.prototype,t.prototype=$__Object$create(null!==e?e.prototype:null),$__Object$defineProperty(t.prototype,"constructor",{value:t}),$__Object$defineProperty(t.prototype,"global",{get:function(){return isBrowser?window:isWorker?self:__global},enumerable:!1}),$__Object$defineProperty(t.prototype,"strict",{get:function(){return!0},enumerable:!1}),$__Object$defineProperty(t.prototype,"normalize",{value:function(e,t,n){if("string"!=typeof e)throw new TypeError("Module name must be a string");var r=e.split("/");if(0==r.length)throw new TypeError("No module name provided");var a=0,o=!1,i=0;if("."==r[0]){if(++a==r.length)throw new TypeError('Illegal module name "'+e+'"');o=!0}else{for(;".."==r[a];)if(++a==r.length)throw new TypeError('Illegal module name "'+e+'"');a&&(o=!0),i=a}for(var s=a;s2)throw new TypeError("Only one wildcard in a path is permitted");if(1==i.length){if(r==o&&o.length>a.length){a=o;break}}else r.substr(0,i[0].length)==i[0]&&r.substr(r.length-i[1].length)==i[1]&&(a=o,t=r.substr(i[0].length,r.length-i[1].length-i[0].length))}var s=this.paths[a];return t&&(s=s.replace("*",t)),isBrowser&&(s=s.replace(/#/g,"%23")),n(this.baseURL,s)},enumerable:!1,writable:!0}),$__Object$defineProperty(t.prototype,"fetch",{value:function(e){var t=this;return new i(function(o,i){a(n(t.baseURL,e.address),function(e){o(e)},function(n){var a=i.bind(null,n);r(n,e,t).then(a,a)})})},enumerable:!1,writable:!0}),t}(__global.LoaderPolyfill));"object"==typeof exports&&(module.exports=u),__global.System=u}()}("undefined"!=typeof window?window:"undefined"!=typeof WorkerGlobalScope?self:global),function(e){e.upgradeSystemLoader=function(){function t(e){var t=String(e).replace(/^\s+|\s+$/g,"").match(/^([^:\/?#]+:)?(\/\/(?:[^:@\/?#]*(?::[^:@\/?#]*)?@)?(([^:\/?#]*)(?::(\d*))?))?([^?#]*)(\?[^#]*)?(#[\s\S]*)?/);return t?{href:t[0]||"",protocol:t[1]||"",authority:t[2]||"",host:t[3]||"",hostname:t[4]||"",port:t[5]||"",pathname:t[6]||"",search:t[7]||"",hash:t[8]||""}:null}function r(e,n){var r=e,a=n;return x&&(a=a.replace(/\\/g,"/")),a=t(a||""),r=t(r||""),a&&r?(a.protocol||r.protocol)+(a.protocol||a.authority?a.authority:r.authority)+function(e){var t=[];return e.replace(/^(\.\.?(\/|$))+/,"").replace(/\/(\.(\/|$))+/g,"/").replace(/\/\.\.$/,"/../").replace(/\/?[^\/]*/g,function(e){"/.."===e?t.pop():t.push(e)}),t.join("").replace(/^\//,"/"===e.charAt(0)?"/":"")}(a.protocol||a.authority||"/"===a.pathname.charAt(0)?a.pathname:a.pathname?(r.authority&&!r.pathname?"/":"")+r.pathname.slice(0,r.pathname.lastIndexOf("/")+1)+a.pathname:r.pathname)+(a.protocol||a.authority||a.pathname?a.search:a.search||r.search)+a.hash:null}function a(t){var n={};if(("object"==typeof t||"function"==typeof t)&&t!==e)if(_)for(var r in t)"default"!==r&&o(n,t,r);else i(n,t);return n.default=t,w(n,"__useDefault",{value:!0}),n}function o(e,t,n){try{var r;(r=Object.getOwnPropertyDescriptor(t,n))&&w(e,n,r)}catch(r){return e[n]=t[n],!1}}function i(e,t,n){var r=t&&t.hasOwnProperty;for(var a in t)r&&!t.hasOwnProperty(a)||n&&a in e||(e[a]=t[a]);return e}function s(e){function t(e,t){t._extensions=[];for(var n=0,r=e.length;n=0;o--){for(var i=r[o],s=0;st.index)return!0;return!1}a.lastIndex=o.lastIndex=i.lastIndex=0;var n,r=[],s={},l=[],u=[];if(e.length/e.split("\n").length<200){for(;n=i.exec(e);)l.push([n.index,n.index+n[0].length]);for(;n=o.exec(e);)t(l,n)||u.push([n.index,n.index+n[0].length])}for(;n=a.exec(e);)if(!t(l,n)&&!t(u,n)){var d=n[1].substr(1,n[1].length-2);if(d.match(/"|'/))continue;r.push(d),s[d]=n.index}return{deps:r,info:s}}function n(e,t){var n=this;return function(r){var a=t[r];return n._getLineAndColumnFromPosition(e.source,a)}}e._extensions.push(f),e._determineFormat=Function.prototype;var r=/(?:^\uFEFF?|[^$_a-zA-Z\xA0-\uFFFF.])(exports\s*(\[['"]|\.)|module(\.exports|\['exports'\]|\["exports"\])\s*(\[['"]|[=,\.])|Object.defineProperty\(\s*module\s*,\s*(?:'|")exports(?:'|"))/,a=/(?:^\uFEFF?|[^$_a-zA-Z\xA0-\uFFFF."'])require\s*\(\s*("[^"\\]*(?:\\.[^"\\]*)*"|'[^'\\]*(?:\\.[^'\\]*)*')\s*\)/g,o=/(^|[^\\])(\/\*([\s\S]*?)\*\/|([^:]|^)\/\/(.*)$)/gm,i=/("[^"\\\n\r]*(\\.[^"\\\n\r]*)*"|'[^'\\\n\r]*(\\.[^'\\\n\r]*)*')/g,s=e.instantiate;e.instantiate=function(o){if(o.metadata.format||(r.lastIndex=0,a.lastIndex=0,(a.exec(o.source)||r.exec(o.source))&&(o.metadata.format="cjs",this._determineFormat(o))),"cjs"==o.metadata.format){var i=t(o.source);o.metadata.deps=o.metadata.deps?o.metadata.deps.concat(i.deps):i.deps,o.metadata.getImportPosition=n.call(this,o,i.info),o.metadata.executingRequire=!0,o.metadata.execute=function(t,n,r){var a=(o.address||"").split("/");a.pop(),a=a.join("/"),b._nodeRequire&&(a=a.substr(5));e.global._g={global:e.global,exports:n,module:r,require:t,__filename:b._nodeRequire?o.address.substr(5):o.address,__dirname:a};var i=e.global.define;e.global.define=void 0;var s={name:o.name,source:"(function() {\n(function(global, exports, module, require, __filename, __dirname){\n"+o.source+"\n}).call(_g.exports, _g.global, _g.exports, _g.module, _g.require, _g.__filename, _g.__dirname);})();",address:o.address};e.__exec(s),e.global.define=i,e.global._g=void 0}}return s.call(this,o)}}function p(e){function t(e,t){var n=[],r=(e.match(f)[1].split(",")[t]||"require").replace(m,""),a=h[r]||(h[r]=new RegExp("/\\*|//|\"|'|`|(?:^|\\breturn\\b|[([=,;:?><&|^*%~+-])\\s*(?=/)|\\b"+r+"(?=\\s*\\()","g"));a.lastIndex=0,v[r]=v.require;for(var o,i,s,l;o=a.exec(e);)i=o[0],(s=v[i])||(s=v[i="/regexp/"]),s.lastIndex=a.lastIndex,(l=s.exec(e))&&l.index===a.lastIndex&&(a.lastIndex=s.lastIndex,s===v.require&&l[2]&&n.push(l[2]));return n}function n(e,t,r,a){var o=this;if("object"==typeof e&&!(e instanceof Array))return n.apply(null,Array.prototype.splice.call(arguments,1,arguments.length-1));if(!(e instanceof Array)){if("string"==typeof e){var i=o.get(e);return i.__useDefault?i.default:i}throw new TypeError("Invalid require")}Promise.all(e.map(function(e){return o.import(e,a)})).then(function(e){t&&t.apply(null,e)},r)}function r(e,t,r){return function(a,o,i){return"string"==typeof a?t(a):n.call(r,a,o,i,{name:e})}}function a(e){function n(n,a,o){var i=n,s=a,l=o,u=!1;"string"!=typeof i&&(l=s,s=i,i=null),s instanceof Array||(l=s,s=["require","exports","module"]),"function"!=typeof l&&(l=function(e){return function(){return e}}(l)),void 0===s[s.length-1]&&s.pop();var d,f,p;if(-1!=(d=y.call(s,"require"))){s.splice(d,1);var m=l.toString();s=s.concat(t(m,d))}-1!=(f=y.call(s,"exports"))&&(s.splice(f,1),m||(m=l.toString(),u=g.test(m))),-1!=(p=y.call(s,"module"))&&s.splice(p,1);var h={deps:s,execute:function(t,n,a){for(var o=[],i=0;i=0;a--)e.source=e.source.substr(0,r[a].start)+r[a].postLocate(t[a])+e.source.substr(r[a].end,e.source.length);return o.call(n,e)})}}),x(function(e){e._contextualModules={},e.setContextual=function(e,t){this._contextualModules[e]=t};var t=e.normalize;e.normalize=function(e,n){var r=this,a=r.pluginLoader||r;if(n){var o=this._contextualModules[e];if(o){var i=e+"/"+n;return r.has(i)?Promise.resolve(i):("string"==typeof o&&(o=a.import(o)),Promise.resolve(o).then(function(e){var t=e;return t.default&&(t=t.default),Promise.resolve(t.call(r,n))}).then(function(e){return r.set(i,r.newModule(e)),i}))}}return t.apply(this,arguments)}}),x(function(e){function t(){document.removeEventListener("DOMContentLoaded",t,!1),window.removeEventListener("load",t,!1),n()}function n(){for(var t=document.getElementsByTagName("script"),n=0;n0)return n;var i=o(t.map(r));if(i.length>0)return i;throw new Error("Unknown stack format: "+e)}function r(e){var t=e.match(l);if(!t)return null;var n=t[1]||"";return{method:n,fnName:n,url:t[2]||"",line:parseInt(t[3])||0,column:parseInt(t[4])||0}}function a(e){var t=e.match(u)||e.match(d);if(!t)return null;var n=t[3].match(c);if(!n)return null;var r=t[2]||"";return t[1]&&(r="eval at "+r),{method:r,fnName:r,url:n[1]||"",line:parseInt(n[2])||0,column:parseInt(n[3])||0}}function o(e){var t=[];return e.forEach(function(e){e&&t.push(e)}),t}function i(e){var t=/at position ([0-9]+)/.exec(e);if(t&&t.length>1)return Number(t[1])}function s(e,t){for(var n=0;nt.index)return!0;return!1}function n(e){for(;a=e.exec(r);)if(!t(i,a)){var n=a[1];o.push(n)}}var r=e.replace(c,"");u.lastIndex=c.lastIndex=d.lastIndex=f.lastIndex=0;var a,o=[],i=[];if(e.length/e.split("\n").length<200)for(;a=f.exec(r);)i.push([a.index,a.index+a[0].length]);return n(u),n(d),o}t._extensions&&t._extensions.push(e),t._traceData={loads:{},parentMap:{}},t.getDependencies=function(e){var t=this.getModuleLoad(e);return t?t.metadata.dependencies:void 0},t.getDependants=function(e){var t=[];return n(this._traceData.parentMap[e]||{},function(e){t.push(e)}),t},t.getModuleLoad=function(e){return this._traceData.loads[e]},t.getBundles=function(e,t){var r=t||{};r[e]=!0;var a=this,o=a._traceData.parentMap[e];if(!o)return[e];var i=[];return n(o,function(e,t){r[e]||(i=i.concat(a.getBundles(e,r)))}),i},t.getImportSpecifier=function(e,t){for(var n,r=0;r-1||o.indexOf("steal-sans-promises.production")>-1&&!n.env)&&this.config({env:s+"-production"}),(this.isEnv("production")||this.loadBundles)&&D.call(this),A.stealPath.set.call(this,i,n)}},devBundle:{order:16,set:function(e,t){var n=!0===e?"dev-bundle":e;n&&(this.devBundle=n)}},depsBundle:{order:17,set:function(e,t){var n=!0===e?"dev-bundle":e;n&&(this.depsBundle=n)}}};n(A,function(e,t){e.order?F.splice(e.order,0,t):F.push(t)}),function(e,t,r){var a=e.config;e.config=function(i){var s=o({},i);n(t,function(t){var n=r[t];if(n.set&&s[t]){var a=n.set.call(e,s[t],i);void 0!==a&&(e[t]=a),delete s[t]}}),a.call(this,s)}}(e,F,A),O.config=function(e){if("string"==typeof e)return this.loader[e];this.loader.config(e)},x(function(e){e.getEnv=function(){return(this.env||"").split("-")[1]||this.env},e.getPlatform=function(){var e=(this.env||"").split("-");return 2===e.length?e[0]:void 0},e.isEnv=function(e){return this.getEnv()===e},e.isPlatform=function(e){return this.getPlatform()===e}});var q=function(e){var n={},r=/Url$/,a=e.split("?"),o=a.shift(),i=a.join("?").split("&"),s=o.split("/");s.pop(),s.join("/");if(i.length&&i[0].length)for(var l,u=0;u1){var c=t(d[0]);n[c=c.replace(r,"URL")]=d.slice(1).join("=")}}return n},B=function(e){var r={},a=/Url$/;r.stealURL=e.src,n(e.attributes,function(e){var n=e.nodeName||e.name,o=t(0===n.indexOf("data-")?n.replace("data-",""):n);o=o.replace(a,"URL"),r[o]=""===e.value||e.value});var i=e.innerHTML;return/\S/.test(i)&&(r.mainSource=i),o(q(e.src),r)},U=function(){var e=this;return new Promise(function(t,n){if(p)t(o({stealURL:location.href},q(location.href)));else if(m||h||v){if(document.currentScript)return e.script=document.currentScript,void t(B(document.currentScript));var r=document.scripts;if(r.length){var a=r[r.length-1];e.script=a,t(B(a))}}else t({stealPath:__dirname})})};return O.startup=function(e){var t,n,a=this,i=this.loader;return w=new Promise(function(e,r){t=e,n=r}),S=U.call(this).then(function(s){function l(e){if(404===e.statusCode&&a.script){var t="This page has "+((i.devBundle?"dev-":"deps-")+"bundle")+" enabled but "+e.url+" could not be retrieved.\nDid you forget to generate the bundle first?\nSee https://stealjs.com/docs/StealJS.development-bundles.html for more information.",n=new Error(t);return n.stack=null,Promise.reject(n)}return Promise.reject(e)}var u;return u="object"==typeof e?o(e,s):s,i.config(u),N.call(i),i.loadBundles?(i.main||!i.isEnv("production")||i.stealBundled||b("Attribute 'main' is required in production environment. Please add it to the script tag."),i.import(i.configMain).then(t,n),w.then(function(e){return N.call(i),i._configLoaded=!0,i.main?i.import(i.main):e})):(i.import(i.devBundle).then(function(){return i.import(i.configMain)},l).then(function(){return i.import(i.depsBundle).then(null,l)}).then(t,n),(j=w.then(function(){return N.call(i),T.call(i),i._configLoaded=!0,u&&i.config(u),i.import("@dev")})).then(function(){if(!i.main||i.localLoader)return w;var e=i.main;return"string"==typeof e&&(e=[e]),Promise.all(r(e,function(e){return i.import(e)}))}))}).then(function(e){return i.mainSource?i.module(i.mainSource):(i.loadScriptModules(),e)})},O.done=function(){return S},O.import=function(){var e=arguments,t=this.System;return w||(t.main||(t.main="@empty"),O.startup()),w.then(function(){var r=[];return n(e,function(e){r.push(t.import(e))}),r.length>1?Promise.all(r):r[0]})},O.setContextual=c.call(e.setContextual,e),O.isEnv=c.call(e.isEnv,e),O.isPlatform=c.call(e.isPlatform,e),O};if(!g||h||v){var S=e.steal;e.steal=j(System),e.steal.startup(S&&"object"==typeof S&&S).then(null,function(e){if("undefined"!=typeof console){var t=console;t[t.error?"error":"log"](e)}}),e.steal.clone=w}else e.steal=j(System),e.steal.System=System,e.steal.dev=require("./ext/dev.js"),steal.clone=w,module.exports=e.steal}("undefined"==typeof window?"undefined"==typeof global?this:global:window); \ No newline at end of file +!function(__global){function __eval(__source,__global,__load){try{eval('(function() { var __moduleName = "'+(__load.name||"").replace('"','"')+'"; '+__source+" \n }).call(__global);")}catch(e){throw"SyntaxError"!=e.name&&"TypeError"!=e.name||(e.message="Evaluating "+(__load.name||load.address)+"\n\t"+e.message),e}}var isWorker="undefined"!=typeof self&&"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope,isBrowser="undefined"!=typeof window&&!isWorker;__global.$__Object$getPrototypeOf=Object.getPrototypeOf||function(e){return e.__proto__};var $__Object$defineProperty;!function(){try{Object.defineProperty({},"a",{})&&($__Object$defineProperty=Object.defineProperty)}catch(e){$__Object$defineProperty=function(e,t,n){try{e[t]=n.value||n.get.call(e)}catch(e){}}}}(),__global.$__Object$create=Object.create||function(e,t){function n(){}if(n.prototype=e,"object"==typeof t)for(prop in t)t.hasOwnProperty(prop)&&(n[prop]=t[prop]);return new n},function(){function e(e){return{status:"loading",name:e,linkSets:[],dependencies:[],metadata:{}}}function t(e,t,n){return new L(i({step:n.address?"fetch":"locate",loader:e,moduleName:t,moduleMetadata:n&&n.metadata||{},moduleSource:n.source,moduleAddress:n.address}))}function n(t,n,a,o){return new L(function(e,r){e(t.loaderObj.normalize(n,a,o))}).then(function(n){var a;if(t.modules[n])return a=e(n),a.status="linked",a.module=t.modules[n],a;for(var o=0,i=t.loads.length;o",t.isDeclarative=!0,e.loaderObj.transpile(t).then(function(e){var n=__global.System,r=n.register;n.register=function(e,n,r){var a=r,o=n;"string"!=typeof e&&(a=o,o=e),t.declare=a,t.depsList=o},__eval(e,__global,t),n.register=r});if("object"!=typeof n)throw TypeError("Invalid instantiate return value");t.depsList=n.deps||[],t.execute=n.execute,t.isDeclarative=!1}}).then(function(){if("loading"==t.status){t.dependencies=[];for(var r=t.depsList,a=[],o=0,i=r.length;o0)){var n=e.startingLoad;if(!1===e.loader.loaderObj.execute){for(var r=[].concat(e.loads),a=0,o=r.length;a=0;i--){for(var s=r[i],l=0;l=0;r-=1){var a=n[r];-1===t.indexOf(a)&&t.unshift(a)}else t=["es2015-no-commonjs","react","stage-0"];return t}function d(e){return(e.version?+e.version.split(".")[0]:6)||6}function c(e,t){var n=this.babelOptions||{};return n.sourceMap="inline",n.filename=e.address,n.code=!0,n.ast=!1,d(t)>=6?(delete n.optional,delete n.whitelist,delete n.blacklist,n.presets=u(n.presets),n.plugins=l(n.plugins)):(n.modules="system",n.blacklist||(n.blacklist=["react"])),n}function f(e){var t=e.types;return{visitor:{Program:function(e,n){e.unshiftContainer("body",[t.exportNamedDeclaration(null,[t.exportSpecifier(t.identifier("true"),t.identifier("__esModule"))])])}}}}function p(e){return e.metadata.importSpecifiers=Object.create(null),function(t){t.types;return{visitor:{ImportDeclaration:function(t,n){var r=t.node,a=r.source.value,o=r.source.loc;e.metadata.importSpecifiers[a]=o}}}}}function m(e,t){var n=t.Babel||t.babel||t,r=d(n),a=c.call(this,e,n),o=this;return Promise.all([g.call(this,n,a),b.call(this,n,a)]).then(function(t){r>=6&&(a.plugins=[p(e),f].concat(t[0]),a.presets=t[1]);try{return n.transform(e.source,a).code+"\n//# sourceURL="+e.address+"!eval"}catch(t){if(t instanceof SyntaxError){var i=new SyntaxError(t.message),s=new o.StackTrace(t.message,[o.StackTrace.item("",e.address,t.loc.line,t.loc.column)]);return i.stack=s.toString(),Promise.reject(i)}return Promise.reject(t)}})}var h=__global,v="undefined"==typeof self&&"undefined"!=typeof process&&"[object process]"==={}.toString.call(process);e.prototype.transpiler="babel",e.prototype.transpile=function(e){var n=this;return n.transpilerHasRun||(h.traceur&&!n.has("traceur")&&n.set("traceur",t(n,"traceur")),h.Babel&&!n.has("babel")&&n.set("babel",t(n,"Babel")),n.transpilerHasRun=!0),n.import(n.transpiler).then(function(t){var a=t;return a.__useDefault&&(a=a.default),(a.Compiler?r:m).call(n,e,a)}).then(function(t){return'var __moduleAddress = "'+e.address+'";'+t})},e.prototype.instantiate=function(e){var r=this;return Promise.resolve(r.normalize(r.transpiler)).then(function(a){if(e.name===a)return{deps:[],execute:function(){var a=h.System,o=h.Reflect.Loader;return __eval("(function(require,exports,module){"+e.source+"})();",h,e),h.System=a,h.Reflect.Loader=o,t(r,n(e.name))}}})};var g=function(){function e(e,r){var a=[];return(r||[]).forEach(function(r){var o=i(r);if(!s(r)||t(e,o))a.push(r);else if(!t(e,o)){var l=this.configMain||"package.json!npm",u=n(o);a.push(this.import(u,{name:l}).then(function(e){var t=e.__esModule?e.default:e;return"string"==typeof r?t:[t,r[1]]}))}},this),Promise.all(a)}function t(e,t){var n=/^(?:babel-plugin-)/;return!!(e.availablePlugins||{})[n.test(t)?t.replace("babel-plugin-",""):t]}function n(e){var t=/^(?:babel-plugin-)/;return/\//.test(e)||t.test(e)?e:"babel-plugin-"+e}return function(t,n){var r=o.call(this),a=n.env||{},i=[e.call(this,t,n.plugins)];for(var s in a)if(r===s){var l=a[s].plugins||[];i.push(e.call(this,t,l))}return Promise.all(i).then(function(e){var t=[];return e.forEach(function(e){t=t.concat(e)}),t})}}(),b=function(){function e(e,r){var a=[];return(r||[]).forEach(function(r){var o=i(r);if(!s(r)||t(e,o))a.push(r);else if(!t(e,o)){var l=this.configMain||"package.json!npm",u=n(o);a.push(this.import(u,{name:l}).then(function(e){var t=e.__esModule?e.default:e;return"string"==typeof r?t:[t,r[1]]}))}},this),Promise.all(a)}function t(e,t){var n=/^(?:babel-preset-)/;return!!(e.availablePresets||{})[n.test(t)?t.replace("babel-preset-",""):t]}function n(e){var t=/^(?:babel-preset-)/;return/\//.test(e)||t.test(e)?e:"babel-preset-"+e}return function(t,n){var r=o.call(this),a=n.env||{},i=[e.call(this,t,n.presets)];for(var s in a)if(r===s){var l=a[s].presets||[];i.push(e.call(this,t,l))}return Promise.all(i).then(function(e){var t=[];return e.forEach(function(e){t=t.concat(e)}),t})}}()}(__global.LoaderPolyfill),function(){function e(e){var t=String(e).replace(/^\s+|\s+$/g,"").match(/^([^:\/?#]+:)?(\/\/(?:[^:@\/?#]*(?::[^:@\/?#]*)?@)?(([^:\/?#]*)(?::(\d*))?))?([^?#]*)(\?[^#]*)?(#[\s\S]*)?/);return t?{href:t[0]||"",protocol:t[1]||"",authority:t[2]||"",host:t[3]||"",hostname:t[4]||"",port:t[5]||"",pathname:t[6]||"",search:t[7]||"",hash:t[8]||""}:null}function t(e){var t=[];return e.replace(/^(\.\.?(\/|$))+/,"").replace(/\/(\.(\/|$))+/g,"/").replace(/\/\.\.$/,"/../").replace(/\/?[^\/]*/g,function(e){"/.."===e?t.pop():t.push(e)}),t.join("").replace(/^\//,"/"===e.charAt(0)?"/":"")}function n(n,r){var a=r,i=n;return o&&(a=a.replace(/\\/g,"/")),a=e(a||""),i=e(i||""),a&&i?(a.protocol||i.protocol)+(a.protocol||a.authority?a.authority:i.authority)+t(a.protocol||a.authority||"/"===a.pathname.charAt(0)?a.pathname:a.pathname?(i.authority&&!i.pathname?"/":"")+i.pathname.slice(0,i.pathname.lastIndexOf("/")+1)+a.pathname:i.pathname)+(a.protocol||a.authority||a.pathname?a.search:a.search||i.search)+a.hash:null}function r(e,t,n){if(void 0===n.getDependants)return i.resolve();var r=n.getDependants(t.name);if(Array.isArray(r)&&r.length){var a=n.StackTrace,o=n.isEnv("production");return i.resolve().then(function(){return o?i.resolve():n.import("@@babel-code-frame")}).then(function(i){var s=n.getModuleLoad(r[0]),l=n.getImportSpecifier(t.name,s)||{line:1,column:0},u="The module ["+n.prettyName(t)+"] couldn't be fetched.\nClicking the link in the stack trace below takes you to the import.\nSee https://stealjs.com/docs/StealJS.error-messages.html#404-not-found for more information.\n",d=e.message+"\n"+u;o||(d+="\n"+i(s.metadata.originalSource||s.source,l.line,l.column)+"\n"),e.message=d;var c=new a(d,[a.item(null,s.address,l.line,l.column)]);e.stack=c.toString()})}return i.resolve()}var a,o="undefined"!=typeof process&&!!process.platform.match(/^win/),i=__global.Promise||require("when/es6-shim/Promise");if("undefined"!=typeof XMLHttpRequest)a=function(e,t,n){function r(){t(o.responseText)}function a(){var t=o.status,r=t+" "+o.statusText+": "+e+"\n"||"XHR error",a=new Error(r);a.url=e,a.statusCode=t,n(a)}var o=new XMLHttpRequest,i=!0,s=!1;if(!("withCredentials"in o)){var l=/^(\w+:)?\/\/([^\/]+)/.exec(e);l&&(i=l[2]===window.location.host,l[1]&&(i&=l[1]===window.location.protocol))}i||"undefined"==typeof XDomainRequest||((o=new XDomainRequest).onload=r,o.onerror=a,o.ontimeout=a,o.onprogress=function(){},o.timeout=0,s=!0),o.onreadystatechange=function(){4===o.readyState&&(200===o.status||0==o.status&&o.responseText?r():a())},o.open("GET",e,!0),s&&setTimeout(function(){o.send()},0),o.send(null)};else if("undefined"!=typeof require){var s,l=/ENOENT/;a=function(e,t,n){if("file:"!=e.substr(0,5))throw"Only file URLs of the form file: allowed running in Node.";s=s||require("fs");var r=e.substr(5);return o&&(r=r.replace(/\//g,"\\")),s.readFile(r,function(r,a){if(r)return l.test(r.message)&&(r.statusCode=404,r.url=e),n(r);t(a+"")})}}else{if("function"!=typeof fetch)throw new TypeError("No environment fetch API available.");a=function(e,t,n){fetch(e).then(function(e){return e.text()}).then(function(e){t(e)}).then(null,function(e){n(e)})}}var u=new(function(e){function t(t){if(e.call(this,t||{}),"undefined"!=typeof location&&location.href){var n=__global.location.href.split("#")[0].split("?")[0];this.baseURL=n.substring(0,n.lastIndexOf("/")+1)}else{if("undefined"==typeof process||!process.cwd)throw new TypeError("No environment baseURL");this.baseURL="file:"+process.cwd()+"/",o&&(this.baseURL=this.baseURL.replace(/\\/g,"/"))}this.paths={"*":"*.js"}}return t.__proto__=null!==e?e:Function.prototype,t.prototype=$__Object$create(null!==e?e.prototype:null),$__Object$defineProperty(t.prototype,"constructor",{value:t}),$__Object$defineProperty(t.prototype,"global",{get:function(){return isBrowser?window:isWorker?self:__global},enumerable:!1}),$__Object$defineProperty(t.prototype,"strict",{get:function(){return!0},enumerable:!1}),$__Object$defineProperty(t.prototype,"normalize",{value:function(e,t,n){if("string"!=typeof e)throw new TypeError("Module name must be a string");var r=e.split("/");if(0==r.length)throw new TypeError("No module name provided");var a=0,o=!1,i=0;if("."==r[0]){if(++a==r.length)throw new TypeError('Illegal module name "'+e+'"');o=!0}else{for(;".."==r[a];)if(++a==r.length)throw new TypeError('Illegal module name "'+e+'"');a&&(o=!0),i=a}for(var s=a;s2)throw new TypeError("Only one wildcard in a path is permitted");if(1==i.length){if(r==o&&o.length>a.length){a=o;break}}else r.substr(0,i[0].length)==i[0]&&r.substr(r.length-i[1].length)==i[1]&&(a=o,t=r.substr(i[0].length,r.length-i[1].length-i[0].length))}var s=this.paths[a];return t&&(s=s.replace("*",t)),isBrowser&&(s=s.replace(/#/g,"%23")),n(this.baseURL,s)},enumerable:!1,writable:!0}),$__Object$defineProperty(t.prototype,"fetch",{value:function(e){var t=this;return new i(function(o,i){a(n(t.baseURL,e.address),function(e){o(e)},function(n){var a=i.bind(null,n);r(n,e,t).then(a,a)})})},enumerable:!1,writable:!0}),t}(__global.LoaderPolyfill));"object"==typeof exports&&(module.exports=u),__global.System=u}()}("undefined"!=typeof window?window:"undefined"!=typeof WorkerGlobalScope?self:global),function(e){e.upgradeSystemLoader=function(){function t(e){var t=String(e).replace(/^\s+|\s+$/g,"").match(/^([^:\/?#]+:)?(\/\/(?:[^:@\/?#]*(?::[^:@\/?#]*)?@)?(([^:\/?#]*)(?::(\d*))?))?([^?#]*)(\?[^#]*)?(#[\s\S]*)?/);return t?{href:t[0]||"",protocol:t[1]||"",authority:t[2]||"",host:t[3]||"",hostname:t[4]||"",port:t[5]||"",pathname:t[6]||"",search:t[7]||"",hash:t[8]||""}:null}function r(e,n){var r=e,a=n;return x&&(a=a.replace(/\\/g,"/")),a=t(a||""),r=t(r||""),a&&r?(a.protocol||r.protocol)+(a.protocol||a.authority?a.authority:r.authority)+function(e){var t=[];return e.replace(/^(\.\.?(\/|$))+/,"").replace(/\/(\.(\/|$))+/g,"/").replace(/\/\.\.$/,"/../").replace(/\/?[^\/]*/g,function(e){"/.."===e?t.pop():t.push(e)}),t.join("").replace(/^\//,"/"===e.charAt(0)?"/":"")}(a.protocol||a.authority||"/"===a.pathname.charAt(0)?a.pathname:a.pathname?(r.authority&&!r.pathname?"/":"")+r.pathname.slice(0,r.pathname.lastIndexOf("/")+1)+a.pathname:r.pathname)+(a.protocol||a.authority||a.pathname?a.search:a.search||r.search)+a.hash:null}function a(t){var n={};if(("object"==typeof t||"function"==typeof t)&&t!==e)if(_)for(var r in t)"default"!==r&&o(n,t,r);else i(n,t);return n.default=t,w(n,"__useDefault",{value:!0}),n}function o(e,t,n){try{var r;(r=Object.getOwnPropertyDescriptor(t,n))&&w(e,n,r)}catch(r){return e[n]=t[n],!1}}function i(e,t,n){var r=t&&t.hasOwnProperty;for(var a in t)r&&!t.hasOwnProperty(a)||n&&a in e||(e[a]=t[a]);return e}function s(e){function t(e,t){t._extensions=[];for(var n=0,r=e.length;n=0;o--){for(var i=r[o],s=0;st.index)return!0;return!1}a.lastIndex=o.lastIndex=i.lastIndex=0;var n,r=[],s={},l=[],u=[];if(e.length/e.split("\n").length<200){for(;n=i.exec(e);)l.push([n.index,n.index+n[0].length]);for(;n=o.exec(e);)t(l,n)||u.push([n.index,n.index+n[0].length])}for(;n=a.exec(e);)if(!t(l,n)&&!t(u,n)){var d=n[1].substr(1,n[1].length-2);if(d.match(/"|'/))continue;r.push(d),s[d]=n.index}return{deps:r,info:s}}function n(e,t){var n=this;return function(r){var a=t[r];return n._getLineAndColumnFromPosition(e.source,a)}}e._extensions.push(f),e._determineFormat=Function.prototype;var r=/(?:^\uFEFF?|[^$_a-zA-Z\xA0-\uFFFF.])(exports\s*(\[['"]|\.)|module(\.exports|\['exports'\]|\["exports"\])\s*(\[['"]|[=,\.])|Object.defineProperty\(\s*module\s*,\s*(?:'|")exports(?:'|"))/,a=/(?:^\uFEFF?|[^$_a-zA-Z\xA0-\uFFFF."'])require\s*\(\s*("[^"\\]*(?:\\.[^"\\]*)*"|'[^'\\]*(?:\\.[^'\\]*)*')\s*\)/g,o=/(^|[^\\])(\/\*([\s\S]*?)\*\/|([^:]|^)\/\/(.*)$)/gm,i=/("[^"\\\n\r]*(\\.[^"\\\n\r]*)*"|'[^'\\\n\r]*(\\.[^'\\\n\r]*)*')/g,s=e.instantiate;e.instantiate=function(o){if(o.metadata.format||(r.lastIndex=0,a.lastIndex=0,(a.exec(o.source)||r.exec(o.source))&&(o.metadata.format="cjs",this._determineFormat(o))),"cjs"==o.metadata.format){var i=t(o.source);o.metadata.deps=o.metadata.deps?o.metadata.deps.concat(i.deps):i.deps,o.metadata.getImportPosition=n.call(this,o,i.info),o.metadata.executingRequire=!0,o.metadata.execute=function(t,n,r){var a=(o.address||"").split("/");a.pop(),a=a.join("/"),b._nodeRequire&&(a=a.substr(5));e.global._g={global:e.global,exports:n,module:r,require:t,__filename:b._nodeRequire?o.address.substr(5):o.address,__dirname:a};var i=e.global.define;e.global.define=void 0;var s={name:o.name,source:"(function() {\n(function(global, exports, module, require, __filename, __dirname){\n"+o.source+"\n}).call(_g.exports, _g.global, _g.exports, _g.module, _g.require, _g.__filename, _g.__dirname);})();",address:o.address};try{e.__exec(s)}catch(t){throw e.StackTrace&&(e.StackTrace.parse(t)||(t.stack=new e.StackTrace(t.message,[e.StackTrace.item("",o.address,1,0)]).toString())),t}e.global.define=i,e.global._g=void 0}}return s.call(this,o)}}function p(e){function t(e,t){var n=[],r=(e.match(f)[1].split(",")[t]||"require").replace(m,""),a=h[r]||(h[r]=new RegExp("/\\*|//|\"|'|`|(?:^|\\breturn\\b|[([=,;:?><&|^*%~+-])\\s*(?=/)|\\b"+r+"(?=\\s*\\()","g"));a.lastIndex=0,v[r]=v.require;for(var o,i,s,l;o=a.exec(e);)i=o[0],(s=v[i])||(s=v[i="/regexp/"]),s.lastIndex=a.lastIndex,(l=s.exec(e))&&l.index===a.lastIndex&&(a.lastIndex=s.lastIndex,s===v.require&&l[2]&&n.push(l[2]));return n}function n(e,t,r,a){var o=this;if("object"==typeof e&&!(e instanceof Array))return n.apply(null,Array.prototype.splice.call(arguments,1,arguments.length-1));if(!(e instanceof Array)){if("string"==typeof e){var i=o.get(e);return i.__useDefault?i.default:i}throw new TypeError("Invalid require")}Promise.all(e.map(function(e){return o.import(e,a)})).then(function(e){t&&t.apply(null,e)},r)}function r(e,t,r){return function(a,o,i){return"string"==typeof a?t(a):n.call(r,a,o,i,{name:e})}}function a(e){function n(n,a,o){var i=n,s=a,l=o,u=!1;"string"!=typeof i&&(l=s,s=i,i=null),s instanceof Array||(l=s,s=["require","exports","module"]),"function"!=typeof l&&(l=function(e){return function(){return e}}(l)),void 0===s[s.length-1]&&s.pop();var d,f,p;if(-1!=(d=y.call(s,"require"))){s.splice(d,1);var m=l.toString();s=s.concat(t(m,d))}-1!=(f=y.call(s,"exports"))&&(s.splice(f,1),m||(m=l.toString(),u=g.test(m))),-1!=(p=y.call(s,"module"))&&s.splice(p,1);var h={deps:s,execute:function(t,n,a){for(var o=[],i=0;i=0;a--)e.source=e.source.substr(0,r[a].start)+r[a].postLocate(t[a])+e.source.substr(r[a].end,e.source.length);return o.call(n,e)})}}),x(function(e){e._contextualModules={},e.setContextual=function(e,t){this._contextualModules[e]=t};var t=e.normalize;e.normalize=function(e,n){var r=this,a=r.pluginLoader||r;if(n){var o=this._contextualModules[e];if(o){var i=e+"/"+n;return r.has(i)?Promise.resolve(i):("string"==typeof o&&(o=a.import(o)),Promise.resolve(o).then(function(e){var t=e;return t.default&&(t=t.default),Promise.resolve(t.call(r,n))}).then(function(e){return r.set(i,r.newModule(e)),i}))}}return t.apply(this,arguments)}}),x(function(e){function t(){document.removeEventListener("DOMContentLoaded",t,!1),window.removeEventListener("load",t,!1),n()}function n(){for(var t=document.getElementsByTagName("script"),n=0;n0)return n;var i=o(t.map(r));if(i.length>0)return i;throw new Error("Unknown stack format: "+e)}function r(e){var t=e.match(l);if(!t)return null;var n=t[1]||"";return{method:n,fnName:n,url:t[2]||"",line:parseInt(t[3])||0,column:parseInt(t[4])||0}}function a(e){var t=e.match(u)||e.match(d);if(!t)return null;var n=t[3].match(c);if(!n)return null;var r=t[2]||"";return t[1]&&(r="eval at "+r),{method:r,fnName:r,url:n[1]||"",line:parseInt(n[2])||0,column:parseInt(n[3])||0}}function o(e){var t=[];return e.forEach(function(e){e&&t.push(e)}),t}function i(e){var t=/at position ([0-9]+)/.exec(e);if(t&&t.length>1)return Number(t[1])}function s(e,t){for(var n=0;nt.index)return!0;return!1}function n(e){for(;a=e.exec(r);)if(!t(i,a)){var n=a[1];o.push(n)}}var r=e.replace(c,"");u.lastIndex=c.lastIndex=d.lastIndex=f.lastIndex=0;var a,o=[],i=[];if(e.length/e.split("\n").length<200)for(;a=f.exec(r);)i.push([a.index,a.index+a[0].length]);return n(u),n(d),o}t._extensions&&t._extensions.push(e),t._traceData={loads:{},parentMap:{}},t.getDependencies=function(e){var t=this.getModuleLoad(e);return t?t.metadata.dependencies:void 0},t.getDependants=function(e){var t=[];return n(this._traceData.parentMap[e]||{},function(e){t.push(e)}),t},t.getModuleLoad=function(e){return this._traceData.loads[e]},t.getBundles=function(e,t){var r=t||{};r[e]=!0;var a=this,o=a._traceData.parentMap[e];if(!o)return[e];var i=[];return n(o,function(e,t){r[e]||(i=i.concat(a.getBundles(e,r)))}),i},t.getImportSpecifier=function(e,t){for(var n,r=0;r-1||o.indexOf("steal-sans-promises.production")>-1&&!n.env)&&this.config({env:s+"-production"}),(this.isEnv("production")||this.loadBundles)&&D.call(this),A.stealPath.set.call(this,i,n)}},devBundle:{order:16,set:function(e,t){var n=!0===e?"dev-bundle":e;n&&(this.devBundle=n)}},depsBundle:{order:17,set:function(e,t){var n=!0===e?"dev-bundle":e;n&&(this.depsBundle=n)}}};n(A,function(e,t){e.order?F.splice(e.order,0,t):F.push(t)}),function(e,t,r){var a=e.config;e.config=function(i){var s=o({},i);n(t,function(t){var n=r[t];if(n.set&&s[t]){var a=n.set.call(e,s[t],i);void 0!==a&&(e[t]=a),delete s[t]}}),a.call(this,s)}}(e,F,A),O.config=function(e){if("string"==typeof e)return this.loader[e];this.loader.config(e)},x(function(e){e.getEnv=function(){return(this.env||"").split("-")[1]||this.env},e.getPlatform=function(){var e=(this.env||"").split("-");return 2===e.length?e[0]:void 0},e.isEnv=function(e){return this.getEnv()===e},e.isPlatform=function(e){return this.getPlatform()===e}});var q=function(e){var n={},r=/Url$/,a=e.split("?"),o=a.shift(),i=a.join("?").split("&"),s=o.split("/");s.pop(),s.join("/");if(i.length&&i[0].length)for(var l,u=0;u1){var c=t(d[0]);n[c=c.replace(r,"URL")]=d.slice(1).join("=")}}return n},B=function(e){var r={},a=/Url$/;r.stealURL=e.src,n(e.attributes,function(e){var n=e.nodeName||e.name,o=t(0===n.indexOf("data-")?n.replace("data-",""):n);o=o.replace(a,"URL"),r[o]=""===e.value||e.value});var i=e.innerHTML;return/\S/.test(i)&&(r.mainSource=i),o(q(e.src),r)},U=function(){var e=this;return new Promise(function(t,n){if(p)t(o({stealURL:location.href},q(location.href)));else if(m||h||v){if(document.currentScript)return e.script=document.currentScript,void t(B(document.currentScript));var r=document.scripts;if(r.length){var a=r[r.length-1];e.script=a,t(B(a))}}else t({stealPath:__dirname})})};return O.startup=function(e){var t,n,a=this,i=this.loader;return w=new Promise(function(e,r){t=e,n=r}),S=U.call(this).then(function(s){function l(e){if(404===e.statusCode&&a.script){var t="This page has "+((i.devBundle?"dev-":"deps-")+"bundle")+" enabled but "+e.url+" could not be retrieved.\nDid you forget to generate the bundle first?\nSee https://stealjs.com/docs/StealJS.development-bundles.html for more information.",n=new Error(t);return n.stack=null,Promise.reject(n)}return Promise.reject(e)}var u;return u="object"==typeof e?o(e,s):s,i.config(u),T.call(i),i.loadBundles?(i.main||!i.isEnv("production")||i.stealBundled||b("Attribute 'main' is required in production environment. Please add it to the script tag."),i.import(i.configMain).then(t,n),w.then(function(e){return T.call(i),i._configLoaded=!0,i.main?i.import(i.main):e})):(i.import(i.devBundle).then(function(){return i.import(i.configMain)},l).then(function(){return i.import(i.depsBundle).then(null,l)}).then(t,n),(j=w.then(function(){return T.call(i),N.call(i),i._configLoaded=!0,u&&i.config(u),i.import("@dev")})).then(function(){if(!i.main||i.localLoader)return w;var e=i.main;return"string"==typeof e&&(e=[e]),Promise.all(r(e,function(e){return i.import(e)}))}))}).then(function(e){return i.mainSource?i.module(i.mainSource):(i.loadScriptModules(),e)})},O.done=function(){return S},O.import=function(){var e=arguments,t=this.System;return w||(t.main||(t.main="@empty"),O.startup()),w.then(function(){var r=[];return n(e,function(e){r.push(t.import(e))}),r.length>1?Promise.all(r):r[0]})},O.setContextual=c.call(e.setContextual,e),O.isEnv=c.call(e.isEnv,e),O.isPlatform=c.call(e.isPlatform,e),O};if(!g||h||v){var S=e.steal;e.steal=j(System),e.steal.startup(S&&"object"==typeof S&&S).then(null,function(e){if("undefined"!=typeof console){var t=console;t[t.error?"error":"log"](e)}}),e.steal.clone=w}else e.steal=j(System),e.steal.System=System,e.steal.dev=require("./ext/dev.js"),steal.clone=w,module.exports=e.steal}("undefined"==typeof window?"undefined"==typeof global?this:global:window); \ No newline at end of file diff --git a/steal.js b/steal.js index b149fe432..5a1275867 100644 --- a/steal.js +++ b/steal.js @@ -3028,6 +3028,7 @@ function logloads(loads) { var babelVersion = getBabelVersion(babel); var options = getBabelOptions.call(this, load, babel); + var loader = this; return Promise.all([ processBabelPlugins.call(this, babel, options), @@ -3042,12 +3043,25 @@ function logloads(loads) { options.presets = results[1]; } - var result = babel.transform(load.source, options); - var source = result.code; - - // add "!eval" to end of Babel sourceURL - // I believe this does something? - return source + '\n//# sourceURL=' + load.address + '!eval'; + try { + var result = babel.transform(load.source, options); + var source = result.code; + + // add "!eval" to end of Babel sourceURL + // I believe this does something? + return source + '\n//# sourceURL=' + load.address + '!eval'; + } catch(ex) { + if(ex instanceof SyntaxError) { + var newError = new SyntaxError(ex.message); + var stack = new loader.StackTrace(ex.message, [ + loader.StackTrace.item("", load.address, + ex.loc.line, ex.loc.column) + ]); + newError.stack = stack.toString(); + return Promise.reject(newError); + } + return Promise.reject(ex); + } }); } @@ -4858,7 +4872,21 @@ function cjs(loader) { '\n}).call(_g.exports, _g.global, _g.exports, _g.module, _g.require, _g.__filename, _g.__dirname);})();', address: load.address }; - loader.__exec(execLoad); + try { + loader.__exec(execLoad); + } catch(ex) { + if(loader.StackTrace) { + var st = loader.StackTrace.parse(ex); + if(!st) { + ex.stack = new loader.StackTrace(ex.message, [ + loader.StackTrace.item("", load.address, 1, 0) + ]).toString(); + } + } + + throw ex; + } + loader.global.define = define; diff --git a/steal.production.js b/steal.production.js index 07b651691..f751a97b3 100644 --- a/steal.production.js +++ b/steal.production.js @@ -4,4 +4,4 @@ * Copyright (c) 2018 Bitovi; Licensed MIT */ -!function(e){"object"==typeof exports?module.exports=e():"function"==typeof define&&define.amd?define(e):"undefined"!=typeof window?window.Promise=e():"undefined"!=typeof global?global.Promise=e():"undefined"!=typeof self&&(self.Promise=e())}(function(){return function e(t,n,r){function o(i,s){if(!n[i]){if(!t[i]){var l="function"==typeof require&&require;if(!s&&l)return l(i,!0);if(a)return a(i,!0);throw new Error("Cannot find module '"+i+"'")}var u=n[i]={exports:{}};t[i][0].call(u.exports,function(e){var n=t[i][1][e];return o(n||e)},u,u.exports,e,t,n,r)}return n[i].exports}for(var a="function"==typeof require&&require,i=0;i=0&&(p.splice(t,1),d("Handled previous rejection ["+e.id+"] "+o.formatObject(e.value)))}function s(e,t){f.push(e,t),null===h&&(h=r(l,0))}function l(){for(h=null;f.length>0;)f.shift()(f.shift())}var u,c=n,d=n;"undefined"!=typeof console&&(u=console,c=void 0!==u.error?function(e){u.error(e)}:function(e){u.log(e)},d=void 0!==u.info?function(e){u.info(e)}:function(e){u.log(e)}),e.onPotentiallyUnhandledRejection=function(e){s(a,e)},e.onPotentiallyUnhandledRejectionHandled=function(e){s(i,e)},e.onFatalRejection=function(e){s(t,e.value)};var f=[],p=[],h=null;return e}})}(function(n){t.exports=n(e)})},{"../env":5,"../format":6}],5:[function(e,t,n){!function(e){"use strict";e(function(e){var t,n="undefined"!=typeof setTimeout&&setTimeout,r=function(e,t){return setTimeout(e,t)},o=function(e){return clearTimeout(e)},a=function(e){return n(e,0)};if("undefined"!=typeof process&&"[object process]"===Object.prototype.toString.call(process))a=function(e){return process.nextTick(e)};else if(t="function"==typeof MutationObserver&&MutationObserver||"function"==typeof WebKitMutationObserver&&WebKitMutationObserver)a=function(e){var t,n=document.createTextNode("");new e(function(){var e=t;t=void 0,e()}).observe(n,{characterData:!0});var r=0;return function(e){t=e,n.data=r^=1}}(t);else if(!n){var i=e("vertx");r=function(e,t){return i.setTimer(t,e)},o=i.cancelTimer,a=i.runOnLoop||i.runOnContext}return{setTimer:r,clearTimer:o,asap:a}})}(function(n){t.exports=n(e)})},{}],6:[function(e,t,n){!function(e){"use strict";e(function(){function e(e){var n=String(e);return"[object Object]"===n&&"undefined"!=typeof JSON&&(n=t(e,n)),n}function t(e,t){try{return JSON.stringify(e)}catch(e){return t}}return{formatError:function(t){var n="object"==typeof t&&null!==t&&(t.stack||t.message)?t.stack||t.message:e(t);return t instanceof Error?n:n+" (WARNING: non-Error used)"},formatObject:e,tryStringify:t}})}(function(e){t.exports=e()})},{}],7:[function(e,t,n){!function(e){"use strict";e(function(){return function(e){function t(e,t){this._handler=e===m?t:n(e)}function n(e){function t(e){n.reject(e)}var n=new g;try{e(function(e){n.resolve(e)},t,function(e){n.notify(e)})}catch(e){t(e)}return n}function r(e){return k(e)?e:new t(m,new b(f(e)))}function o(e){return new t(m,new b(new x(e)))}function a(){return Q}function i(e,t){return new t(m,new g(e.receiver,e.join().context))}function s(e,n,r){function o(e,t,n){c[e]=t,0==--u&&n.become(new _(c))}for(var a,i="function"==typeof n?function(t,a,i){i.resolved||l(r,o,t,e(n,a,t),i)}:o,s=new g,u=r.length>>>0,c=new Array(u),d=0;d0?t(n,a.value,o):(o.become(a),u(e,n+1,a))}else t(n,r,o)}function u(e,t,n){for(var r=t;r0||"function"!=typeof t&&o<0)return new this.constructor(m,r);var a=this._beget(),i=a._handler;return r.chain(i,r.receiver,e,t,n),a},t.prototype.catch=function(e){return this.then(void 0,e)},t.prototype._beget=function(){return i(this._handler,this.constructor)},t.all=function(e){return s(z,null,e)},t.race=function(e){return"object"!=typeof e||null===e?o(new TypeError("non-iterable passed to race()")):0===e.length?a():1===e.length?r(e[0]):d(e)},t._traverse=function(e,t){return s(D,e,t)},t._visitRemaining=u,m.prototype.when=m.prototype.become=m.prototype.notify=m.prototype.fail=m.prototype._unreport=m.prototype._report=A,m.prototype._state=0,m.prototype.state=function(){return this._state},m.prototype.join=function(){for(var e=this;void 0!==e.handler;)e=e.handler;return e},m.prototype.chain=function(e,t,n,r,o){this.when({resolver:e,receiver:t,fulfilled:n,rejected:r,progress:o})},m.prototype.visit=function(e,t,n,r){this.chain(H,e,t,n,r)},m.prototype.fold=function(e,t,n,r){this.when(new L(e,t,n,r))},F(m,v),v.prototype.become=function(e){e.fail()};var H=new v;F(m,g),g.prototype._state=0,g.prototype.resolve=function(e){this.become(f(e))},g.prototype.reject=function(e){this.resolved||this.become(new x(e))},g.prototype.join=function(){if(!this.resolved)return this;for(var e=this;void 0!==e.handler;)if((e=e.handler)===this)return this.handler=S();return e},g.prototype.run=function(){var e=this.consumers,t=this.handler;this.handler=this.handler.join(),this.consumers=void 0;for(var n=0;n",t.isDeclarative=!0,e.loaderObj.transpile(t).then(function(e){var n=__global.System,r=n.register;n.register=function(e,n,r){var o=r,a=n;"string"!=typeof e&&(o=a,a=e),t.declare=o,t.depsList=a},__eval(e,__global,t),n.register=r});if("object"!=typeof n)throw TypeError("Invalid instantiate return value");t.depsList=n.deps||[],t.execute=n.execute,t.isDeclarative=!1}}).then(function(){if("loading"==t.status){t.dependencies=[];for(var r=t.depsList,o=[],a=0,i=r.length;a0)){var n=e.startingLoad;if(!1===e.loader.loaderObj.execute){for(var r=[].concat(e.loads),o=0,a=r.length;o=0;i--){for(var s=r[i],l=0;l=0;r-=1){var o=n[r];-1===t.indexOf(o)&&t.unshift(o)}else t=["es2015-no-commonjs","react","stage-0"];return t}function c(e){return(e.version?+e.version.split(".")[0]:6)||6}function d(e,t){var n=this.babelOptions||{};return n.sourceMap="inline",n.filename=e.address,n.code=!0,n.ast=!1,c(t)>=6?(delete n.optional,delete n.whitelist,delete n.blacklist,n.presets=u(n.presets),n.plugins=l(n.plugins)):(n.modules="system",n.blacklist||(n.blacklist=["react"])),n}function f(e){var t=e.types;return{visitor:{Program:function(e,n){e.unshiftContainer("body",[t.exportNamedDeclaration(null,[t.exportSpecifier(t.identifier("true"),t.identifier("__esModule"))])])}}}}function p(e){return e.metadata.importSpecifiers=Object.create(null),function(t){t.types;return{visitor:{ImportDeclaration:function(t,n){var r=t.node,o=r.source.value,a=r.source.loc;e.metadata.importSpecifiers[o]=a}}}}}function h(e,t){var n=t.Babel||t.babel||t,r=c(n),o=d.call(this,e,n);return Promise.all([g.call(this,n,o),b.call(this,n,o)]).then(function(t){return r>=6&&(o.plugins=[p(e),f].concat(t[0]),o.presets=t[1]),n.transform(e.source,o).code+"\n//# sourceURL="+e.address+"!eval"})}var m=__global,v="undefined"==typeof self&&"undefined"!=typeof process&&"[object process]"==={}.toString.call(process);e.prototype.transpiler="babel",e.prototype.transpile=function(e){var n=this;return n.transpilerHasRun||(m.traceur&&!n.has("traceur")&&n.set("traceur",t(n,"traceur")),m.Babel&&!n.has("babel")&&n.set("babel",t(n,"Babel")),n.transpilerHasRun=!0),n.import(n.transpiler).then(function(t){var o=t;return o.__useDefault&&(o=o.default),(o.Compiler?r:h).call(n,e,o)}).then(function(t){return'var __moduleAddress = "'+e.address+'";'+t})},e.prototype.instantiate=function(e){var r=this;return Promise.resolve(r.normalize(r.transpiler)).then(function(o){if(e.name===o)return{deps:[],execute:function(){var o=m.System,a=m.Reflect.Loader;return __eval("(function(require,exports,module){"+e.source+"})();",m,e),m.System=o,m.Reflect.Loader=a,t(r,n(e.name))}}})};var g=function(){function e(e,r){var o=[];return(r||[]).forEach(function(r){var a=i(r);if(!s(r)||t(e,a))o.push(r);else if(!t(e,a)){var l=this.configMain||"package.json!npm",u=n(a);o.push(this.import(u,{name:l}).then(function(e){var t=e.__esModule?e.default:e;return"string"==typeof r?t:[t,r[1]]}))}},this),Promise.all(o)}function t(e,t){var n=/^(?:babel-plugin-)/;return!!(e.availablePlugins||{})[n.test(t)?t.replace("babel-plugin-",""):t]}function n(e){var t=/^(?:babel-plugin-)/;return/\//.test(e)||t.test(e)?e:"babel-plugin-"+e}return function(t,n){var r=a.call(this),o=n.env||{},i=[e.call(this,t,n.plugins)];for(var s in o)if(r===s){var l=o[s].plugins||[];i.push(e.call(this,t,l))}return Promise.all(i).then(function(e){var t=[];return e.forEach(function(e){t=t.concat(e)}),t})}}(),b=function(){function e(e,r){var o=[];return(r||[]).forEach(function(r){var a=i(r);if(!s(r)||t(e,a))o.push(r);else if(!t(e,a)){var l=this.configMain||"package.json!npm",u=n(a);o.push(this.import(u,{name:l}).then(function(e){var t=e.__esModule?e.default:e;return"string"==typeof r?t:[t,r[1]]}))}},this),Promise.all(o)}function t(e,t){var n=/^(?:babel-preset-)/;return!!(e.availablePresets||{})[n.test(t)?t.replace("babel-preset-",""):t]}function n(e){var t=/^(?:babel-preset-)/;return/\//.test(e)||t.test(e)?e:"babel-preset-"+e}return function(t,n){var r=a.call(this),o=n.env||{},i=[e.call(this,t,n.presets)];for(var s in o)if(r===s){var l=o[s].presets||[];i.push(e.call(this,t,l))}return Promise.all(i).then(function(e){var t=[];return e.forEach(function(e){t=t.concat(e)}),t})}}()}(__global.LoaderPolyfill),function(){function e(e){var t=String(e).replace(/^\s+|\s+$/g,"").match(/^([^:\/?#]+:)?(\/\/(?:[^:@\/?#]*(?::[^:@\/?#]*)?@)?(([^:\/?#]*)(?::(\d*))?))?([^?#]*)(\?[^#]*)?(#[\s\S]*)?/);return t?{href:t[0]||"",protocol:t[1]||"",authority:t[2]||"",host:t[3]||"",hostname:t[4]||"",port:t[5]||"",pathname:t[6]||"",search:t[7]||"",hash:t[8]||""}:null}function t(e){var t=[];return e.replace(/^(\.\.?(\/|$))+/,"").replace(/\/(\.(\/|$))+/g,"/").replace(/\/\.\.$/,"/../").replace(/\/?[^\/]*/g,function(e){"/.."===e?t.pop():t.push(e)}),t.join("").replace(/^\//,"/"===e.charAt(0)?"/":"")}function n(n,r){var o=r,i=n;return a&&(o=o.replace(/\\/g,"/")),o=e(o||""),i=e(i||""),o&&i?(o.protocol||i.protocol)+(o.protocol||o.authority?o.authority:i.authority)+t(o.protocol||o.authority||"/"===o.pathname.charAt(0)?o.pathname:o.pathname?(i.authority&&!i.pathname?"/":"")+i.pathname.slice(0,i.pathname.lastIndexOf("/")+1)+o.pathname:i.pathname)+(o.protocol||o.authority||o.pathname?o.search:o.search||i.search)+o.hash:null}function r(e,t,n){if(void 0===n.getDependants)return i.resolve();var r=n.getDependants(t.name);if(Array.isArray(r)&&r.length){var o=n.StackTrace,a=n.isEnv("production");return i.resolve().then(function(){return a?i.resolve():n.import("@@babel-code-frame")}).then(function(i){var s=n.getModuleLoad(r[0]),l=n.getImportSpecifier(t.name,s)||{line:1,column:0},u="The module ["+n.prettyName(t)+"] couldn't be fetched.\nClicking the link in the stack trace below takes you to the import.\nSee https://stealjs.com/docs/StealJS.error-messages.html#404-not-found for more information.\n",c=e.message+"\n"+u;a||(c+="\n"+i(s.metadata.originalSource||s.source,l.line,l.column)+"\n"),e.message=c;var d=new o(c,[o.item(null,s.address,l.line,l.column)]);e.stack=d.toString()})}return i.resolve()}var o,a="undefined"!=typeof process&&!!process.platform.match(/^win/),i=__global.Promise||require("when/es6-shim/Promise");if("undefined"!=typeof XMLHttpRequest)o=function(e,t,n){function r(){t(a.responseText)}function o(){var t=a.status,r=t+" "+a.statusText+": "+e+"\n"||"XHR error",o=new Error(r);o.url=e,o.statusCode=t,n(o)}var a=new XMLHttpRequest,i=!0,s=!1;if(!("withCredentials"in a)){var l=/^(\w+:)?\/\/([^\/]+)/.exec(e);l&&(i=l[2]===window.location.host,l[1]&&(i&=l[1]===window.location.protocol))}i||"undefined"==typeof XDomainRequest||((a=new XDomainRequest).onload=r,a.onerror=o,a.ontimeout=o,a.onprogress=function(){},a.timeout=0,s=!0),a.onreadystatechange=function(){4===a.readyState&&(200===a.status||0==a.status&&a.responseText?r():o())},a.open("GET",e,!0),s&&setTimeout(function(){a.send()},0),a.send(null)};else if("undefined"!=typeof require){var s,l=/ENOENT/;o=function(e,t,n){if("file:"!=e.substr(0,5))throw"Only file URLs of the form file: allowed running in Node.";s=s||require("fs");var r=e.substr(5);return a&&(r=r.replace(/\//g,"\\")),s.readFile(r,function(r,o){if(r)return l.test(r.message)&&(r.statusCode=404,r.url=e),n(r);t(o+"")})}}else{if("function"!=typeof fetch)throw new TypeError("No environment fetch API available.");o=function(e,t,n){fetch(e).then(function(e){return e.text()}).then(function(e){t(e)}).then(null,function(e){n(e)})}}var u=new(function(e){function t(t){if(e.call(this,t||{}),"undefined"!=typeof location&&location.href){var n=__global.location.href.split("#")[0].split("?")[0];this.baseURL=n.substring(0,n.lastIndexOf("/")+1)}else{if("undefined"==typeof process||!process.cwd)throw new TypeError("No environment baseURL");this.baseURL="file:"+process.cwd()+"/",a&&(this.baseURL=this.baseURL.replace(/\\/g,"/"))}this.paths={"*":"*.js"}}return t.__proto__=null!==e?e:Function.prototype,t.prototype=$__Object$create(null!==e?e.prototype:null),$__Object$defineProperty(t.prototype,"constructor",{value:t}),$__Object$defineProperty(t.prototype,"global",{get:function(){return isBrowser?window:isWorker?self:__global},enumerable:!1}),$__Object$defineProperty(t.prototype,"strict",{get:function(){return!0},enumerable:!1}),$__Object$defineProperty(t.prototype,"normalize",{value:function(e,t,n){if("string"!=typeof e)throw new TypeError("Module name must be a string");var r=e.split("/");if(0==r.length)throw new TypeError("No module name provided");var o=0,a=!1,i=0;if("."==r[0]){if(++o==r.length)throw new TypeError('Illegal module name "'+e+'"');a=!0}else{for(;".."==r[o];)if(++o==r.length)throw new TypeError('Illegal module name "'+e+'"');o&&(a=!0),i=o}for(var s=o;s2)throw new TypeError("Only one wildcard in a path is permitted");if(1==i.length){if(r==a&&a.length>o.length){o=a;break}}else r.substr(0,i[0].length)==i[0]&&r.substr(r.length-i[1].length)==i[1]&&(o=a,t=r.substr(i[0].length,r.length-i[1].length-i[0].length))}var s=this.paths[o];return t&&(s=s.replace("*",t)),isBrowser&&(s=s.replace(/#/g,"%23")),n(this.baseURL,s)},enumerable:!1,writable:!0}),$__Object$defineProperty(t.prototype,"fetch",{value:function(e){var t=this;return new i(function(a,i){o(n(t.baseURL,e.address),function(e){a(e)},function(n){var o=i.bind(null,n);r(n,e,t).then(o,o)})})},enumerable:!1,writable:!0}),t}(__global.LoaderPolyfill));"object"==typeof exports&&(module.exports=u),__global.System=u}()}("undefined"!=typeof window?window:"undefined"!=typeof WorkerGlobalScope?self:global),function(e){e.upgradeSystemLoader=function(){function t(e){var t=String(e).replace(/^\s+|\s+$/g,"").match(/^([^:\/?#]+:)?(\/\/(?:[^:@\/?#]*(?::[^:@\/?#]*)?@)?(([^:\/?#]*)(?::(\d*))?))?([^?#]*)(\?[^#]*)?(#[\s\S]*)?/);return t?{href:t[0]||"",protocol:t[1]||"",authority:t[2]||"",host:t[3]||"",hostname:t[4]||"",port:t[5]||"",pathname:t[6]||"",search:t[7]||"",hash:t[8]||""}:null}function r(e,n){var r=e,o=n;return _&&(o=o.replace(/\\/g,"/")),o=t(o||""),r=t(r||""),o&&r?(o.protocol||r.protocol)+(o.protocol||o.authority?o.authority:r.authority)+function(e){var t=[];return e.replace(/^(\.\.?(\/|$))+/,"").replace(/\/(\.(\/|$))+/g,"/").replace(/\/\.\.$/,"/../").replace(/\/?[^\/]*/g,function(e){"/.."===e?t.pop():t.push(e)}),t.join("").replace(/^\//,"/"===e.charAt(0)?"/":"")}(o.protocol||o.authority||"/"===o.pathname.charAt(0)?o.pathname:o.pathname?(r.authority&&!r.pathname?"/":"")+r.pathname.slice(0,r.pathname.lastIndexOf("/")+1)+o.pathname:r.pathname)+(o.protocol||o.authority||o.pathname?o.search:o.search||r.search)+o.hash:null}function o(t){var n={};if(("object"==typeof t||"function"==typeof t)&&t!==e)if(x)for(var r in t)"default"!==r&&a(n,t,r);else i(n,t);return n.default=t,w(n,"__useDefault",{value:!0}),n}function a(e,t,n){try{var r;(r=Object.getOwnPropertyDescriptor(t,n))&&w(e,n,r)}catch(r){return e[n]=t[n],!1}}function i(e,t,n){var r=t&&t.hasOwnProperty;for(var o in t)r&&!t.hasOwnProperty(o)||n&&o in e||(e[o]=t[o]);return e}function s(e){function t(e,t){t._extensions=[];for(var n=0,r=e.length;n=0;a--){for(var i=r[a],s=0;st.index)return!0;return!1}o.lastIndex=a.lastIndex=i.lastIndex=0;var n,r=[],s={},l=[],u=[];if(e.length/e.split("\n").length<200){for(;n=i.exec(e);)l.push([n.index,n.index+n[0].length]);for(;n=a.exec(e);)t(l,n)||u.push([n.index,n.index+n[0].length])}for(;n=o.exec(e);)if(!t(l,n)&&!t(u,n)){var c=n[1].substr(1,n[1].length-2);if(c.match(/"|'/))continue;r.push(c),s[c]=n.index}return{deps:r,info:s}}function n(e,t){var n=this;return function(r){var o=t[r];return n._getLineAndColumnFromPosition(e.source,o)}}e._extensions.push(f),e._determineFormat=Function.prototype;var r=/(?:^\uFEFF?|[^$_a-zA-Z\xA0-\uFFFF.])(exports\s*(\[['"]|\.)|module(\.exports|\['exports'\]|\["exports"\])\s*(\[['"]|[=,\.])|Object.defineProperty\(\s*module\s*,\s*(?:'|")exports(?:'|"))/,o=/(?:^\uFEFF?|[^$_a-zA-Z\xA0-\uFFFF."'])require\s*\(\s*("[^"\\]*(?:\\.[^"\\]*)*"|'[^'\\]*(?:\\.[^'\\]*)*')\s*\)/g,a=/(^|[^\\])(\/\*([\s\S]*?)\*\/|([^:]|^)\/\/(.*)$)/gm,i=/("[^"\\\n\r]*(\\.[^"\\\n\r]*)*"|'[^'\\\n\r]*(\\.[^'\\\n\r]*)*')/g,s=e.instantiate;e.instantiate=function(a){if(a.metadata.format||(r.lastIndex=0,o.lastIndex=0,(o.exec(a.source)||r.exec(a.source))&&(a.metadata.format="cjs",this._determineFormat(a))),"cjs"==a.metadata.format){var i=t(a.source);a.metadata.deps=a.metadata.deps?a.metadata.deps.concat(i.deps):i.deps,a.metadata.getImportPosition=n.call(this,a,i.info),a.metadata.executingRequire=!0,a.metadata.execute=function(t,n,r){var o=(a.address||"").split("/");o.pop(),o=o.join("/"),b._nodeRequire&&(o=o.substr(5));e.global._g={global:e.global,exports:n,module:r,require:t,__filename:b._nodeRequire?a.address.substr(5):a.address,__dirname:o};var i=e.global.define;e.global.define=void 0;var s={name:a.name,source:"(function() {\n(function(global, exports, module, require, __filename, __dirname){\n"+a.source+"\n}).call(_g.exports, _g.global, _g.exports, _g.module, _g.require, _g.__filename, _g.__dirname);})();",address:a.address};e.__exec(s),e.global.define=i,e.global._g=void 0}}return s.call(this,a)}}function p(e){function t(e,t){var n=[],r=(e.match(f)[1].split(",")[t]||"require").replace(h,""),o=m[r]||(m[r]=new RegExp("/\\*|//|\"|'|`|(?:^|\\breturn\\b|[([=,;:?><&|^*%~+-])\\s*(?=/)|\\b"+r+"(?=\\s*\\()","g"));o.lastIndex=0,v[r]=v.require;for(var a,i,s,l;a=o.exec(e);)i=a[0],(s=v[i])||(s=v[i="/regexp/"]),s.lastIndex=o.lastIndex,(l=s.exec(e))&&l.index===o.lastIndex&&(o.lastIndex=s.lastIndex,s===v.require&&l[2]&&n.push(l[2]));return n}function n(e,t,r,o){var a=this;if("object"==typeof e&&!(e instanceof Array))return n.apply(null,Array.prototype.splice.call(arguments,1,arguments.length-1));if(!(e instanceof Array)){if("string"==typeof e){var i=a.get(e);return i.__useDefault?i.default:i}throw new TypeError("Invalid require")}Promise.all(e.map(function(e){return a.import(e,o)})).then(function(e){t&&t.apply(null,e)},r)}function r(e,t,r){return function(o,a,i){return"string"==typeof o?t(o):n.call(r,o,a,i,{name:e})}}function o(e){function n(n,o,a){var i=n,s=o,l=a,u=!1;"string"!=typeof i&&(l=s,s=i,i=null),s instanceof Array||(l=s,s=["require","exports","module"]),"function"!=typeof l&&(l=function(e){return function(){return e}}(l)),void 0===s[s.length-1]&&s.pop();var c,f,p;if(-1!=(c=y.call(s,"require"))){s.splice(c,1);var h=l.toString();s=s.concat(t(h,c))}-1!=(f=y.call(s,"exports"))&&(s.splice(f,1),h||(h=l.toString(),u=g.test(h))),-1!=(p=y.call(s,"module"))&&s.splice(p,1);var m={deps:s,execute:function(t,n,o){for(var a=[],i=0;i=0;o--)e.source=e.source.substr(0,r[o].start)+r[o].postLocate(t[o])+e.source.substr(r[o].end,e.source.length);return a.call(n,e)})}}),_(function(e){e._contextualModules={},e.setContextual=function(e,t){this._contextualModules[e]=t};var t=e.normalize;e.normalize=function(e,n){var r=this,o=r.pluginLoader||r;if(n){var a=this._contextualModules[e];if(a){var i=e+"/"+n;return r.has(i)?Promise.resolve(i):("string"==typeof a&&(a=o.import(a)),Promise.resolve(a).then(function(e){var t=e;return t.default&&(t=t.default),Promise.resolve(t.call(r,n))}).then(function(e){return r.set(i,r.newModule(e)),i}))}}return t.apply(this,arguments)}}),_(function(e){function t(){document.removeEventListener("DOMContentLoaded",t,!1),window.removeEventListener("load",t,!1),n()}function n(){for(var t=document.getElementsByTagName("script"),n=0;n0)return n;var i=a(t.map(r));if(i.length>0)return i;throw new Error("Unknown stack format: "+e)}function r(e){var t=e.match(l);if(!t)return null;var n=t[1]||"";return{method:n,fnName:n,url:t[2]||"",line:parseInt(t[3])||0,column:parseInt(t[4])||0}}function o(e){var t=e.match(u)||e.match(c);if(!t)return null;var n=t[3].match(d);if(!n)return null;var r=t[2]||"";return t[1]&&(r="eval at "+r),{method:r,fnName:r,url:n[1]||"",line:parseInt(n[2])||0,column:parseInt(n[3])||0}}function a(e){var t=[];return e.forEach(function(e){e&&t.push(e)}),t}function i(e){var t=/at position ([0-9]+)/.exec(e);if(t&&t.length>1)return Number(t[1])}function s(e,t){for(var n=0;nt.index)return!0;return!1}function n(e){for(;o=e.exec(r);)if(!t(i,o)){var n=o[1];a.push(n)}}var r=e.replace(d,"");u.lastIndex=d.lastIndex=c.lastIndex=f.lastIndex=0;var o,a=[],i=[];if(e.length/e.split("\n").length<200)for(;o=f.exec(r);)i.push([o.index,o.index+o[0].length]);return n(u),n(c),a}t._extensions&&t._extensions.push(e),t._traceData={loads:{},parentMap:{}},t.getDependencies=function(e){var t=this.getModuleLoad(e);return t?t.metadata.dependencies:void 0},t.getDependants=function(e){var t=[];return n(this._traceData.parentMap[e]||{},function(e){t.push(e)}),t},t.getModuleLoad=function(e){return this._traceData.loads[e]},t.getBundles=function(e,t){var r=t||{};r[e]=!0;var o=this,a=o._traceData.parentMap[e];if(!a)return[e];var i=[];return n(a,function(e,t){r[e]||(i=i.concat(o.getBundles(e,r)))}),i},t.getImportSpecifier=function(e,t){for(var n,r=0;r-1||a.indexOf("steal-sans-promises.production")>-1&&!n.env)&&this.config({env:s+"-production"}),(this.isEnv("production")||this.loadBundles)&&q.call(this),F.stealPath.set.call(this,i,n)}},devBundle:{order:16,set:function(e,t){var n=!0===e?"dev-bundle":e;n&&(this.devBundle=n)}},depsBundle:{order:17,set:function(e,t){var n=!0===e?"dev-bundle":e;n&&(this.depsBundle=n)}}};n(F,function(e,t){e.order?N.splice(e.order,0,t):N.push(t)}),function(e,t,r){var o=e.config;e.config=function(i){var s=a({},i);n(t,function(t){var n=r[t];if(n.set&&s[t]){var o=n.set.call(e,s[t],i);void 0!==o&&(e[t]=o),delete s[t]}}),o.call(this,s)}}(e,N,F),O.config=function(e){if("string"==typeof e)return this.loader[e];this.loader.config(e)},_(function(e){e.getEnv=function(){return(this.env||"").split("-")[1]||this.env},e.getPlatform=function(){var e=(this.env||"").split("-");return 2===e.length?e[0]:void 0},e.isEnv=function(e){return this.getEnv()===e},e.isPlatform=function(e){return this.getPlatform()===e}});var z=function(e){var n={},r=/Url$/,o=e.split("?"),a=o.shift(),i=o.join("?").split("&"),s=a.split("/");s.pop(),s.join("/");if(i.length&&i[0].length)for(var l,u=0;u1){var d=t(c[0]);n[d=d.replace(r,"URL")]=c.slice(1).join("=")}}return n},A=function(e){var r={},o=/Url$/;r.stealURL=e.src,n(e.attributes,function(e){var n=e.nodeName||e.name,a=t(0===n.indexOf("data-")?n.replace("data-",""):n);a=a.replace(o,"URL"),r[a]=""===e.value||e.value});var i=e.innerHTML;return/\S/.test(i)&&(r.mainSource=i),a(z(e.src),r)},U=function(){var e=this;return new Promise(function(t,n){if(p)t(a({stealURL:location.href},z(location.href)));else if(h||m||v){if(document.currentScript)return e.script=document.currentScript,void t(A(document.currentScript));var r=document.scripts;if(r.length){var o=r[r.length-1];e.script=o,t(A(o))}}else t({stealPath:__dirname})})};return O.startup=function(e){var t,n,o=this,i=this.loader;return w=new Promise(function(e,r){t=e,n=r}),S=U.call(this).then(function(s){function l(e){if(404===e.statusCode&&o.script){var t="This page has "+((i.devBundle?"dev-":"deps-")+"bundle")+" enabled but "+e.url+" could not be retrieved.\nDid you forget to generate the bundle first?\nSee https://stealjs.com/docs/StealJS.development-bundles.html for more information.",n=new Error(t);return n.stack=null,Promise.reject(n)}return Promise.reject(e)}var u;return u="object"==typeof e?a(e,s):s,i.config(u),D.call(i),i.loadBundles?(i.main||!i.isEnv("production")||i.stealBundled||b("Attribute 'main' is required in production environment. Please add it to the script tag."),i.import(i.configMain).then(t,n),w.then(function(e){return D.call(i),i._configLoaded=!0,i.main?i.import(i.main):e})):(i.import(i.devBundle).then(function(){return i.import(i.configMain)},l).then(function(){return i.import(i.depsBundle).then(null,l)}).then(t,n),(j=w.then(function(){return D.call(i),$.call(i),i._configLoaded=!0,u&&i.config(u),i.import("@dev")})).then(function(){if(!i.main||i.localLoader)return w;var e=i.main;return"string"==typeof e&&(e=[e]),Promise.all(r(e,function(e){return i.import(e)}))}))}).then(function(e){return i.mainSource?i.module(i.mainSource):(i.loadScriptModules(),e)})},O.done=function(){return S},O.import=function(){var e=arguments,t=this.System;return w||(t.main||(t.main="@empty"),O.startup()),w.then(function(){var r=[];return n(e,function(e){r.push(t.import(e))}),r.length>1?Promise.all(r):r[0]})},O.setContextual=d.call(e.setContextual,e),O.isEnv=d.call(e.isEnv,e),O.isPlatform=d.call(e.isPlatform,e),O};if(!g||m||v){var S=e.steal;e.steal=j(System),e.steal.startup(S&&"object"==typeof S&&S).then(null,function(e){if("undefined"!=typeof console){var t=console;t[t.error?"error":"log"](e)}}),e.steal.clone=w}else e.steal=j(System),e.steal.System=System,e.steal.dev=require("./ext/dev.js"),steal.clone=w,module.exports=e.steal}("undefined"==typeof window?"undefined"==typeof global?this:global:window); \ No newline at end of file +!function(e){"object"==typeof exports?module.exports=e():"function"==typeof define&&define.amd?define(e):"undefined"!=typeof window?window.Promise=e():"undefined"!=typeof global?global.Promise=e():"undefined"!=typeof self&&(self.Promise=e())}(function(){return function e(t,n,r){function o(i,s){if(!n[i]){if(!t[i]){var l="function"==typeof require&&require;if(!s&&l)return l(i,!0);if(a)return a(i,!0);throw new Error("Cannot find module '"+i+"'")}var u=n[i]={exports:{}};t[i][0].call(u.exports,function(e){var n=t[i][1][e];return o(n||e)},u,u.exports,e,t,n,r)}return n[i].exports}for(var a="function"==typeof require&&require,i=0;i=0&&(p.splice(t,1),d("Handled previous rejection ["+e.id+"] "+o.formatObject(e.value)))}function s(e,t){f.push(e,t),null===h&&(h=r(l,0))}function l(){for(h=null;f.length>0;)f.shift()(f.shift())}var u,c=n,d=n;"undefined"!=typeof console&&(u=console,c=void 0!==u.error?function(e){u.error(e)}:function(e){u.log(e)},d=void 0!==u.info?function(e){u.info(e)}:function(e){u.log(e)}),e.onPotentiallyUnhandledRejection=function(e){s(a,e)},e.onPotentiallyUnhandledRejectionHandled=function(e){s(i,e)},e.onFatalRejection=function(e){s(t,e.value)};var f=[],p=[],h=null;return e}})}(function(n){t.exports=n(e)})},{"../env":5,"../format":6}],5:[function(e,t,n){!function(e){"use strict";e(function(e){var t,n="undefined"!=typeof setTimeout&&setTimeout,r=function(e,t){return setTimeout(e,t)},o=function(e){return clearTimeout(e)},a=function(e){return n(e,0)};if("undefined"!=typeof process&&"[object process]"===Object.prototype.toString.call(process))a=function(e){return process.nextTick(e)};else if(t="function"==typeof MutationObserver&&MutationObserver||"function"==typeof WebKitMutationObserver&&WebKitMutationObserver)a=function(e){var t,n=document.createTextNode("");new e(function(){var e=t;t=void 0,e()}).observe(n,{characterData:!0});var r=0;return function(e){t=e,n.data=r^=1}}(t);else if(!n){var i=e("vertx");r=function(e,t){return i.setTimer(t,e)},o=i.cancelTimer,a=i.runOnLoop||i.runOnContext}return{setTimer:r,clearTimer:o,asap:a}})}(function(n){t.exports=n(e)})},{}],6:[function(e,t,n){!function(e){"use strict";e(function(){function e(e){var n=String(e);return"[object Object]"===n&&"undefined"!=typeof JSON&&(n=t(e,n)),n}function t(e,t){try{return JSON.stringify(e)}catch(e){return t}}return{formatError:function(t){var n="object"==typeof t&&null!==t&&(t.stack||t.message)?t.stack||t.message:e(t);return t instanceof Error?n:n+" (WARNING: non-Error used)"},formatObject:e,tryStringify:t}})}(function(e){t.exports=e()})},{}],7:[function(e,t,n){!function(e){"use strict";e(function(){return function(e){function t(e,t){this._handler=e===m?t:n(e)}function n(e){function t(e){n.reject(e)}var n=new g;try{e(function(e){n.resolve(e)},t,function(e){n.notify(e)})}catch(e){t(e)}return n}function r(e){return k(e)?e:new t(m,new b(f(e)))}function o(e){return new t(m,new b(new _(e)))}function a(){return Q}function i(e,t){return new t(m,new g(e.receiver,e.join().context))}function s(e,n,r){function o(e,t,n){c[e]=t,0==--u&&n.become(new x(c))}for(var a,i="function"==typeof n?function(t,a,i){i.resolved||l(r,o,t,e(n,a,t),i)}:o,s=new g,u=r.length>>>0,c=new Array(u),d=0;d0?t(n,a.value,o):(o.become(a),u(e,n+1,a))}else t(n,r,o)}function u(e,t,n){for(var r=t;r0||"function"!=typeof t&&o<0)return new this.constructor(m,r);var a=this._beget(),i=a._handler;return r.chain(i,r.receiver,e,t,n),a},t.prototype.catch=function(e){return this.then(void 0,e)},t.prototype._beget=function(){return i(this._handler,this.constructor)},t.all=function(e){return s(z,null,e)},t.race=function(e){return"object"!=typeof e||null===e?o(new TypeError("non-iterable passed to race()")):0===e.length?a():1===e.length?r(e[0]):d(e)},t._traverse=function(e,t){return s(D,e,t)},t._visitRemaining=u,m.prototype.when=m.prototype.become=m.prototype.notify=m.prototype.fail=m.prototype._unreport=m.prototype._report=A,m.prototype._state=0,m.prototype.state=function(){return this._state},m.prototype.join=function(){for(var e=this;void 0!==e.handler;)e=e.handler;return e},m.prototype.chain=function(e,t,n,r,o){this.when({resolver:e,receiver:t,fulfilled:n,rejected:r,progress:o})},m.prototype.visit=function(e,t,n,r){this.chain(H,e,t,n,r)},m.prototype.fold=function(e,t,n,r){this.when(new L(e,t,n,r))},F(m,v),v.prototype.become=function(e){e.fail()};var H=new v;F(m,g),g.prototype._state=0,g.prototype.resolve=function(e){this.become(f(e))},g.prototype.reject=function(e){this.resolved||this.become(new _(e))},g.prototype.join=function(){if(!this.resolved)return this;for(var e=this;void 0!==e.handler;)if((e=e.handler)===this)return this.handler=S();return e},g.prototype.run=function(){var e=this.consumers,t=this.handler;this.handler=this.handler.join(),this.consumers=void 0;for(var n=0;n",t.isDeclarative=!0,e.loaderObj.transpile(t).then(function(e){var n=__global.System,r=n.register;n.register=function(e,n,r){var o=r,a=n;"string"!=typeof e&&(o=a,a=e),t.declare=o,t.depsList=a},__eval(e,__global,t),n.register=r});if("object"!=typeof n)throw TypeError("Invalid instantiate return value");t.depsList=n.deps||[],t.execute=n.execute,t.isDeclarative=!1}}).then(function(){if("loading"==t.status){t.dependencies=[];for(var r=t.depsList,o=[],a=0,i=r.length;a0)){var n=e.startingLoad;if(!1===e.loader.loaderObj.execute){for(var r=[].concat(e.loads),o=0,a=r.length;o=0;i--){for(var s=r[i],l=0;l=0;r-=1){var o=n[r];-1===t.indexOf(o)&&t.unshift(o)}else t=["es2015-no-commonjs","react","stage-0"];return t}function c(e){return(e.version?+e.version.split(".")[0]:6)||6}function d(e,t){var n=this.babelOptions||{};return n.sourceMap="inline",n.filename=e.address,n.code=!0,n.ast=!1,c(t)>=6?(delete n.optional,delete n.whitelist,delete n.blacklist,n.presets=u(n.presets),n.plugins=l(n.plugins)):(n.modules="system",n.blacklist||(n.blacklist=["react"])),n}function f(e){var t=e.types;return{visitor:{Program:function(e,n){e.unshiftContainer("body",[t.exportNamedDeclaration(null,[t.exportSpecifier(t.identifier("true"),t.identifier("__esModule"))])])}}}}function p(e){return e.metadata.importSpecifiers=Object.create(null),function(t){t.types;return{visitor:{ImportDeclaration:function(t,n){var r=t.node,o=r.source.value,a=r.source.loc;e.metadata.importSpecifiers[o]=a}}}}}function h(e,t){var n=t.Babel||t.babel||t,r=c(n),o=d.call(this,e,n),a=this;return Promise.all([g.call(this,n,o),b.call(this,n,o)]).then(function(t){r>=6&&(o.plugins=[p(e),f].concat(t[0]),o.presets=t[1]);try{return n.transform(e.source,o).code+"\n//# sourceURL="+e.address+"!eval"}catch(t){if(t instanceof SyntaxError){var i=new SyntaxError(t.message),s=new a.StackTrace(t.message,[a.StackTrace.item("",e.address,t.loc.line,t.loc.column)]);return i.stack=s.toString(),Promise.reject(i)}return Promise.reject(t)}})}var m=__global,v="undefined"==typeof self&&"undefined"!=typeof process&&"[object process]"==={}.toString.call(process);e.prototype.transpiler="babel",e.prototype.transpile=function(e){var n=this;return n.transpilerHasRun||(m.traceur&&!n.has("traceur")&&n.set("traceur",t(n,"traceur")),m.Babel&&!n.has("babel")&&n.set("babel",t(n,"Babel")),n.transpilerHasRun=!0),n.import(n.transpiler).then(function(t){var o=t;return o.__useDefault&&(o=o.default),(o.Compiler?r:h).call(n,e,o)}).then(function(t){return'var __moduleAddress = "'+e.address+'";'+t})},e.prototype.instantiate=function(e){var r=this;return Promise.resolve(r.normalize(r.transpiler)).then(function(o){if(e.name===o)return{deps:[],execute:function(){var o=m.System,a=m.Reflect.Loader;return __eval("(function(require,exports,module){"+e.source+"})();",m,e),m.System=o,m.Reflect.Loader=a,t(r,n(e.name))}}})};var g=function(){function e(e,r){var o=[];return(r||[]).forEach(function(r){var a=i(r);if(!s(r)||t(e,a))o.push(r);else if(!t(e,a)){var l=this.configMain||"package.json!npm",u=n(a);o.push(this.import(u,{name:l}).then(function(e){var t=e.__esModule?e.default:e;return"string"==typeof r?t:[t,r[1]]}))}},this),Promise.all(o)}function t(e,t){var n=/^(?:babel-plugin-)/;return!!(e.availablePlugins||{})[n.test(t)?t.replace("babel-plugin-",""):t]}function n(e){var t=/^(?:babel-plugin-)/;return/\//.test(e)||t.test(e)?e:"babel-plugin-"+e}return function(t,n){var r=a.call(this),o=n.env||{},i=[e.call(this,t,n.plugins)];for(var s in o)if(r===s){var l=o[s].plugins||[];i.push(e.call(this,t,l))}return Promise.all(i).then(function(e){var t=[];return e.forEach(function(e){t=t.concat(e)}),t})}}(),b=function(){function e(e,r){var o=[];return(r||[]).forEach(function(r){var a=i(r);if(!s(r)||t(e,a))o.push(r);else if(!t(e,a)){var l=this.configMain||"package.json!npm",u=n(a);o.push(this.import(u,{name:l}).then(function(e){var t=e.__esModule?e.default:e;return"string"==typeof r?t:[t,r[1]]}))}},this),Promise.all(o)}function t(e,t){var n=/^(?:babel-preset-)/;return!!(e.availablePresets||{})[n.test(t)?t.replace("babel-preset-",""):t]}function n(e){var t=/^(?:babel-preset-)/;return/\//.test(e)||t.test(e)?e:"babel-preset-"+e}return function(t,n){var r=a.call(this),o=n.env||{},i=[e.call(this,t,n.presets)];for(var s in o)if(r===s){var l=o[s].presets||[];i.push(e.call(this,t,l))}return Promise.all(i).then(function(e){var t=[];return e.forEach(function(e){t=t.concat(e)}),t})}}()}(__global.LoaderPolyfill),function(){function e(e){var t=String(e).replace(/^\s+|\s+$/g,"").match(/^([^:\/?#]+:)?(\/\/(?:[^:@\/?#]*(?::[^:@\/?#]*)?@)?(([^:\/?#]*)(?::(\d*))?))?([^?#]*)(\?[^#]*)?(#[\s\S]*)?/);return t?{href:t[0]||"",protocol:t[1]||"",authority:t[2]||"",host:t[3]||"",hostname:t[4]||"",port:t[5]||"",pathname:t[6]||"",search:t[7]||"",hash:t[8]||""}:null}function t(e){var t=[];return e.replace(/^(\.\.?(\/|$))+/,"").replace(/\/(\.(\/|$))+/g,"/").replace(/\/\.\.$/,"/../").replace(/\/?[^\/]*/g,function(e){"/.."===e?t.pop():t.push(e)}),t.join("").replace(/^\//,"/"===e.charAt(0)?"/":"")}function n(n,r){var o=r,i=n;return a&&(o=o.replace(/\\/g,"/")),o=e(o||""),i=e(i||""),o&&i?(o.protocol||i.protocol)+(o.protocol||o.authority?o.authority:i.authority)+t(o.protocol||o.authority||"/"===o.pathname.charAt(0)?o.pathname:o.pathname?(i.authority&&!i.pathname?"/":"")+i.pathname.slice(0,i.pathname.lastIndexOf("/")+1)+o.pathname:i.pathname)+(o.protocol||o.authority||o.pathname?o.search:o.search||i.search)+o.hash:null}function r(e,t,n){if(void 0===n.getDependants)return i.resolve();var r=n.getDependants(t.name);if(Array.isArray(r)&&r.length){var o=n.StackTrace,a=n.isEnv("production");return i.resolve().then(function(){return a?i.resolve():n.import("@@babel-code-frame")}).then(function(i){var s=n.getModuleLoad(r[0]),l=n.getImportSpecifier(t.name,s)||{line:1,column:0},u="The module ["+n.prettyName(t)+"] couldn't be fetched.\nClicking the link in the stack trace below takes you to the import.\nSee https://stealjs.com/docs/StealJS.error-messages.html#404-not-found for more information.\n",c=e.message+"\n"+u;a||(c+="\n"+i(s.metadata.originalSource||s.source,l.line,l.column)+"\n"),e.message=c;var d=new o(c,[o.item(null,s.address,l.line,l.column)]);e.stack=d.toString()})}return i.resolve()}var o,a="undefined"!=typeof process&&!!process.platform.match(/^win/),i=__global.Promise||require("when/es6-shim/Promise");if("undefined"!=typeof XMLHttpRequest)o=function(e,t,n){function r(){t(a.responseText)}function o(){var t=a.status,r=t+" "+a.statusText+": "+e+"\n"||"XHR error",o=new Error(r);o.url=e,o.statusCode=t,n(o)}var a=new XMLHttpRequest,i=!0,s=!1;if(!("withCredentials"in a)){var l=/^(\w+:)?\/\/([^\/]+)/.exec(e);l&&(i=l[2]===window.location.host,l[1]&&(i&=l[1]===window.location.protocol))}i||"undefined"==typeof XDomainRequest||((a=new XDomainRequest).onload=r,a.onerror=o,a.ontimeout=o,a.onprogress=function(){},a.timeout=0,s=!0),a.onreadystatechange=function(){4===a.readyState&&(200===a.status||0==a.status&&a.responseText?r():o())},a.open("GET",e,!0),s&&setTimeout(function(){a.send()},0),a.send(null)};else if("undefined"!=typeof require){var s,l=/ENOENT/;o=function(e,t,n){if("file:"!=e.substr(0,5))throw"Only file URLs of the form file: allowed running in Node.";s=s||require("fs");var r=e.substr(5);return a&&(r=r.replace(/\//g,"\\")),s.readFile(r,function(r,o){if(r)return l.test(r.message)&&(r.statusCode=404,r.url=e),n(r);t(o+"")})}}else{if("function"!=typeof fetch)throw new TypeError("No environment fetch API available.");o=function(e,t,n){fetch(e).then(function(e){return e.text()}).then(function(e){t(e)}).then(null,function(e){n(e)})}}var u=new(function(e){function t(t){if(e.call(this,t||{}),"undefined"!=typeof location&&location.href){var n=__global.location.href.split("#")[0].split("?")[0];this.baseURL=n.substring(0,n.lastIndexOf("/")+1)}else{if("undefined"==typeof process||!process.cwd)throw new TypeError("No environment baseURL");this.baseURL="file:"+process.cwd()+"/",a&&(this.baseURL=this.baseURL.replace(/\\/g,"/"))}this.paths={"*":"*.js"}}return t.__proto__=null!==e?e:Function.prototype,t.prototype=$__Object$create(null!==e?e.prototype:null),$__Object$defineProperty(t.prototype,"constructor",{value:t}),$__Object$defineProperty(t.prototype,"global",{get:function(){return isBrowser?window:isWorker?self:__global},enumerable:!1}),$__Object$defineProperty(t.prototype,"strict",{get:function(){return!0},enumerable:!1}),$__Object$defineProperty(t.prototype,"normalize",{value:function(e,t,n){if("string"!=typeof e)throw new TypeError("Module name must be a string");var r=e.split("/");if(0==r.length)throw new TypeError("No module name provided");var o=0,a=!1,i=0;if("."==r[0]){if(++o==r.length)throw new TypeError('Illegal module name "'+e+'"');a=!0}else{for(;".."==r[o];)if(++o==r.length)throw new TypeError('Illegal module name "'+e+'"');o&&(a=!0),i=o}for(var s=o;s2)throw new TypeError("Only one wildcard in a path is permitted");if(1==i.length){if(r==a&&a.length>o.length){o=a;break}}else r.substr(0,i[0].length)==i[0]&&r.substr(r.length-i[1].length)==i[1]&&(o=a,t=r.substr(i[0].length,r.length-i[1].length-i[0].length))}var s=this.paths[o];return t&&(s=s.replace("*",t)),isBrowser&&(s=s.replace(/#/g,"%23")),n(this.baseURL,s)},enumerable:!1,writable:!0}),$__Object$defineProperty(t.prototype,"fetch",{value:function(e){var t=this;return new i(function(a,i){o(n(t.baseURL,e.address),function(e){a(e)},function(n){var o=i.bind(null,n);r(n,e,t).then(o,o)})})},enumerable:!1,writable:!0}),t}(__global.LoaderPolyfill));"object"==typeof exports&&(module.exports=u),__global.System=u}()}("undefined"!=typeof window?window:"undefined"!=typeof WorkerGlobalScope?self:global),function(e){e.upgradeSystemLoader=function(){function t(e){var t=String(e).replace(/^\s+|\s+$/g,"").match(/^([^:\/?#]+:)?(\/\/(?:[^:@\/?#]*(?::[^:@\/?#]*)?@)?(([^:\/?#]*)(?::(\d*))?))?([^?#]*)(\?[^#]*)?(#[\s\S]*)?/);return t?{href:t[0]||"",protocol:t[1]||"",authority:t[2]||"",host:t[3]||"",hostname:t[4]||"",port:t[5]||"",pathname:t[6]||"",search:t[7]||"",hash:t[8]||""}:null}function r(e,n){var r=e,o=n;return x&&(o=o.replace(/\\/g,"/")),o=t(o||""),r=t(r||""),o&&r?(o.protocol||r.protocol)+(o.protocol||o.authority?o.authority:r.authority)+function(e){var t=[];return e.replace(/^(\.\.?(\/|$))+/,"").replace(/\/(\.(\/|$))+/g,"/").replace(/\/\.\.$/,"/../").replace(/\/?[^\/]*/g,function(e){"/.."===e?t.pop():t.push(e)}),t.join("").replace(/^\//,"/"===e.charAt(0)?"/":"")}(o.protocol||o.authority||"/"===o.pathname.charAt(0)?o.pathname:o.pathname?(r.authority&&!r.pathname?"/":"")+r.pathname.slice(0,r.pathname.lastIndexOf("/")+1)+o.pathname:r.pathname)+(o.protocol||o.authority||o.pathname?o.search:o.search||r.search)+o.hash:null}function o(t){var n={};if(("object"==typeof t||"function"==typeof t)&&t!==e)if(_)for(var r in t)"default"!==r&&a(n,t,r);else i(n,t);return n.default=t,w(n,"__useDefault",{value:!0}),n}function a(e,t,n){try{var r;(r=Object.getOwnPropertyDescriptor(t,n))&&w(e,n,r)}catch(r){return e[n]=t[n],!1}}function i(e,t,n){var r=t&&t.hasOwnProperty;for(var o in t)r&&!t.hasOwnProperty(o)||n&&o in e||(e[o]=t[o]);return e}function s(e){function t(e,t){t._extensions=[];for(var n=0,r=e.length;n=0;a--){for(var i=r[a],s=0;st.index)return!0;return!1}o.lastIndex=a.lastIndex=i.lastIndex=0;var n,r=[],s={},l=[],u=[];if(e.length/e.split("\n").length<200){for(;n=i.exec(e);)l.push([n.index,n.index+n[0].length]);for(;n=a.exec(e);)t(l,n)||u.push([n.index,n.index+n[0].length])}for(;n=o.exec(e);)if(!t(l,n)&&!t(u,n)){var c=n[1].substr(1,n[1].length-2);if(c.match(/"|'/))continue;r.push(c),s[c]=n.index}return{deps:r,info:s}}function n(e,t){var n=this;return function(r){var o=t[r];return n._getLineAndColumnFromPosition(e.source,o)}}e._extensions.push(f),e._determineFormat=Function.prototype;var r=/(?:^\uFEFF?|[^$_a-zA-Z\xA0-\uFFFF.])(exports\s*(\[['"]|\.)|module(\.exports|\['exports'\]|\["exports"\])\s*(\[['"]|[=,\.])|Object.defineProperty\(\s*module\s*,\s*(?:'|")exports(?:'|"))/,o=/(?:^\uFEFF?|[^$_a-zA-Z\xA0-\uFFFF."'])require\s*\(\s*("[^"\\]*(?:\\.[^"\\]*)*"|'[^'\\]*(?:\\.[^'\\]*)*')\s*\)/g,a=/(^|[^\\])(\/\*([\s\S]*?)\*\/|([^:]|^)\/\/(.*)$)/gm,i=/("[^"\\\n\r]*(\\.[^"\\\n\r]*)*"|'[^'\\\n\r]*(\\.[^'\\\n\r]*)*')/g,s=e.instantiate;e.instantiate=function(a){if(a.metadata.format||(r.lastIndex=0,o.lastIndex=0,(o.exec(a.source)||r.exec(a.source))&&(a.metadata.format="cjs",this._determineFormat(a))),"cjs"==a.metadata.format){var i=t(a.source);a.metadata.deps=a.metadata.deps?a.metadata.deps.concat(i.deps):i.deps,a.metadata.getImportPosition=n.call(this,a,i.info),a.metadata.executingRequire=!0,a.metadata.execute=function(t,n,r){var o=(a.address||"").split("/");o.pop(),o=o.join("/"),b._nodeRequire&&(o=o.substr(5));e.global._g={global:e.global,exports:n,module:r,require:t,__filename:b._nodeRequire?a.address.substr(5):a.address,__dirname:o};var i=e.global.define;e.global.define=void 0;var s={name:a.name,source:"(function() {\n(function(global, exports, module, require, __filename, __dirname){\n"+a.source+"\n}).call(_g.exports, _g.global, _g.exports, _g.module, _g.require, _g.__filename, _g.__dirname);})();",address:a.address};try{e.__exec(s)}catch(t){throw e.StackTrace&&(e.StackTrace.parse(t)||(t.stack=new e.StackTrace(t.message,[e.StackTrace.item("",a.address,1,0)]).toString())),t}e.global.define=i,e.global._g=void 0}}return s.call(this,a)}}function p(e){function t(e,t){var n=[],r=(e.match(f)[1].split(",")[t]||"require").replace(h,""),o=m[r]||(m[r]=new RegExp("/\\*|//|\"|'|`|(?:^|\\breturn\\b|[([=,;:?><&|^*%~+-])\\s*(?=/)|\\b"+r+"(?=\\s*\\()","g"));o.lastIndex=0,v[r]=v.require;for(var a,i,s,l;a=o.exec(e);)i=a[0],(s=v[i])||(s=v[i="/regexp/"]),s.lastIndex=o.lastIndex,(l=s.exec(e))&&l.index===o.lastIndex&&(o.lastIndex=s.lastIndex,s===v.require&&l[2]&&n.push(l[2]));return n}function n(e,t,r,o){var a=this;if("object"==typeof e&&!(e instanceof Array))return n.apply(null,Array.prototype.splice.call(arguments,1,arguments.length-1));if(!(e instanceof Array)){if("string"==typeof e){var i=a.get(e);return i.__useDefault?i.default:i}throw new TypeError("Invalid require")}Promise.all(e.map(function(e){return a.import(e,o)})).then(function(e){t&&t.apply(null,e)},r)}function r(e,t,r){return function(o,a,i){return"string"==typeof o?t(o):n.call(r,o,a,i,{name:e})}}function o(e){function n(n,o,a){var i=n,s=o,l=a,u=!1;"string"!=typeof i&&(l=s,s=i,i=null),s instanceof Array||(l=s,s=["require","exports","module"]),"function"!=typeof l&&(l=function(e){return function(){return e}}(l)),void 0===s[s.length-1]&&s.pop();var c,f,p;if(-1!=(c=y.call(s,"require"))){s.splice(c,1);var h=l.toString();s=s.concat(t(h,c))}-1!=(f=y.call(s,"exports"))&&(s.splice(f,1),h||(h=l.toString(),u=g.test(h))),-1!=(p=y.call(s,"module"))&&s.splice(p,1);var m={deps:s,execute:function(t,n,o){for(var a=[],i=0;i=0;o--)e.source=e.source.substr(0,r[o].start)+r[o].postLocate(t[o])+e.source.substr(r[o].end,e.source.length);return a.call(n,e)})}}),x(function(e){e._contextualModules={},e.setContextual=function(e,t){this._contextualModules[e]=t};var t=e.normalize;e.normalize=function(e,n){var r=this,o=r.pluginLoader||r;if(n){var a=this._contextualModules[e];if(a){var i=e+"/"+n;return r.has(i)?Promise.resolve(i):("string"==typeof a&&(a=o.import(a)),Promise.resolve(a).then(function(e){var t=e;return t.default&&(t=t.default),Promise.resolve(t.call(r,n))}).then(function(e){return r.set(i,r.newModule(e)),i}))}}return t.apply(this,arguments)}}),x(function(e){function t(){document.removeEventListener("DOMContentLoaded",t,!1),window.removeEventListener("load",t,!1),n()}function n(){for(var t=document.getElementsByTagName("script"),n=0;n0)return n;var i=a(t.map(r));if(i.length>0)return i;throw new Error("Unknown stack format: "+e)}function r(e){var t=e.match(l);if(!t)return null;var n=t[1]||"";return{method:n,fnName:n,url:t[2]||"",line:parseInt(t[3])||0,column:parseInt(t[4])||0}}function o(e){var t=e.match(u)||e.match(c);if(!t)return null;var n=t[3].match(d);if(!n)return null;var r=t[2]||"";return t[1]&&(r="eval at "+r),{method:r,fnName:r,url:n[1]||"",line:parseInt(n[2])||0,column:parseInt(n[3])||0}}function a(e){var t=[];return e.forEach(function(e){e&&t.push(e)}),t}function i(e){var t=/at position ([0-9]+)/.exec(e);if(t&&t.length>1)return Number(t[1])}function s(e,t){for(var n=0;nt.index)return!0;return!1}function n(e){for(;o=e.exec(r);)if(!t(i,o)){var n=o[1];a.push(n)}}var r=e.replace(d,"");u.lastIndex=d.lastIndex=c.lastIndex=f.lastIndex=0;var o,a=[],i=[];if(e.length/e.split("\n").length<200)for(;o=f.exec(r);)i.push([o.index,o.index+o[0].length]);return n(u),n(c),a}t._extensions&&t._extensions.push(e),t._traceData={loads:{},parentMap:{}},t.getDependencies=function(e){var t=this.getModuleLoad(e);return t?t.metadata.dependencies:void 0},t.getDependants=function(e){var t=[];return n(this._traceData.parentMap[e]||{},function(e){t.push(e)}),t},t.getModuleLoad=function(e){return this._traceData.loads[e]},t.getBundles=function(e,t){var r=t||{};r[e]=!0;var o=this,a=o._traceData.parentMap[e];if(!a)return[e];var i=[];return n(a,function(e,t){r[e]||(i=i.concat(o.getBundles(e,r)))}),i},t.getImportSpecifier=function(e,t){for(var n,r=0;r-1||a.indexOf("steal-sans-promises.production")>-1&&!n.env)&&this.config({env:s+"-production"}),(this.isEnv("production")||this.loadBundles)&&q.call(this),F.stealPath.set.call(this,i,n)}},devBundle:{order:16,set:function(e,t){var n=!0===e?"dev-bundle":e;n&&(this.devBundle=n)}},depsBundle:{order:17,set:function(e,t){var n=!0===e?"dev-bundle":e;n&&(this.depsBundle=n)}}};n(F,function(e,t){e.order?N.splice(e.order,0,t):N.push(t)}),function(e,t,r){var o=e.config;e.config=function(i){var s=a({},i);n(t,function(t){var n=r[t];if(n.set&&s[t]){var o=n.set.call(e,s[t],i);void 0!==o&&(e[t]=o),delete s[t]}}),o.call(this,s)}}(e,N,F),P.config=function(e){if("string"==typeof e)return this.loader[e];this.loader.config(e)},x(function(e){e.getEnv=function(){return(this.env||"").split("-")[1]||this.env},e.getPlatform=function(){var e=(this.env||"").split("-");return 2===e.length?e[0]:void 0},e.isEnv=function(e){return this.getEnv()===e},e.isPlatform=function(e){return this.getPlatform()===e}});var z=function(e){var n={},r=/Url$/,o=e.split("?"),a=o.shift(),i=o.join("?").split("&"),s=a.split("/");s.pop(),s.join("/");if(i.length&&i[0].length)for(var l,u=0;u1){var d=t(c[0]);n[d=d.replace(r,"URL")]=c.slice(1).join("=")}}return n},A=function(e){var r={},o=/Url$/;r.stealURL=e.src,n(e.attributes,function(e){var n=e.nodeName||e.name,a=t(0===n.indexOf("data-")?n.replace("data-",""):n);a=a.replace(o,"URL"),r[a]=""===e.value||e.value});var i=e.innerHTML;return/\S/.test(i)&&(r.mainSource=i),a(z(e.src),r)},U=function(){var e=this;return new Promise(function(t,n){if(p)t(a({stealURL:location.href},z(location.href)));else if(h||m||v){if(document.currentScript)return e.script=document.currentScript,void t(A(document.currentScript));var r=document.scripts;if(r.length){var o=r[r.length-1];e.script=o,t(A(o))}}else t({stealPath:__dirname})})};return P.startup=function(e){var t,n,o=this,i=this.loader;return w=new Promise(function(e,r){t=e,n=r}),S=U.call(this).then(function(s){function l(e){if(404===e.statusCode&&o.script){var t="This page has "+((i.devBundle?"dev-":"deps-")+"bundle")+" enabled but "+e.url+" could not be retrieved.\nDid you forget to generate the bundle first?\nSee https://stealjs.com/docs/StealJS.development-bundles.html for more information.",n=new Error(t);return n.stack=null,Promise.reject(n)}return Promise.reject(e)}var u;return u="object"==typeof e?a(e,s):s,i.config(u),D.call(i),i.loadBundles?(i.main||!i.isEnv("production")||i.stealBundled||b("Attribute 'main' is required in production environment. Please add it to the script tag."),i.import(i.configMain).then(t,n),w.then(function(e){return D.call(i),i._configLoaded=!0,i.main?i.import(i.main):e})):(i.import(i.devBundle).then(function(){return i.import(i.configMain)},l).then(function(){return i.import(i.depsBundle).then(null,l)}).then(t,n),(j=w.then(function(){return D.call(i),$.call(i),i._configLoaded=!0,u&&i.config(u),i.import("@dev")})).then(function(){if(!i.main||i.localLoader)return w;var e=i.main;return"string"==typeof e&&(e=[e]),Promise.all(r(e,function(e){return i.import(e)}))}))}).then(function(e){return i.mainSource?i.module(i.mainSource):(i.loadScriptModules(),e)})},P.done=function(){return S},P.import=function(){var e=arguments,t=this.System;return w||(t.main||(t.main="@empty"),P.startup()),w.then(function(){var r=[];return n(e,function(e){r.push(t.import(e))}),r.length>1?Promise.all(r):r[0]})},P.setContextual=d.call(e.setContextual,e),P.isEnv=d.call(e.isEnv,e),P.isPlatform=d.call(e.isPlatform,e),P};if(!g||m||v){var S=e.steal;e.steal=j(System),e.steal.startup(S&&"object"==typeof S&&S).then(null,function(e){if("undefined"!=typeof console){var t=console;t[t.error?"error":"log"](e)}}),e.steal.clone=w}else e.steal=j(System),e.steal.System=System,e.steal.dev=require("./ext/dev.js"),steal.clone=w,module.exports=e.steal}("undefined"==typeof window?"undefined"==typeof global?this:global:window); \ No newline at end of file diff --git a/test/parse_errors/cjs.js b/test/parse_errors/cjs.js new file mode 100644 index 000000000..ef8ca2254 --- /dev/null +++ b/test/parse_errors/cjs.js @@ -0,0 +1,13 @@ +module.exports = {}; + +function functionAbove() { + +} + +function someFunction() { + something weird(); +} + +function anotherFunction() { + +} diff --git a/test/parse_errors/dev.html b/test/parse_errors/dev.html new file mode 100644 index 000000000..059ed4422 --- /dev/null +++ b/test/parse_errors/dev.html @@ -0,0 +1,74 @@ + + + + + syntax error messages + + + + + + + diff --git a/test/parse_errors/esm.js b/test/parse_errors/esm.js new file mode 100644 index 000000000..4a6fa8b3d --- /dev/null +++ b/test/parse_errors/esm.js @@ -0,0 +1,7 @@ +export default {}; + +something weird(); + +function someFunction() { + +} diff --git a/test/parse_errors/package.json b/test/parse_errors/package.json new file mode 100644 index 000000000..11fffeffb --- /dev/null +++ b/test/parse_errors/package.json @@ -0,0 +1,5 @@ +{ + "name": "parse_errors", + "main": "main.js", + "version": "1.0.0" +} diff --git a/test/test.js b/test/test.js index f76e7547f..b530b156a 100644 --- a/test/test.js +++ b/test/test.js @@ -322,6 +322,10 @@ QUnit.test("Error message in malformed JSON modules", function(assert){ makeIframe("json_syntax_err/dev.html", assert); }); +QUnit.test("Error message for syntax errors in ES and CJS modules", function(assert){ + makeIframe("parse_errors/dev.html", assert); +}); + QUnit.module("steal startup and config"); QUnit.test("Load urlOptions correctly with async script append", function(assert) {