forked from stealjs/steal
-
Notifications
You must be signed in to change notification settings - Fork 0
/
steal.production.js
10 lines (10 loc) · 43.6 KB
/
steal.production.js
1
2
3
4
5
6
7
8
9
10
/*
* steal v0.1.0
*
* Copyright (c) 2014 Bitovi; Licensed MIT
*/
/*
* ES6 Promises shim from when.js, Copyright (c) 2010-2014 Brian Cavalier, John Hann, MIT License
*/
!function(){return"undefined"!=typeof Promise&&Promise.all&&Promise.resolve&&Promise.reject}()&&!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;g<d.length;g++)e(d[g]);return e}({1:[function(a,b){var c=b.exports=a("../lib/Promise"),d="undefined"!=typeof global&&global||"undefined"!=typeof window&&window||"undefined"!=typeof self&&self;"undefined"!=typeof d&&"undefined"==typeof d.Promise&&(d.Promise=c)},{"../lib/Promise":2}],2:[function(b,c){!function(a){"use strict";a(function(a){var b=a("./makePromise"),c=a("./scheduler"),d=a("./async");return b({scheduler:new c(d),monitor:"undefined"!=typeof console?console:void 0})})}("function"==typeof a&&a.amd?a:function(a){c.exports=a(b)})},{"./async":4,"./makePromise":5,"./scheduler":6}],3:[function(b,c){!function(a){"use strict";a(function(){function a(a){this.head=this.tail=this.length=0,this.buffer=new Array(1<<a)}return a.prototype.push=function(a){return this.length===this.buffer.length&&this._ensureCapacity(2*this.length),this.buffer[this.tail]=a,this.tail=this.tail+1&this.buffer.length-1,++this.length,this.length},a.prototype.shift=function(){var a=this.buffer[this.head];return this.buffer[this.head]=void 0,this.head=this.head+1&this.buffer.length-1,--this.length,a},a.prototype._ensureCapacity=function(a){var b,c=this.head,d=this.buffer,e=new Array(a),f=0;if(0===c)for(b=this.length;b>f;++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){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){try{return a("vertx").runOnLoop||a("vertx").runOnContext}catch(b){}var c=setTimeout;return function(a){c(a,0)}}(a)})}("function"==typeof a&&a.amd?a:function(a){c.exports=a(b)})},{}],5:[function(b,c){!function(a){"use strict";a(function(){return function(a){function b(a){function b(a){f._handler.resolve(a)}function d(a){f._handler.reject(a)}function e(a){f._handler.notify(a)}var f=this;this._handler=new q,c(a,b,d,e)}function c(a,b,c,d){try{a(b,c,d)}catch(e){c(e)}}function d(a){return a instanceof b?a:new j(new r(k(a)))}function e(a){return new j(new r(new v(a)))}function f(){return G}function g(){return new j(new q)}function h(a){function b(a,b,c,d){c.when(F,F,void 0,a,function(a){b[d]=a,0===--g&&this.resolve(b)},a.reject,a.notify)}var c,d,e=new q,f=a.length>>>0,g=f,h=[];for(c=0;f>c;++c)c in a?(d=a[c],C(d)?b(e,h,l(d),c):(h[c]=d,--g)):--g;return 0===g&&e.resolve(h),new j(e)}function i(a){if(Object(a)===a&&0===a.length)return f();for(var b=new q,c=0;c<a.length;++c)k(a[c]).when(F,F,void 0,b,b.resolve,b.reject);return new j(b)}function j(a){this._handler=a}function k(a,c){return a instanceof b?m(a,c):C(a)?n(a):new u(a)}function l(a){return a instanceof b?a._handler.join():n(a)}function m(a,b){var c=a._handler.join();return b===c?w():c}function n(a){try{var b=a.then;return"function"==typeof b?new t(b,a):new u(a)}catch(c){return new v(c)}}function o(){}function p(a){if(this.handler=a,this._isMonitored()){var b=this._env.promiseMonitor.captureStack();this.trace=a._addTrace(b)}}function q(a){this.consumers=[],this.receiver=a,this.handler=void 0,this.resolved=!1,this._isMonitored()&&(this.trace=this._env.promiseMonitor.captureStack())}function r(a){p.call(this,a)}function s(a,b){p.call(this,a),this.receiver=b}function t(a,b){q.call(this),this.assimilated=!1,this.untrustedThen=a,this.thenable=b}function u(a){this.value=a}function v(a){this.value=a,this.observed=!1,this._isMonitored()&&(this.key=this._env.promiseMonitor.startTrace(a))}function w(){return new v(new TypeError("Promise cycle"))}function x(a){return{state:"fulfilled",value:a}}function y(a){return{state:"rejected",reason:a}}function z(){return{state:"pending"}}function A(a,b,c,d,e,f,g,h){this.a=a,this.b=b,this.c=c,this.d=d,this.e=e,this.f=f,this.g=g,this.handler=h}function B(a,b){this.q=a,this.value=b}function C(a){return("object"==typeof a||"function"==typeof a)&&null!==a}function D(a,b,c){try{return a.call(c,b)}catch(d){return e(d)}}function E(a,b,c){try{return a.call(c,b)}catch(d){return d}}function F(){}var G,H=a.scheduler,I=Object.create||function(a){function b(){}return b.prototype=a,new b};return b.resolve=d,b.reject=e,b.never=f,b._defer=g,b.prototype.then=function(a,b,c){var d=this._handler,e=new q(d.receiver);return d.when(e.resolve,e.notify,e,d.receiver,a,b,c),new j(e)},b.prototype["catch"]=b.prototype.otherwise=function(a){return this.then(void 0,a)},b.prototype._bindContext=function(a){return new j(new s(this._handler,a))},b.all=h,b.race=i,j.prototype=I(b.prototype),o.prototype.inspect=z,o.prototype.when=F,o.prototype.resolve=F,o.prototype.reject=F,o.prototype.notify=F,o.prototype.join=function(){return this},o.prototype._env=a.monitor||b,o.prototype._addTrace=F,o.prototype._isMonitored=function(){return"undefined"!=typeof this._env.promiseMonitor},p.prototype=I(o.prototype),p.prototype.join=function(){return this.handler.join()},p.prototype.inspect=function(){return this.handler.inspect()},p.prototype._addTrace=function(a){return this.handler._addTrace(a)},q.prototype=I(o.prototype),q.prototype.inspect=function(){return this.resolved?this.handler.join().inspect():z()},q.prototype.resolve=function(a){this._join(k(a,this))},q.prototype.reject=function(a){this._join(new v(a))},q.prototype.join=function(){return this.resolved?this.handler.join():this},q.prototype.run=function(){var a=this.consumers,b=this.handler=this.handler.join();this.consumers=void 0;for(var c=0;c<a.length;c+=7)b.when(a[c],a[c+1],a[c+2],a[c+3],a[c+4],a[c+5],a[c+6])},q.prototype._join=function(a){this.resolved||(this.resolved=!0,this.handler=a,H.enqueue(this),this._isMonitored()&&(this.trace=a._addTrace(this.trace)))},q.prototype.when=function(a,b,c,d,e,f,g){this.resolved?H.enqueue(new A(a,b,c,d,e,f,g,this.handler.join())):this.consumers.push(a,b,c,d,e,f,g)},q.prototype.notify=function(a){this.resolved||H.enqueue(new B(this.consumers,a))},q.prototype._addTrace=function(a){return this.resolved?this.handler._addTrace(a):a},r.prototype=I(p.prototype),r.prototype.when=function(a,b,c,d,e,f,g){H.enqueue(new A(a,b,c,d,e,f,g,this.join()))},s.prototype=I(p.prototype),s.prototype.when=function(a,b,c,d,e,f,g){void 0!==this.receiver&&(d=this.receiver),this.join().when(a,b,c,d,e,f,g)},t.prototype=I(q.prototype),t.prototype.when=function(a,b,c,d,e,f,g){this.assimilated||(this.assimilated=!0,this._assimilate()),q.prototype.when.call(this,a,b,c,d,e,f,g)},t.prototype._assimilate=function(){function a(a){d.resolve(a)}function b(a){d.reject(a)}function c(a){d.notify(a)}var d=this;this._try(this.untrustedThen,this.thenable,a,b,c)},t.prototype._try=function(a,b,c,d,e){try{a.call(b,c,d,e)}catch(f){d(f)}},u.prototype=I(o.prototype),u.prototype.inspect=function(){return x(this.value)},u.prototype.when=function(a,b,c,d,e){var f="function"==typeof e?D(e,this.value,d):this.value;a.call(c,f)},v.prototype=I(o.prototype),v.prototype.inspect=function(){return y(this.value)},v.prototype.when=function(a,b,c,d,f,g){this._isMonitored()&&!this.observed&&this._env.promiseMonitor.removeTrace(this.key),this.observed=!0;var h="function"==typeof g?D(g,this.value,d):e(this.value);a.call(c,h)},v.prototype._addTrace=function(a){this.observed||this._env.promiseMonitor.updateTrace(this.key,a)},G=new j(new o),A.prototype.run=function(){this.handler.when(this.a,this.b,this.c,this.d,this.e,this.f,this.g)},B.prototype.run=function(){for(var a=this.q,b=1;b<a.length;b+=7)this._notify(a[b],a[b+1],a[b+2],a[b+5])},B.prototype._notify=function(a,b,c,d){var e="function"==typeof d?E(d,this.value,c):this.value;a.call(b,e)},b}})}("function"==typeof a&&a.amd?a:function(a){c.exports=a()})},{}],6:[function(b,c){!function(a){"use strict";a(function(a){function b(a){this._enqueue=a,this._handlerQueue=new c(15);var b=this;this.drainQueue=function(){b._drainQueue()}}var c=a("./Queue");return b.prototype.enqueue=function(a){1===this._handlerQueue.push(a)&&this._enqueue(this.drainQueue)},b.prototype._drainQueue=function(){for(var a=this._handlerQueue;a.length>0;)a.shift().run()},b})}("function"==typeof a&&a.amd?a:function(a){c.exports=a(b)})},{"./Queue":3}]},{},[1])(1)}),function(global){function __eval(__source,global,__moduleName){try{eval('var __moduleName = "'+(__moduleName||"").replace('"','"')+'"; with(global) { (function() { '+__source+" \n }).call(global); }")}catch(e){throw"SyntaxError"==e.name&&(e.message="Evaluating "+(__sourceURL||__moduleName)+"\n "+e.message),e}}!function(){function a(a){return{status:"loading",name:a,metadata:{},linkSets:[]}}function b(b,d,e,f){return new v(function(a){a(b.normalize(d,e,f))}).then(function(d){var e;if(b._modules[d])return e=a(d),e.status="linked",e;for(var f=0,g=b._loads.length;g>f;f++)if(e=b._loads[f],e.name==d)return e;return e=a(d),b._loads.push(e),c(b,e),e})}function c(a,b){d(a,b,v.resolve().then(function(){return a.locate({name:b.name,metadata:b.metadata})}))}function d(a,b,c){e(a,b,c.then(function(c){return"failed"==b.status?void 0:(b.address=c,a.fetch({name:b.name,metadata:b.metadata,address:c}))}))}function e(a,c,d){d.then(function(b){return"failed"==c.status?void 0:a.translate({name:c.name,metadata:c.metadata,address:c.address,source:b})}).then(function(b){return"failed"==c.status?void 0:(c.source=b,a.instantiate({name:c.name,metadata:c.metadata,address:c.address,source:b}))}).then(function(d){if("failed"==c.status)return void 0;var e;if(void 0===d){if(!global.traceur)throw new TypeError("Include Traceur for module syntax support");t||(t=global.traceur,$traceurRuntime.ModuleStore.get=$traceurRuntime.getModuleImpl=function(a){return System.get(a)}),c.address=c.address||"anon"+ ++z;var f=new t.syntax.Parser(new t.syntax.SourceFile(c.address,c.source));c.body=f.parseModule(),e=r(c.body),c.kind="declarative"}else{if("object"!=typeof d)throw TypeError("Invalid instantiate return value");e=d.deps||[],c.execute=d.execute,c.kind="dynamic"}c.dependencies={},c.depsList=e;for(var h=[],i=0,j=e.length;j>i;i++)(function(d){var e=b(a,d,c.name,c.address);e.then(function(a){if(c.dependencies[d]=a.name,"linked"!=a.status)for(var b=c.linkSets.concat([]),e=0,f=b.length;f>e;e++)g(b[e],a)}),h.push(e)})(e[i]);return v.all(h)}).then(function(){c.status="loaded";for(var a=c.linkSets.concat([]),b=0,d=a.length;d>b;b++)h(a[b],c)},function(a){c.status="failed",c.exception=a;for(var b=0,d=c.linkSets.length;d>b;b++)i(c.linkSets[b],a)})}function f(a,b){var c,d,e=new v(function(a,b){c=a,d=b}),f={loader:a,loads:[],done:e,resolve:c,reject:d,loadingCount:0};return g(f,b),f}function g(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++;var e=a.loader;for(var f in b.dependencies){var h=b.dependencies[f];if(!e._modules[h])for(var c=0,d=e._loads.length;d>c;c++)if(e._loads[c].name==h){g(a,e._loads[c]);break}}}function h(a,b){if(a.loadingCount--,!(a.loadingCount>0)){var c=a.loads[0];try{o(a.loads,a.loader)}catch(d){return i(a,d)}a.resolve(c)}}function i(a,b){for(var c=a.loads.concat([]),d=0,e=c.length;e>d;d++){var f=c[d],g=x.call(f.linkSets,a);if(f.linkSets.splice(g,1),0==f.linkSets.length){var h=x.call(a.loader._loads,f);-1!=h&&a.loader._loads.splice(h,1)}}a.reject(b)}function j(a,b){b.name&&(a._modules[b.name]=b.module);var c=x.call(a._loads,b);-1!=c&&a._loads.splice(c,1);for(var d=0,e=b.linkSets.length;e>d;d++)c=x.call(b.linkSets[d].loads,b),b.linkSets[d].loads.splice(c,1);b.linkSets=[]}function k(a,b,c){return new v(l(a,b,c&&c.address?"fetch":"locate",void 0,c&&c.address,void 0)).then(function(a){return a})}function l(b,g,h,i,j,k){return function(l,m){if(b._modules[g])throw new TypeError('Module "'+g+'" already exists in the module table');for(var n=0,o=b._loads.length;o>n;n++)if(b._loads[n].name==g)throw new TypeError('Module "'+g+'" is already loading');var p=a(g);i&&(p.metadata=i);var q=f(b,p);b._loads.push(p),q.done.then(l,m),"locate"==h?c(b,p):"fetch"==h?d(b,p,v.resolve(j)):(p.address=j,e(b,p,v.resolve(k)))}}function m(a,b){return n(b.module,a),b.module.module}function n(a,b){if(a.module)return a.module;for(var c in a.dependencies){var d=a.dependencies[c];b._modules[d].module||n(b._modules[d],b)}t.options.sourceMaps=!0,t.options.modules="instantiate";var e=new t.util.ErrorReporter;e.reportMessageInternal=function(a,b){throw b+"\n"+a};var f=global.System;global.System=global.traceurSystem;var g=new t.codegeneration.module.AttachModuleNameTransformer(a.name).transformAny(a.body);g=new t.codegeneration.FromOptionsTransformer(e).transform(g),global.System=f,delete a.body;var h=new t.outputgeneration.SourceMapGenerator({file:a.address}),i={sourceMapGenerator:h},j=t.outputgeneration.TreeWriter.write(g,i);global.btoa&&(j+="\n//# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(i.sourceMap)))+"\n");var k=System.register;System.register=function(c,d,e){for(var g=0;g<d.length;g++)d[g]=a.dependencies[d[g]];global.System=b,a.module=new s(e.apply(global,d)),global.System=f},__eval(j,global,a.name),System.register=k}function o(a,b){for(var c=!1;a.length;){c=!0;a:for(var d=0;d<a.length;d++){var e=a[d],f=[];for(var g in e.dependencies){var h=e.dependencies[g];if(!b._modules[h])continue a;var i=x.call(e.depsList,g);f[i]=h}if(c=!1,"declarative"==e.kind)e.module={name:e.name,dependencies:e.dependencies,body:e.body,address:e.address};else{var k=e.execute.apply(null,f);if(!(k instanceof s))throw new TypeError("Execution must define a Module instance");e.module={module:k}}e.status="linked",j(b,e)}if(c)throw new TypeError("Circular dependencies not supported by the polyfill")}}function p(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),u(this,"global",{get:function(){return global}}),u(this,"realm",{get:function(){throw new TypeError("Realms not implemented in polyfill")}}),this._modules={},this._loads=[]}function q(a,b,c,d){var e,f;if(b(a,c,d)!==!1)for(e in a)a.hasOwnProperty(e)&&"location"!=e&&"type"!=e&&(f=a[e],"object"==typeof f&&null!==f&&q(f,b,a,e))}function r(a){function b(a){-1==x.call(c,a)&&c.push(a)}var c=[];return q(a,function(a){"EXPORT_DECLARATION"==a.type?a.declaration.moduleSpecifier&&b(a.declaration.moduleSpecifier.token.processedValue):"IMPORT_DECLARATION"==a.type?b(a.moduleSpecifier.token.processedValue):"MODULE_DECLARATION"==a.type&&b(a.expression.token.processedValue)}),c}function s(a){if("object"!=typeof a)throw new TypeError("Expected object");if(!(this instanceof s))return new s(a);var b=this;for(var c in a)!function(a,c){u(b,a,{configurable:!1,enumerable:!0,get:function(){return c}})}(c,a[c]);Object.preventExtensions&&Object.preventExtensions(this)}var t,u,v=global.Promise||require("./promise");try{Object.defineProperty({},"a",{})&&(u=Object.defineProperty)}catch(w){u=function(a,b,c){try{a[b]=c.value||c.get.call(a)}catch(d){}}}console.assert=console.assert||function(){};var x=Array.prototype.indexOf||function(a){for(var b=0,c=this.length;c>b;b++)if(this[b]===a)return b;return-1},y={};p.prototype={define:function(a,b,c){if(y[a])throw new TypeError("Module is already loading.");return y[a]=new v(l(this,a,c&&c.address?"fetch":"translate",c&&c.meta||{},c&&c.address,b)),y[a].then(function(){delete y[a]})},load:function(a,b){return this._modules[a]?(n(this._modules[a],this),v.resolve(this._modules[a].module)):y[a]?y[a]:(y[a]=k(this,a,b),y[a].then(function(){delete y[a]}))},module:function(b,c){var d=a();d.address=c&&c.address;var g=f(this,d),h=v.resolve(b),i=this,j=g.done.then(function(){return m(i,d)});return e(this,d,h),j},"import":function(a,b){if(this._modules[a])return n(this._modules[a],this),v.resolve(this._modules[a].module);var c=this;return(y[a]||(y[a]=k(this,a,b))).then(function(b){return delete y[a],m(c,b)})},eval:function(){throw new TypeError("Eval not implemented in polyfill")},get:function(a){return this._modules[a]?(n(this._modules[a],this),this._modules[a].module):void 0},has:function(a){return!!this._modules[a]},set:function(a,b){if(!(b instanceof s))throw new TypeError("Set must be a module");this._modules[a]={module:b}},"delete":function(a){return this._modules[a]?delete this._modules[a]:!1},entries:function(){throw new TypeError("Iteration not yet implemented in the polyfill")},keys:function(){throw new TypeError("Iteration not yet implemented in the polyfill")},values:function(){throw new TypeError("Iteration not yet implemented in the polyfill")},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},instantiate:function(){}};var z=0;"object"==typeof exports&&(module.exports=p),global.Reflect=global.Reflect||{},global.Reflect.Loader=global.Reflect.Loader||p,global.LoaderPolyfill=p,global.Module=s}()}("undefined"!=typeof global?global:this),function(a){function b(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 c(a,c){function d(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)?"/":"")}return c=b(c||""),a=b(a||""),c&&a?(c.protocol||a.protocol)+(c.protocol||c.authority?c.authority:a.authority)+d(c.protocol||c.authority||"/"===c.pathname.charAt(0)?c.pathname:c.pathname?(a.authority&&!a.pathname?"/":"")+a.pathname.slice(0,a.pathname.lastIndexOf("/")+1)+c.pathname:a.pathname)+(c.protocol||c.authority||c.pathname?c.search:c.search||a.search)+c.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;b<a.length;b++){var c=a[b];if("module"==c.type){var d=c.getAttribute("name"),e=c.getAttribute("src"),f=c.innerHTML;(d?k.define(d,f,{address:e}):k.module(f,{address:e})).then(function(){},function(a){nextTick(function(){throw a})})}}}var f,g="undefined"!=typeof window,h=a.Reflect&&a.Reflect.Loader||require("./loader"),i=a.Promise||require("./promise");if(g)f=function(a,b,c){function d(){b(f.responseText)}function e(){c(f.statusText+": "+a||"XHR error")}var f=new XMLHttpRequest,g=!0;if(!("withCredentials"in f)){var h=/^(\w+:)?\/\/([^\/]+)/.exec(a);h&&(g=h[2]===window.location.host,h[1]&&(g&=h[1]===window.location.protocol))}g||(f=new XDomainRequest,f.onload=d,f.onerror=e,f.ontimeout=e),f.onreadystatechange=function(){4===f.readyState&&(200===f.status||0==f.status&&f.responseText?d():e())},f.open("GET",a,!0),f.send(null)};else{var j=require("fs");f=function(a,b,c){return j.readFile(a,function(a,d){return a?c(a):void b(d+"")})}}var k=new h({global:g?window:a,strict:!0,normalize:function(a,b){if("string"!=typeof a)throw new TypeError("Module name must be a string");var c=a.split("/");if(0==c.length)throw new TypeError("No module name provided");var d=0,e=!1,f=0;if("."==c[0]){if(d++,d==c.length)throw new TypeError('Illegal module name "'+a+'"');e=!0}else{for(;".."==c[d];)if(d++,d==c.length)throw new TypeError('Illegal module name "'+a+'"');d&&(e=!0),f=d}for(var g=d;g<c.length;g++){var h=c[g];if(""==h||"."==h||".."==h)throw new TypeError('Illegal module name "'+a+'"')}if(!e)return a;{var i=[],j=(b||"").split("/");j.length-1-f}return i=i.concat(j.splice(0,j.length-1-f)),i=i.concat(c.splice(d,c.length-d)),i.join("/")},locate:function(a){var b,d=a.name,e="";for(var f in this.paths){var g=f.split("*");if(g.length>2)throw new TypeError("Only one wildcard in a path is permitted");1==g.length?d==f&&f.length>e.length&&(e=f):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 h=this.paths[e];return b&&(h=h.replace("*",b)),c(this.baseURL,h)},fetch:function(a){var b,d,e=new i(function(a,c){b=a,d=c});return f(c(this.baseURL,a.address),function(a){b(a)},d),e}});if(g){var l=window.location.href.split("#")[0].split("?")[0];k.baseURL=l.substring(0,l.lastIndexOf("/")+1)}else k.baseURL="./";if(k.paths={"*":"*.js"},a.System&&a.traceur&&(a.traceurSystem=a.System),a.System=k,g){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")]()}"object"==typeof exports&&(module.exports=k)}("undefined"!=typeof global?global:this),function(__$global){var extend=function(a,b){for(var c in b)a[c]=b[c];return a},cloneSystemLoader=function(a){var b=__$global.Loader||__$global.LoaderPolyfill,c=new b(a);return c.baseURL=a.baseURL,c.paths=extend({},a.paths),c},upgradeLoader=function(baseLoader){function core(loader){function __eval(__source,__global,__address,__sourceMap){try{__source="with(__global) { (function() { "+__source+" \n }).call(__global); }\n//# sourceURL="+__address+(__sourceMap?"\n//# sourceMappingURL="+__sourceMap:""),eval(__source)}catch(e){throw"SyntaxError"==e.name&&(e.message="Evaluating "+__address+"\n "+e.message),e}}!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(b,c){function d(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)?"/":"")}return c=a(c||""),b=a(b||""),c&&b?(c.protocol||b.protocol)+(c.protocol||c.authority?c.authority:b.authority)+d(c.protocol||c.authority||"/"===c.pathname.charAt(0)?c.pathname:c.pathname?(b.authority&&!b.pathname?"/":"")+b.pathname.slice(0,b.pathname.lastIndexOf("/")+1)+c.pathname:b.pathname)+(c.protocol||c.authority||c.pathname?c.search:c.search||b.search)+c.hash:null}var c=function(a){if(!(a instanceof Module)){for(var b=[],d=0;d<a.length;d++)b[d]=c(a[d]);return b}return a.__useDefault?a["default"]:a};loader.getModule=function(a){return c(loader.get(a))},loader.set("@empty",Module({}));var d=loader["import"];loader["import"]=function(a,b){return new Promise(function(c){c(loader.normalize.call(this,a,b&&b.name,b&&b.address))}).then(function(a){return Promise.resolve(d.call(loader,a,b)).then(function(a){return c(a)})})};var e;if("undefined"==typeof window)e=__dirname+"/";else if(e=document.baseURI,!e){var f=document.getElementsByTagName("base");e=f[0]&&f[0].href||window.location.href}loader.meta={};var g,h=loader.locate;loader.locate=function(a){this.baseURL!=g&&(this.baseURL=g=b(e,this.baseURL));var c=loader.meta[a.name];for(var d in c)a.metadata[d]=c[d];return Promise.resolve(h.call(this,a))};var i=loader.translate;loader.translate=function(a){var b=loader.meta[a.name];for(var c in b)a.metadata[c]=b[c];return i(a)},loader.__exec=function(a){var c=!1;"@traceur"==a.name&&loader===loader.global.System&&(c=!0);var d,e=a.source.lastIndexOf("\n");-1!=e&&"//# sourceMappingURL="==a.source.substr(e+1,21)&&(d=b(a.address,a.source.substr(e+22))),__eval(a.source,loader.global,a.address,d),c&&(loader.global.traceurSystem=loader.global.System,loader.global.System=loader)}}()}function formats(a){var b={};if(a.format={},a.formats=[],"undefined"!=typeof window){var c=document.getElementsByTagName("script");c=c[c.length-1],a.paths["@traceur"]=c.getAttribute("data-traceur-src")||c.src.substr(0,c.src.lastIndexOf("/")+1)+"traceur.js"}var d=/(?:^\s*|[}{\(\);,\n]\s*)(import\s+['"]|(import|module)\s+[^"'\(\)\n;]+\s+from\s+['"]|export\s+(\*|\{|default|function|var|const|let|[_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*))/,e=/^\s*export\s*\*\s*from\s*(?:'([^']+)'|"([^"]+)")/,f=/^(\s*(\/\*.*\*\/)|(\/\/[^\n]*))*(["']use strict["'];?)?["']([^'"]+)["'][;\n]/,g=a.instantiate;a.instantiate=function(c){var h=c.name||"";c.source=c.source||"";var i=c.metadata.format;if(!i){var j=c.source.match(f);j&&(i=c.metadata.format=j[5])}"@traceur"==h&&(i="global");var k;if(!a.global.traceur&&("es6"==i||!i)&&(k=c.source.match(e)))return{deps:[k[1]||k[2]],execute:function(b){return a.get(b)}};if("es6"==i||!i&&c.source.match(d))return a.global.traceur?g.call(a,c):a["import"]("@traceur").then(function(){return g.call(a,c)});if((c.metadata.exports||c.metadata.deps)&&(i="global"),!i||!this.format[i])for(var l=0;l<this.formats.length;l++){var m=this.formats[l],n=this.format[m];if(n.detect(c)){i=m;break}}var n=this.format[i];if(!i||!n)throw new TypeError("No format found for "+(i?i:c.address));c.metadata.format=i,b[c.name]=c;for(var o=n.deps(c),l=0;l<o.length;l++)lastIndexOf.call(o,o[l])!=l&&o.splice(l--,1);return{deps:o,execute:function(){var d=n.execute.call(this,Array.prototype.splice.call(arguments,0,arguments.length),c);return delete b[c.name],d instanceof a.global.Module?d:new a.global.Module(d&&d.__esModule?d:{__useDefault:!0,"default":d})}}};var h=a.normalize;a.normalize=function(a,c,d){var e=b[c],f=e&&this.format[e.metadata.format],g=f&&f.normalize;return g?g.call(this,a,c,d,h):h.apply(this,arguments)}}function formatAMD(a){function b(b,c,d){return function(e,g,h){return"string"==typeof e&&-1!=indexOf.call(c,e)?a.getModule(d[indexOf.call(c,e)]):f(e,g,h,{name:b})}}function c(a,b){for(var c=0;c<a.length;c++)lastIndexOf.call(a,a[c])!=c&&a.splice(c--,1);var d;return-1!=(d=indexOf.call(a,"require"))&&(b.requireIndex=d,a.splice(d,1)),-1!=(d=indexOf.call(a,"exports"))&&(b.exportsIndex=d,a.splice(d,1)),-1!=(d=indexOf.call(a,"module"))&&(b.moduleIndex=d,a.splice(d,1)),a}function d(c,d){for(var e=d.metadata,f=[],g=0;g<c.length;g++){var h=a.get(c[g]);if(h.__useDefault)h=h["default"];else if(!h.__esModule){var i={__esModule:!0};for(var j in h)i[j]=h[j];h=i}f[g]=h}var h,k;return void 0!==e.moduleIndex&&f.splice(e.moduleIndex,0,k={},h={id:d.name,uri:d.address,config:function(){return{}},exports:k}),void 0!==e.exportsIndex&&f.splice(e.exportsIndex,0,k=k||{}),void 0!==e.requireIndex&&f.splice(e.requireIndex,0,b(d.name,e.deps,c)),{deps:f,module:h||k&&{exports:k}}}a.formats.push("amd");var e=/(?:^\s*|[}{\(\);,\n\?\&]\s*)define\s*\(\s*("[^"]+"\s*,\s*|'[^']+'\s*,\s*)?(\[(\s*("[^"]+"|'[^']+')\s*,)*(\s*("[^"]+"|'[^']+')\s*)?\]|function\s*|{|[_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*\))/,f=a.require=function(b,c,d,e){if("object"==typeof b&&!(b instanceof Array))return f.apply(null,Array.prototype.splice.call(arguments,1,arguments.length-1));if(!(b instanceof Array)){if("string"==typeof b)return a.getModule(b);throw"Invalid require"}Promise.all(b.map(function(b){return a["import"](b,e)})).then(function(a){c.apply(null,a)},d)};a.format.amd={detect:function(a){return!!a.source.match(e)},deps:function(b){var e,f=a.global,g=b.metadata,h=!1;return f.define=function(i,j,k){if("string"!=typeof i&&(k=j,j=i,i=null),!i&&h)throw"Multiple anonymous defines for module "+b.name;if(i||(h=!0),!(j instanceof Array)){k=j;var l=b.source;b.source=k.toString(),j=["require","exports","module"].concat(a.format.cjs.deps(b,f)),b.source=l}if("function"!=typeof k&&(k=function(a){return function(){return a}}(k)),i&&i!=b.name){var m={name:i,address:i,metadata:{}};m.metadata.deps=j=c(j,m.metadata),a.defined[i]={deps:j,execute:function(){var a=d(Array.prototype.splice.call(arguments,0,arguments.length),m),b=k.apply(f,a.deps)||a.module&&a.module.exports;return b instanceof f.Module?b:new f.Module(b&&b.__esModule?b:{__useDefault:!0,"default":b})}}}else e=j,g.factory=k},f.define.amd={},f.module=void 0,f.exports=void 0,a.__exec(b),e=e||[],e=c(e,g),f.define=void 0,g.deps=e,e},execute:function(b,c){if(c.metadata.factory){var e=d(b,c);return c.metadata.factory.apply(a.global,e.deps)||e.module&&e.module.exports}}}}function formatCJS(a){a.formats.push("cjs");var b=/(?:^\s*|[}{\(\);,\n=:\?\&]\s*|module\.)(exports\s*\[\s*('[^']+'|"[^"]+")\s*\]|\exports\s*\.\s*[_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*|exports\s*\=)/,c=/(?:^\s*|[}{\(\);,\n=:\?\&]\s*)require\s*\(\s*("([^"]+)"|'([^']+)')\s*\)/g,d=/(\/\*([\s\S]*?)\*\/|([^:]|^)\/\/(.*)$)/gm,e=function(){},f={nextTick:function(a){setTimeout(a,7)},browser:!0,env:{},argv:[],on:e,once:e,off:e,emit:e,cwd:function(){return"/"}};a.set("@@nodeProcess",Module(f)),a.format.cjs={detect:function(a){return b.lastIndex=0,c.lastIndex=0,!(!c.exec(a.source)&&!b.exec(a.source))},deps:function(a){b.lastIndex=0,c.lastIndex=0;for(var e,f=[],g=a.source.replace(d,"");e=c.exec(g);)f.push(e[2]||e[3]);return a.metadata.deps=f,f},execute:function(b,c){var d=c.address.split("/");d.pop(),d=d.join("/");var e=c.metadata.deps,g=a.global._g={global:a.global,exports:{},process:f,require:function(c){var d=indexOf.call(e,c);return-1!=d?a.getModule(b[d]):void 0},__filename:c.address,__dirname:d};g.module={exports:g.exports};var h="";for(var i in g)h+="var "+i+" = _g."+i+";";var j={name:c.name,source:h+c.source,address:c.address};return a.__exec(j),a.global._g=void 0,g.module.exports}}}function formatGlobal(a){a.formats.push("global");var b=/(["']global["'];\s*)((['"]import [^'"]+['"];\s*)*)(['"]export ([^'"]+)["'])?/,c=/(["']import [^'"]+)+/g,d={};a.shim={},a.format.global={detect:function(){return!0},deps:function(a){var d,e;if(d=a.source.match(b)){if(e=d[2].match(c))for(var f=0;f<e.length;f++)e[f]=e[f].substr(8);a.metadata.exports=d[5]}return e=e||[],a.metadata.deps&&(e=e.concat(a.metadata.deps)),e},execute:function(b,c){for(var e=a.global.hasOwnProperty,f=c.metadata.exports,g=0;g<b.length;g++){var h=d[b[g]];if(h)for(var i in h)a.global[i]=h[i]}var j={};for(var k in a.global)(!e||a.global.hasOwnProperty(k))&&(j[k]=a.global[k]);f&&(c.source+='\nthis["'+f+'"] = '+f),a.__exec(c);var l,h;if(f){var m=f.split(".")[0];l=eval.call(a.global,f),h={},h[m]=a.global[m]}else{h={};for(var k in a.global)(e||"sessionStorage"!=k&&"localStorage"!=k&&"clipboardData"!=k&&"frames"!=k)&&(e&&!a.global.hasOwnProperty(k)||k==a.global||j[k]==a.global[k]||(h[k]=a.global[k],l?l!==a.global[k]&&(l=!1):l!==!1&&(l=a.global[k])))}return d[c.name]=h,l?l:new Module(h)}}}function map(a){function b(a,b){var c=b.split("/"),d=a.split("/");if(c.length>d.length)return 0;for(var e=0;e<c.length;e++)if(d[e]!=c[e])return 0;return c.length}function c(c,d){var e,f,g,h,i=0,j=0;if(d)for(var k in a.map){var l=a.map[k];if("object"==typeof l&&!(b(d,k)<=j))for(var m in l)b(c,m)<=i||(e=m,i=m.split("/").length,f=k,j=k.split("/").length)}e&&(h=c.split("/"),g=h.splice(i,h.length-i).join("/"),c=a.map[f][e]+(g?"/"+g:""),i=0);for(var k in a.map){var l=a.map[k];
"string"==typeof l&&(b(c,k)<=i||(e=k,i=k.split("/").length))}return i?(h=c.split("/"),g=h.splice(i,h.length-i).join("/"),a.map[e]+(g?"/"+g:"")):c}a.map=a.map||{};var d=a.normalize;a.normalize=function(b,e,f){return Promise.resolve(d.call(a,b,e,f)).then(function(a){return c(a,e)})}}function plugins(a){var b=a.normalize;a.normalize=function(c,d,e){var f;return d&&-1!=(f=d.indexOf("!"))&&(d=d.substr(0,f)),Promise.resolve(b(c,d,e)).then(function(b){var c=b.lastIndexOf("!");if(-1!=c){var f=b.substr(0,c),g=b.substr(c+1)||f.substr(f.lastIndexOf(".")+1);return new Promise(function(b){b(a.normalize(g,d,e))}).then(function(b){return g=b,a.normalize(f,d,e)}).then(function(a){return a+"!"+g})}return b})};var c=a.locate;a.locate=function(b){var d=b.name,e=d.lastIndexOf("!");if(-1!=e){var f=d.substr(e+1);b.name=d.substr(0,e);var g=a.pluginLoader||a;return g.load(f).then(function(){var c=g.get(f);return c=c["default"]||c,b.metadata.plugin=c,b.metadata.pluginName=f,b.metadata.pluginArgument=b.name,b.metadata.buildType=c.buildType||"js",c.locate?c.locate.call(a,b):new Promise(function(c){c(a.locate(b))}).then(function(a){return a.substr(0,a.length-3)})})}return c.call(this,b)};var d=a.fetch;a.fetch=function(a){var b=this;return"function"==typeof a.metadata.plugin?new Promise(function(c,e){a.metadata.plugin(a.metadata.pluginArgument,a.address,function(c,e,f){d.call(b,{name:a.name,address:c,metadata:{}}).then(e,f)},c,e)}):(a.metadata.plugin&&a.metadata.plugin.fetch||d).call(this,a)};var e=a.translate;a.translate=function(a){var b=a.metadata.plugin;return b&&b.translate?b.translate.call(this,a):e.call(this,a)};var f=a.instantiate;a.instantiate=function(a){var b=a.metadata.plugin;return b&&b.instantiate?b.instantiate.call(this,a):f.call(this,a)}}function bundles(a){a.bundles=a.bundles||{};var b=a.fetch;a.fetch=function(c){for(var d in a.bundles)if(-1!=indexOf.call(a.bundles[d],c.name))return Promise.resolve(a.normalize(d)).then(function(b){return a.bundles[b]=a.bundles[b]||a.bundles[d],a.load(b)}).then(function(){return""});return b.apply(this,arguments)};var c=a.locate;a.locate=function(b){return a.bundles[b.name]&&(b.metadata.bundle=!0),c.call(this,b)}}function register(a){a.defined={},a.register=function(b,c,d){a.defined[b]={deps:c,execute:function(){return Module(d.apply(this,arguments))}}};var b=a.locate;a.locate=function(c){return a.defined[c.name]?"":b.apply(this,arguments)};var c=a.fetch;a.fetch=function(b){return a.defined[b.name]?"":c.apply(this,arguments)};var d=a.instantiate;a.instantiate=function(b){if(a.defined[b.name]){var c=a.defined[b.name];return delete a.defined[b.name],c}return d.apply(this,arguments)}}function versions(a){var b=/^(\d+)(?:\.(\d+)(?:\.(\d+)(?:-([0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*))?)?)?$/,c=function(a,b){var c,d=a.split("."),e=b.split(".");d[2]&&-1!=(c=indexOf.call(d[2],"-"))&&d.splice(2,1,d[2].substr(0,c),d[2].substr(c+1)),e[2]&&-1!=(c=indexOf.call(e[2],"-"))&&e.splice(2,1,e[2].substr(0,c),e[2].substr(c+1));for(var f=0;f<Math.max(d.length,e.length);f++){if(!d[f])return 1;if(!e[f])return-1;if(d[f]!=e[f])return parseInt(d[f])>parseInt(e[f])?1:-1}return 0},d=a.normalize;a.versions=a.versions||{},a.normalize=function(e,f,g){var h=a.versions;return Promise.resolve(d.call(this,e,f,g)).then(function(a){var d,e,f,g,i=a.indexOf("@");if(-1==i){for(var j in h)if(g=h[j],a.substr(0,j.length)==j&&(f=a.substr(j.length,1),!f||"/"==f))return j+"@"+("string"==typeof g?g:g[g.length-1])+a.substr(j.length);return a}d=a.substr(i+1).split("/")[0];var k,l=d.length;if("^"==d.substr(0,1)&&(d=d.substr(1),k=!0),e=d.match(b),!e)return a;k&&(e[2]||(k=!1),e[3]||(e[2]>0?e[3]="0":k=!1)),k&&(e[1]>0?(e[2]||(d=e[1]+".0.0"),e[3]||(d=e[1]+".0"),k=d,e=[e[1]]):e[2]>0?(k=d,e=[0,e[2]]):(k=!1,e=[0,0,e[3]]),d=e.join("."));var m=a.substr(0,i);if(g=h[m]||[],"string"==typeof g&&(g=[g]),!e[3]||k)for(var n=g.length-1;n>=0;n--){var o=g[n];if(o.substr(0,d.length)==d&&o.substr(d.length,1).match(/^[\.\-]?$/)&&(!k||k&&-1!=c(o,k)))return m+"@"+o+a.substr(m.length+l+1)}return-1==indexOf.call(g,d)&&(g.push(d),g.sort(c),a=m+"@"+d+a.substr(m.length+l+1),e[3]&&-1!=(i=indexOf.call(g,e[1]+"."+e[2]))&&g.splice(i,1),e[2]&&-1!=(i=indexOf.call(g,e[1]))&&g.splice(i,1),h[m]=1==g.length?g[0]:g),a})}}var System=cloneSystemLoader(baseLoader),indexOf=Array.prototype.indexOf||function(a){for(var b=0,c=this.length;c>b;b++)if(this[b]===a)return b;return-1},lastIndexOf=Array.prototype.lastIndexOf||function(a){for(var b=this.length-1;b>=0;b--)if(this[b]===a)return b;return-b};return core(System),formats(System),formatAMD(System),formatCJS(System),formatGlobal(System),map(System),plugins(System),bundles(System),register(System),versions(System),__$global.systemMainEntryPoint&&System["import"](__$global.systemMainEntryPoint),System};!function(){if(__$global.upgradeSystemLoader=function(){__$global.upgradeSystemLoader=void 0;var a=__$global.System;__$global.System=upgradeLoader(System),__$global.System.clone=function(){return upgradeLoader(a)}},!__$global.System||__$global.System.registerModule)if("undefined"!=typeof window){var a=curScript.src,b=a.substr(0,a.lastIndexOf("/")+1);document.write('<script type="text/javascript" src="'+b+'es6-module-loader.js" data-init="upgradeSystemLoader"></script>')}else{{var c=require("es6-module-loader");c.System}__$global.System=c.System,__$global.Loader=c.Loader,__$global.Module=c.Module,__$global.upgradeSystemLoader(),module.exports=__$global.System}else __$global.upgradeSystemLoader()}()}("undefined"!=typeof window?window:global),function(a){function b(a){for(var b=0;b<a.length;b++)[].lastIndexOf.call(a,a[b])!=b&&a.splice(b--,1);return a}var c=function(a){return a.replace(/-+(.)?/g,function(a,b){return b?b.toUpperCase():""})},d=function(a,b){var c,d;if("number"==typeof a.length&&a.length-1 in a)for(c=0,d=a.length;d>c;c++)b.call(a[c],a[c],c,a);else for(c in a)a.hasOwnProperty(c)&&b.call(a[c],a[c],c,a);return a},e=function(a){return"string"==typeof a},f=function(a,b){return d(b,function(b,c){a[c]=b}),a},g=function(a){var b=a.lastIndexOf("/");return-1!==b?a.substr(0,b):a},h=function(a){return a[a.length-1]},i=function(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},j=function(a,b){function c(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)?"/":"")}return b=i(b||""),a=i(a||""),b&&a?(b.protocol||a.protocol)+(b.protocol||b.authority?b.authority:a.authority)+c(b.protocol||b.authority||"/"===b.pathname.charAt(0)?b.pathname:b.pathname?(a.authority&&!a.pathname?"/":"")+a.pathname.slice(0,a.pathname.lastIndexOf("/")+1)+b.pathname:a.pathname)+(b.protocol||b.authority||b.pathname?b.search:b.search||a.search)+b.hash:null},k=function(a){var b=a.lastIndexOf("/"),c=(-1==b?a:a.substr(b+1)).match(/^[\w-\s\.]+/);return c?c[0]:""},l=function(a){var b=k(a),c=b.lastIndexOf(".");return-1!==c?b.substr(c+1):""},m={},n=function(a){var b=a.lastIndexOf("!"),c="";if(-1!=b){var d=a.substr(0,b),e=a.substr(b+1)||d.substr(d.lastIndexOf(".")+1);c="!"+e,m[e]=!0,a=d}else if(m[a])return a;var f=k(a),g=l(a);return"/"===a[a.length-1]?a+k(a.substr(0,a.length-1))+c:/^(\w+(?:s)?:\/\/|\.|file|\/)/.test(a)||-1!==f.indexOf(".")?"js"===g?a.substr(0,a.lastIndexOf("."))+c:a+c:a+"/"+f+c},o=function(b){var l,m,o,p=function(){var a=arguments,b=function(){var b,c=[];d(a,function(a){e(a)?c.push(p.System["import"](n(a))):"function"==typeof a&&(b=a)});var f=Promise.all(c);return b?f.then(function(a){return b&&b.apply(null,a)}):f};return"production"===p.config().env?b():l.then(b,b)};p.System=b,p.parseURI=i,p.joinURIs=j;var q=function(a){a.ext={};var b=a.normalize,c=/\.(\w+)!$/;a.normalize=function(d,e,f){var g,h=d.match(c);return h&&a.ext[g=h[1]]&&(d+=a.ext[g]),b.call(this,d,e,f)}};q(b);var r=function(a){var b=a.normalize;a.normalize=function(a,c,d){var e,f,g=a.length-1;return"/"===a[g]&&(e=a.substring(0,g).lastIndexOf("/"),f=a.substring(e+1,g),a+=f),b.call(this,a,c,d)}};r(b);var s={env:"development"};p.config=function(a){if(e(a)){var b=a;if(!(arguments.length>=2)){var c=u[b];return c&&c.get?c.get():s[b]}}else{if("object"!=typeof a){var g={};return d(u,function(a,b){a.get&&(g[b]=a.get())}),f(g,s)}a=f({},a),d(u,function(b,c){if(b.set&&a[c]){var d=b.set(a[c]);void 0!==d&&(s[c]=d),delete a[c]}}),f(s,a)}};var t=function(a){return{get:function(){return p.System[a]},set:function(b){p.System[a]="object"==typeof b&&"object"==typeof p.System[a]?f(p.System[a]||{},b||{}):b}}},u={env:{set:function(a){return v(),a}},baseUrl:t("baseURL"),baseURL:t("baseURL"),root:t("baseURL"),config:{set:function(a){var c=k(a),d=g(a);b.paths.stealconfig=c,u.root.set((d===a?".":d)+"/")}},paths:t("paths"),map:t("map"),startId:{set:function(a){u.main.set(n(a))},get:function(){return b.main}},main:{get:t("main").get,set:function(a){b.main=a,v()}},meta:t("meta"),ext:t("ext")},v=function(){if("production"===s.env&&b.main){var a=b.main,c=b.bundlesPath||"bundles/",d=c+k(a);b.meta[d]={format:"amd"},b.bundles[d]=[a]}},w="less-1.7.0",x=function(){var a,e,f,g,i,j={},k=document.getElementsByTagName("script"),l=k[k.length-1];if(l){a=l.src.split("?"),e=a.shift(),f=a.join("?"),a=f.split(","),e.indexOf("steal.production")>-1&&(j.env="production"),g=a[0],g&&(j.startId=g),i=a[1],i&&(j.env=i),a=e.split("/");var m=a.pop();if(0!==m.indexOf("steal")||b.paths["steal/dev"]||(j.paths={"steal/*":a.join("/")+"/*.js",less:a.join("/")+"/"+w+".js","@traceur":a.slice(0,-1).join("/")+"/traceur/traceur.js"}),"steal"===h(a)&&(a.pop(),"bower_components"===h(a)&&a.pop()),d(l.attributes,function(a){var b=c(0===a.nodeName.indexOf("data-")?a.nodeName.replace("data-",""):a.nodeName);j[b]=a.value}),j.root||j.baseUrl||(j.root=a.join("/")+"/"),"production"===j.env){var n=j.paths=j.paths||{},o="bundles/*.css",p="bundles/*";n[o]||(n[o]="dist/bundles/*css"),n[p]||(n[p]="dist/bundles/*.js")}}return j},y=function(){var a={};return"string"!=typeof __dirname||b.paths["steal/dev"]||(a.paths={"steal/*":__dirname+"/*.js","@traceur":__dirname.split("/").slice(0,-1).join("/")+"/traceur/traceur.js"}),b.register("less",[],function(){var a=require;return{__useDefault:!0,"default":a("less")}}),a};return p.startup=function(c){if(a.document)var g=x();else var g=y();f(b.ext,{css:"steal/css",less:"steal/less"}),p.config(g),c&&p.config(c);var h=p.config();d(h.executed||[],function(a,c){b.register(c,[],function(){})});var i=[];return h.startIds&&(i.push.apply(i,e(h.startIds)?[h.startIds]:h.startIds),h.startIds=i.slice(0)),"production"==h.env&&p.System.main?o=p.System.import(p.System.main)["catch"](function(a){}):"development"==h.env?(l=p.System.import("stealconfig"),m=l.then(function(){return c&&p.config(c),p.System.import("steal/dev")},function(){return p.System.import("steal/dev")}),o=m.then(function(){return p.System.main?b.import(p.System.main):l}).then(function(){p.dev&&p.dev.log("app loaded successfully")},function(a){})):void 0},p},p=/(?:^\s*|[}{\(\);,\n\?\&]\s*)steal\s*\(\s*((?:"[^"]+"\s*,|'[^']+'\s*,\s*)*)/,q=function(a){function c(b,c){for(var d=(c.metadata,[]),e=0;e<b.length;e++){var f=a.get(b[e]);if(f.__useDefault)f=f["default"];else if(!f.__esModule){var g={__esModule:!0};for(var h in f)g[h]=f[h];f=g}d[e]=f}var f,i;return{deps:d,module:f||i&&{exports:i}}}return a.formats.unshift("steal"),a.format.steal={detect:function(a){return!!a.source.match(p)},deps:function(c){var d=a.global,e=[],f=c.metadata,g=d.steal;return d.steal=function(){for(var a=0;a<arguments.length;a++)"string"==typeof arguments[a]?e.push(arguments[a]):f.factory=arguments[a]},a.__exec(c),d.steal=g,e=e||[],e=b(e,f),d.define=void 0,f.deps=e,e},execute:function(b,d){if(d.metadata.factory){var e=c(b,d);return d.metadata.factory.apply(a.global,e.deps)||e.module&&e.module.exports}},normalize:function(a,b,c,d){return d(n(a,this),b,c)}},a};if("undefined"!=typeof System&&q(System),"undefined"!=typeof window){var r=window.steal;window.steal=o(System),window.steal.startup(r&&"object"==typeof r&&r),window.steal.addFormat=q}else a.steal=o(System),a.steal.System=System,a.steal.dev=require("./dev.js"),steal.clone=o,module.exports=a.steal,a.steal.addFormat=q}("undefined"==typeof window?global:window);