/* * es6-module-loader v0.9.4 * https://github.com/ModuleLoader/es6-module-loader * Copyright (c) 2014 Guy Bedford, Luke Hoban, Addy Osmani; Licensed MIT */ !function(a){"object"==typeof exports?module.exports=a():"function"==typeof define&&define.amd?define(a):"undefined"!=typeof window?window.Promise=a():"undefined"!=typeof global?global.Promise=a():"undefined"!=typeof self&&(self.Promise=a())}(function(){var a;return function b(a,c,d){function e(g,h){if(!c[g]){if(!a[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);throw new Error("Cannot find module '"+g+"'")}var j=c[g]={exports:{}};a[g][0].call(j.exports,function(b){var c=a[g][1][b];return e(c?c:b)},j,j.exports,b,a,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;gf;++f)e[f]=d[f];else{for(a=d.length,b=this.tail;a>c;++f,++c)e[f]=d[c];for(c=0;b>c;++f,++c)e[f]=d[c]}this.buffer=e,this.head=0,this.tail=this.length},a})}("function"==typeof a&&a.amd?a:function(a){c.exports=a()})},{}],4:[function(b,c){!function(a){"use strict";a(function(a){function b(a){this._async=a,this._queue=new d(15),this._afterQueue=new d(5),this._running=!1;var b=this;this.drain=function(){b._drain()}}function c(a){for(;a.length>0;)a.shift().run()}var d=a("./Queue");return b.prototype.enqueue=function(a){this._add(this._queue,a)},b.prototype.afterQueue=function(a){this._add(this._afterQueue,a)},b.prototype._drain=function(){c(this._queue),this._running=!1,c(this._afterQueue)},b.prototype._add=function(a,b){a.push(b),this._running||(this._running=!0,this._async(this.drain))},b})}("function"==typeof a&&a.amd?a:function(a){c.exports=a(b)})},{"./Queue":3}],5:[function(b,c){!function(a){"use strict";a(function(a){var b,c;return b="undefined"!=typeof process&&null!==process&&"function"==typeof process.nextTick?function(a){process.nextTick(a)}:(c="function"==typeof MutationObserver&&MutationObserver||"function"==typeof WebKitMutationObserver&&WebKitMutationObserver)?function(a,b){function c(){var a=d;d=void 0,a()}var d,e=a.createElement("div"),f=new b(c);return f.observe(e,{attributes:!0}),function(a){d=a,e.setAttribute("class","x")}}(document,c):function(a){var b;try{b=a("vertx")}catch(c){}if(b){if("function"==typeof b.runOnLoop)return b.runOnLoop;if("function"==typeof b.runOnContext)return b.runOnContext}var d=setTimeout;return function(a){d(a,0)}}(a)})}("function"==typeof a&&a.amd?a:function(a){c.exports=a(b)})},{}],6:[function(b,c){!function(a){"use strict";a(function(a){function b(a){var b="object"==typeof a&&a.stack?a.stack:c(a);return a instanceof Error?b:b+" (WARNING: non-Error used)"}function c(a){var b=String(a);return"[object Object]"===b&&"undefined"!=typeof JSON&&(b=d(a,b)),b}function d(a,b){try{return JSON.stringify(a)}catch(a){return b}}function e(a){throw a}function f(){}var g=a("../timer");return function(a){function d(a){a.handled||(n.push(a),k("Potentially unhandled rejection ["+a.id+"] "+b(a.value)))}function h(a){var b=n.indexOf(a);b>=0&&(n.splice(b,1),l("Handled previous rejection ["+a.id+"] "+c(a.value)))}function i(a,b){m.push(a,b),o||(o=!0,o=g.set(j,0))}function j(){for(o=!1;m.length>0;)m.shift()(m.shift())}var k=f,l=f;"undefined"!=typeof console&&(k="undefined"!=typeof console.error?function(a){}:function(a){},l="undefined"!=typeof console.info?function(a){}:function(a){}),a.onPotentiallyUnhandledRejection=function(a){i(d,a)},a.onPotentiallyUnhandledRejectionHandled=function(a){i(h,a)},a.onFatalRejection=function(a){i(e,a.value)};var m=[],n=[],o=!1;return a}})}("function"==typeof a&&a.amd?a:function(a){c.exports=a(b)})},{"../timer":8}],7:[function(b,c){!function(a){"use strict";a(function(){return function(a){function b(a,b){this._handler=a===n?b:c(a)}function c(a){function b(a){e.resolve(a)}function c(a){e.reject(a)}function d(a){e.notify(a)}var e=new p;try{a(b,c,d)}catch(f){c(f)}return e}function d(a){return B(a)?a:new b(n,new q(k(a)))}function e(a){return new b(n,new q(new t(a)))}function f(){return Q}function g(){return new b(n,new p)}function h(a){function c(a,b,c){this[a]=b,0===--j&&c.become(new s(this))}var d,e,f,g,h=new p,j=a.length>>>0,k=new Array(j);for(d=0;d0)){i(a,d+1,e,h);break}k[d]=e.value,--j}else k[d]=f,--j;else--j;return 0===j&&h.become(new s(k)),new b(n,h)}function i(a,b,c,d){d.become(c);var e,f,g;for(e=b;e0||"function"!=typeof b&&0>d)return new this.constructor(n,c);var e=this._beget(),f=e._handler;return c.chain(f,c.receiver,a,b,arguments.length>2?arguments[2]:void 0),e},b.prototype["catch"]=function(a){return this.then(void 0,a)},b.prototype._beget=function(){var a=this._handler,b=new p(a.receiver,a.join().context);return new this.constructor(n,b)},b.all=h,b.race=j,n.prototype.when=n.prototype.become=n.prototype.notify=n.prototype.fail=n.prototype._unreport=n.prototype._report=K,n.prototype._state=0,n.prototype.state=function(){return this._state},n.prototype.join=function(){for(var a=this;void 0!==a.handler;)a=a.handler;return a},n.prototype.chain=function(a,b,c,d,e){this.when({resolver:a,receiver:b,fulfilled:c,rejected:d,progress:e})},n.prototype.visit=function(a,b,c,d){this.chain(N,a,b,c,d)},n.prototype.fold=function(a,b,c,d){this.visit(d,function(d){a.call(c,b,d,this)},d.reject,d.notify)},J(n,o),o.prototype.become=function(a){a.fail()};var N=new o;J(n,p),p.prototype._state=0,p.prototype.resolve=function(a){this.become(k(a))},p.prototype.reject=function(a){this.resolved||this.become(new t(a))},p.prototype.join=function(){if(!this.resolved)return this;for(var a=this;void 0!==a.handler;)if(a=a.handler,a===this)return this.handler=w();return a},p.prototype.run=function(){var a=this.consumers,b=this.join();this.consumers=void 0;for(var c=0;cf;f++)if(e=b.loads[f],e.name==c)return e;return e=a(c),b.loads.push(e),d(b,e),e})}function d(a,b){e(a,b,y.resolve().then(function(){return a.loaderObj.locate({name:b.name,metadata:b.metadata})}))}function e(a,b,c){f(a,b,c.then(function(c){return"loading"==b.status?(b.address=c,a.loaderObj.fetch({name:b.name,metadata:b.metadata,address:c})):void 0}))}function f(a,b,d){d.then(function(c){return"loading"==b.status?a.loaderObj.translate({name:b.name,metadata:b.metadata,address:b.address,source:c}):void 0}).then(function(c){return"loading"==b.status?(b.source=c,a.loaderObj.instantiate({name:b.name,metadata:b.metadata,address:b.address,source:c})):void 0}).then(function(d){if("loading"==b.status){if(void 0===d)b.address=b.address||"anon"+ ++B,b.isDeclarative=!0,a.loaderObj.parse(b);else{if("object"!=typeof d)throw TypeError("Invalid instantiate return value");b.depsList=d.deps||[],b.execute=d.execute,b.isDeclarative=!1}b.dependencies=[];for(var e=b.depsList,f=[],g=0,h=e.length;h>g;g++)(function(d,e){f.push(c(a,d,b.name,b.address).then(function(a){if(b.dependencies[e]={key:d,value:a.name},"linked"!=a.status)for(var c=b.linkSets.concat([]),f=0,g=c.length;g>f;f++)i(c[f],a)}))})(e[g],g);return y.all(f)}}).then(function(){b.status="loaded";for(var a=b.linkSets.concat([]),c=0,d=a.length;d>c;c++)k(a[c],b)})["catch"](function(a){b.status="failed",b.exception=a;for(var c=b.linkSets.concat([]),d=0,e=c.length;e>d;d++)l(c[d],a)})}function g(b){return function(c){var g=b.loader,i=b.moduleName,j=b.step;if(g.modules[i])throw new TypeError('"'+i+'" already exists in the module table');for(var k=0,l=g.loads.length;l>k;k++)if(g.loads[k].name==i)throw new TypeError('"'+i+'" already loading');var m=a(i);m.metadata=b.moduleMetadata;var n=h(g,m);g.loads.push(m),c(n.done),"locate"==j?d(g,m):"fetch"==j?e(g,m,y.resolve(b.moduleAddress)):(m.address=b.moduleAddress,f(g,m,y.resolve(b.moduleSource)))}}function h(a,b){var c={loader:a,loads:[],startingLoad:b,loadingCount:0};return c.done=new y(function(a,b){c.resolve=a,c.reject=b}),i(c,b),c}function i(a,b){for(var c=0,d=a.loads.length;d>c;c++)if(a.loads[c]==b)return;a.loads.push(b),b.linkSets.push(a),"loaded"!=b.status&&a.loadingCount++;for(var e=a.loader,c=0,d=b.dependencies.length;d>c;c++){var f=b.dependencies[c].value;if(!e.modules[f])for(var g=0,h=e.loads.length;h>g;g++)if(e.loads[g].name==f){i(a,e.loads[g]);break}}}function j(a){try{o(a)}catch(b){return l(a,b),!0}}function k(a,b){if(a.loadingCount--,!(a.loadingCount>0)){var c=a.startingLoad;if(a.loader.loaderObj.execute===!1){for(var d=[].concat(a.loads),e=0,f=d.length;f>e;e++){var b=d[e];b.module=b.isDeclarative?{name:b.name,module:C({}),evaluated:!0}:{module:C({})},b.status="linked",m(a.loader,b)}return a.resolve(c)}var g=j(a);g||a.resolve(c)}}function l(a,b){for(var c=a.loader,d=a.loads.concat([]),e=0,f=d.length;f>e;e++){var g=d[e];c.loaderObj.failed=c.loaderObj.failed||[],-1==z.call(c.loaderObj.failed,g)&&c.loaderObj.failed.push(g);var h=z.call(g.linkSets,a);if(g.linkSets.splice(h,1),0==g.linkSets.length){var i=z.call(a.loader.loads,g);-1!=i&&a.loader.loads.splice(i,1)}}a.reject(b)}function m(a,b){if(a.loaderObj.trace){a.loaderObj.loads||(a.loaderObj.loads={});var c={};b.dependencies.forEach(function(a){c[a.key]=a.value}),a.loaderObj.loads[b.name]={name:b.name,deps:b.dependencies.map(function(a){return a.key}),depMap:c,address:b.address,metadata:b.metadata,source:b.source,kind:b.isDeclarative?"declarative":"dynamic"}}b.name&&(a.modules[b.name]=b.module);var d=z.call(a.loads,b);-1!=d&&a.loads.splice(d,1);for(var e=0,f=b.linkSets.length;f>e;e++)d=z.call(b.linkSets[e].loads,b),-1!=d&&b.linkSets[e].loads.splice(d,1);b.linkSets.splice(0,b.linkSets.length)}function n(a,b,c,d){if(c[a.groupIndex]=c[a.groupIndex]||[],-1==z.call(c[a.groupIndex],a)){c[a.groupIndex].push(a);for(var e=0,f=b.length;f>e;e++)for(var g=b[e],h=0;h=0;f--){for(var g=c[f],h=0;hc;c++){var g=d.importers[c];if(!g.locked){var h=z.call(g.dependencies,d);g.setters[h](e)}}return d.locked=!1,b});d.setters=f.setters,d.execute=f.execute;for(var g=0,h=a.dependencies.length;h>g;g++){var i=a.dependencies[g].value,j=c.modules[i];if(!j)for(var k=0;kf;f++){var h=e[f];if(h&&-1==z.call(b,h)&&(d=u(h,b,c)))return d+"\n in module "+h.name}if(a.failed)return new Error("Module failed execution.");if(!a.evaluated)return a.evaluated=!0,d=s(a),d?a.failed=!0:Object.preventExtensions&&Object.preventExtensions(a.module),a.execute=void 0,d}}function v(a){if("object"!=typeof a)throw new TypeError("Options must be an object");a.normalize&&(this.normalize=a.normalize),a.locate&&(this.locate=a.locate),a.fetch&&(this.fetch=a.fetch),a.translate&&(this.translate=a.translate),a.instantiate&&(this.instantiate=a.instantiate),this._loader={loaderObj:this,loads:[],modules:{},importPromises:{},moduleRecords:{}},A(this,"global",{get:function(){return __global}})}function w(){}function x(a,b,c){var d=a._loader.importPromises;return d[b]=c.then(function(a){return d[b]=void 0,a},function(a){throw d[b]=void 0,a})}var y=__global.Promise||require("when/es6-shim/Promise");console.assert=console.assert||function(){};var z=Array.prototype.indexOf||function(a){for(var b=0,c=this.length;c>b;b++)if(this[b]===a)return b;return-1},A=$__Object$defineProperty,B=0;v.prototype={constructor:v,define:function(a,b,c){if(this._loader.importPromises[a])throw new TypeError("Module is already loading.");return x(this,a,new y(g({step:"translate",loader:this._loader,moduleName:a,moduleMetadata:c&&c.metadata||{},moduleSource:b,moduleAddress:c&&c.address})))},"delete":function(a){return this._loader.modules[a]?delete this._loader.modules[a]:!1},get:function(a){return this._loader.modules[a]?(t(this._loader.modules[a],[],this),this._loader.modules[a].module):void 0},has:function(a){return!!this._loader.modules[a]},"import":function(a,c){var d=this;return y.resolve(d.normalize(a,c&&c.name,c&&c.address)).then(function(a){var e=d._loader;return e.modules[a]?(t(e.modules[a],[],e._loader),e.modules[a].module):e.importPromises[a]||x(d,a,b(e,a,c||{}).then(function(b){return delete e.importPromises[a],r(e,b)}))})},load:function(a){return this._loader.modules[a]?(t(this._loader.modules[a],[],this._loader),y.resolve(this._loader.modules[a].module)):this._loader.importPromises[a]||x(this,a,b(this._loader,a,{}))},module:function(b,c){var d=a();d.address=c&&c.address;var e=h(this._loader,d),g=y.resolve(b),i=this._loader,j=e.done.then(function(){return r(i,d)});return f(i,d,g),j},newModule:function(a){if("object"!=typeof a)throw new TypeError("Expected object");var b=new w;for(var c in a)!function(c){A(b,c,{configurable:!1,enumerable:!0,get:function(){return a[c]}})}(c);return Object.preventExtensions&&Object.preventExtensions(b),b},set:function(a,b){if(!(b instanceof w))throw new TypeError("Loader.set("+a+", module) must be a module");this._loader.modules[a]={module:b}},normalize:function(a){return a},locate:function(a){return a.name},fetch:function(){throw new TypeError("Fetch not implemented")},translate:function(a){return a.source},parse:function(){throw new TypeError("Loader.parse is not implemented")},instantiate:function(){}};var C=v.prototype.newModule;!function(){var a;v.prototype.parse=function(b){if(!a)if("undefined"==typeof window&&"undefined"==typeof WorkerGlobalScope)a=require("traceur");else{if(!__global.traceur)throw new TypeError("Include Traceur for module syntax support");a=__global.traceur}b.isDeclarative=!0;var c=a.options||{};c.modules="instantiate",c.script=!1,c.sourceMaps=!0,c.filename=b.address;var d=new a.Compiler(c),e=d.compile(b.source,c.filename),f=d.getSourceMap();__global.btoa&&f&&(e+="\n//# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(f)))+"\n"),__eval(e,__global,b)}}(),"object"==typeof exports&&(module.exports=v),__global.Reflect=__global.Reflect||{},__global.Reflect.Loader=__global.Reflect.Loader||v,__global.Reflect.global=__global.Reflect.global||__global,__global.LoaderPolyfill=v}(),function(){function a(a){var b=String(a).replace(/^\s+|\s+$/g,"").match(/^([^:\/?#]+:)?(\/\/(?:[^:@]*(?::[^:@]*)?@)?(([^:\/?#]*)(?::(\d*))?))?([^?#]*)(\?[^#]*)?(#[\s\S]*)?/);return b?{href:b[0]||"",protocol:b[1]||"",authority:b[2]||"",host:b[3]||"",hostname:b[4]||"",port:b[5]||"",pathname:b[6]||"",search:b[7]||"",hash:b[8]||""}:null}function b(a){var b=[];return a.replace(/^(\.\.?(\/|$))+/,"").replace(/\/(\.(\/|$))+/g,"/").replace(/\/\.\.$/,"/../").replace(/\/?[^\/]*/g,function(a){"/.."===a?b.pop():b.push(a)}),b.join("").replace(/^\//,"/"===a.charAt(0)?"/":"")}function c(c,d){return d=a(d||""),c=a(c||""),d&&c?(d.protocol||c.protocol)+(d.protocol||d.authority?d.authority:c.authority)+b(d.protocol||d.authority||"/"===d.pathname.charAt(0)?d.pathname:d.pathname?(c.authority&&!c.pathname?"/":"")+c.pathname.slice(0,c.pathname.lastIndexOf("/")+1)+d.pathname:c.pathname)+(d.protocol||d.authority||d.pathname?d.search:d.search||c.search)+d.hash:null}function d(){document.removeEventListener("DOMContentLoaded",d,!1),window.removeEventListener("load",d,!1),e()}function e(){for(var a=document.getElementsByTagName("script"),b=0;b2)throw new TypeError("Only one wildcard in a path is permitted");if(1==g.length){if(d==f&&f.length>e.length){e=f;break}}else d.substr(0,g[0].length)==g[0]&&d.substr(d.length-g[1].length)==g[1]&&(e=f,b=d.substr(g[0].length,d.length-g[1].length-g[0].length))}var i=this.paths[e];return b&&(i=i.replace("*",b)),h&&(i=i.replace(/#/g,"%23")),c(this.baseURL,i)},enumerable:!1,writable:!0}),$__Object$defineProperty(b.prototype,"fetch",{value:function(a){var b=this;return new i(function(d,e){f(c(b.baseURL,a.address),function(a){d(a)},e)})},enumerable:!1,writable:!0}),b}(__global.LoaderPolyfill),l=new k;if("object"==typeof exports&&(module.exports=l),__global.System=l,h&&"undefined"!=typeof document.getElementsByTagName){var m=document.getElementsByTagName("script");m=m[m.length-1],"complete"===document.readyState?setTimeout(e):document.addEventListener&&(document.addEventListener("DOMContentLoaded",d,!1),window.addEventListener("load",d,!1)),m.getAttribute("data-init")&&window[m.getAttribute("data-init")]()}}()}("undefined"!=typeof window?window:"undefined"!=typeof WorkerGlobalScope?self:global); //# sourceMappingURL=es6-module-loader.js.map