From 11f0f7363ffcabc25a012f6f0b63ce2e757d0a2a Mon Sep 17 00:00:00 2001 From: Mehrdad Arshad Rad Date: Thu, 13 Oct 2016 22:43:33 -0700 Subject: [PATCH] add requered node modules --- .../node_modules/core-js/client/shim.min.js | 10 + .../node_modules/reflect-metadata/Reflect.js | 949 +++ .../node_modules/systemjs/dist/system.src.js | 5153 +++++++++++++++++ .../assets/node_modules/zone.js/dist/zone.js | 1327 +++++ 4 files changed, 7439 insertions(+) create mode 100644 services/dashboard/assets/node_modules/core-js/client/shim.min.js create mode 100644 services/dashboard/assets/node_modules/reflect-metadata/Reflect.js create mode 100644 services/dashboard/assets/node_modules/systemjs/dist/system.src.js create mode 100644 services/dashboard/assets/node_modules/zone.js/dist/zone.js diff --git a/services/dashboard/assets/node_modules/core-js/client/shim.min.js b/services/dashboard/assets/node_modules/core-js/client/shim.min.js new file mode 100644 index 00000000..e532c683 --- /dev/null +++ b/services/dashboard/assets/node_modules/core-js/client/shim.min.js @@ -0,0 +1,10 @@ +/** + * core-js 2.4.1 + * https://github.com/zloirock/core-js + * License: http://rock.mit-license.org + * © 2016 Denis Pushkarev + */ +!function(a,b,c){"use strict";!function(a){function __webpack_require__(c){if(b[c])return b[c].exports;var d=b[c]={exports:{},id:c,loaded:!1};return a[c].call(d.exports,d,d.exports,__webpack_require__),d.loaded=!0,d.exports}var b={};return __webpack_require__.m=a,__webpack_require__.c=b,__webpack_require__.p="",__webpack_require__(0)}([function(a,b,c){c(1),c(50),c(51),c(52),c(54),c(55),c(58),c(59),c(60),c(61),c(62),c(63),c(64),c(65),c(66),c(68),c(70),c(72),c(74),c(77),c(78),c(79),c(83),c(86),c(87),c(88),c(89),c(91),c(92),c(93),c(94),c(95),c(97),c(99),c(100),c(101),c(103),c(104),c(105),c(107),c(108),c(109),c(111),c(112),c(113),c(114),c(115),c(116),c(117),c(118),c(119),c(120),c(121),c(122),c(123),c(124),c(126),c(130),c(131),c(132),c(133),c(137),c(139),c(140),c(141),c(142),c(143),c(144),c(145),c(146),c(147),c(148),c(149),c(150),c(151),c(152),c(158),c(159),c(161),c(162),c(163),c(167),c(168),c(169),c(170),c(171),c(173),c(174),c(175),c(176),c(179),c(181),c(182),c(183),c(185),c(187),c(189),c(190),c(191),c(193),c(194),c(195),c(196),c(203),c(206),c(207),c(209),c(210),c(211),c(212),c(213),c(214),c(215),c(216),c(217),c(218),c(219),c(220),c(222),c(223),c(224),c(225),c(226),c(227),c(228),c(229),c(231),c(234),c(235),c(237),c(238),c(239),c(240),c(241),c(242),c(243),c(244),c(245),c(246),c(247),c(249),c(250),c(251),c(252),c(253),c(254),c(255),c(256),c(258),c(259),c(261),c(262),c(263),c(264),c(267),c(268),c(269),c(270),c(271),c(272),c(273),c(274),c(276),c(277),c(278),c(279),c(280),c(281),c(282),c(283),c(284),c(285),c(286),c(287),a.exports=c(288)},function(a,b,d){var e=d(2),f=d(3),g=d(4),h=d(6),i=d(16),j=d(20).KEY,k=d(5),l=d(21),m=d(22),n=d(17),o=d(23),p=d(24),q=d(25),r=d(27),s=d(40),t=d(43),u=d(10),v=d(30),w=d(14),x=d(15),y=d(44),z=d(47),A=d(49),B=d(9),C=d(28),D=A.f,E=B.f,F=z.f,G=e.Symbol,H=e.JSON,I=H&&H.stringify,J="prototype",K=o("_hidden"),L=o("toPrimitive"),M={}.propertyIsEnumerable,N=l("symbol-registry"),O=l("symbols"),P=l("op-symbols"),Q=Object[J],R="function"==typeof G,S=e.QObject,T=!S||!S[J]||!S[J].findChild,U=g&&k(function(){return 7!=y(E({},"a",{get:function(){return E(this,"a",{value:7}).a}})).a})?function(a,b,c){var d=D(Q,b);d&&delete Q[b],E(a,b,c),d&&a!==Q&&E(Q,b,d)}:E,V=function(a){var b=O[a]=y(G[J]);return b._k=a,b},W=R&&"symbol"==typeof G.iterator?function(a){return"symbol"==typeof a}:function(a){return a instanceof G},X=function defineProperty(a,b,c){return a===Q&&X(P,b,c),u(a),b=w(b,!0),u(c),f(O,b)?(c.enumerable?(f(a,K)&&a[K][b]&&(a[K][b]=!1),c=y(c,{enumerable:x(0,!1)})):(f(a,K)||E(a,K,x(1,{})),a[K][b]=!0),U(a,b,c)):E(a,b,c)},Y=function defineProperties(a,b){u(a);for(var c,d=s(b=v(b)),e=0,f=d.length;f>e;)X(a,c=d[e++],b[c]);return a},Z=function create(a,b){return b===c?y(a):Y(y(a),b)},$=function propertyIsEnumerable(a){var b=M.call(this,a=w(a,!0));return!(this===Q&&f(O,a)&&!f(P,a))&&(!(b||!f(this,a)||!f(O,a)||f(this,K)&&this[K][a])||b)},_=function getOwnPropertyDescriptor(a,b){if(a=v(a),b=w(b,!0),a!==Q||!f(O,b)||f(P,b)){var c=D(a,b);return!c||!f(O,b)||f(a,K)&&a[K][b]||(c.enumerable=!0),c}},aa=function getOwnPropertyNames(a){for(var b,c=F(v(a)),d=[],e=0;c.length>e;)f(O,b=c[e++])||b==K||b==j||d.push(b);return d},ba=function getOwnPropertySymbols(a){for(var b,c=a===Q,d=F(c?P:v(a)),e=[],g=0;d.length>g;)!f(O,b=d[g++])||c&&!f(Q,b)||e.push(O[b]);return e};R||(G=function Symbol(){if(this instanceof G)throw TypeError("Symbol is not a constructor!");var a=n(arguments.length>0?arguments[0]:c),b=function(c){this===Q&&b.call(P,c),f(this,K)&&f(this[K],a)&&(this[K][a]=!1),U(this,a,x(1,c))};return g&&T&&U(Q,a,{configurable:!0,set:b}),V(a)},i(G[J],"toString",function toString(){return this._k}),A.f=_,B.f=X,d(48).f=z.f=aa,d(42).f=$,d(41).f=ba,g&&!d(26)&&i(Q,"propertyIsEnumerable",$,!0),p.f=function(a){return V(o(a))}),h(h.G+h.W+h.F*!R,{Symbol:G});for(var ca="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),da=0;ca.length>da;)o(ca[da++]);for(var ca=C(o.store),da=0;ca.length>da;)q(ca[da++]);h(h.S+h.F*!R,"Symbol",{"for":function(a){return f(N,a+="")?N[a]:N[a]=G(a)},keyFor:function keyFor(a){if(W(a))return r(N,a);throw TypeError(a+" is not a symbol!")},useSetter:function(){T=!0},useSimple:function(){T=!1}}),h(h.S+h.F*!R,"Object",{create:Z,defineProperty:X,defineProperties:Y,getOwnPropertyDescriptor:_,getOwnPropertyNames:aa,getOwnPropertySymbols:ba}),H&&h(h.S+h.F*(!R||k(function(){var a=G();return"[null]"!=I([a])||"{}"!=I({a:a})||"{}"!=I(Object(a))})),"JSON",{stringify:function stringify(a){if(a!==c&&!W(a)){for(var b,d,e=[a],f=1;arguments.length>f;)e.push(arguments[f++]);return b=e[1],"function"==typeof b&&(d=b),!d&&t(b)||(b=function(a,b){if(d&&(b=d.call(this,a,b)),!W(b))return b}),e[1]=b,I.apply(H,e)}}}),G[J][L]||d(8)(G[J],L,G[J].valueOf),m(G,"Symbol"),m(Math,"Math",!0),m(e.JSON,"JSON",!0)},function(a,c){var d=a.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof b&&(b=d)},function(a,b){var c={}.hasOwnProperty;a.exports=function(a,b){return c.call(a,b)}},function(a,b,c){a.exports=!c(5)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(a,b){a.exports=function(a){try{return!!a()}catch(b){return!0}}},function(a,b,d){var e=d(2),f=d(7),g=d(8),h=d(16),i=d(18),j="prototype",k=function(a,b,d){var l,m,n,o,p=a&k.F,q=a&k.G,r=a&k.S,s=a&k.P,t=a&k.B,u=q?e:r?e[b]||(e[b]={}):(e[b]||{})[j],v=q?f:f[b]||(f[b]={}),w=v[j]||(v[j]={});q&&(d=b);for(l in d)m=!p&&u&&u[l]!==c,n=(m?u:d)[l],o=t&&m?i(n,e):s&&"function"==typeof n?i(Function.call,n):n,u&&h(u,l,n,a&k.U),v[l]!=n&&g(v,l,o),s&&w[l]!=n&&(w[l]=n)};e.core=f,k.F=1,k.G=2,k.S=4,k.P=8,k.B=16,k.W=32,k.U=64,k.R=128,a.exports=k},function(b,c){var d=b.exports={version:"2.4.0"};"number"==typeof a&&(a=d)},function(a,b,c){var d=c(9),e=c(15);a.exports=c(4)?function(a,b,c){return d.f(a,b,e(1,c))}:function(a,b,c){return a[b]=c,a}},function(a,b,c){var d=c(10),e=c(12),f=c(14),g=Object.defineProperty;b.f=c(4)?Object.defineProperty:function defineProperty(a,b,c){if(d(a),b=f(b,!0),d(c),e)try{return g(a,b,c)}catch(h){}if("get"in c||"set"in c)throw TypeError("Accessors not supported!");return"value"in c&&(a[b]=c.value),a}},function(a,b,c){var d=c(11);a.exports=function(a){if(!d(a))throw TypeError(a+" is not an object!");return a}},function(a,b){a.exports=function(a){return"object"==typeof a?null!==a:"function"==typeof a}},function(a,b,c){a.exports=!c(4)&&!c(5)(function(){return 7!=Object.defineProperty(c(13)("div"),"a",{get:function(){return 7}}).a})},function(a,b,c){var d=c(11),e=c(2).document,f=d(e)&&d(e.createElement);a.exports=function(a){return f?e.createElement(a):{}}},function(a,b,c){var d=c(11);a.exports=function(a,b){if(!d(a))return a;var c,e;if(b&&"function"==typeof(c=a.toString)&&!d(e=c.call(a)))return e;if("function"==typeof(c=a.valueOf)&&!d(e=c.call(a)))return e;if(!b&&"function"==typeof(c=a.toString)&&!d(e=c.call(a)))return e;throw TypeError("Can't convert object to primitive value")}},function(a,b){a.exports=function(a,b){return{enumerable:!(1&a),configurable:!(2&a),writable:!(4&a),value:b}}},function(a,b,c){var d=c(2),e=c(8),f=c(3),g=c(17)("src"),h="toString",i=Function[h],j=(""+i).split(h);c(7).inspectSource=function(a){return i.call(a)},(a.exports=function(a,b,c,h){var i="function"==typeof c;i&&(f(c,"name")||e(c,"name",b)),a[b]!==c&&(i&&(f(c,g)||e(c,g,a[b]?""+a[b]:j.join(String(b)))),a===d?a[b]=c:h?a[b]?a[b]=c:e(a,b,c):(delete a[b],e(a,b,c)))})(Function.prototype,h,function toString(){return"function"==typeof this&&this[g]||i.call(this)})},function(a,b){var d=0,e=Math.random();a.exports=function(a){return"Symbol(".concat(a===c?"":a,")_",(++d+e).toString(36))}},function(a,b,d){var e=d(19);a.exports=function(a,b,d){if(e(a),b===c)return a;switch(d){case 1:return function(c){return a.call(b,c)};case 2:return function(c,d){return a.call(b,c,d)};case 3:return function(c,d,e){return a.call(b,c,d,e)}}return function(){return a.apply(b,arguments)}}},function(a,b){a.exports=function(a){if("function"!=typeof a)throw TypeError(a+" is not a function!");return a}},function(a,b,c){var d=c(17)("meta"),e=c(11),f=c(3),g=c(9).f,h=0,i=Object.isExtensible||function(){return!0},j=!c(5)(function(){return i(Object.preventExtensions({}))}),k=function(a){g(a,d,{value:{i:"O"+ ++h,w:{}}})},l=function(a,b){if(!e(a))return"symbol"==typeof a?a:("string"==typeof a?"S":"P")+a;if(!f(a,d)){if(!i(a))return"F";if(!b)return"E";k(a)}return a[d].i},m=function(a,b){if(!f(a,d)){if(!i(a))return!0;if(!b)return!1;k(a)}return a[d].w},n=function(a){return j&&o.NEED&&i(a)&&!f(a,d)&&k(a),a},o=a.exports={KEY:d,NEED:!1,fastKey:l,getWeak:m,onFreeze:n}},function(a,b,c){var d=c(2),e="__core-js_shared__",f=d[e]||(d[e]={});a.exports=function(a){return f[a]||(f[a]={})}},function(a,b,c){var d=c(9).f,e=c(3),f=c(23)("toStringTag");a.exports=function(a,b,c){a&&!e(a=c?a:a.prototype,f)&&d(a,f,{configurable:!0,value:b})}},function(a,b,c){var d=c(21)("wks"),e=c(17),f=c(2).Symbol,g="function"==typeof f,h=a.exports=function(a){return d[a]||(d[a]=g&&f[a]||(g?f:e)("Symbol."+a))};h.store=d},function(a,b,c){b.f=c(23)},function(a,b,c){var d=c(2),e=c(7),f=c(26),g=c(24),h=c(9).f;a.exports=function(a){var b=e.Symbol||(e.Symbol=f?{}:d.Symbol||{});"_"==a.charAt(0)||a in b||h(b,a,{value:g.f(a)})}},function(a,b){a.exports=!1},function(a,b,c){var d=c(28),e=c(30);a.exports=function(a,b){for(var c,f=e(a),g=d(f),h=g.length,i=0;h>i;)if(f[c=g[i++]]===b)return c}},function(a,b,c){var d=c(29),e=c(39);a.exports=Object.keys||function keys(a){return d(a,e)}},function(a,b,c){var d=c(3),e=c(30),f=c(34)(!1),g=c(38)("IE_PROTO");a.exports=function(a,b){var c,h=e(a),i=0,j=[];for(c in h)c!=g&&d(h,c)&&j.push(c);for(;b.length>i;)d(h,c=b[i++])&&(~f(j,c)||j.push(c));return j}},function(a,b,c){var d=c(31),e=c(33);a.exports=function(a){return d(e(a))}},function(a,b,c){var d=c(32);a.exports=Object("z").propertyIsEnumerable(0)?Object:function(a){return"String"==d(a)?a.split(""):Object(a)}},function(a,b){var c={}.toString;a.exports=function(a){return c.call(a).slice(8,-1)}},function(a,b){a.exports=function(a){if(a==c)throw TypeError("Can't call method on "+a);return a}},function(a,b,c){var d=c(30),e=c(35),f=c(37);a.exports=function(a){return function(b,c,g){var h,i=d(b),j=e(i.length),k=f(g,j);if(a&&c!=c){for(;j>k;)if(h=i[k++],h!=h)return!0}else for(;j>k;k++)if((a||k in i)&&i[k]===c)return a||k||0;return!a&&-1}}},function(a,b,c){var d=c(36),e=Math.min;a.exports=function(a){return a>0?e(d(a),9007199254740991):0}},function(a,b){var c=Math.ceil,d=Math.floor;a.exports=function(a){return isNaN(a=+a)?0:(a>0?d:c)(a)}},function(a,b,c){var d=c(36),e=Math.max,f=Math.min;a.exports=function(a,b){return a=d(a),a<0?e(a+b,0):f(a,b)}},function(a,b,c){var d=c(21)("keys"),e=c(17);a.exports=function(a){return d[a]||(d[a]=e(a))}},function(a,b){a.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(a,b,c){var d=c(28),e=c(41),f=c(42);a.exports=function(a){var b=d(a),c=e.f;if(c)for(var g,h=c(a),i=f.f,j=0;h.length>j;)i.call(a,g=h[j++])&&b.push(g);return b}},function(a,b){b.f=Object.getOwnPropertySymbols},function(a,b){b.f={}.propertyIsEnumerable},function(a,b,c){var d=c(32);a.exports=Array.isArray||function isArray(a){return"Array"==d(a)}},function(a,b,d){var e=d(10),f=d(45),g=d(39),h=d(38)("IE_PROTO"),i=function(){},j="prototype",k=function(){var a,b=d(13)("iframe"),c=g.length,e="<",f=">";for(b.style.display="none",d(46).appendChild(b),b.src="javascript:",a=b.contentWindow.document,a.open(),a.write(e+"script"+f+"document.F=Object"+e+"/script"+f),a.close(),k=a.F;c--;)delete k[j][g[c]];return k()};a.exports=Object.create||function create(a,b){var d;return null!==a?(i[j]=e(a),d=new i,i[j]=null,d[h]=a):d=k(),b===c?d:f(d,b)}},function(a,b,c){var d=c(9),e=c(10),f=c(28);a.exports=c(4)?Object.defineProperties:function defineProperties(a,b){e(a);for(var c,g=f(b),h=g.length,i=0;h>i;)d.f(a,c=g[i++],b[c]);return a}},function(a,b,c){a.exports=c(2).document&&document.documentElement},function(a,b,c){var d=c(30),e=c(48).f,f={}.toString,g="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],h=function(a){try{return e(a)}catch(b){return g.slice()}};a.exports.f=function getOwnPropertyNames(a){return g&&"[object Window]"==f.call(a)?h(a):e(d(a))}},function(a,b,c){var d=c(29),e=c(39).concat("length","prototype");b.f=Object.getOwnPropertyNames||function getOwnPropertyNames(a){return d(a,e)}},function(a,b,c){var d=c(42),e=c(15),f=c(30),g=c(14),h=c(3),i=c(12),j=Object.getOwnPropertyDescriptor;b.f=c(4)?j:function getOwnPropertyDescriptor(a,b){if(a=f(a),b=g(b,!0),i)try{return j(a,b)}catch(c){}if(h(a,b))return e(!d.f.call(a,b),a[b])}},function(a,b,c){var d=c(6);d(d.S+d.F*!c(4),"Object",{defineProperty:c(9).f})},function(a,b,c){var d=c(6);d(d.S+d.F*!c(4),"Object",{defineProperties:c(45)})},function(a,b,c){var d=c(30),e=c(49).f;c(53)("getOwnPropertyDescriptor",function(){return function getOwnPropertyDescriptor(a,b){return e(d(a),b)}})},function(a,b,c){var d=c(6),e=c(7),f=c(5);a.exports=function(a,b){var c=(e.Object||{})[a]||Object[a],g={};g[a]=b(c),d(d.S+d.F*f(function(){c(1)}),"Object",g)}},function(a,b,c){var d=c(6);d(d.S,"Object",{create:c(44)})},function(a,b,c){var d=c(56),e=c(57);c(53)("getPrototypeOf",function(){return function getPrototypeOf(a){return e(d(a))}})},function(a,b,c){var d=c(33);a.exports=function(a){return Object(d(a))}},function(a,b,c){var d=c(3),e=c(56),f=c(38)("IE_PROTO"),g=Object.prototype;a.exports=Object.getPrototypeOf||function(a){return a=e(a),d(a,f)?a[f]:"function"==typeof a.constructor&&a instanceof a.constructor?a.constructor.prototype:a instanceof Object?g:null}},function(a,b,c){var d=c(56),e=c(28);c(53)("keys",function(){return function keys(a){return e(d(a))}})},function(a,b,c){c(53)("getOwnPropertyNames",function(){return c(47).f})},function(a,b,c){var d=c(11),e=c(20).onFreeze;c(53)("freeze",function(a){return function freeze(b){return a&&d(b)?a(e(b)):b}})},function(a,b,c){var d=c(11),e=c(20).onFreeze;c(53)("seal",function(a){return function seal(b){return a&&d(b)?a(e(b)):b}})},function(a,b,c){var d=c(11),e=c(20).onFreeze;c(53)("preventExtensions",function(a){return function preventExtensions(b){return a&&d(b)?a(e(b)):b}})},function(a,b,c){var d=c(11);c(53)("isFrozen",function(a){return function isFrozen(b){return!d(b)||!!a&&a(b)}})},function(a,b,c){var d=c(11);c(53)("isSealed",function(a){return function isSealed(b){return!d(b)||!!a&&a(b)}})},function(a,b,c){var d=c(11);c(53)("isExtensible",function(a){return function isExtensible(b){return!!d(b)&&(!a||a(b))}})},function(a,b,c){var d=c(6);d(d.S+d.F,"Object",{assign:c(67)})},function(a,b,c){var d=c(28),e=c(41),f=c(42),g=c(56),h=c(31),i=Object.assign;a.exports=!i||c(5)(function(){var a={},b={},c=Symbol(),d="abcdefghijklmnopqrst";return a[c]=7,d.split("").forEach(function(a){b[a]=a}),7!=i({},a)[c]||Object.keys(i({},b)).join("")!=d})?function assign(a,b){for(var c=g(a),i=arguments.length,j=1,k=e.f,l=f.f;i>j;)for(var m,n=h(arguments[j++]),o=k?d(n).concat(k(n)):d(n),p=o.length,q=0;p>q;)l.call(n,m=o[q++])&&(c[m]=n[m]);return c}:i},function(a,b,c){var d=c(6);d(d.S,"Object",{is:c(69)})},function(a,b){a.exports=Object.is||function is(a,b){return a===b?0!==a||1/a===1/b:a!=a&&b!=b}},function(a,b,c){var d=c(6);d(d.S,"Object",{setPrototypeOf:c(71).set})},function(a,b,d){var e=d(11),f=d(10),g=function(a,b){if(f(a),!e(b)&&null!==b)throw TypeError(b+": can't set as prototype!")};a.exports={set:Object.setPrototypeOf||("__proto__"in{}?function(a,b,c){try{c=d(18)(Function.call,d(49).f(Object.prototype,"__proto__").set,2),c(a,[]),b=!(a instanceof Array)}catch(e){b=!0}return function setPrototypeOf(a,d){return g(a,d),b?a.__proto__=d:c(a,d),a}}({},!1):c),check:g}},function(a,b,c){var d=c(73),e={};e[c(23)("toStringTag")]="z",e+""!="[object z]"&&c(16)(Object.prototype,"toString",function toString(){return"[object "+d(this)+"]"},!0)},function(a,b,d){var e=d(32),f=d(23)("toStringTag"),g="Arguments"==e(function(){return arguments}()),h=function(a,b){try{return a[b]}catch(c){}};a.exports=function(a){var b,d,i;return a===c?"Undefined":null===a?"Null":"string"==typeof(d=h(b=Object(a),f))?d:g?e(b):"Object"==(i=e(b))&&"function"==typeof b.callee?"Arguments":i}},function(a,b,c){var d=c(6);d(d.P,"Function",{bind:c(75)})},function(a,b,c){var d=c(19),e=c(11),f=c(76),g=[].slice,h={},i=function(a,b,c){if(!(b in h)){for(var d=[],e=0;e2){b=s?b.trim():m(b,3);var c,d,e,f=b.charCodeAt(0);if(43===f||45===f){if(c=b.charCodeAt(2),88===c||120===c)return NaN}else if(48===f){switch(b.charCodeAt(1)){case 66:case 98:d=2,e=49;break;case 79:case 111:d=8,e=55;break;default:return+b}for(var g,i=b.slice(2),j=0,k=i.length;je)return NaN;return parseInt(i,d)}}return+b};if(!o(" 0o1")||!o("0b1")||o("+0x1")){o=function Number(a){var b=arguments.length<1?0:a,c=this;return c instanceof o&&(r?i(function(){q.valueOf.call(c)}):f(c)!=n)?g(new p(t(b)),c,o):t(b)};for(var u,v=c(4)?j(p):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger".split(","),w=0;v.length>w;w++)e(p,u=v[w])&&!e(o,u)&&l(o,u,k(p,u));o.prototype=q,q.constructor=o,c(16)(d,n,o)}},function(a,b,c){var d=c(11),e=c(71).set;a.exports=function(a,b,c){var f,g=b.constructor;return g!==c&&"function"==typeof g&&(f=g.prototype)!==c.prototype&&d(f)&&e&&e(a,f),a}},function(a,b,c){var d=c(6),e=c(33),f=c(5),g=c(82),h="["+g+"]",i="​…",j=RegExp("^"+h+h+"*"),k=RegExp(h+h+"*$"),l=function(a,b,c){var e={},h=f(function(){return!!g[a]()||i[a]()!=i}),j=e[a]=h?b(m):g[a];c&&(e[c]=j),d(d.P+d.F*h,"String",e)},m=l.trim=function(a,b){return a=String(e(a)),1&b&&(a=a.replace(j,"")),2&b&&(a=a.replace(k,"")),a};a.exports=l},function(a,b){a.exports="\t\n\x0B\f\r   ᠎              \u2028\u2029\ufeff"},function(a,b,c){var d=c(6),e=c(36),f=c(84),g=c(85),h=1..toFixed,i=Math.floor,j=[0,0,0,0,0,0],k="Number.toFixed: incorrect invocation!",l="0",m=function(a,b){for(var c=-1,d=b;++c<6;)d+=a*j[c],j[c]=d%1e7,d=i(d/1e7)},n=function(a){for(var b=6,c=0;--b>=0;)c+=j[b],j[b]=i(c/a),c=c%a*1e7},o=function(){for(var a=6,b="";--a>=0;)if(""!==b||0===a||0!==j[a]){var c=String(j[a]);b=""===b?c:b+g.call(l,7-c.length)+c}return b},p=function(a,b,c){return 0===b?c:b%2===1?p(a,b-1,c*a):p(a*a,b/2,c)},q=function(a){for(var b=0,c=a;c>=4096;)b+=12,c/=4096;for(;c>=2;)b+=1,c/=2;return b};d(d.P+d.F*(!!h&&("0.000"!==8e-5.toFixed(3)||"1"!==.9.toFixed(0)||"1.25"!==1.255.toFixed(2)||"1000000000000000128"!==(0xde0b6b3a7640080).toFixed(0))||!c(5)(function(){h.call({})})),"Number",{toFixed:function toFixed(a){var b,c,d,h,i=f(this,k),j=e(a),r="",s=l;if(j<0||j>20)throw RangeError(k);if(i!=i)return"NaN";if(i<=-1e21||i>=1e21)return String(i);if(i<0&&(r="-",i=-i),i>1e-21)if(b=q(i*p(2,69,1))-69,c=b<0?i*p(2,-b,1):i/p(2,b,1),c*=4503599627370496,b=52-b,b>0){for(m(0,c),d=j;d>=7;)m(1e7,0),d-=7;for(m(p(10,d,1),0),d=b-1;d>=23;)n(1<<23),d-=23;n(1<0?(h=s.length,s=r+(h<=j?"0."+g.call(l,j-h)+s:s.slice(0,h-j)+"."+s.slice(h-j))):s=r+s,s}})},function(a,b,c){var d=c(32);a.exports=function(a,b){if("number"!=typeof a&&"Number"!=d(a))throw TypeError(b);return+a}},function(a,b,c){var d=c(36),e=c(33);a.exports=function repeat(a){var b=String(e(this)),c="",f=d(a);if(f<0||f==1/0)throw RangeError("Count can't be negative");for(;f>0;(f>>>=1)&&(b+=b))1&f&&(c+=b);return c}},function(a,b,d){var e=d(6),f=d(5),g=d(84),h=1..toPrecision;e(e.P+e.F*(f(function(){return"1"!==h.call(1,c)})||!f(function(){h.call({})})),"Number",{toPrecision:function toPrecision(a){var b=g(this,"Number#toPrecision: incorrect invocation!");return a===c?h.call(b):h.call(b,a)}})},function(a,b,c){var d=c(6);d(d.S,"Number",{EPSILON:Math.pow(2,-52)})},function(a,b,c){var d=c(6),e=c(2).isFinite;d(d.S,"Number",{isFinite:function isFinite(a){return"number"==typeof a&&e(a)}})},function(a,b,c){var d=c(6);d(d.S,"Number",{isInteger:c(90)})},function(a,b,c){var d=c(11),e=Math.floor;a.exports=function isInteger(a){return!d(a)&&isFinite(a)&&e(a)===a}},function(a,b,c){var d=c(6);d(d.S,"Number",{isNaN:function isNaN(a){return a!=a}})},function(a,b,c){var d=c(6),e=c(90),f=Math.abs;d(d.S,"Number",{isSafeInteger:function isSafeInteger(a){return e(a)&&f(a)<=9007199254740991}})},function(a,b,c){var d=c(6);d(d.S,"Number",{MAX_SAFE_INTEGER:9007199254740991})},function(a,b,c){var d=c(6);d(d.S,"Number",{MIN_SAFE_INTEGER:-9007199254740991})},function(a,b,c){var d=c(6),e=c(96);d(d.S+d.F*(Number.parseFloat!=e),"Number",{parseFloat:e})},function(a,b,c){var d=c(2).parseFloat,e=c(81).trim;a.exports=1/d(c(82)+"-0")!==-(1/0)?function parseFloat(a){var b=e(String(a),3),c=d(b);return 0===c&&"-"==b.charAt(0)?-0:c}:d},function(a,b,c){var d=c(6),e=c(98);d(d.S+d.F*(Number.parseInt!=e),"Number",{parseInt:e})},function(a,b,c){var d=c(2).parseInt,e=c(81).trim,f=c(82),g=/^[\-+]?0[xX]/;a.exports=8!==d(f+"08")||22!==d(f+"0x16")?function parseInt(a,b){var c=e(String(a),3);return d(c,b>>>0||(g.test(c)?16:10))}:d},function(a,b,c){var d=c(6),e=c(98);d(d.G+d.F*(parseInt!=e),{parseInt:e})},function(a,b,c){var d=c(6),e=c(96);d(d.G+d.F*(parseFloat!=e),{parseFloat:e})},function(a,b,c){var d=c(6),e=c(102),f=Math.sqrt,g=Math.acosh;d(d.S+d.F*!(g&&710==Math.floor(g(Number.MAX_VALUE))&&g(1/0)==1/0),"Math",{acosh:function acosh(a){return(a=+a)<1?NaN:a>94906265.62425156?Math.log(a)+Math.LN2:e(a-1+f(a-1)*f(a+1))}})},function(a,b){a.exports=Math.log1p||function log1p(a){return(a=+a)>-1e-8&&a<1e-8?a-a*a/2:Math.log(1+a)}},function(a,b,c){function asinh(a){return isFinite(a=+a)&&0!=a?a<0?-asinh(-a):Math.log(a+Math.sqrt(a*a+1)):a}var d=c(6),e=Math.asinh;d(d.S+d.F*!(e&&1/e(0)>0),"Math",{asinh:asinh})},function(a,b,c){var d=c(6),e=Math.atanh;d(d.S+d.F*!(e&&1/e(-0)<0),"Math",{atanh:function atanh(a){return 0==(a=+a)?a:Math.log((1+a)/(1-a))/2}})},function(a,b,c){var d=c(6),e=c(106);d(d.S,"Math",{cbrt:function cbrt(a){return e(a=+a)*Math.pow(Math.abs(a),1/3)}})},function(a,b){a.exports=Math.sign||function sign(a){return 0==(a=+a)||a!=a?a:a<0?-1:1}},function(a,b,c){var d=c(6);d(d.S,"Math",{clz32:function clz32(a){return(a>>>=0)?31-Math.floor(Math.log(a+.5)*Math.LOG2E):32}})},function(a,b,c){var d=c(6),e=Math.exp;d(d.S,"Math",{cosh:function cosh(a){return(e(a=+a)+e(-a))/2}})},function(a,b,c){var d=c(6),e=c(110);d(d.S+d.F*(e!=Math.expm1),"Math",{expm1:e})},function(a,b){var c=Math.expm1;a.exports=!c||c(10)>22025.465794806718||c(10)<22025.465794806718||c(-2e-17)!=-2e-17?function expm1(a){return 0==(a=+a)?a:a>-1e-6&&a<1e-6?a+a*a/2:Math.exp(a)-1}:c},function(a,b,c){var d=c(6),e=c(106),f=Math.pow,g=f(2,-52),h=f(2,-23),i=f(2,127)*(2-h),j=f(2,-126),k=function(a){return a+1/g-1/g};d(d.S,"Math",{fround:function fround(a){var b,c,d=Math.abs(a),f=e(a);return di||c!=c?f*(1/0):f*c)}})},function(a,b,c){var d=c(6),e=Math.abs;d(d.S,"Math",{hypot:function hypot(a,b){for(var c,d,f=0,g=0,h=arguments.length,i=0;g0?(d=c/i,f+=d*d):f+=c;return i===1/0?1/0:i*Math.sqrt(f)}})},function(a,b,c){var d=c(6),e=Math.imul;d(d.S+d.F*c(5)(function(){return e(4294967295,5)!=-5||2!=e.length}),"Math",{imul:function imul(a,b){var c=65535,d=+a,e=+b,f=c&d,g=c&e;return 0|f*g+((c&d>>>16)*g+f*(c&e>>>16)<<16>>>0)}})},function(a,b,c){var d=c(6);d(d.S,"Math",{log10:function log10(a){return Math.log(a)/Math.LN10}})},function(a,b,c){var d=c(6);d(d.S,"Math",{log1p:c(102)})},function(a,b,c){var d=c(6);d(d.S,"Math",{log2:function log2(a){return Math.log(a)/Math.LN2}})},function(a,b,c){var d=c(6);d(d.S,"Math",{sign:c(106)})},function(a,b,c){var d=c(6),e=c(110),f=Math.exp;d(d.S+d.F*c(5)(function(){return!Math.sinh(-2e-17)!=-2e-17}),"Math",{sinh:function sinh(a){return Math.abs(a=+a)<1?(e(a)-e(-a))/2:(f(a-1)-f(-a-1))*(Math.E/2)}})},function(a,b,c){var d=c(6),e=c(110),f=Math.exp;d(d.S,"Math",{tanh:function tanh(a){var b=e(a=+a),c=e(-a);return b==1/0?1:c==1/0?-1:(b-c)/(f(a)+f(-a))}})},function(a,b,c){var d=c(6);d(d.S,"Math",{trunc:function trunc(a){return(a>0?Math.floor:Math.ceil)(a)}})},function(a,b,c){var d=c(6),e=c(37),f=String.fromCharCode,g=String.fromCodePoint;d(d.S+d.F*(!!g&&1!=g.length),"String",{fromCodePoint:function fromCodePoint(a){for(var b,c=[],d=arguments.length,g=0;d>g;){if(b=+arguments[g++],e(b,1114111)!==b)throw RangeError(b+" is not a valid code point");c.push(b<65536?f(b):f(((b-=65536)>>10)+55296,b%1024+56320))}return c.join("")}})},function(a,b,c){var d=c(6),e=c(30),f=c(35);d(d.S,"String",{raw:function raw(a){for(var b=e(a.raw),c=f(b.length),d=arguments.length,g=[],h=0;c>h;)g.push(String(b[h++])),h=k?a?"":c:(g=i.charCodeAt(j),g<55296||g>56319||j+1===k||(h=i.charCodeAt(j+1))<56320||h>57343?a?i.charAt(j):g:a?i.slice(j,j+2):(g-55296<<10)+(h-56320)+65536)}}},function(a,b,d){var e=d(6),f=d(35),g=d(127),h="endsWith",i=""[h];e(e.P+e.F*d(129)(h),"String",{endsWith:function endsWith(a){var b=g(this,a,h),d=arguments.length>1?arguments[1]:c,e=f(b.length),j=d===c?e:Math.min(f(d),e),k=String(a);return i?i.call(b,k,j):b.slice(j-k.length,j)===k}})},function(a,b,c){var d=c(128),e=c(33);a.exports=function(a,b,c){if(d(b))throw TypeError("String#"+c+" doesn't accept regex!");return String(e(a))}},function(a,b,d){var e=d(11),f=d(32),g=d(23)("match");a.exports=function(a){var b;return e(a)&&((b=a[g])!==c?!!b:"RegExp"==f(a))}},function(a,b,c){var d=c(23)("match");a.exports=function(a){var b=/./;try{"/./"[a](b)}catch(c){try{return b[d]=!1,!"/./"[a](b)}catch(e){}}return!0}},function(a,b,d){var e=d(6),f=d(127),g="includes";e(e.P+e.F*d(129)(g),"String",{includes:function includes(a){return!!~f(this,a,g).indexOf(a,arguments.length>1?arguments[1]:c)}})},function(a,b,c){var d=c(6);d(d.P,"String",{repeat:c(85)})},function(a,b,d){var e=d(6),f=d(35),g=d(127),h="startsWith",i=""[h];e(e.P+e.F*d(129)(h),"String",{startsWith:function startsWith(a){var b=g(this,a,h),d=f(Math.min(arguments.length>1?arguments[1]:c,b.length)),e=String(a);return i?i.call(b,e,d):b.slice(d,d+e.length)===e}})},function(a,b,d){var e=d(125)(!0);d(134)(String,"String",function(a){this._t=String(a),this._i=0},function(){var a,b=this._t,d=this._i;return d>=b.length?{value:c,done:!0}:(a=e(b,d),this._i+=a.length,{value:a,done:!1})})},function(a,b,d){var e=d(26),f=d(6),g=d(16),h=d(8),i=d(3),j=d(135),k=d(136),l=d(22),m=d(57),n=d(23)("iterator"),o=!([].keys&&"next"in[].keys()),p="@@iterator",q="keys",r="values",s=function(){return this};a.exports=function(a,b,d,t,u,v,w){k(d,b,t);var x,y,z,A=function(a){if(!o&&a in E)return E[a];switch(a){case q:return function keys(){return new d(this,a)};case r:return function values(){return new d(this,a)}}return function entries(){return new d(this,a)}},B=b+" Iterator",C=u==r,D=!1,E=a.prototype,F=E[n]||E[p]||u&&E[u],G=F||A(u),H=u?C?A("entries"):G:c,I="Array"==b?E.entries||F:F;if(I&&(z=m(I.call(new a)),z!==Object.prototype&&(l(z,B,!0),e||i(z,n)||h(z,n,s))),C&&F&&F.name!==r&&(D=!0,G=function values(){return F.call(this)}),e&&!w||!o&&!D&&E[n]||h(E,n,G),j[b]=G,j[B]=s,u)if(x={values:C?G:A(r),keys:v?G:A(q),entries:H},w)for(y in x)y in E||g(E,y,x[y]);else f(f.P+f.F*(o||D),b,x);return x}},function(a,b){a.exports={}},function(a,b,c){var d=c(44),e=c(15),f=c(22),g={};c(8)(g,c(23)("iterator"),function(){return this}),a.exports=function(a,b,c){a.prototype=d(g,{next:e(1,c)}),f(a,b+" Iterator")}},function(a,b,c){c(138)("anchor",function(a){return function anchor(b){return a(this,"a","name",b)}})},function(a,b,c){var d=c(6),e=c(5),f=c(33),g=/"/g,h=function(a,b,c,d){var e=String(f(a)),h="<"+b;return""!==c&&(h+=" "+c+'="'+String(d).replace(g,""")+'"'),h+">"+e+""};a.exports=function(a,b){var c={};c[a]=b(h),d(d.P+d.F*e(function(){var b=""[a]('"');return b!==b.toLowerCase()||b.split('"').length>3}),"String",c)}},function(a,b,c){c(138)("big",function(a){return function big(){return a(this,"big","","")}})},function(a,b,c){c(138)("blink",function(a){return function blink(){return a(this,"blink","","")}})},function(a,b,c){c(138)("bold",function(a){return function bold(){return a(this,"b","","")}})},function(a,b,c){c(138)("fixed",function(a){return function fixed(){return a(this,"tt","","")}})},function(a,b,c){c(138)("fontcolor",function(a){return function fontcolor(b){return a(this,"font","color",b)}})},function(a,b,c){c(138)("fontsize",function(a){return function fontsize(b){return a(this,"font","size",b)}})},function(a,b,c){c(138)("italics",function(a){return function italics(){return a(this,"i","","")}})},function(a,b,c){c(138)("link",function(a){return function link(b){return a(this,"a","href",b)}})},function(a,b,c){c(138)("small",function(a){return function small(){return a(this,"small","","")}})},function(a,b,c){c(138)("strike",function(a){return function strike(){return a(this,"strike","","")}})},function(a,b,c){c(138)("sub",function(a){return function sub(){return a(this,"sub","","")}})},function(a,b,c){c(138)("sup",function(a){return function sup(){return a(this,"sup","","")}})},function(a,b,c){var d=c(6);d(d.S,"Array",{isArray:c(43)})},function(a,b,d){var e=d(18),f=d(6),g=d(56),h=d(153),i=d(154),j=d(35),k=d(155),l=d(156);f(f.S+f.F*!d(157)(function(a){Array.from(a)}),"Array",{from:function from(a){var b,d,f,m,n=g(a),o="function"==typeof this?this:Array,p=arguments.length,q=p>1?arguments[1]:c,r=q!==c,s=0,t=l(n);if(r&&(q=e(q,p>2?arguments[2]:c,2)),t==c||o==Array&&i(t))for(b=j(n.length),d=new o(b);b>s;s++)k(d,s,r?q(n[s],s):n[s]);else for(m=t.call(n),d=new o;!(f=m.next()).done;s++)k(d,s,r?h(m,q,[f.value,s],!0):f.value);return d.length=s,d}})},function(a,b,d){var e=d(10);a.exports=function(a,b,d,f){try{return f?b(e(d)[0],d[1]):b(d)}catch(g){var h=a["return"];throw h!==c&&e(h.call(a)),g}}},function(a,b,d){var e=d(135),f=d(23)("iterator"),g=Array.prototype;a.exports=function(a){return a!==c&&(e.Array===a||g[f]===a)}},function(a,b,c){var d=c(9),e=c(15);a.exports=function(a,b,c){b in a?d.f(a,b,e(0,c)):a[b]=c}},function(a,b,d){var e=d(73),f=d(23)("iterator"),g=d(135);a.exports=d(7).getIteratorMethod=function(a){if(a!=c)return a[f]||a["@@iterator"]||g[e(a)]}},function(a,b,c){var d=c(23)("iterator"),e=!1; +try{var f=[7][d]();f["return"]=function(){e=!0},Array.from(f,function(){throw 2})}catch(g){}a.exports=function(a,b){if(!b&&!e)return!1;var c=!1;try{var f=[7],g=f[d]();g.next=function(){return{done:c=!0}},f[d]=function(){return g},a(f)}catch(h){}return c}},function(a,b,c){var d=c(6),e=c(155);d(d.S+d.F*c(5)(function(){function F(){}return!(Array.of.call(F)instanceof F)}),"Array",{of:function of(){for(var a=0,b=arguments.length,c=new("function"==typeof this?this:Array)(b);b>a;)e(c,a,arguments[a++]);return c.length=b,c}})},function(a,b,d){var e=d(6),f=d(30),g=[].join;e(e.P+e.F*(d(31)!=Object||!d(160)(g)),"Array",{join:function join(a){return g.call(f(this),a===c?",":a)}})},function(a,b,c){var d=c(5);a.exports=function(a,b){return!!a&&d(function(){b?a.call(null,function(){},1):a.call(null)})}},function(a,b,d){var e=d(6),f=d(46),g=d(32),h=d(37),i=d(35),j=[].slice;e(e.P+e.F*d(5)(function(){f&&j.call(f)}),"Array",{slice:function slice(a,b){var d=i(this.length),e=g(this);if(b=b===c?d:b,"Array"==e)return j.call(this,a,b);for(var f=h(a,d),k=h(b,d),l=i(k-f),m=Array(l),n=0;nw;w++)if((n||w in t)&&(q=t[w],r=u(q,w,s),a))if(d)x[w]=r;else if(r)switch(a){case 3:return!0;case 5:return q;case 6:return w;case 2:x.push(q)}else if(l)return!1;return m?-1:k||l?l:x}}},function(a,b,c){var d=c(166);a.exports=function(a,b){return new(d(a))(b)}},function(a,b,d){var e=d(11),f=d(43),g=d(23)("species");a.exports=function(a){var b;return f(a)&&(b=a.constructor,"function"!=typeof b||b!==Array&&!f(b.prototype)||(b=c),e(b)&&(b=b[g],null===b&&(b=c))),b===c?Array:b}},function(a,b,c){var d=c(6),e=c(164)(1);d(d.P+d.F*!c(160)([].map,!0),"Array",{map:function map(a){return e(this,a,arguments[1])}})},function(a,b,c){var d=c(6),e=c(164)(2);d(d.P+d.F*!c(160)([].filter,!0),"Array",{filter:function filter(a){return e(this,a,arguments[1])}})},function(a,b,c){var d=c(6),e=c(164)(3);d(d.P+d.F*!c(160)([].some,!0),"Array",{some:function some(a){return e(this,a,arguments[1])}})},function(a,b,c){var d=c(6),e=c(164)(4);d(d.P+d.F*!c(160)([].every,!0),"Array",{every:function every(a){return e(this,a,arguments[1])}})},function(a,b,c){var d=c(6),e=c(172);d(d.P+d.F*!c(160)([].reduce,!0),"Array",{reduce:function reduce(a){return e(this,a,arguments.length,arguments[1],!1)}})},function(a,b,c){var d=c(19),e=c(56),f=c(31),g=c(35);a.exports=function(a,b,c,h,i){d(b);var j=e(a),k=f(j),l=g(j.length),m=i?l-1:0,n=i?-1:1;if(c<2)for(;;){if(m in k){h=k[m],m+=n;break}if(m+=n,i?m<0:l<=m)throw TypeError("Reduce of empty array with no initial value")}for(;i?m>=0:l>m;m+=n)m in k&&(h=b(h,k[m],m,j));return h}},function(a,b,c){var d=c(6),e=c(172);d(d.P+d.F*!c(160)([].reduceRight,!0),"Array",{reduceRight:function reduceRight(a){return e(this,a,arguments.length,arguments[1],!0)}})},function(a,b,c){var d=c(6),e=c(34)(!1),f=[].indexOf,g=!!f&&1/[1].indexOf(1,-0)<0;d(d.P+d.F*(g||!c(160)(f)),"Array",{indexOf:function indexOf(a){return g?f.apply(this,arguments)||0:e(this,a,arguments[1])}})},function(a,b,c){var d=c(6),e=c(30),f=c(36),g=c(35),h=[].lastIndexOf,i=!!h&&1/[1].lastIndexOf(1,-0)<0;d(d.P+d.F*(i||!c(160)(h)),"Array",{lastIndexOf:function lastIndexOf(a){if(i)return h.apply(this,arguments)||0;var b=e(this),c=g(b.length),d=c-1;for(arguments.length>1&&(d=Math.min(d,f(arguments[1]))),d<0&&(d=c+d);d>=0;d--)if(d in b&&b[d]===a)return d||0;return-1}})},function(a,b,c){var d=c(6);d(d.P,"Array",{copyWithin:c(177)}),c(178)("copyWithin")},function(a,b,d){var e=d(56),f=d(37),g=d(35);a.exports=[].copyWithin||function copyWithin(a,b){var d=e(this),h=g(d.length),i=f(a,h),j=f(b,h),k=arguments.length>2?arguments[2]:c,l=Math.min((k===c?h:f(k,h))-j,h-i),m=1;for(j0;)j in d?d[i]=d[j]:delete d[i],i+=m,j+=m;return d}},function(a,b,d){var e=d(23)("unscopables"),f=Array.prototype;f[e]==c&&d(8)(f,e,{}),a.exports=function(a){f[e][a]=!0}},function(a,b,c){var d=c(6);d(d.P,"Array",{fill:c(180)}),c(178)("fill")},function(a,b,d){var e=d(56),f=d(37),g=d(35);a.exports=function fill(a){for(var b=e(this),d=g(b.length),h=arguments.length,i=f(h>1?arguments[1]:c,d),j=h>2?arguments[2]:c,k=j===c?d:f(j,d);k>i;)b[i++]=a;return b}},function(a,b,d){var e=d(6),f=d(164)(5),g="find",h=!0;g in[]&&Array(1)[g](function(){h=!1}),e(e.P+e.F*h,"Array",{find:function find(a){return f(this,a,arguments.length>1?arguments[1]:c)}}),d(178)(g)},function(a,b,d){var e=d(6),f=d(164)(6),g="findIndex",h=!0;g in[]&&Array(1)[g](function(){h=!1}),e(e.P+e.F*h,"Array",{findIndex:function findIndex(a){return f(this,a,arguments.length>1?arguments[1]:c)}}),d(178)(g)},function(a,b,d){var e=d(178),f=d(184),g=d(135),h=d(30);a.exports=d(134)(Array,"Array",function(a,b){this._t=h(a),this._i=0,this._k=b},function(){var a=this._t,b=this._k,d=this._i++;return!a||d>=a.length?(this._t=c,f(1)):"keys"==b?f(0,d):"values"==b?f(0,a[d]):f(0,[d,a[d]])},"values"),g.Arguments=g.Array,e("keys"),e("values"),e("entries")},function(a,b){a.exports=function(a,b){return{value:b,done:!!a}}},function(a,b,c){c(186)("Array")},function(a,b,c){var d=c(2),e=c(9),f=c(4),g=c(23)("species");a.exports=function(a){var b=d[a];f&&b&&!b[g]&&e.f(b,g,{configurable:!0,get:function(){return this}})}},function(a,b,d){var e=d(2),f=d(80),g=d(9).f,h=d(48).f,i=d(128),j=d(188),k=e.RegExp,l=k,m=k.prototype,n=/a/g,o=/a/g,p=new k(n)!==n;if(d(4)&&(!p||d(5)(function(){return o[d(23)("match")]=!1,k(n)!=n||k(o)==o||"/a/i"!=k(n,"i")}))){k=function RegExp(a,b){var d=this instanceof k,e=i(a),g=b===c;return!d&&e&&a.constructor===k&&g?a:f(p?new l(e&&!g?a.source:a,b):l((e=a instanceof k)?a.source:a,e&&g?j.call(a):b),d?this:m,k)};for(var q=(function(a){a in k||g(k,a,{configurable:!0,get:function(){return l[a]},set:function(b){l[a]=b}})}),r=h(l),s=0;r.length>s;)q(r[s++]);m.constructor=k,k.prototype=m,d(16)(e,"RegExp",k)}d(186)("RegExp")},function(a,b,c){var d=c(10);a.exports=function(){var a=d(this),b="";return a.global&&(b+="g"),a.ignoreCase&&(b+="i"),a.multiline&&(b+="m"),a.unicode&&(b+="u"),a.sticky&&(b+="y"),b}},function(a,b,d){d(190);var e=d(10),f=d(188),g=d(4),h="toString",i=/./[h],j=function(a){d(16)(RegExp.prototype,h,a,!0)};d(5)(function(){return"/a/b"!=i.call({source:"a",flags:"b"})})?j(function toString(){var a=e(this);return"/".concat(a.source,"/","flags"in a?a.flags:!g&&a instanceof RegExp?f.call(a):c)}):i.name!=h&&j(function toString(){return i.call(this)})},function(a,b,c){c(4)&&"g"!=/./g.flags&&c(9).f(RegExp.prototype,"flags",{configurable:!0,get:c(188)})},function(a,b,d){d(192)("match",1,function(a,b,d){return[function match(d){var e=a(this),f=d==c?c:d[b];return f!==c?f.call(d,e):new RegExp(d)[b](String(e))},d]})},function(a,b,c){var d=c(8),e=c(16),f=c(5),g=c(33),h=c(23);a.exports=function(a,b,c){var i=h(a),j=c(g,i,""[a]),k=j[0],l=j[1];f(function(){var b={};return b[i]=function(){return 7},7!=""[a](b)})&&(e(String.prototype,a,k),d(RegExp.prototype,i,2==b?function(a,b){return l.call(a,this,b)}:function(a){return l.call(a,this)}))}},function(a,b,d){d(192)("replace",2,function(a,b,d){return[function replace(e,f){var g=a(this),h=e==c?c:e[b];return h!==c?h.call(e,g,f):d.call(String(g),e,f)},d]})},function(a,b,d){d(192)("search",1,function(a,b,d){return[function search(d){var e=a(this),f=d==c?c:d[b];return f!==c?f.call(d,e):new RegExp(d)[b](String(e))},d]})},function(a,b,d){d(192)("split",2,function(a,b,e){var f=d(128),g=e,h=[].push,i="split",j="length",k="lastIndex";if("c"=="abbc"[i](/(b)*/)[1]||4!="test"[i](/(?:)/,-1)[j]||2!="ab"[i](/(?:ab)*/)[j]||4!="."[i](/(.?)(.?)/)[j]||"."[i](/()()/)[j]>1||""[i](/.?/)[j]){var l=/()??/.exec("")[1]===c;e=function(a,b){var d=String(this);if(a===c&&0===b)return[];if(!f(a))return g.call(d,a,b);var e,i,m,n,o,p=[],q=(a.ignoreCase?"i":"")+(a.multiline?"m":"")+(a.unicode?"u":"")+(a.sticky?"y":""),r=0,s=b===c?4294967295:b>>>0,t=new RegExp(a.source,q+"g");for(l||(e=new RegExp("^"+t.source+"$(?!\\s)",q));(i=t.exec(d))&&(m=i.index+i[0][j],!(m>r&&(p.push(d.slice(r,i.index)),!l&&i[j]>1&&i[0].replace(e,function(){for(o=1;o1&&i.index=s)));)t[k]===i.index&&t[k]++;return r===d[j]?!n&&t.test("")||p.push(""):p.push(d.slice(r)),p[j]>s?p.slice(0,s):p}}else"0"[i](c,0)[j]&&(e=function(a,b){return a===c&&0===b?[]:g.call(this,a,b)});return[function split(d,f){var g=a(this),h=d==c?c:d[b];return h!==c?h.call(d,g,f):e.call(String(g),d,f)},e]})},function(a,b,d){var e,f,g,h=d(26),i=d(2),j=d(18),k=d(73),l=d(6),m=d(11),n=d(19),o=d(197),p=d(198),q=d(199),r=d(200).set,s=d(201)(),t="Promise",u=i.TypeError,v=i.process,w=i[t],v=i.process,x="process"==k(v),y=function(){},z=!!function(){try{var a=w.resolve(1),b=(a.constructor={})[d(23)("species")]=function(a){a(y,y)};return(x||"function"==typeof PromiseRejectionEvent)&&a.then(y)instanceof b}catch(c){}}(),A=function(a,b){return a===b||a===w&&b===g},B=function(a){var b;return!(!m(a)||"function"!=typeof(b=a.then))&&b},C=function(a){return A(w,a)?new D(a):new f(a)},D=f=function(a){var b,d;this.promise=new a(function(a,e){if(b!==c||d!==c)throw u("Bad Promise constructor");b=a,d=e}),this.resolve=n(b),this.reject=n(d)},E=function(a){try{a()}catch(b){return{error:b}}},F=function(a,b){if(!a._n){a._n=!0;var c=a._c;s(function(){for(var d=a._v,e=1==a._s,f=0,g=function(b){var c,f,g=e?b.ok:b.fail,h=b.resolve,i=b.reject,j=b.domain;try{g?(e||(2==a._h&&I(a),a._h=1),g===!0?c=d:(j&&j.enter(),c=g(d),j&&j.exit()),c===b.promise?i(u("Promise-chain cycle")):(f=B(c))?f.call(c,h,i):h(c)):i(d)}catch(k){i(k)}};c.length>f;)g(c[f++]);a._c=[],a._n=!1,b&&!a._h&&G(a)})}},G=function(a){r.call(i,function(){var b,d,e,f=a._v;if(H(a)&&(b=E(function(){x?v.emit("unhandledRejection",f,a):(d=i.onunhandledrejection)?d({promise:a,reason:f}):(e=i.console)&&e.error&&e.error("Unhandled promise rejection",f)}),a._h=x||H(a)?2:1),a._a=c,b)throw b.error})},H=function(a){if(1==a._h)return!1;for(var b,c=a._a||a._c,d=0;c.length>d;)if(b=c[d++],b.fail||!H(b.promise))return!1;return!0},I=function(a){r.call(i,function(){var b;x?v.emit("rejectionHandled",a):(b=i.onrejectionhandled)&&b({promise:a,reason:a._v})})},J=function(a){var b=this;b._d||(b._d=!0,b=b._w||b,b._v=a,b._s=2,b._a||(b._a=b._c.slice()),F(b,!0))},K=function(a){var b,c=this;if(!c._d){c._d=!0,c=c._w||c;try{if(c===a)throw u("Promise can't be resolved itself");(b=B(a))?s(function(){var d={_w:c,_d:!1};try{b.call(a,j(K,d,1),j(J,d,1))}catch(e){J.call(d,e)}}):(c._v=a,c._s=1,F(c,!1))}catch(d){J.call({_w:c,_d:!1},d)}}};z||(w=function Promise(a){o(this,w,t,"_h"),n(a),e.call(this);try{a(j(K,this,1),j(J,this,1))}catch(b){J.call(this,b)}},e=function Promise(a){this._c=[],this._a=c,this._s=0,this._d=!1,this._v=c,this._h=0,this._n=!1},e.prototype=d(202)(w.prototype,{then:function then(a,b){var d=C(q(this,w));return d.ok="function"!=typeof a||a,d.fail="function"==typeof b&&b,d.domain=x?v.domain:c,this._c.push(d),this._a&&this._a.push(d),this._s&&F(this,!1),d.promise},"catch":function(a){return this.then(c,a)}}),D=function(){var a=new e;this.promise=a,this.resolve=j(K,a,1),this.reject=j(J,a,1)}),l(l.G+l.W+l.F*!z,{Promise:w}),d(22)(w,t),d(186)(t),g=d(7)[t],l(l.S+l.F*!z,t,{reject:function reject(a){var b=C(this),c=b.reject;return c(a),b.promise}}),l(l.S+l.F*(h||!z),t,{resolve:function resolve(a){if(a instanceof w&&A(a.constructor,this))return a;var b=C(this),c=b.resolve;return c(a),b.promise}}),l(l.S+l.F*!(z&&d(157)(function(a){w.all(a)["catch"](y)})),t,{all:function all(a){var b=this,d=C(b),e=d.resolve,f=d.reject,g=E(function(){var d=[],g=0,h=1;p(a,!1,function(a){var i=g++,j=!1;d.push(c),h++,b.resolve(a).then(function(a){j||(j=!0,d[i]=a,--h||e(d))},f)}),--h||e(d)});return g&&f(g.error),d.promise},race:function race(a){var b=this,c=C(b),d=c.reject,e=E(function(){p(a,!1,function(a){b.resolve(a).then(c.resolve,d)})});return e&&d(e.error),c.promise}})},function(a,b){a.exports=function(a,b,d,e){if(!(a instanceof b)||e!==c&&e in a)throw TypeError(d+": incorrect invocation!");return a}},function(a,b,c){var d=c(18),e=c(153),f=c(154),g=c(10),h=c(35),i=c(156),j={},k={},b=a.exports=function(a,b,c,l,m){var n,o,p,q,r=m?function(){return a}:i(a),s=d(c,l,b?2:1),t=0;if("function"!=typeof r)throw TypeError(a+" is not iterable!");if(f(r)){for(n=h(a.length);n>t;t++)if(q=b?s(g(o=a[t])[0],o[1]):s(a[t]),q===j||q===k)return q}else for(p=r.call(a);!(o=p.next()).done;)if(q=e(p,s,o.value,b),q===j||q===k)return q};b.BREAK=j,b.RETURN=k},function(a,b,d){var e=d(10),f=d(19),g=d(23)("species");a.exports=function(a,b){var d,h=e(a).constructor;return h===c||(d=e(h)[g])==c?b:f(d)}},function(a,b,c){var d,e,f,g=c(18),h=c(76),i=c(46),j=c(13),k=c(2),l=k.process,m=k.setImmediate,n=k.clearImmediate,o=k.MessageChannel,p=0,q={},r="onreadystatechange",s=function(){var a=+this;if(q.hasOwnProperty(a)){var b=q[a];delete q[a],b()}},t=function(a){s.call(a.data)};m&&n||(m=function setImmediate(a){for(var b=[],c=1;arguments.length>c;)b.push(arguments[c++]);return q[++p]=function(){h("function"==typeof a?a:Function(a),b)},d(p),p},n=function clearImmediate(a){delete q[a]},"process"==c(32)(l)?d=function(a){l.nextTick(g(s,a,1))}:o?(e=new o,f=e.port2,e.port1.onmessage=t,d=g(f.postMessage,f,1)):k.addEventListener&&"function"==typeof postMessage&&!k.importScripts?(d=function(a){k.postMessage(a+"","*")},k.addEventListener("message",t,!1)):d=r in j("script")?function(a){i.appendChild(j("script"))[r]=function(){i.removeChild(this),s.call(a)}}:function(a){setTimeout(g(s,a,1),0)}),a.exports={set:m,clear:n}},function(a,b,d){var e=d(2),f=d(200).set,g=e.MutationObserver||e.WebKitMutationObserver,h=e.process,i=e.Promise,j="process"==d(32)(h);a.exports=function(){var a,b,d,k=function(){var e,f;for(j&&(e=h.domain)&&e.exit();a;){f=a.fn,a=a.next;try{f()}catch(g){throw a?d():b=c,g}}b=c,e&&e.enter()};if(j)d=function(){h.nextTick(k)};else if(g){var l=!0,m=document.createTextNode("");new g(k).observe(m,{characterData:!0}),d=function(){m.data=l=!l}}else if(i&&i.resolve){var n=i.resolve();d=function(){n.then(k)}}else d=function(){f.call(e,k)};return function(e){var f={fn:e,next:c};b&&(b.next=f),a||(a=f,d()),b=f}}},function(a,b,c){var d=c(16);a.exports=function(a,b,c){for(var e in b)d(a,e,b[e],c);return a}},function(a,b,d){var e=d(204);a.exports=d(205)("Map",function(a){return function Map(){return a(this,arguments.length>0?arguments[0]:c)}},{get:function get(a){var b=e.getEntry(this,a);return b&&b.v},set:function set(a,b){return e.def(this,0===a?0:a,b)}},e,!0)},function(a,b,d){var e=d(9).f,f=d(44),g=d(202),h=d(18),i=d(197),j=d(33),k=d(198),l=d(134),m=d(184),n=d(186),o=d(4),p=d(20).fastKey,q=o?"_s":"size",r=function(a,b){var c,d=p(b);if("F"!==d)return a._i[d];for(c=a._f;c;c=c.n)if(c.k==b)return c};a.exports={getConstructor:function(a,b,d,l){var m=a(function(a,e){i(a,m,b,"_i"),a._i=f(null),a._f=c,a._l=c,a[q]=0,e!=c&&k(e,d,a[l],a)});return g(m.prototype,{clear:function clear(){for(var a=this,b=a._i,d=a._f;d;d=d.n)d.r=!0,d.p&&(d.p=d.p.n=c),delete b[d.i];a._f=a._l=c,a[q]=0},"delete":function(a){var b=this,c=r(b,a);if(c){var d=c.n,e=c.p;delete b._i[c.i],c.r=!0,e&&(e.n=d),d&&(d.p=e),b._f==c&&(b._f=d),b._l==c&&(b._l=e),b[q]--}return!!c},forEach:function forEach(a){i(this,m,"forEach");for(var b,d=h(a,arguments.length>1?arguments[1]:c,3);b=b?b.n:this._f;)for(d(b.v,b.k,this);b&&b.r;)b=b.p},has:function has(a){return!!r(this,a)}}),o&&e(m.prototype,"size",{get:function(){return j(this[q])}}),m},def:function(a,b,d){var e,f,g=r(a,b);return g?g.v=d:(a._l=g={i:f=p(b,!0),k:b,v:d,p:e=a._l,n:c,r:!1},a._f||(a._f=g),e&&(e.n=g),a[q]++,"F"!==f&&(a._i[f]=g)),a},getEntry:r,setStrong:function(a,b,d){l(a,b,function(a,b){this._t=a,this._k=b,this._l=c},function(){for(var a=this,b=a._k,d=a._l;d&&d.r;)d=d.p;return a._t&&(a._l=d=d?d.n:a._t._f)?"keys"==b?m(0,d.k):"values"==b?m(0,d.v):m(0,[d.k,d.v]):(a._t=c,m(1))},d?"entries":"values",!d,!0),n(b)}}},function(a,b,d){var e=d(2),f=d(6),g=d(16),h=d(202),i=d(20),j=d(198),k=d(197),l=d(11),m=d(5),n=d(157),o=d(22),p=d(80);a.exports=function(a,b,d,q,r,s){var t=e[a],u=t,v=r?"set":"add",w=u&&u.prototype,x={},y=function(a){var b=w[a];g(w,a,"delete"==a?function(a){return!(s&&!l(a))&&b.call(this,0===a?0:a)}:"has"==a?function has(a){return!(s&&!l(a))&&b.call(this,0===a?0:a)}:"get"==a?function get(a){return s&&!l(a)?c:b.call(this,0===a?0:a)}:"add"==a?function add(a){return b.call(this,0===a?0:a),this}:function set(a,c){return b.call(this,0===a?0:a,c),this})};if("function"==typeof u&&(s||w.forEach&&!m(function(){(new u).entries().next()}))){var z=new u,A=z[v](s?{}:-0,1)!=z,B=m(function(){z.has(1)}),C=n(function(a){new u(a)}),D=!s&&m(function(){for(var a=new u,b=5;b--;)a[v](b,b);return!a.has(-0)});C||(u=b(function(b,d){k(b,u,a);var e=p(new t,b,u);return d!=c&&j(d,r,e[v],e),e}),u.prototype=w,w.constructor=u),(B||D)&&(y("delete"),y("has"),r&&y("get")),(D||A)&&y(v),s&&w.clear&&delete w.clear}else u=q.getConstructor(b,a,r,v),h(u.prototype,d),i.NEED=!0;return o(u,a),x[a]=u,f(f.G+f.W+f.F*(u!=t),x),s||q.setStrong(u,a,r),u}},function(a,b,d){var e=d(204);a.exports=d(205)("Set",function(a){return function Set(){return a(this,arguments.length>0?arguments[0]:c)}},{add:function add(a){return e.def(this,a=0===a?0:a,a)}},e)},function(a,b,d){var e,f=d(164)(0),g=d(16),h=d(20),i=d(67),j=d(208),k=d(11),l=h.getWeak,m=Object.isExtensible,n=j.ufstore,o={},p=function(a){return function WeakMap(){return a(this,arguments.length>0?arguments[0]:c)}},q={get:function get(a){if(k(a)){var b=l(a);return b===!0?n(this).get(a):b?b[this._i]:c}},set:function set(a,b){return j.def(this,a,b)}},r=a.exports=d(205)("WeakMap",p,q,j,!0,!0);7!=(new r).set((Object.freeze||Object)(o),7).get(o)&&(e=j.getConstructor(p),i(e.prototype,q),h.NEED=!0,f(["delete","has","get","set"],function(a){var b=r.prototype,c=b[a];g(b,a,function(b,d){if(k(b)&&!m(b)){this._f||(this._f=new e);var f=this._f[a](b,d);return"set"==a?this:f}return c.call(this,b,d)})}))},function(a,b,d){var e=d(202),f=d(20).getWeak,g=d(10),h=d(11),i=d(197),j=d(198),k=d(164),l=d(3),m=k(5),n=k(6),o=0,p=function(a){return a._l||(a._l=new q)},q=function(){this.a=[]},r=function(a,b){return m(a.a,function(a){return a[0]===b})};q.prototype={get:function(a){var b=r(this,a);if(b)return b[1]},has:function(a){return!!r(this,a)},set:function(a,b){var c=r(this,a);c?c[1]=b:this.a.push([a,b])},"delete":function(a){var b=n(this.a,function(b){return b[0]===a});return~b&&this.a.splice(b,1),!!~b}},a.exports={getConstructor:function(a,b,d,g){var k=a(function(a,e){i(a,k,b,"_i"),a._i=o++,a._l=c,e!=c&&j(e,d,a[g],a)});return e(k.prototype,{"delete":function(a){if(!h(a))return!1;var b=f(a);return b===!0?p(this)["delete"](a):b&&l(b,this._i)&&delete b[this._i]},has:function has(a){if(!h(a))return!1;var b=f(a);return b===!0?p(this).has(a):b&&l(b,this._i)}}),k},def:function(a,b,c){var d=f(g(b),!0);return d===!0?p(a).set(b,c):d[a._i]=c,a},ufstore:p}},function(a,b,d){var e=d(208);d(205)("WeakSet",function(a){return function WeakSet(){return a(this,arguments.length>0?arguments[0]:c)}},{add:function add(a){return e.def(this,a,!0)}},e,!1,!0)},function(a,b,c){var d=c(6),e=c(19),f=c(10),g=(c(2).Reflect||{}).apply,h=Function.apply;d(d.S+d.F*!c(5)(function(){g(function(){})}),"Reflect",{apply:function apply(a,b,c){var d=e(a),i=f(c);return g?g(d,b,i):h.call(d,b,i)}})},function(a,b,c){var d=c(6),e=c(44),f=c(19),g=c(10),h=c(11),i=c(5),j=c(75),k=(c(2).Reflect||{}).construct,l=i(function(){function F(){}return!(k(function(){},[],F)instanceof F)}),m=!i(function(){k(function(){})});d(d.S+d.F*(l||m),"Reflect",{construct:function construct(a,b){f(a),g(b);var c=arguments.length<3?a:f(arguments[2]);if(m&&!l)return k(a,b,c);if(a==c){switch(b.length){case 0:return new a;case 1:return new a(b[0]);case 2:return new a(b[0],b[1]);case 3:return new a(b[0],b[1],b[2]);case 4:return new a(b[0],b[1],b[2],b[3])}var d=[null];return d.push.apply(d,b),new(j.apply(a,d))}var i=c.prototype,n=e(h(i)?i:Object.prototype),o=Function.apply.call(a,n,b);return h(o)?o:n}})},function(a,b,c){var d=c(9),e=c(6),f=c(10),g=c(14);e(e.S+e.F*c(5)(function(){Reflect.defineProperty(d.f({},1,{value:1}),1,{value:2})}),"Reflect",{defineProperty:function defineProperty(a,b,c){f(a),b=g(b,!0),f(c);try{return d.f(a,b,c),!0}catch(e){return!1}}})},function(a,b,c){var d=c(6),e=c(49).f,f=c(10);d(d.S,"Reflect",{deleteProperty:function deleteProperty(a,b){var c=e(f(a),b);return!(c&&!c.configurable)&&delete a[b]}})},function(a,b,d){var e=d(6),f=d(10),g=function(a){this._t=f(a),this._i=0;var b,c=this._k=[];for(b in a)c.push(b)};d(136)(g,"Object",function(){var a,b=this,d=b._k;do if(b._i>=d.length)return{value:c,done:!0};while(!((a=d[b._i++])in b._t));return{value:a,done:!1}}),e(e.S,"Reflect",{enumerate:function enumerate(a){return new g(a)}})},function(a,b,d){function get(a,b){var d,h,k=arguments.length<3?a:arguments[2];return j(a)===k?a[b]:(d=e.f(a,b))?g(d,"value")?d.value:d.get!==c?d.get.call(k):c:i(h=f(a))?get(h,b,k):void 0}var e=d(49),f=d(57),g=d(3),h=d(6),i=d(11),j=d(10);h(h.S,"Reflect",{get:get})},function(a,b,c){var d=c(49),e=c(6),f=c(10);e(e.S,"Reflect",{getOwnPropertyDescriptor:function getOwnPropertyDescriptor(a,b){return d.f(f(a),b)}})},function(a,b,c){var d=c(6),e=c(57),f=c(10);d(d.S,"Reflect",{getPrototypeOf:function getPrototypeOf(a){return e(f(a))}})},function(a,b,c){var d=c(6);d(d.S,"Reflect",{has:function has(a,b){return b in a}})},function(a,b,c){var d=c(6),e=c(10),f=Object.isExtensible;d(d.S,"Reflect",{isExtensible:function isExtensible(a){return e(a),!f||f(a)}})},function(a,b,c){var d=c(6);d(d.S,"Reflect",{ownKeys:c(221)})},function(a,b,c){var d=c(48),e=c(41),f=c(10),g=c(2).Reflect;a.exports=g&&g.ownKeys||function ownKeys(a){var b=d.f(f(a)),c=e.f;return c?b.concat(c(a)):b}},function(a,b,c){var d=c(6),e=c(10),f=Object.preventExtensions;d(d.S,"Reflect",{preventExtensions:function preventExtensions(a){e(a);try{return f&&f(a),!0}catch(b){return!1}}})},function(a,b,d){function set(a,b,d){var i,m,n=arguments.length<4?a:arguments[3],o=f.f(k(a),b);if(!o){if(l(m=g(a)))return set(m,b,d,n);o=j(0)}return h(o,"value")?!(o.writable===!1||!l(n))&&(i=f.f(n,b)||j(0),i.value=d,e.f(n,b,i),!0):o.set!==c&&(o.set.call(n,d),!0)}var e=d(9),f=d(49),g=d(57),h=d(3),i=d(6),j=d(15),k=d(10),l=d(11);i(i.S,"Reflect",{set:set})},function(a,b,c){var d=c(6),e=c(71);e&&d(d.S,"Reflect",{setPrototypeOf:function setPrototypeOf(a,b){e.check(a,b);try{return e.set(a,b),!0}catch(c){return!1}}})},function(a,b,c){var d=c(6);d(d.S,"Date",{now:function(){return(new Date).getTime()}})},function(a,b,c){var d=c(6),e=c(56),f=c(14);d(d.P+d.F*c(5)(function(){return null!==new Date(NaN).toJSON()||1!==Date.prototype.toJSON.call({toISOString:function(){return 1}})}),"Date",{toJSON:function toJSON(a){var b=e(this),c=f(b);return"number"!=typeof c||isFinite(c)?b.toISOString():null}})},function(a,b,c){var d=c(6),e=c(5),f=Date.prototype.getTime,g=function(a){return a>9?a:"0"+a};d(d.P+d.F*(e(function(){return"0385-07-25T07:06:39.999Z"!=new Date(-5e13-1).toISOString()})||!e(function(){new Date(NaN).toISOString()})),"Date",{toISOString:function toISOString(){if(!isFinite(f.call(this)))throw RangeError("Invalid time value");var a=this,b=a.getUTCFullYear(),c=a.getUTCMilliseconds(),d=b<0?"-":b>9999?"+":"";return d+("00000"+Math.abs(b)).slice(d?-6:-4)+"-"+g(a.getUTCMonth()+1)+"-"+g(a.getUTCDate())+"T"+g(a.getUTCHours())+":"+g(a.getUTCMinutes())+":"+g(a.getUTCSeconds())+"."+(c>99?c:"0"+g(c))+"Z"}})},function(a,b,c){var d=Date.prototype,e="Invalid Date",f="toString",g=d[f],h=d.getTime;new Date(NaN)+""!=e&&c(16)(d,f,function toString(){var a=h.call(this);return a===a?g.call(this):e})},function(a,b,c){var d=c(23)("toPrimitive"),e=Date.prototype;d in e||c(8)(e,d,c(230))},function(a,b,c){var d=c(10),e=c(14),f="number";a.exports=function(a){if("string"!==a&&a!==f&&"default"!==a)throw TypeError("Incorrect hint");return e(d(this),a!=f)}},function(a,b,d){var e=d(6),f=d(232),g=d(233),h=d(10),i=d(37),j=d(35),k=d(11),l=d(2).ArrayBuffer,m=d(199),n=g.ArrayBuffer,o=g.DataView,p=f.ABV&&l.isView,q=n.prototype.slice,r=f.VIEW,s="ArrayBuffer";e(e.G+e.W+e.F*(l!==n),{ArrayBuffer:n}),e(e.S+e.F*!f.CONSTR,s,{isView:function isView(a){return p&&p(a)||k(a)&&r in a}}),e(e.P+e.U+e.F*d(5)(function(){return!new n(2).slice(1,c).byteLength}),s,{slice:function slice(a,b){if(q!==c&&b===c)return q.call(h(this),a);for(var d=h(this).byteLength,e=i(a,d),f=i(b===c?d:b,d),g=new(m(this,n))(j(f-e)),k=new o(this),l=new o(g),p=0;e>1,k=23===b?E(2,-24)-E(2,-77):0,l=0,m=a<0||0===a&&1/a<0?1:0;for(a=D(a),a!=a||a===B?(e=a!=a?1:0,d=i):(d=F(G(a)/H),a*(f=E(2,-d))<1&&(d--,f*=2),a+=d+j>=1?k/f:k*E(2,1-j),a*f>=2&&(d++,f/=2),d+j>=i?(e=0,d=i):d+j>=1?(e=(a*f-1)*E(2,b),d+=j):(e=a*E(2,j-1)*E(2,b),d=0));b>=8;g[l++]=255&e,e/=256,b-=8);for(d=d<0;g[l++]=255&d,d/=256,h-=8);return g[--l]|=128*m,g},P=function(a,b,c){var d,e=8*c-b-1,f=(1<>1,h=e-7,i=c-1,j=a[i--],k=127&j;for(j>>=7;h>0;k=256*k+a[i],i--,h-=8);for(d=k&(1<<-h)-1,k>>=-h,h+=b;h>0;d=256*d+a[i],i--,h-=8);if(0===k)k=1-g;else{if(k===f)return d?NaN:j?-B:B;d+=E(2,b),k-=g}return(j?-1:1)*d*E(2,k-b)},Q=function(a){return a[3]<<24|a[2]<<16|a[1]<<8|a[0]},R=function(a){return[255&a]},S=function(a){return[255&a,a>>8&255]},T=function(a){return[255&a,a>>8&255,a>>16&255,a>>24&255]},U=function(a){return O(a,52,8)},V=function(a){return O(a,23,4)},W=function(a,b,c){p(a[u],b,{get:function(){return this[c]}})},X=function(a,b,c,d){var e=+c,f=m(e);if(e!=f||f<0||f+b>a[M])throw A(w);var g=a[L]._b,h=f+a[N],i=g.slice(h,h+b);return d?i:i.reverse()},Y=function(a,b,c,d,e,f){var g=+c,h=m(g);if(g!=h||h<0||h+b>a[M])throw A(w);for(var i=a[L]._b,j=h+a[N],k=d(+e),l=0;lba;)($=aa[ba++])in x||i(x,$,C[$]);g||(_.constructor=x)}var ca=new y(new x(2)),da=y[u].setInt8;ca.setInt8(0,2147483648),ca.setInt8(1,2147483649),!ca.getInt8(0)&&ca.getInt8(1)||j(y[u],{setInt8:function setInt8(a,b){da.call(this,a,b<<24>>24)},setUint8:function setUint8(a,b){da.call(this,a,b<<24>>24)}},!0)}else x=function ArrayBuffer(a){var b=Z(this,a);this._b=q.call(Array(b),0),this[M]=b},y=function DataView(a,b,d){l(this,y,t),l(a,x,t);var e=a[M],f=m(b);if(f<0||f>e)throw A("Wrong offset!");if(d=d===c?e-f:n(d),f+d>e)throw A(v);this[L]=a,this[N]=f,this[M]=d},f&&(W(x,J,"_l"),W(y,I,"_b"),W(y,J,"_l"),W(y,K,"_o")),j(y[u],{getInt8:function getInt8(a){return X(this,1,a)[0]<<24>>24},getUint8:function getUint8(a){return X(this,1,a)[0]},getInt16:function getInt16(a){var b=X(this,2,a,arguments[1]);return(b[1]<<8|b[0])<<16>>16},getUint16:function getUint16(a){var b=X(this,2,a,arguments[1]);return b[1]<<8|b[0]},getInt32:function getInt32(a){return Q(X(this,4,a,arguments[1]))},getUint32:function getUint32(a){return Q(X(this,4,a,arguments[1]))>>>0},getFloat32:function getFloat32(a){return P(X(this,4,a,arguments[1]),23,4)},getFloat64:function getFloat64(a){return P(X(this,8,a,arguments[1]),52,8)},setInt8:function setInt8(a,b){Y(this,1,a,R,b)},setUint8:function setUint8(a,b){Y(this,1,a,R,b)},setInt16:function setInt16(a,b){Y(this,2,a,S,b,arguments[2])},setUint16:function setUint16(a,b){Y(this,2,a,S,b,arguments[2])},setInt32:function setInt32(a,b){Y(this,4,a,T,b,arguments[2])},setUint32:function setUint32(a,b){Y(this,4,a,T,b,arguments[2])},setFloat32:function setFloat32(a,b){Y(this,4,a,V,b,arguments[2])},setFloat64:function setFloat64(a,b){Y(this,8,a,U,b,arguments[2])}});r(x,s),r(y,t),i(y[u],h.VIEW,!0),b[s]=x,b[t]=y},function(a,b,c){var d=c(6);d(d.G+d.W+d.F*!c(232).ABV,{DataView:c(233).DataView})},function(a,b,c){c(236)("Int8",1,function(a){return function Int8Array(b,c,d){return a(this,b,c,d)}})},function(a,b,d){if(d(4)){var e=d(26),f=d(2),g=d(5),h=d(6),i=d(232),j=d(233),k=d(18),l=d(197),m=d(15),n=d(8),o=d(202),p=d(36),q=d(35),r=d(37),s=d(14),t=d(3),u=d(69),v=d(73),w=d(11),x=d(56),y=d(154),z=d(44),A=d(57),B=d(48).f,C=d(156),D=d(17),E=d(23),F=d(164),G=d(34),H=d(199),I=d(183),J=d(135),K=d(157),L=d(186),M=d(180),N=d(177),O=d(9),P=d(49),Q=O.f,R=P.f,S=f.RangeError,T=f.TypeError,U=f.Uint8Array,V="ArrayBuffer",W="Shared"+V,X="BYTES_PER_ELEMENT",Y="prototype",Z=Array[Y],$=j.ArrayBuffer,_=j.DataView,aa=F(0),ba=F(2),ca=F(3),da=F(4),ea=F(5),fa=F(6),ga=G(!0),ha=G(!1),ia=I.values,ja=I.keys,ka=I.entries,la=Z.lastIndexOf,ma=Z.reduce,na=Z.reduceRight,oa=Z.join,pa=Z.sort,qa=Z.slice,ra=Z.toString,sa=Z.toLocaleString,ta=E("iterator"),ua=E("toStringTag"),va=D("typed_constructor"),wa=D("def_constructor"),xa=i.CONSTR,ya=i.TYPED,za=i.VIEW,Aa="Wrong length!",Ba=F(1,function(a,b){return Ha(H(a,a[wa]),b)}),Ca=g(function(){return 1===new U(new Uint16Array([1]).buffer)[0]}),Da=!!U&&!!U[Y].set&&g(function(){new U(1).set({})}),Ea=function(a,b){if(a===c)throw T(Aa);var d=+a,e=q(a);if(b&&!u(d,e))throw S(Aa);return e},Fa=function(a,b){var c=p(a);if(c<0||c%b)throw S("Wrong offset!");return c},Ga=function(a){if(w(a)&&ya in a)return a;throw T(a+" is not a typed array!")},Ha=function(a,b){if(!(w(a)&&va in a))throw T("It is not a typed array constructor!");return new a(b)},Ia=function(a,b){return Ja(H(a,a[wa]),b)},Ja=function(a,b){for(var c=0,d=b.length,e=Ha(a,d);d>c;)e[c]=b[c++];return e},Ka=function(a,b,c){Q(a,b,{get:function(){return this._d[c]}})},La=function from(a){var b,d,e,f,g,h,i=x(a),j=arguments.length,l=j>1?arguments[1]:c,m=l!==c,n=C(i);if(n!=c&&!y(n)){for(h=n.call(i),e=[],b=0;!(g=h.next()).done;b++)e.push(g.value);i=e}for(m&&j>2&&(l=k(l,arguments[2],2)),b=0,d=q(i.length),f=Ha(this,d);d>b;b++)f[b]=m?l(i[b],b):i[b];return f},Ma=function of(){for(var a=0,b=arguments.length,c=Ha(this,b);b>a;)c[a]=arguments[a++];return c},Na=!!U&&g(function(){sa.call(new U(1))}),Oa=function toLocaleString(){return sa.apply(Na?qa.call(Ga(this)):Ga(this),arguments)},Pa={copyWithin:function copyWithin(a,b){return N.call(Ga(this),a,b,arguments.length>2?arguments[2]:c)},every:function every(a){return da(Ga(this),a,arguments.length>1?arguments[1]:c)},fill:function fill(a){return M.apply(Ga(this),arguments)},filter:function filter(a){return Ia(this,ba(Ga(this),a,arguments.length>1?arguments[1]:c))},find:function find(a){return ea(Ga(this),a,arguments.length>1?arguments[1]:c)},findIndex:function findIndex(a){return fa(Ga(this),a,arguments.length>1?arguments[1]:c)},forEach:function forEach(a){aa(Ga(this),a,arguments.length>1?arguments[1]:c)},indexOf:function indexOf(a){return ha(Ga(this),a,arguments.length>1?arguments[1]:c)},includes:function includes(a){return ga(Ga(this),a,arguments.length>1?arguments[1]:c)},join:function join(a){return oa.apply(Ga(this),arguments)},lastIndexOf:function lastIndexOf(a){ +return la.apply(Ga(this),arguments)},map:function map(a){return Ba(Ga(this),a,arguments.length>1?arguments[1]:c)},reduce:function reduce(a){return ma.apply(Ga(this),arguments)},reduceRight:function reduceRight(a){return na.apply(Ga(this),arguments)},reverse:function reverse(){for(var a,b=this,c=Ga(b).length,d=Math.floor(c/2),e=0;e1?arguments[1]:c)},sort:function sort(a){return pa.call(Ga(this),a)},subarray:function subarray(a,b){var d=Ga(this),e=d.length,f=r(a,e);return new(H(d,d[wa]))(d.buffer,d.byteOffset+f*d.BYTES_PER_ELEMENT,q((b===c?e:r(b,e))-f))}},Qa=function slice(a,b){return Ia(this,qa.call(Ga(this),a,b))},Ra=function set(a){Ga(this);var b=Fa(arguments[1],1),c=this.length,d=x(a),e=q(d.length),f=0;if(e+b>c)throw S(Aa);for(;f255?255:255&d),e.v[p](c*b+e.o,d,Ca)},E=function(a,b){Q(a,b,{get:function(){return C(this,b)},set:function(a){return D(this,b,a)},enumerable:!0})};u?(r=d(function(a,d,e,f){l(a,r,k,"_d");var g,h,i,j,m=0,o=0;if(w(d)){if(!(d instanceof $||(j=v(d))==V||j==W))return ya in d?Ja(r,d):La.call(r,d);g=d,o=Fa(e,b);var p=d.byteLength;if(f===c){if(p%b)throw S(Aa);if(h=p-o,h<0)throw S(Aa)}else if(h=q(f)*b,h+o>p)throw S(Aa);i=h/b}else i=Ea(d,!0),h=i*b,g=new $(h);for(n(a,"_d",{b:g,o:o,l:h,e:i,v:new _(g)});m1?arguments[1]:c)}}),d(178)("includes")},function(a,b,c){var d=c(6),e=c(125)(!0);d(d.P,"String",{at:function at(a){return e(this,a)}})},function(a,b,d){var e=d(6),f=d(248);e(e.P,"String",{padStart:function padStart(a){return f(this,a,arguments.length>1?arguments[1]:c,!0)}})},function(a,b,d){var e=d(35),f=d(85),g=d(33);a.exports=function(a,b,d,h){var i=String(g(a)),j=i.length,k=d===c?" ":String(d),l=e(b);if(l<=j||""==k)return i;var m=l-j,n=f.call(k,Math.ceil(m/k.length));return n.length>m&&(n=n.slice(0,m)),h?n+i:i+n}},function(a,b,d){var e=d(6),f=d(248);e(e.P,"String",{padEnd:function padEnd(a){return f(this,a,arguments.length>1?arguments[1]:c,!1)}})},function(a,b,c){c(81)("trimLeft",function(a){return function trimLeft(){return a(this,1)}},"trimStart")},function(a,b,c){c(81)("trimRight",function(a){return function trimRight(){return a(this,2)}},"trimEnd")},function(a,b,c){var d=c(6),e=c(33),f=c(35),g=c(128),h=c(188),i=RegExp.prototype,j=function(a,b){this._r=a,this._s=b};c(136)(j,"RegExp String",function next(){var a=this._r.exec(this._s);return{value:a,done:null===a}}),d(d.P,"String",{matchAll:function matchAll(a){if(e(this),!g(a))throw TypeError(a+" is not a regexp!");var b=String(this),c="flags"in i?String(a.flags):h.call(a),d=new RegExp(a.source,~c.indexOf("g")?c:"g"+c);return d.lastIndex=f(a.lastIndex),new j(d,b)}})},function(a,b,c){c(25)("asyncIterator")},function(a,b,c){c(25)("observable")},function(a,b,c){var d=c(6),e=c(221),f=c(30),g=c(49),h=c(155);d(d.S,"Object",{getOwnPropertyDescriptors:function getOwnPropertyDescriptors(a){for(var b,c=f(a),d=g.f,i=e(c),j={},k=0;i.length>k;)h(j,b=i[k++],d(c,b));return j}})},function(a,b,c){var d=c(6),e=c(257)(!1);d(d.S,"Object",{values:function values(a){return e(a)}})},function(a,b,c){var d=c(28),e=c(30),f=c(42).f;a.exports=function(a){return function(b){for(var c,g=e(b),h=d(g),i=h.length,j=0,k=[];i>j;)f.call(g,c=h[j++])&&k.push(a?[c,g[c]]:g[c]);return k}}},function(a,b,c){var d=c(6),e=c(257)(!0);d(d.S,"Object",{entries:function entries(a){return e(a)}})},function(a,b,c){var d=c(6),e=c(56),f=c(19),g=c(9);c(4)&&d(d.P+c(260),"Object",{__defineGetter__:function __defineGetter__(a,b){g.f(e(this),a,{get:f(b),enumerable:!0,configurable:!0})}})},function(a,b,c){a.exports=c(26)||!c(5)(function(){var a=Math.random();__defineSetter__.call(null,a,function(){}),delete c(2)[a]})},function(a,b,c){var d=c(6),e=c(56),f=c(19),g=c(9);c(4)&&d(d.P+c(260),"Object",{__defineSetter__:function __defineSetter__(a,b){g.f(e(this),a,{set:f(b),enumerable:!0,configurable:!0})}})},function(a,b,c){var d=c(6),e=c(56),f=c(14),g=c(57),h=c(49).f;c(4)&&d(d.P+c(260),"Object",{__lookupGetter__:function __lookupGetter__(a){var b,c=e(this),d=f(a,!0);do if(b=h(c,d))return b.get;while(c=g(c))}})},function(a,b,c){var d=c(6),e=c(56),f=c(14),g=c(57),h=c(49).f;c(4)&&d(d.P+c(260),"Object",{__lookupSetter__:function __lookupSetter__(a){var b,c=e(this),d=f(a,!0);do if(b=h(c,d))return b.set;while(c=g(c))}})},function(a,b,c){var d=c(6);d(d.P+d.R,"Map",{toJSON:c(265)("Map")})},function(a,b,c){var d=c(73),e=c(266);a.exports=function(a){return function toJSON(){if(d(this)!=a)throw TypeError(a+"#toJSON isn't generic");return e(this)}}},function(a,b,c){var d=c(198);a.exports=function(a,b){var c=[];return d(a,!1,c.push,c,b),c}},function(a,b,c){var d=c(6);d(d.P+d.R,"Set",{toJSON:c(265)("Set")})},function(a,b,c){var d=c(6);d(d.S,"System",{global:c(2)})},function(a,b,c){var d=c(6),e=c(32);d(d.S,"Error",{isError:function isError(a){return"Error"===e(a)}})},function(a,b,c){var d=c(6);d(d.S,"Math",{iaddh:function iaddh(a,b,c,d){var e=a>>>0,f=b>>>0,g=c>>>0;return f+(d>>>0)+((e&g|(e|g)&~(e+g>>>0))>>>31)|0}})},function(a,b,c){var d=c(6);d(d.S,"Math",{isubh:function isubh(a,b,c,d){var e=a>>>0,f=b>>>0,g=c>>>0;return f-(d>>>0)-((~e&g|~(e^g)&e-g>>>0)>>>31)|0}})},function(a,b,c){var d=c(6);d(d.S,"Math",{imulh:function imulh(a,b){var c=65535,d=+a,e=+b,f=d&c,g=e&c,h=d>>16,i=e>>16,j=(h*g>>>0)+(f*g>>>16);return h*i+(j>>16)+((f*i>>>0)+(j&c)>>16)}})},function(a,b,c){var d=c(6);d(d.S,"Math",{umulh:function umulh(a,b){var c=65535,d=+a,e=+b,f=d&c,g=e&c,h=d>>>16,i=e>>>16,j=(h*g>>>0)+(f*g>>>16);return h*i+(j>>>16)+((f*i>>>0)+(j&c)>>>16)}})},function(a,b,c){var d=c(275),e=c(10),f=d.key,g=d.set;d.exp({defineMetadata:function defineMetadata(a,b,c,d){g(a,b,e(c),f(d))}})},function(a,b,d){var e=d(203),f=d(6),g=d(21)("metadata"),h=g.store||(g.store=new(d(207))),i=function(a,b,d){var f=h.get(a);if(!f){if(!d)return c;h.set(a,f=new e)}var g=f.get(b);if(!g){if(!d)return c;f.set(b,g=new e)}return g},j=function(a,b,d){var e=i(b,d,!1);return e!==c&&e.has(a)},k=function(a,b,d){var e=i(b,d,!1);return e===c?c:e.get(a)},l=function(a,b,c,d){i(c,d,!0).set(a,b)},m=function(a,b){var c=i(a,b,!1),d=[];return c&&c.forEach(function(a,b){d.push(b)}),d},n=function(a){return a===c||"symbol"==typeof a?a:String(a)},o=function(a){f(f.S,"Reflect",a)};a.exports={store:h,map:i,has:j,get:k,set:l,keys:m,key:n,exp:o}},function(a,b,d){var e=d(275),f=d(10),g=e.key,h=e.map,i=e.store;e.exp({deleteMetadata:function deleteMetadata(a,b){var d=arguments.length<3?c:g(arguments[2]),e=h(f(b),d,!1);if(e===c||!e["delete"](a))return!1;if(e.size)return!0;var j=i.get(b);return j["delete"](d),!!j.size||i["delete"](b)}})},function(a,b,d){var e=d(275),f=d(10),g=d(57),h=e.has,i=e.get,j=e.key,k=function(a,b,d){var e=h(a,b,d);if(e)return i(a,b,d);var f=g(b);return null!==f?k(a,f,d):c};e.exp({getMetadata:function getMetadata(a,b){return k(a,f(b),arguments.length<3?c:j(arguments[2]))}})},function(a,b,d){var e=d(206),f=d(266),g=d(275),h=d(10),i=d(57),j=g.keys,k=g.key,l=function(a,b){var c=j(a,b),d=i(a);if(null===d)return c;var g=l(d,b);return g.length?c.length?f(new e(c.concat(g))):g:c};g.exp({getMetadataKeys:function getMetadataKeys(a){return l(h(a),arguments.length<2?c:k(arguments[1]))}})},function(a,b,d){var e=d(275),f=d(10),g=e.get,h=e.key;e.exp({getOwnMetadata:function getOwnMetadata(a,b){return g(a,f(b),arguments.length<3?c:h(arguments[2]))}})},function(a,b,d){var e=d(275),f=d(10),g=e.keys,h=e.key;e.exp({getOwnMetadataKeys:function getOwnMetadataKeys(a){return g(f(a),arguments.length<2?c:h(arguments[1]))}})},function(a,b,d){var e=d(275),f=d(10),g=d(57),h=e.has,i=e.key,j=function(a,b,c){var d=h(a,b,c);if(d)return!0;var e=g(b);return null!==e&&j(a,e,c)};e.exp({hasMetadata:function hasMetadata(a,b){return j(a,f(b),arguments.length<3?c:i(arguments[2]))}})},function(a,b,d){var e=d(275),f=d(10),g=e.has,h=e.key;e.exp({hasOwnMetadata:function hasOwnMetadata(a,b){return g(a,f(b),arguments.length<3?c:h(arguments[2]))}})},function(a,b,d){var e=d(275),f=d(10),g=d(19),h=e.key,i=e.set;e.exp({metadata:function metadata(a,b){return function decorator(d,e){i(a,b,(e!==c?f:g)(d),h(e))}}})},function(a,b,c){var d=c(6),e=c(201)(),f=c(2).process,g="process"==c(32)(f);d(d.G,{asap:function asap(a){var b=g&&f.domain;e(b?b.bind(a):a)}})},function(a,b,d){var e=d(6),f=d(2),g=d(7),h=d(201)(),i=d(23)("observable"),j=d(19),k=d(10),l=d(197),m=d(202),n=d(8),o=d(198),p=o.RETURN,q=function(a){return null==a?c:j(a)},r=function(a){var b=a._c;b&&(a._c=c,b())},s=function(a){return a._o===c},t=function(a){s(a)||(a._o=c,r(a))},u=function(a,b){k(a),this._c=c,this._o=a,a=new v(this);try{var d=b(a),e=d;null!=d&&("function"==typeof d.unsubscribe?d=function(){e.unsubscribe()}:j(d),this._c=d)}catch(f){return void a.error(f)}s(this)&&r(this)};u.prototype=m({},{unsubscribe:function unsubscribe(){t(this)}});var v=function(a){this._s=a};v.prototype=m({},{next:function next(a){var b=this._s;if(!s(b)){var c=b._o;try{var d=q(c.next);if(d)return d.call(c,a)}catch(e){try{t(b)}finally{throw e}}}},error:function error(a){var b=this._s;if(s(b))throw a;var d=b._o;b._o=c;try{var e=q(d.error);if(!e)throw a;a=e.call(d,a)}catch(f){try{r(b)}finally{throw f}}return r(b),a},complete:function complete(a){var b=this._s;if(!s(b)){var d=b._o;b._o=c;try{var e=q(d.complete);a=e?e.call(d,a):c}catch(f){try{r(b)}finally{throw f}}return r(b),a}}});var w=function Observable(a){l(this,w,"Observable","_f")._f=j(a)};m(w.prototype,{subscribe:function subscribe(a){return new u(a,this._f)},forEach:function forEach(a){var b=this;return new(g.Promise||f.Promise)(function(c,d){j(a);var e=b.subscribe({next:function(b){try{return a(b)}catch(c){d(c),e.unsubscribe()}},error:d,complete:c})})}}),m(w,{from:function from(a){var b="function"==typeof this?this:w,c=q(k(a)[i]);if(c){var d=k(c.call(a));return d.constructor===b?d:new b(function(a){return d.subscribe(a)})}return new b(function(b){var c=!1;return h(function(){if(!c){try{if(o(a,!1,function(a){if(b.next(a),c)return p})===p)return}catch(d){if(c)throw d;return void b.error(d)}b.complete()}}),function(){c=!0}})},of:function of(){for(var a=0,b=arguments.length,c=Array(b);ag;)(c[g]=arguments[g++])===h&&(i=!0);return function(){var d,f=this,g=arguments.length,j=0,k=0;if(!i&&!g)return e(a,c,f);if(d=c.slice(),i)for(;b>j;j++)d[j]===h&&(d[j]=arguments[k++]);for(;g>k;)d.push(arguments[k++]);return e(a,d,f)}}},function(a,b,c){a.exports=c(2)}]),"undefined"!=typeof module&&module.exports?module.exports=a:"function"==typeof define&&define.amd?define(function(){return a}):b.core=a}(1,1); +//# sourceMappingURL=shim.min.js.map \ No newline at end of file diff --git a/services/dashboard/assets/node_modules/reflect-metadata/Reflect.js b/services/dashboard/assets/node_modules/reflect-metadata/Reflect.js new file mode 100644 index 00000000..ab1d3c31 --- /dev/null +++ b/services/dashboard/assets/node_modules/reflect-metadata/Reflect.js @@ -0,0 +1,949 @@ +/*! ***************************************************************************** +Copyright (C) Microsoft. All rights reserved. +Licensed under the Apache License, Version 2.0 (the "License"); you may not use +this file except in compliance with the License. You may obtain a copy of the +License at http://www.apache.org/licenses/LICENSE-2.0 + +THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED +WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, +MERCHANTABLITY OR NON-INFRINGEMENT. + +See the Apache Version 2.0 License for specific language governing permissions +and limitations under the License. +***************************************************************************** */ +var Reflect; +(function (Reflect) { + "use strict"; + var hasOwn = Object.prototype.hasOwnProperty; + // feature test for Object.create support + var supportsCreate = typeof Object.create === "function"; + // feature test for __proto__ support + var supportsProto = (function () { + var sentinel = {}; + function __() { } + __.prototype = sentinel; + var instance = new __(); + return instance.__proto__ === sentinel; + })(); + // create an object in dictionary mode (a.k.a. "slow" mode in v8) + var createDictionary = supportsCreate ? function () { return MakeDictionary(Object.create(null)); } : + supportsProto ? function () { return MakeDictionary({ __proto__: null }); } : + function () { return MakeDictionary({}); }; + var HashMap; + (function (HashMap) { + var downLevel = !supportsCreate && !supportsProto; + HashMap.has = downLevel + ? function (map, key) { return hasOwn.call(map, key); } + : function (map, key) { return key in map; }; + HashMap.get = downLevel + ? function (map, key) { return hasOwn.call(map, key) ? map[key] : undefined; } + : function (map, key) { return map[key]; }; + })(HashMap || (HashMap = {})); + // Load global or shim versions of Map, Set, and WeakMap + var functionPrototype = Object.getPrototypeOf(Function); + var _Map = typeof Map === "function" ? Map : CreateMapPolyfill(); + var _Set = typeof Set === "function" ? Set : CreateSetPolyfill(); + var _WeakMap = typeof WeakMap === "function" ? WeakMap : CreateWeakMapPolyfill(); + // [[Metadata]] internal slot + var Metadata = new _WeakMap(); + /** + * Applies a set of decorators to a property of a target object. + * @param decorators An array of decorators. + * @param target The target object. + * @param targetKey (Optional) The property key to decorate. + * @param targetDescriptor (Optional) The property descriptor for the target key + * @remarks Decorators are applied in reverse order. + * @example + * + * class Example { + * // property declarations are not part of ES6, though they are valid in TypeScript: + * // static staticProperty; + * // property; + * + * constructor(p) { } + * static staticMethod(p) { } + * method(p) { } + * } + * + * // constructor + * Example = Reflect.decorate(decoratorsArray, Example); + * + * // property (on constructor) + * Reflect.decorate(decoratorsArray, Example, "staticProperty"); + * + * // property (on prototype) + * Reflect.decorate(decoratorsArray, Example.prototype, "property"); + * + * // method (on constructor) + * Object.defineProperty(Example, "staticMethod", + * Reflect.decorate(decoratorsArray, Example, "staticMethod", + * Object.getOwnPropertyDescriptor(Example, "staticMethod"))); + * + * // method (on prototype) + * Object.defineProperty(Example.prototype, "method", + * Reflect.decorate(decoratorsArray, Example.prototype, "method", + * Object.getOwnPropertyDescriptor(Example.prototype, "method"))); + * + */ + function decorate(decorators, target, targetKey, targetDescriptor) { + if (!IsUndefined(targetDescriptor)) { + if (!IsArray(decorators)) + throw new TypeError(); + if (!IsObject(target)) + throw new TypeError(); + if (IsUndefined(targetKey)) + throw new TypeError(); + if (!IsObject(targetDescriptor)) + throw new TypeError(); + targetKey = ToPropertyKey(targetKey); + return DecoratePropertyWithDescriptor(decorators, target, targetKey, targetDescriptor); + } + else if (!IsUndefined(targetKey)) { + if (!IsArray(decorators)) + throw new TypeError(); + if (!IsObject(target)) + throw new TypeError(); + targetKey = ToPropertyKey(targetKey); + return DecoratePropertyWithoutDescriptor(decorators, target, targetKey); + } + else { + if (!IsArray(decorators)) + throw new TypeError(); + if (!IsConstructor(target)) + throw new TypeError(); + return DecorateConstructor(decorators, target); + } + } + Reflect.decorate = decorate; + /** + * A default metadata decorator factory that can be used on a class, class member, or parameter. + * @param metadataKey The key for the metadata entry. + * @param metadataValue The value for the metadata entry. + * @returns A decorator function. + * @remarks + * If `metadataKey` is already defined for the target and target key, the + * metadataValue for that key will be overwritten. + * @example + * + * // constructor + * @Reflect.metadata(key, value) + * class Example { + * } + * + * // property (on constructor, TypeScript only) + * class Example { + * @Reflect.metadata(key, value) + * static staticProperty; + * } + * + * // property (on prototype, TypeScript only) + * class Example { + * @Reflect.metadata(key, value) + * property; + * } + * + * // method (on constructor) + * class Example { + * @Reflect.metadata(key, value) + * static staticMethod() { } + * } + * + * // method (on prototype) + * class Example { + * @Reflect.metadata(key, value) + * method() { } + * } + * + */ + function metadata(metadataKey, metadataValue) { + function decorator(target, targetKey) { + if (!IsUndefined(targetKey)) { + if (!IsObject(target)) + throw new TypeError(); + targetKey = ToPropertyKey(targetKey); + OrdinaryDefineOwnMetadata(metadataKey, metadataValue, target, targetKey); + } + else { + if (!IsConstructor(target)) + throw new TypeError(); + OrdinaryDefineOwnMetadata(metadataKey, metadataValue, target, /*targetKey*/ undefined); + } + } + return decorator; + } + Reflect.metadata = metadata; + /** + * Define a unique metadata entry on the target. + * @param metadataKey A key used to store and retrieve metadata. + * @param metadataValue A value that contains attached metadata. + * @param target The target object on which to define metadata. + * @param targetKey (Optional) The property key for the target. + * @example + * + * class Example { + * // property declarations are not part of ES6, though they are valid in TypeScript: + * // static staticProperty; + * // property; + * + * constructor(p) { } + * static staticMethod(p) { } + * method(p) { } + * } + * + * // constructor + * Reflect.defineMetadata("custom:annotation", options, Example); + * + * // property (on constructor) + * Reflect.defineMetadata("custom:annotation", options, Example, "staticProperty"); + * + * // property (on prototype) + * Reflect.defineMetadata("custom:annotation", options, Example.prototype, "property"); + * + * // method (on constructor) + * Reflect.defineMetadata("custom:annotation", options, Example, "staticMethod"); + * + * // method (on prototype) + * Reflect.defineMetadata("custom:annotation", options, Example.prototype, "method"); + * + * // decorator factory as metadata-producing annotation. + * function MyAnnotation(options): Decorator { + * return (target, key?) => Reflect.defineMetadata("custom:annotation", options, target, key); + * } + * + */ + function defineMetadata(metadataKey, metadataValue, target, targetKey) { + if (!IsObject(target)) + throw new TypeError(); + if (!IsUndefined(targetKey)) + targetKey = ToPropertyKey(targetKey); + return OrdinaryDefineOwnMetadata(metadataKey, metadataValue, target, targetKey); + } + Reflect.defineMetadata = defineMetadata; + /** + * Gets a value indicating whether the target object or its prototype chain has the provided metadata key defined. + * @param metadataKey A key used to store and retrieve metadata. + * @param target The target object on which the metadata is defined. + * @param targetKey (Optional) The property key for the target. + * @returns `true` if the metadata key was defined on the target object or its prototype chain; otherwise, `false`. + * @example + * + * class Example { + * // property declarations are not part of ES6, though they are valid in TypeScript: + * // static staticProperty; + * // property; + * + * constructor(p) { } + * static staticMethod(p) { } + * method(p) { } + * } + * + * // constructor + * result = Reflect.hasMetadata("custom:annotation", Example); + * + * // property (on constructor) + * result = Reflect.hasMetadata("custom:annotation", Example, "staticProperty"); + * + * // property (on prototype) + * result = Reflect.hasMetadata("custom:annotation", Example.prototype, "property"); + * + * // method (on constructor) + * result = Reflect.hasMetadata("custom:annotation", Example, "staticMethod"); + * + * // method (on prototype) + * result = Reflect.hasMetadata("custom:annotation", Example.prototype, "method"); + * + */ + function hasMetadata(metadataKey, target, targetKey) { + if (!IsObject(target)) + throw new TypeError(); + if (!IsUndefined(targetKey)) + targetKey = ToPropertyKey(targetKey); + return OrdinaryHasMetadata(metadataKey, target, targetKey); + } + Reflect.hasMetadata = hasMetadata; + /** + * Gets a value indicating whether the target object has the provided metadata key defined. + * @param metadataKey A key used to store and retrieve metadata. + * @param target The target object on which the metadata is defined. + * @param targetKey (Optional) The property key for the target. + * @returns `true` if the metadata key was defined on the target object; otherwise, `false`. + * @example + * + * class Example { + * // property declarations are not part of ES6, though they are valid in TypeScript: + * // static staticProperty; + * // property; + * + * constructor(p) { } + * static staticMethod(p) { } + * method(p) { } + * } + * + * // constructor + * result = Reflect.hasOwnMetadata("custom:annotation", Example); + * + * // property (on constructor) + * result = Reflect.hasOwnMetadata("custom:annotation", Example, "staticProperty"); + * + * // property (on prototype) + * result = Reflect.hasOwnMetadata("custom:annotation", Example.prototype, "property"); + * + * // method (on constructor) + * result = Reflect.hasOwnMetadata("custom:annotation", Example, "staticMethod"); + * + * // method (on prototype) + * result = Reflect.hasOwnMetadata("custom:annotation", Example.prototype, "method"); + * + */ + function hasOwnMetadata(metadataKey, target, targetKey) { + if (!IsObject(target)) + throw new TypeError(); + if (!IsUndefined(targetKey)) + targetKey = ToPropertyKey(targetKey); + return OrdinaryHasOwnMetadata(metadataKey, target, targetKey); + } + Reflect.hasOwnMetadata = hasOwnMetadata; + /** + * Gets the metadata value for the provided metadata key on the target object or its prototype chain. + * @param metadataKey A key used to store and retrieve metadata. + * @param target The target object on which the metadata is defined. + * @param targetKey (Optional) The property key for the target. + * @returns The metadata value for the metadata key if found; otherwise, `undefined`. + * @example + * + * class Example { + * // property declarations are not part of ES6, though they are valid in TypeScript: + * // static staticProperty; + * // property; + * + * constructor(p) { } + * static staticMethod(p) { } + * method(p) { } + * } + * + * // constructor + * result = Reflect.getMetadata("custom:annotation", Example); + * + * // property (on constructor) + * result = Reflect.getMetadata("custom:annotation", Example, "staticProperty"); + * + * // property (on prototype) + * result = Reflect.getMetadata("custom:annotation", Example.prototype, "property"); + * + * // method (on constructor) + * result = Reflect.getMetadata("custom:annotation", Example, "staticMethod"); + * + * // method (on prototype) + * result = Reflect.getMetadata("custom:annotation", Example.prototype, "method"); + * + */ + function getMetadata(metadataKey, target, targetKey) { + if (!IsObject(target)) + throw new TypeError(); + if (!IsUndefined(targetKey)) + targetKey = ToPropertyKey(targetKey); + return OrdinaryGetMetadata(metadataKey, target, targetKey); + } + Reflect.getMetadata = getMetadata; + /** + * Gets the metadata value for the provided metadata key on the target object. + * @param metadataKey A key used to store and retrieve metadata. + * @param target The target object on which the metadata is defined. + * @param targetKey (Optional) The property key for the target. + * @returns The metadata value for the metadata key if found; otherwise, `undefined`. + * @example + * + * class Example { + * // property declarations are not part of ES6, though they are valid in TypeScript: + * // static staticProperty; + * // property; + * + * constructor(p) { } + * static staticMethod(p) { } + * method(p) { } + * } + * + * // constructor + * result = Reflect.getOwnMetadata("custom:annotation", Example); + * + * // property (on constructor) + * result = Reflect.getOwnMetadata("custom:annotation", Example, "staticProperty"); + * + * // property (on prototype) + * result = Reflect.getOwnMetadata("custom:annotation", Example.prototype, "property"); + * + * // method (on constructor) + * result = Reflect.getOwnMetadata("custom:annotation", Example, "staticMethod"); + * + * // method (on prototype) + * result = Reflect.getOwnMetadata("custom:annotation", Example.prototype, "method"); + * + */ + function getOwnMetadata(metadataKey, target, targetKey) { + if (!IsObject(target)) + throw new TypeError(); + if (!IsUndefined(targetKey)) + targetKey = ToPropertyKey(targetKey); + return OrdinaryGetOwnMetadata(metadataKey, target, targetKey); + } + Reflect.getOwnMetadata = getOwnMetadata; + /** + * Gets the metadata keys defined on the target object or its prototype chain. + * @param target The target object on which the metadata is defined. + * @param targetKey (Optional) The property key for the target. + * @returns An array of unique metadata keys. + * @example + * + * class Example { + * // property declarations are not part of ES6, though they are valid in TypeScript: + * // static staticProperty; + * // property; + * + * constructor(p) { } + * static staticMethod(p) { } + * method(p) { } + * } + * + * // constructor + * result = Reflect.getMetadataKeys(Example); + * + * // property (on constructor) + * result = Reflect.getMetadataKeys(Example, "staticProperty"); + * + * // property (on prototype) + * result = Reflect.getMetadataKeys(Example.prototype, "property"); + * + * // method (on constructor) + * result = Reflect.getMetadataKeys(Example, "staticMethod"); + * + * // method (on prototype) + * result = Reflect.getMetadataKeys(Example.prototype, "method"); + * + */ + function getMetadataKeys(target, targetKey) { + if (!IsObject(target)) + throw new TypeError(); + if (!IsUndefined(targetKey)) + targetKey = ToPropertyKey(targetKey); + return OrdinaryMetadataKeys(target, targetKey); + } + Reflect.getMetadataKeys = getMetadataKeys; + /** + * Gets the unique metadata keys defined on the target object. + * @param target The target object on which the metadata is defined. + * @param targetKey (Optional) The property key for the target. + * @returns An array of unique metadata keys. + * @example + * + * class Example { + * // property declarations are not part of ES6, though they are valid in TypeScript: + * // static staticProperty; + * // property; + * + * constructor(p) { } + * static staticMethod(p) { } + * method(p) { } + * } + * + * // constructor + * result = Reflect.getOwnMetadataKeys(Example); + * + * // property (on constructor) + * result = Reflect.getOwnMetadataKeys(Example, "staticProperty"); + * + * // property (on prototype) + * result = Reflect.getOwnMetadataKeys(Example.prototype, "property"); + * + * // method (on constructor) + * result = Reflect.getOwnMetadataKeys(Example, "staticMethod"); + * + * // method (on prototype) + * result = Reflect.getOwnMetadataKeys(Example.prototype, "method"); + * + */ + function getOwnMetadataKeys(target, targetKey) { + if (!IsObject(target)) + throw new TypeError(); + if (!IsUndefined(targetKey)) + targetKey = ToPropertyKey(targetKey); + return OrdinaryOwnMetadataKeys(target, targetKey); + } + Reflect.getOwnMetadataKeys = getOwnMetadataKeys; + /** + * Deletes the metadata entry from the target object with the provided key. + * @param metadataKey A key used to store and retrieve metadata. + * @param target The target object on which the metadata is defined. + * @param targetKey (Optional) The property key for the target. + * @returns `true` if the metadata entry was found and deleted; otherwise, false. + * @example + * + * class Example { + * // property declarations are not part of ES6, though they are valid in TypeScript: + * // static staticProperty; + * // property; + * + * constructor(p) { } + * static staticMethod(p) { } + * method(p) { } + * } + * + * // constructor + * result = Reflect.deleteMetadata("custom:annotation", Example); + * + * // property (on constructor) + * result = Reflect.deleteMetadata("custom:annotation", Example, "staticProperty"); + * + * // property (on prototype) + * result = Reflect.deleteMetadata("custom:annotation", Example.prototype, "property"); + * + * // method (on constructor) + * result = Reflect.deleteMetadata("custom:annotation", Example, "staticMethod"); + * + * // method (on prototype) + * result = Reflect.deleteMetadata("custom:annotation", Example.prototype, "method"); + * + */ + function deleteMetadata(metadataKey, target, targetKey) { + // https://github.com/rbuckton/ReflectDecorators/blob/master/spec/metadata.md#deletemetadata-metadatakey-p- + if (!IsObject(target)) + throw new TypeError(); + if (!IsUndefined(targetKey)) + targetKey = ToPropertyKey(targetKey); + var metadataMap = GetOrCreateMetadataMap(target, targetKey, /*create*/ false); + if (IsUndefined(metadataMap)) + return false; + if (!metadataMap.delete(metadataKey)) + return false; + if (metadataMap.size > 0) + return true; + var targetMetadata = Metadata.get(target); + targetMetadata.delete(targetKey); + if (targetMetadata.size > 0) + return true; + Metadata.delete(target); + return true; + } + Reflect.deleteMetadata = deleteMetadata; + function DecorateConstructor(decorators, target) { + for (var i = decorators.length - 1; i >= 0; --i) { + var decorator = decorators[i]; + var decorated = decorator(target); + if (!IsUndefined(decorated)) { + if (!IsConstructor(decorated)) + throw new TypeError(); + target = decorated; + } + } + return target; + } + function DecoratePropertyWithDescriptor(decorators, target, propertyKey, descriptor) { + for (var i = decorators.length - 1; i >= 0; --i) { + var decorator = decorators[i]; + var decorated = decorator(target, propertyKey, descriptor); + if (!IsUndefined(decorated)) { + if (!IsObject(decorated)) + throw new TypeError(); + descriptor = decorated; + } + } + return descriptor; + } + function DecoratePropertyWithoutDescriptor(decorators, target, propertyKey) { + for (var i = decorators.length - 1; i >= 0; --i) { + var decorator = decorators[i]; + decorator(target, propertyKey); + } + } + // https://github.com/rbuckton/ReflectDecorators/blob/master/spec/metadata.md#getorcreatemetadatamap--o-p-create- + function GetOrCreateMetadataMap(target, targetKey, create) { + var targetMetadata = Metadata.get(target); + if (!targetMetadata) { + if (!create) + return undefined; + targetMetadata = new _Map(); + Metadata.set(target, targetMetadata); + } + var keyMetadata = targetMetadata.get(targetKey); + if (!keyMetadata) { + if (!create) + return undefined; + keyMetadata = new _Map(); + targetMetadata.set(targetKey, keyMetadata); + } + return keyMetadata; + } + // https://github.com/rbuckton/ReflectDecorators/blob/master/spec/metadata.md#ordinaryhasmetadata--metadatakey-o-p- + function OrdinaryHasMetadata(MetadataKey, O, P) { + var hasOwn = OrdinaryHasOwnMetadata(MetadataKey, O, P); + if (hasOwn) + return true; + var parent = GetPrototypeOf(O); + return parent !== null ? OrdinaryHasMetadata(MetadataKey, parent, P) : false; + } + // https://github.com/rbuckton/ReflectDecorators/blob/master/spec/metadata.md#ordinaryhasownmetadata--metadatakey-o-p- + function OrdinaryHasOwnMetadata(MetadataKey, O, P) { + var metadataMap = GetOrCreateMetadataMap(O, P, /*create*/ false); + return metadataMap !== undefined && Boolean(metadataMap.has(MetadataKey)); + } + // https://github.com/rbuckton/ReflectDecorators/blob/master/spec/metadata.md#ordinarygetmetadata--metadatakey-o-p- + function OrdinaryGetMetadata(MetadataKey, O, P) { + var hasOwn = OrdinaryHasOwnMetadata(MetadataKey, O, P); + if (hasOwn) + return OrdinaryGetOwnMetadata(MetadataKey, O, P); + var parent = GetPrototypeOf(O); + return parent !== null ? OrdinaryGetMetadata(MetadataKey, parent, P) : undefined; + } + // https://github.com/rbuckton/ReflectDecorators/blob/master/spec/metadata.md#ordinarygetownmetadata--metadatakey-o-p- + function OrdinaryGetOwnMetadata(MetadataKey, O, P) { + var metadataMap = GetOrCreateMetadataMap(O, P, /*create*/ false); + return metadataMap === undefined ? undefined : metadataMap.get(MetadataKey); + } + // https://github.com/rbuckton/ReflectDecorators/blob/master/spec/metadata.md#ordinarydefineownmetadata--metadatakey-metadatavalue-o-p- + function OrdinaryDefineOwnMetadata(MetadataKey, MetadataValue, O, P) { + var metadataMap = GetOrCreateMetadataMap(O, P, /*create*/ true); + metadataMap.set(MetadataKey, MetadataValue); + } + // https://github.com/rbuckton/ReflectDecorators/blob/master/spec/metadata.md#ordinarymetadatakeys--o-p- + function OrdinaryMetadataKeys(O, P) { + var ownKeys = OrdinaryOwnMetadataKeys(O, P); + var parent = GetPrototypeOf(O); + if (parent === null) + return ownKeys; + var parentKeys = OrdinaryMetadataKeys(parent, P); + if (parentKeys.length <= 0) + return ownKeys; + if (ownKeys.length <= 0) + return parentKeys; + var keys = new _Set(); + for (var _i = 0; _i < ownKeys.length; _i++) { + var key = ownKeys[_i]; + keys.add(key); + } + for (var _a = 0; _a < parentKeys.length; _a++) { + var key = parentKeys[_a]; + keys.add(key); + } + return getKeys(keys); + } + // https://github.com/rbuckton/ReflectDecorators/blob/master/spec/metadata.md#ordinaryownmetadatakeys--o-p- + function OrdinaryOwnMetadataKeys(target, targetKey) { + var metadataMap = GetOrCreateMetadataMap(target, targetKey, /*create*/ false); + var keys = []; + if (metadataMap) + forEach(metadataMap, function (_, key) { return keys.push(key); }); + return keys; + } + // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-ecmascript-language-types-undefined-type + function IsUndefined(x) { + return x === undefined; + } + // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-isarray + function IsArray(x) { + return Array.isArray ? Array.isArray(x) : x instanceof Array || Object.prototype.toString.call(x) === "[object Array]"; + } + // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object-type + function IsObject(x) { + return typeof x === "object" ? x !== null : typeof x === "function"; + } + // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-isconstructor + function IsConstructor(x) { + return typeof x === "function"; + } + // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-ecmascript-language-types-symbol-type + function IsSymbol(x) { + return typeof x === "symbol"; + } + // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-topropertykey + function ToPropertyKey(value) { + return IsSymbol(value) ? value : String(value); + } + function GetPrototypeOf(O) { + var proto = Object.getPrototypeOf(O); + if (typeof O !== "function" || O === functionPrototype) + return proto; + // TypeScript doesn't set __proto__ in ES5, as it's non-standard. + // Try to determine the superclass Exampleonstructor. Compatible implementations + // must either set __proto__ on a subclass Exampleonstructor to the superclass Exampleonstructor, + // or ensure each class has a valid `constructor` property on its prototype that + // points back to the constructor. + // If this is not the same as Function.[[Prototype]], then this is definately inherited. + // This is the case when in ES6 or when using __proto__ in a compatible browser. + if (proto !== functionPrototype) + return proto; + // If the super prototype is Object.prototype, null, or undefined, then we cannot determine the heritage. + var prototype = O.prototype; + var prototypeProto = prototype && Object.getPrototypeOf(prototype); + if (prototypeProto == null || prototypeProto === Object.prototype) + return proto; + // If the constructor was not a function, then we cannot determine the heritage. + var constructor = prototypeProto.constructor; + if (typeof constructor !== "function") + return proto; + // If we have some kind of self-reference, then we cannot determine the heritage. + if (constructor === O) + return proto; + // we have a pretty good guess at the heritage. + return constructor; + } + function IteratorStep(iterator) { + var result = iterator.next(); + return result.done ? undefined : result; + } + function IteratorClose(iterator) { + var f = iterator["return"]; + if (f) + f.call(iterator); + } + function forEach(source, callback, thisArg) { + var entries = source.entries; + if (typeof entries === "function") { + var iterator = entries.call(source); + var result; + try { + while (result = IteratorStep(iterator)) { + var _a = result.value, key = _a[0], value = _a[1]; + callback.call(thisArg, value, key, source); + } + } + finally { + if (result) + IteratorClose(iterator); + } + } + else { + var forEach_1 = source.forEach; + if (typeof forEach_1 === "function") { + forEach_1.call(source, callback, thisArg); + } + } + } + function getKeys(source) { + var keys = []; + forEach(source, function (_, key) { keys.push(key); }); + return keys; + } + // naive MapIterator shim + function CreateMapIterator(keys, values, kind) { + var index = 0; + return { + next: function () { + if ((keys || values) && index < (keys || values).length) { + var current = index++; + switch (kind) { + case "key": return { value: keys[current], done: false }; + case "value": return { value: values[current], done: false }; + case "key+value": return { value: [keys[current], values[current]], done: false }; + } + } + keys = undefined; + values = undefined; + return { value: undefined, done: true }; + }, + "throw": function (error) { + if (keys || values) { + keys = undefined; + values = undefined; + } + throw error; + }, + "return": function (value) { + if (keys || values) { + keys = undefined; + values = undefined; + } + return { value: value, done: true }; + } + }; + } + // naive Map shim + function CreateMapPolyfill() { + var cacheSentinel = {}; + return (function () { + function Map() { + this._keys = []; + this._values = []; + this._cacheKey = cacheSentinel; + this._cacheIndex = -2; + } + Object.defineProperty(Map.prototype, "size", { + get: function () { return this._keys.length; }, + enumerable: true, + configurable: true + }); + Map.prototype.has = function (key) { return this._find(key, /*insert*/ false) >= 0; }; + Map.prototype.get = function (key) { + var index = this._find(key, /*insert*/ false); + return index >= 0 ? this._values[index] : undefined; + }; + Map.prototype.set = function (key, value) { + var index = this._find(key, /*insert*/ true); + this._values[index] = value; + return this; + }; + Map.prototype.delete = function (key) { + var index = this._find(key, /*insert*/ false); + if (index >= 0) { + var size = this._keys.length; + for (var i = index + 1; i < size; i++) { + this._keys[i - 1] = this._keys[i]; + this._values[i - 1] = this._values[i]; + } + this._keys.length--; + this._values.length--; + this._cacheKey = cacheSentinel; + this._cacheIndex = -2; + return true; + } + return false; + }; + Map.prototype.clear = function () { + this._keys.length = 0; + this._values.length = 0; + this._cacheKey = cacheSentinel; + this._cacheIndex = -2; + }; + Map.prototype.keys = function () { return CreateMapIterator(this._keys, /*values*/ undefined, "key"); }; + Map.prototype.values = function () { return CreateMapIterator(/*keys*/ undefined, this._values, "value"); }; + Map.prototype.entries = function () { return CreateMapIterator(this._keys, this._values, "key+value"); }; + Map.prototype._find = function (key, insert) { + if (this._cacheKey === key) + return this._cacheIndex; + var index = this._keys.indexOf(key); + if (index < 0 && insert) { + index = this._keys.length; + this._keys.push(key); + this._values.push(undefined); + } + return this._cacheKey = key, this._cacheIndex = index; + }; + return Map; + })(); + } + // naive Set shim + function CreateSetPolyfill() { + return (function () { + function Set() { + this._map = new _Map(); + } + Object.defineProperty(Set.prototype, "size", { + get: function () { return this._map.size; }, + enumerable: true, + configurable: true + }); + Set.prototype.has = function (value) { return this._map.has(value); }; + Set.prototype.add = function (value) { return this._map.set(value, value), this; }; + Set.prototype.delete = function (value) { return this._map.delete(value); }; + Set.prototype.clear = function () { this._map.clear(); }; + Set.prototype.keys = function () { return this._map.keys(); }; + Set.prototype.values = function () { return this._map.values(); }; + Set.prototype.entries = function () { return this._map.entries(); }; + return Set; + })(); + } + // naive WeakMap shim + function CreateWeakMapPolyfill() { + var UUID_SIZE = 16; + var keys = createDictionary(); + var rootKey = CreateUniqueKey(); + return (function () { + function WeakMap() { + this._key = CreateUniqueKey(); + } + WeakMap.prototype.has = function (target) { + var table = GetOrCreateWeakMapTable(target, /*create*/ false); + return table !== undefined ? HashMap.has(table, this._key) : false; + }; + WeakMap.prototype.get = function (target) { + var table = GetOrCreateWeakMapTable(target, /*create*/ false); + return table !== undefined ? HashMap.get(table, this._key) : undefined; + }; + WeakMap.prototype.set = function (target, value) { + var table = GetOrCreateWeakMapTable(target, /*create*/ true); + table[this._key] = value; + return this; + }; + WeakMap.prototype.delete = function (target) { + var table = GetOrCreateWeakMapTable(target, /*create*/ false); + return table !== undefined ? delete table[this._key] : false; + }; + WeakMap.prototype.clear = function () { + // NOTE: not a real clear, just makes the previous data unreachable + this._key = CreateUniqueKey(); + }; + return WeakMap; + })(); + function FillRandomBytes(buffer, size) { + for (var i = 0; i < size; ++i) + buffer[i] = Math.random() * 0xff | 0; + return buffer; + } + function GenRandomBytes(size) { + if (typeof Uint8Array === "function") { + if (typeof crypto !== "undefined") + return crypto.getRandomValues(new Uint8Array(size)); + if (typeof msCrypto !== "undefined") + return msCrypto.getRandomValues(new Uint8Array(size)); + return FillRandomBytes(new Uint8Array(size), size); + } + return FillRandomBytes(new Array(size), size); + } + function CreateUUID() { + var data = GenRandomBytes(UUID_SIZE); + // mark as random - RFC 4122 § 4.4 + data[6] = data[6] & 0x4f | 0x40; + data[8] = data[8] & 0xbf | 0x80; + var result = ""; + for (var offset = 0; offset < UUID_SIZE; ++offset) { + var byte = data[offset]; + if (offset === 4 || offset === 6 || offset === 8) + result += "-"; + if (byte < 16) + result += "0"; + result += byte.toString(16).toLowerCase(); + } + return result; + } + function CreateUniqueKey() { + var key; + do + key = "@@WeakMap@@" + CreateUUID(); + while (HashMap.has(keys, key)); + keys[key] = true; + return key; + } + function GetOrCreateWeakMapTable(target, create) { + if (!hasOwn.call(target, rootKey)) { + if (!create) + return undefined; + Object.defineProperty(target, rootKey, { value: createDictionary() }); + } + return target[rootKey]; + } + } + // uses a heuristic used by v8 and chakra to force an object into dictionary mode. + function MakeDictionary(obj) { + obj.__DICTIONARY_MODE__ = 1; + delete obj.____DICTIONARY_MODE__; + return obj; + } + // patch global Reflect + (function (__global) { + if (typeof __global.Reflect !== "undefined") { + if (__global.Reflect !== Reflect) { + for (var p in Reflect) { + if (hasOwn.call(Reflect, p)) { + __global.Reflect[p] = Reflect[p]; + } + } + } + } + else { + __global.Reflect = Reflect; + } + })(typeof window !== "undefined" ? window : + typeof WorkerGlobalScope !== "undefined" ? self : + typeof global !== "undefined" ? global : + Function("return this;")()); +})(Reflect || (Reflect = {})); +//# sourceMappingURL=Reflect.js.map \ No newline at end of file diff --git a/services/dashboard/assets/node_modules/systemjs/dist/system.src.js b/services/dashboard/assets/node_modules/systemjs/dist/system.src.js new file mode 100644 index 00000000..3734388d --- /dev/null +++ b/services/dashboard/assets/node_modules/systemjs/dist/system.src.js @@ -0,0 +1,5153 @@ +/* + * SystemJS v0.19.39 + */ +(function() { +function bootstrap() {// from https://gist.github.com/Yaffle/1088850 +(function(global) { +function URLPolyfill(url, baseURL) { + if (typeof url != 'string') + throw new TypeError('URL must be a string'); + var m = String(url).replace(/^\s+|\s+$/g, "").match(/^([^:\/?#]+:)?(?:\/\/(?:([^:@\/?#]*)(?::([^:@\/?#]*))?@)?(([^:\/?#]*)(?::(\d*))?))?([^?#]*)(\?[^#]*)?(#[\s\S]*)?/); + if (!m) + throw new RangeError('Invalid URL format'); + var protocol = m[1] || ""; + var username = m[2] || ""; + var password = m[3] || ""; + var host = m[4] || ""; + var hostname = m[5] || ""; + var port = m[6] || ""; + var pathname = m[7] || ""; + var search = m[8] || ""; + var hash = m[9] || ""; + if (baseURL !== undefined) { + var base = baseURL instanceof URLPolyfill ? baseURL : new URLPolyfill(baseURL); + var flag = !protocol && !host && !username; + if (flag && !pathname && !search) + search = base.search; + if (flag && pathname[0] !== "/") + pathname = (pathname ? (((base.host || base.username) && !base.pathname ? "/" : "") + base.pathname.slice(0, base.pathname.lastIndexOf("/") + 1) + pathname) : base.pathname); + // dot segments removal + var output = []; + pathname.replace(/^(\.\.?(\/|$))+/, "") + .replace(/\/(\.(\/|$))+/g, "/") + .replace(/\/\.\.$/, "/../") + .replace(/\/?[^\/]*/g, function (p) { + if (p === "/..") + output.pop(); + else + output.push(p); + }); + pathname = output.join("").replace(/^\//, pathname[0] === "/" ? "/" : ""); + if (flag) { + port = base.port; + hostname = base.hostname; + host = base.host; + password = base.password; + username = base.username; + } + if (!protocol) + protocol = base.protocol; + } + + // convert URLs to use / always + pathname = pathname.replace(/\\/g, '/'); + + this.origin = host ? protocol + (protocol !== "" || host !== "" ? "//" : "") + host : ""; + this.href = protocol + (protocol && host || protocol == "file:" ? "//" : "") + (username !== "" ? username + (password !== "" ? ":" + password : "") + "@" : "") + host + pathname + search + hash; + this.protocol = protocol; + this.username = username; + this.password = password; + this.host = host; + this.hostname = hostname; + this.port = port; + this.pathname = pathname; + this.search = search; + this.hash = hash; +} +global.URLPolyfill = URLPolyfill; +})(typeof self != 'undefined' ? self : global);(function(__global) { + + var isWorker = typeof window == 'undefined' && typeof self != 'undefined' && typeof importScripts != 'undefined'; + var isBrowser = typeof window != 'undefined' && typeof document != 'undefined'; + var isWindows = typeof process != 'undefined' && typeof process.platform != 'undefined' && !!process.platform.match(/^win/); + + if (!__global.console) + __global.console = { assert: function() {} }; + + // IE8 support + var indexOf = Array.prototype.indexOf || function(item) { + for (var i = 0, thisLen = this.length; i < thisLen; i++) { + if (this[i] === item) { + return i; + } + } + return -1; + }; + + var defineProperty; + (function () { + try { + if (!!Object.defineProperty({}, 'a', {})) + defineProperty = Object.defineProperty; + } + catch (e) { + defineProperty = function(obj, prop, opt) { + try { + obj[prop] = opt.value || opt.get.call(obj); + } + catch(e) {} + } + } + })(); + + var errArgs = new Error(0, '_').fileName == '_'; + + function addToError(err, msg) { + // parse the stack removing loader code lines for simplification + if (!err.originalErr) { + var stack = ((err.message || err) + (err.stack ? '\n' + err.stack : '')).toString().split('\n'); + var newStack = []; + for (var i = 0; i < stack.length; i++) { + if (typeof $__curScript == 'undefined' || stack[i].indexOf($__curScript.src) == -1) + newStack.push(stack[i]); + } + } + + var newMsg = '(SystemJS) ' + (newStack ? newStack.join('\n\t') : err.message.substr(11)) + '\n\t' + msg; + + // Convert file:/// URLs to paths in Node + if (!isBrowser) + newMsg = newMsg.replace(isWindows ? /file:\/\/\//g : /file:\/\//g, ''); + + var newErr = errArgs ? new Error(newMsg, err.fileName, err.lineNumber) : new Error(newMsg); + + newErr.stack = newMsg; + + // track the original error + newErr.originalErr = err.originalErr || err; + + return newErr; + } + + function __eval(source, debugName, context) { + try { + new Function(source).call(context); + } + catch(e) { + throw addToError(e, 'Evaluating ' + debugName); + } + } + + var baseURI; + + // environent baseURI detection + if (typeof document != 'undefined' && document.getElementsByTagName) { + baseURI = document.baseURI; + + if (!baseURI) { + var bases = document.getElementsByTagName('base'); + baseURI = bases[0] && bases[0].href || window.location.href; + } + } + else if (typeof location != 'undefined') { + baseURI = __global.location.href; + } + + // sanitize out the hash and querystring + if (baseURI) { + baseURI = baseURI.split('#')[0].split('?')[0]; + baseURI = baseURI.substr(0, baseURI.lastIndexOf('/') + 1); + } + else if (typeof process != 'undefined' && process.cwd) { + baseURI = 'file://' + (isWindows ? '/' : '') + process.cwd() + '/'; + if (isWindows) + baseURI = baseURI.replace(/\\/g, '/'); + } + else { + throw new TypeError('No environment baseURI'); + } + + try { + var nativeURL = new __global.URL('test:///').protocol == 'test:'; + } + catch(e) {} + + var URL = nativeURL ? __global.URL : __global.URLPolyfill; + +/* +********************************************************************************************* + + Dynamic Module Loader Polyfill + + - Implemented exactly to the former 2014-08-24 ES6 Specification Draft Rev 27, Section 15 + http://wiki.ecmascript.org/doku.php?id=harmony:specification_drafts#august_24_2014_draft_rev_27 + + - Functions are commented with their spec numbers, with spec differences commented. + + - Spec bugs are commented in this code with links. + + - Abstract functions have been combined where possible, and their associated functions + commented. + + - Realm implementation is entirely omitted. + +********************************************************************************************* +*/ + +function Module() {} +// http://www.ecma-international.org/ecma-262/6.0/#sec-@@tostringtag +defineProperty(Module.prototype, 'toString', { + value: function() { + return 'Module'; + } +}); +function Loader(options) { + this._loader = { + loaderObj: this, + loads: [], + modules: {}, + importPromises: {}, + moduleRecords: {} + }; + + // 26.3.3.6 + defineProperty(this, 'global', { + get: function() { + return __global; + } + }); + + // 26.3.3.13 realm not implemented +} + +(function() { + +// Some Helpers + +// logs a linkset snapshot for debugging +/* function snapshot(loader) { + console.log('---Snapshot---'); + for (var i = 0; i < loader.loads.length; i++) { + var load = loader.loads[i]; + var linkSetLog = ' ' + load.name + ' (' + load.status + '): '; + + for (var j = 0; j < load.linkSets.length; j++) { + linkSetLog += '{' + logloads(load.linkSets[j].loads) + '} '; + } + console.log(linkSetLog); + } + console.log(''); +} +function logloads(loads) { + var log = ''; + for (var k = 0; k < loads.length; k++) + log += loads[k].name + (k != loads.length - 1 ? ' ' : ''); + return log; +} */ + + +/* function checkInvariants() { + // see https://bugs.ecmascript.org/show_bug.cgi?id=2603#c1 + + var loads = System._loader.loads; + var linkSets = []; + + for (var i = 0; i < loads.length; i++) { + var load = loads[i]; + console.assert(load.status == 'loading' || load.status == 'loaded', 'Each load is loading or loaded'); + + for (var j = 0; j < load.linkSets.length; j++) { + var linkSet = load.linkSets[j]; + + for (var k = 0; k < linkSet.loads.length; k++) + console.assert(loads.indexOf(linkSet.loads[k]) != -1, 'linkSet loads are a subset of loader loads'); + + if (linkSets.indexOf(linkSet) == -1) + linkSets.push(linkSet); + } + } + + for (var i = 0; i < loads.length; i++) { + var load = loads[i]; + for (var j = 0; j < linkSets.length; j++) { + var linkSet = linkSets[j]; + + if (linkSet.loads.indexOf(load) != -1) + console.assert(load.linkSets.indexOf(linkSet) != -1, 'linkSet contains load -> load contains linkSet'); + + if (load.linkSets.indexOf(linkSet) != -1) + console.assert(linkSet.loads.indexOf(load) != -1, 'load contains linkSet -> linkSet contains load'); + } + } + + for (var i = 0; i < linkSets.length; i++) { + var linkSet = linkSets[i]; + for (var j = 0; j < linkSet.loads.length; j++) { + var load = linkSet.loads[j]; + + for (var k = 0; k < load.dependencies.length; k++) { + var depName = load.dependencies[k].value; + var depLoad; + for (var l = 0; l < loads.length; l++) { + if (loads[l].name != depName) + continue; + depLoad = loads[l]; + break; + } + + // loading records are allowed not to have their dependencies yet + // if (load.status != 'loading') + // console.assert(depLoad, 'depLoad found'); + + // console.assert(linkSet.loads.indexOf(depLoad) != -1, 'linkset contains all dependencies'); + } + } + } +} */ + + // 15.2.3 - Runtime Semantics: Loader State + + // 15.2.3.11 + function createLoaderLoad(object) { + return { + // modules is an object for ES5 implementation + modules: {}, + loads: [], + loaderObj: object + }; + } + + // 15.2.3.2 Load Records and LoadRequest Objects + + var anonCnt = 0; + + // 15.2.3.2.1 + function createLoad(name) { + return { + status: 'loading', + name: name || '', + linkSets: [], + dependencies: [], + metadata: {} + }; + } + + // 15.2.3.2.2 createLoadRequestObject, absorbed into calling functions + + // 15.2.4 + + // 15.2.4.1 + function loadModule(loader, name, options) { + return new Promise(asyncStartLoadPartwayThrough({ + step: options.address ? 'fetch' : 'locate', + loader: loader, + moduleName: name, + // allow metadata for import https://bugs.ecmascript.org/show_bug.cgi?id=3091 + moduleMetadata: options && options.metadata || {}, + moduleSource: options.source, + moduleAddress: options.address + })); + } + + // 15.2.4.2 + function requestLoad(loader, request, refererName, refererAddress) { + // 15.2.4.2.1 CallNormalize + return new Promise(function(resolve, reject) { + resolve(loader.loaderObj.normalize(request, refererName, refererAddress)); + }) + // 15.2.4.2.2 GetOrCreateLoad + .then(function(name) { + var load; + if (loader.modules[name]) { + load = createLoad(name); + load.status = 'linked'; + // https://bugs.ecmascript.org/show_bug.cgi?id=2795 + load.module = loader.modules[name]; + return load; + } + + for (var i = 0, l = loader.loads.length; i < l; i++) { + load = loader.loads[i]; + if (load.name != name) + continue; + return load; + } + + load = createLoad(name); + loader.loads.push(load); + + proceedToLocate(loader, load); + + return load; + }); + } + + // 15.2.4.3 + function proceedToLocate(loader, load) { + proceedToFetch(loader, load, + Promise.resolve() + // 15.2.4.3.1 CallLocate + .then(function() { + return loader.loaderObj.locate({ name: load.name, metadata: load.metadata }); + }) + ); + } + + // 15.2.4.4 + function proceedToFetch(loader, load, p) { + proceedToTranslate(loader, load, + p + // 15.2.4.4.1 CallFetch + .then(function(address) { + // adjusted, see https://bugs.ecmascript.org/show_bug.cgi?id=2602 + if (load.status != 'loading') + return; + load.address = address; + + return loader.loaderObj.fetch({ name: load.name, metadata: load.metadata, address: address }); + }) + ); + } + + // 15.2.4.5 + function proceedToTranslate(loader, load, p) { + p + // 15.2.4.5.1 CallTranslate + .then(function(source) { + if (load.status != 'loading') + return; + + load.address = load.address || load.name; + + return Promise.resolve(loader.loaderObj.translate({ name: load.name, metadata: load.metadata, address: load.address, source: source })) + + // 15.2.4.5.2 CallInstantiate + .then(function(source) { + load.source = source; + return loader.loaderObj.instantiate({ name: load.name, metadata: load.metadata, address: load.address, source: source }); + }) + + // 15.2.4.5.3 InstantiateSucceeded + .then(function(instantiateResult) { + if (instantiateResult === undefined) + throw new TypeError('Declarative modules unsupported in the polyfill.'); + + if (typeof instantiateResult != 'object') + throw new TypeError('Invalid instantiate return value'); + + load.depsList = instantiateResult.deps || []; + load.execute = instantiateResult.execute; + }) + // 15.2.4.6 ProcessLoadDependencies + .then(function() { + load.dependencies = []; + var depsList = load.depsList; + + var loadPromises = []; + for (var i = 0, l = depsList.length; i < l; i++) (function(request, index) { + loadPromises.push( + requestLoad(loader, request, load.name, load.address) + + // 15.2.4.6.1 AddDependencyLoad (load is parentLoad) + .then(function(depLoad) { + + // adjusted from spec to maintain dependency order + // this is due to the System.register internal implementation needs + load.dependencies[index] = { + key: request, + value: depLoad.name + }; + + if (depLoad.status != 'linked') { + var linkSets = load.linkSets.concat([]); + for (var i = 0, l = linkSets.length; i < l; i++) + addLoadToLinkSet(linkSets[i], depLoad); + } + + // console.log('AddDependencyLoad ' + depLoad.name + ' for ' + load.name); + // snapshot(loader); + }) + ); + })(depsList[i], i); + + return Promise.all(loadPromises); + }) + + // 15.2.4.6.2 LoadSucceeded + .then(function() { + // console.log('LoadSucceeded ' + load.name); + // snapshot(loader); + + load.status = 'loaded'; + + var linkSets = load.linkSets.concat([]); + for (var i = 0, l = linkSets.length; i < l; i++) + updateLinkSetOnLoad(linkSets[i], load); + }); + }) + // 15.2.4.5.4 LoadFailed + ['catch'](function(exc) { + load.status = 'failed'; + load.exception = exc; + + var linkSets = load.linkSets.concat([]); + for (var i = 0, l = linkSets.length; i < l; i++) { + linkSetFailed(linkSets[i], load, exc); + } + + console.assert(load.linkSets.length == 0, 'linkSets not removed'); + }); + } + + // 15.2.4.7 PromiseOfStartLoadPartwayThrough absorbed into calling functions + + // 15.2.4.7.1 + function asyncStartLoadPartwayThrough(stepState) { + return function(resolve, reject) { + var loader = stepState.loader; + var name = stepState.moduleName; + var step = stepState.step; + + if (loader.modules[name]) + throw new TypeError('"' + name + '" already exists in the module table'); + + // adjusted to pick up existing loads + var existingLoad; + for (var i = 0, l = loader.loads.length; i < l; i++) { + if (loader.loads[i].name == name) { + existingLoad = loader.loads[i]; + + if (step == 'translate' && !existingLoad.source) { + existingLoad.address = stepState.moduleAddress; + proceedToTranslate(loader, existingLoad, Promise.resolve(stepState.moduleSource)); + } + + // a primary load -> use that existing linkset if it is for the direct load here + // otherwise create a new linkset unit + if (existingLoad.linkSets.length && existingLoad.linkSets[0].loads[0].name == existingLoad.name) + return existingLoad.linkSets[0].done.then(function() { + resolve(existingLoad); + }); + } + } + + var load = existingLoad || createLoad(name); + + load.metadata = stepState.moduleMetadata; + + var linkSet = createLinkSet(loader, load); + + loader.loads.push(load); + + resolve(linkSet.done); + + if (step == 'locate') + proceedToLocate(loader, load); + + else if (step == 'fetch') + proceedToFetch(loader, load, Promise.resolve(stepState.moduleAddress)); + + else { + console.assert(step == 'translate', 'translate step'); + load.address = stepState.moduleAddress; + proceedToTranslate(loader, load, Promise.resolve(stepState.moduleSource)); + } + } + } + + // Declarative linking functions run through alternative implementation: + // 15.2.5.1.1 CreateModuleLinkageRecord not implemented + // 15.2.5.1.2 LookupExport not implemented + // 15.2.5.1.3 LookupModuleDependency not implemented + + // 15.2.5.2.1 + function createLinkSet(loader, startingLoad) { + var linkSet = { + loader: loader, + loads: [], + startingLoad: startingLoad, // added see spec bug https://bugs.ecmascript.org/show_bug.cgi?id=2995 + loadingCount: 0 + }; + linkSet.done = new Promise(function(resolve, reject) { + linkSet.resolve = resolve; + linkSet.reject = reject; + }); + addLoadToLinkSet(linkSet, startingLoad); + return linkSet; + } + // 15.2.5.2.2 + function addLoadToLinkSet(linkSet, load) { + if (load.status == 'failed') + return; + + for (var i = 0, l = linkSet.loads.length; i < l; i++) + if (linkSet.loads[i] == load) + return; + + linkSet.loads.push(load); + load.linkSets.push(linkSet); + + // adjustment, see https://bugs.ecmascript.org/show_bug.cgi?id=2603 + if (load.status != 'loaded') { + linkSet.loadingCount++; + } + + var loader = linkSet.loader; + + for (var i = 0, l = load.dependencies.length; i < l; i++) { + if (!load.dependencies[i]) + continue; + + var name = load.dependencies[i].value; + + if (loader.modules[name]) + continue; + + for (var j = 0, d = loader.loads.length; j < d; j++) { + if (loader.loads[j].name != name) + continue; + + addLoadToLinkSet(linkSet, loader.loads[j]); + break; + } + } + // console.log('add to linkset ' + load.name); + // snapshot(linkSet.loader); + } + + // linking errors can be generic or load-specific + // this is necessary for debugging info + function doLink(linkSet) { + var error = false; + try { + link(linkSet, function(load, exc) { + linkSetFailed(linkSet, load, exc); + error = true; + }); + } + catch(e) { + linkSetFailed(linkSet, null, e); + error = true; + } + return error; + } + + // 15.2.5.2.3 + function updateLinkSetOnLoad(linkSet, load) { + // console.log('update linkset on load ' + load.name); + // snapshot(linkSet.loader); + + console.assert(load.status == 'loaded' || load.status == 'linked', 'loaded or linked'); + + linkSet.loadingCount--; + + if (linkSet.loadingCount > 0) + return; + + // adjusted for spec bug https://bugs.ecmascript.org/show_bug.cgi?id=2995 + var startingLoad = linkSet.startingLoad; + + // non-executing link variation for loader tracing + // on the server. Not in spec. + /***/ + if (linkSet.loader.loaderObj.execute === false) { + var loads = [].concat(linkSet.loads); + for (var i = 0, l = loads.length; i < l; i++) { + var load = loads[i]; + load.module = { + name: load.name, + module: _newModule({}), + evaluated: true + }; + load.status = 'linked'; + finishLoad(linkSet.loader, load); + } + return linkSet.resolve(startingLoad); + } + /***/ + + var abrupt = doLink(linkSet); + + if (abrupt) + return; + + console.assert(linkSet.loads.length == 0, 'loads cleared'); + + linkSet.resolve(startingLoad); + } + + // 15.2.5.2.4 + function linkSetFailed(linkSet, load, exc) { + var loader = linkSet.loader; + var requests; + + checkError: + if (load) { + if (linkSet.loads[0].name == load.name) { + exc = addToError(exc, 'Error loading ' + load.name); + } + else { + for (var i = 0; i < linkSet.loads.length; i++) { + var pLoad = linkSet.loads[i]; + for (var j = 0; j < pLoad.dependencies.length; j++) { + var dep = pLoad.dependencies[j]; + if (dep.value == load.name) { + exc = addToError(exc, 'Error loading ' + load.name + ' as "' + dep.key + '" from ' + pLoad.name); + break checkError; + } + } + } + exc = addToError(exc, 'Error loading ' + load.name + ' from ' + linkSet.loads[0].name); + } + } + else { + exc = addToError(exc, 'Error linking ' + linkSet.loads[0].name); + } + + + var loads = linkSet.loads.concat([]); + for (var i = 0, l = loads.length; i < l; i++) { + var load = loads[i]; + + // store all failed load records + loader.loaderObj.failed = loader.loaderObj.failed || []; + if (indexOf.call(loader.loaderObj.failed, load) == -1) + loader.loaderObj.failed.push(load); + + var linkIndex = indexOf.call(load.linkSets, linkSet); + console.assert(linkIndex != -1, 'link not present'); + load.linkSets.splice(linkIndex, 1); + if (load.linkSets.length == 0) { + var globalLoadsIndex = indexOf.call(linkSet.loader.loads, load); + if (globalLoadsIndex != -1) + linkSet.loader.loads.splice(globalLoadsIndex, 1); + } + } + linkSet.reject(exc); + } + + // 15.2.5.2.5 + function finishLoad(loader, load) { + // add to global trace if tracing + if (loader.loaderObj.trace) { + if (!loader.loaderObj.loads) + loader.loaderObj.loads = {}; + var depMap = {}; + load.dependencies.forEach(function(dep) { + depMap[dep.key] = dep.value; + }); + loader.loaderObj.loads[load.name] = { + name: load.name, + deps: load.dependencies.map(function(dep){ return dep.key }), + depMap: depMap, + address: load.address, + metadata: load.metadata, + source: load.source + }; + } + // if not anonymous, add to the module table + if (load.name) { + console.assert(!loader.modules[load.name] || loader.modules[load.name].module === load.module.module, 'load not in module table'); + loader.modules[load.name] = load.module; + } + var loadIndex = indexOf.call(loader.loads, load); + if (loadIndex != -1) + loader.loads.splice(loadIndex, 1); + for (var i = 0, l = load.linkSets.length; i < l; i++) { + loadIndex = indexOf.call(load.linkSets[i].loads, load); + if (loadIndex != -1) + load.linkSets[i].loads.splice(loadIndex, 1); + } + load.linkSets.splice(0, load.linkSets.length); + } + + function doDynamicExecute(linkSet, load, linkError) { + try { + var module = load.execute(); + } + catch(e) { + linkError(load, e); + return; + } + if (!module || !(module instanceof Module)) + linkError(load, new TypeError('Execution must define a Module instance')); + else + return module; + } + + // 26.3 Loader + + // 26.3.1.1 + // defined at top + + // importPromises adds ability to import a module twice without error - https://bugs.ecmascript.org/show_bug.cgi?id=2601 + function createImportPromise(loader, name, promise) { + var importPromises = loader._loader.importPromises; + return importPromises[name] = promise.then(function(m) { + importPromises[name] = undefined; + return m; + }, function(e) { + importPromises[name] = undefined; + throw e; + }); + } + + Loader.prototype = { + // 26.3.3.1 + constructor: Loader, + // 26.3.3.2 + define: function(name, source, options) { + // check if already defined + if (this._loader.importPromises[name]) + throw new TypeError('Module is already loading.'); + return createImportPromise(this, name, new Promise(asyncStartLoadPartwayThrough({ + step: 'translate', + loader: this._loader, + moduleName: name, + moduleMetadata: options && options.metadata || {}, + moduleSource: source, + moduleAddress: options && options.address + }))); + }, + // 26.3.3.3 + 'delete': function(name) { + var loader = this._loader; + delete loader.importPromises[name]; + delete loader.moduleRecords[name]; + return loader.modules[name] ? delete loader.modules[name] : false; + }, + // 26.3.3.4 entries not implemented + // 26.3.3.5 + get: function(key) { + if (!this._loader.modules[key]) + return; + return this._loader.modules[key].module; + }, + // 26.3.3.7 + has: function(name) { + return !!this._loader.modules[name]; + }, + // 26.3.3.8 + 'import': function(name, parentName, parentAddress) { + if (typeof parentName == 'object') + parentName = parentName.name; + + // run normalize first + var loaderObj = this; + + // added, see https://bugs.ecmascript.org/show_bug.cgi?id=2659 + return Promise.resolve(loaderObj.normalize(name, parentName)) + .then(function(name) { + var loader = loaderObj._loader; + + if (loader.modules[name]) + return loader.modules[name].module; + + return loader.importPromises[name] || createImportPromise(loaderObj, name, + loadModule(loader, name, {}) + .then(function(load) { + delete loader.importPromises[name]; + return load.module.module; + })); + }); + }, + // 26.3.3.9 keys not implemented + // 26.3.3.10 + load: function(name) { + var loader = this._loader; + if (loader.modules[name]) + return Promise.resolve(); + return loader.importPromises[name] || createImportPromise(this, name, new Promise(asyncStartLoadPartwayThrough({ + step: 'locate', + loader: loader, + moduleName: name, + moduleMetadata: {}, + moduleSource: undefined, + moduleAddress: undefined + })) + .then(function() { + delete loader.importPromises[name]; + })); + }, + // 26.3.3.11 + module: function(source, options) { + var load = createLoad(); + load.address = options && options.address; + var linkSet = createLinkSet(this._loader, load); + var sourcePromise = Promise.resolve(source); + var loader = this._loader; + var p = linkSet.done.then(function() { + return load.module.module; + }); + proceedToTranslate(loader, load, sourcePromise); + return p; + }, + // 26.3.3.12 + newModule: function (obj) { + if (typeof obj != 'object') + throw new TypeError('Expected object'); + + var m = new Module(); + + var pNames = []; + if (Object.getOwnPropertyNames && obj != null) + pNames = Object.getOwnPropertyNames(obj); + else + for (var key in obj) + pNames.push(key); + + for (var i = 0; i < pNames.length; i++) (function(key) { + defineProperty(m, key, { + configurable: false, + enumerable: true, + get: function () { + return obj[key]; + }, + set: function() { + throw new Error('Module exports cannot be changed externally.'); + } + }); + })(pNames[i]); + + if (Object.freeze) + Object.freeze(m); + + return m; + }, + // 26.3.3.14 + set: function(name, module) { + if (!(module instanceof Module)) + throw new TypeError('Loader.set(' + name + ', module) must be a module'); + this._loader.modules[name] = { + module: module + }; + }, + // 26.3.3.15 values not implemented + // 26.3.3.16 @@iterator not implemented + // 26.3.3.17 @@toStringTag not implemented + + // 26.3.3.18.1 + normalize: function(name, referrerName, referrerAddress) {}, + // 26.3.3.18.2 + locate: function(load) { + return load.name; + }, + // 26.3.3.18.3 + fetch: function(load) { + }, + // 26.3.3.18.4 + translate: function(load) { + return load.source; + }, + // 26.3.3.18.5 + instantiate: function(load) { + } + }; + + var _newModule = Loader.prototype.newModule; + +/* + * ES6 Module Declarative Linking Code + */ + function link(linkSet, linkError) { + + var loader = linkSet.loader; + + if (!linkSet.loads.length) + return; + + var loads = linkSet.loads.concat([]); + + for (var i = 0; i < loads.length; i++) { + var load = loads[i]; + + var module = doDynamicExecute(linkSet, load, linkError); + if (!module) + return; + load.module = { + name: load.name, + module: module + }; + load.status = 'linked'; + + finishLoad(loader, load); + } + } + +})(); + +var System; + + var fetchTextFromURL; + if (typeof XMLHttpRequest != 'undefined') { + fetchTextFromURL = function(url, authorization, fulfill, reject) { + var xhr = new XMLHttpRequest(); + var sameDomain = true; + var doTimeout = false; + if (!('withCredentials' in xhr)) { + // check if same domain + var domainCheck = /^(\w+:)?\/\/([^\/]+)/.exec(url); + if (domainCheck) { + sameDomain = domainCheck[2] === window.location.host; + if (domainCheck[1]) + sameDomain &= domainCheck[1] === window.location.protocol; + } + } + if (!sameDomain && typeof XDomainRequest != 'undefined') { + xhr = new XDomainRequest(); + xhr.onload = load; + xhr.onerror = error; + xhr.ontimeout = error; + xhr.onprogress = function() {}; + xhr.timeout = 0; + doTimeout = true; + } + function load() { + fulfill(xhr.responseText); + } + function error() { + reject(new Error('XHR error' + (xhr.status ? ' (' + xhr.status + (xhr.statusText ? ' ' + xhr.statusText : '') + ')' : '') + ' loading ' + url)); + } + + xhr.onreadystatechange = function () { + if (xhr.readyState === 4) { + // in Chrome on file:/// URLs, status is 0 + if (xhr.status == 0) { + if (xhr.responseText) { + load(); + } + else { + // when responseText is empty, wait for load or error event + // to inform if it is a 404 or empty file + xhr.addEventListener('error', error); + xhr.addEventListener('load', load); + } + } + else if (xhr.status === 200) { + load(); + } + else { + error(); + } + } + }; + xhr.open("GET", url, true); + + if (xhr.setRequestHeader) { + xhr.setRequestHeader('Accept', 'application/x-es-module, */*'); + // can set "authorization: true" to enable withCredentials only + if (authorization) { + if (typeof authorization == 'string') + xhr.setRequestHeader('Authorization', authorization); + xhr.withCredentials = true; + } + } + + if (doTimeout) { + setTimeout(function() { + xhr.send(); + }, 0); + } else { + xhr.send(null); + } + }; + } + else if (typeof require != 'undefined' && typeof process != 'undefined') { + var fs; + fetchTextFromURL = function(url, authorization, fulfill, reject) { + if (url.substr(0, 8) != 'file:///') + throw new Error('Unable to fetch "' + url + '". Only file URLs of the form file:/// allowed running in Node.'); + fs = fs || require('fs'); + if (isWindows) + url = url.replace(/\//g, '\\').substr(8); + else + url = url.substr(7); + return fs.readFile(url, function(err, data) { + if (err) { + return reject(err); + } + else { + // Strip Byte Order Mark out if it's the leading char + var dataString = data + ''; + if (dataString[0] === '\ufeff') + dataString = dataString.substr(1); + + fulfill(dataString); + } + }); + }; + } + else if (typeof self != 'undefined' && typeof self.fetch != 'undefined') { + fetchTextFromURL = function(url, authorization, fulfill, reject) { + var opts = { + headers: {'Accept': 'application/x-es-module, */*'} + }; + + if (authorization) { + if (typeof authorization == 'string') + opts.headers['Authorization'] = authorization; + opts.credentials = 'include'; + } + + fetch(url, opts) + .then(function (r) { + if (r.ok) { + return r.text(); + } else { + throw new Error('Fetch error: ' + r.status + ' ' + r.statusText); + } + }) + .then(fulfill, reject); + } + } + else { + throw new TypeError('No environment fetch API available.'); + } +/* + * Traceur, Babel and TypeScript transpile hook for Loader + */ +var transpile = (function() { + + // use Traceur by default + Loader.prototype.transpiler = 'traceur'; + + function transpile(load) { + var self = this; + + return Promise.resolve(__global[self.transpiler == 'typescript' ? 'ts' : self.transpiler] + || (self.pluginLoader || self)['import'](self.transpiler)) + .then(function(transpiler) { + if (transpiler.__useDefault) + transpiler = transpiler['default']; + + var transpileFunction; + if (transpiler.Compiler) + transpileFunction = traceurTranspile; + else if (transpiler.createLanguageService) + transpileFunction = typescriptTranspile; + else + transpileFunction = babelTranspile; + + // note __moduleName will be part of the transformer meta in future when we have the spec for this + return '(function(__moduleName){' + transpileFunction.call(self, load, transpiler) + '\n})("' + load.name + '");\n//# sourceURL=' + load.address + '!transpiled'; + }); + }; + + function traceurTranspile(load, traceur) { + var options = this.traceurOptions || {}; + options.modules = 'instantiate'; + options.script = false; + if (options.sourceMaps === undefined) + options.sourceMaps = 'inline'; + options.filename = load.address; + options.inputSourceMap = load.metadata.sourceMap; + options.moduleName = false; + + var compiler = new traceur.Compiler(options); + + return doTraceurCompile(load.source, compiler, options.filename); + } + function doTraceurCompile(source, compiler, filename) { + try { + return compiler.compile(source, filename); + } + catch(e) { + // on older versions of traceur (<0.9.3), an array of errors is thrown + // rather than a single error. + if (e.length) { + throw e[0]; + } + throw e; + } + } + + function babelTranspile(load, babel) { + var options = this.babelOptions || {}; + options.modules = 'system'; + if (options.sourceMap === undefined) + options.sourceMap = 'inline'; + options.inputSourceMap = load.metadata.sourceMap; + options.filename = load.address; + options.code = true; + options.ast = false; + + return babel.transform(load.source, options).code; + } + + function typescriptTranspile(load, ts) { + var options = this.typescriptOptions || {}; + options.target = options.target || ts.ScriptTarget.ES5; + if (options.sourceMap === undefined) + options.sourceMap = true; + if (options.sourceMap && options.inlineSourceMap !== false) + options.inlineSourceMap = true; + + options.module = ts.ModuleKind.System; + + return ts.transpile(load.source, options, load.address); + } + + return transpile; +})(); +// SystemJS Loader Class and Extension helpers +function SystemJSLoader() { + Loader.call(this); + + this.paths = {}; + this._loader.paths = {}; + + systemJSConstructor.call(this); +} + +// inline Object.create-style class extension +function SystemProto() {}; +SystemProto.prototype = Loader.prototype; +SystemJSLoader.prototype = new SystemProto(); +SystemJSLoader.prototype.constructor = SystemJSLoader; + +var systemJSConstructor; + +function hook(name, hook) { + SystemJSLoader.prototype[name] = hook(SystemJSLoader.prototype[name] || function() {}); +} +function hookConstructor(hook) { + systemJSConstructor = hook(systemJSConstructor || function() {}); +} + + +var absURLRegEx = /^[^\/]+:\/\//; +function isAbsolute(name) { + return name.match(absURLRegEx); +} +function isRel(name) { + return (name[0] == '.' && (!name[1] || name[1] == '/' || name[1] == '.')) || name[0] == '/'; +} +function isPlain(name) { + return !isRel(name) && !isAbsolute(name); +} + +var baseURIObj = new URL(baseURI); + +function urlResolve(name, parent) { + // url resolution shortpaths + if (name[0] == '.') { + // dot-relative url normalization + if (name[1] == '/' && name[2] != '.') + return (parent && parent.substr(0, parent.lastIndexOf('/') + 1) || baseURI) + name.substr(2); + } + else if (name[0] != '/' && name.indexOf(':') == -1) { + // plain parent normalization + return (parent && parent.substr(0, parent.lastIndexOf('/') + 1) || baseURI) + name; + } + + return new URL(name, parent && parent.replace(/#/g, '%05') || baseURIObj).href.replace(/%05/g, '#'); +} + +// NB no specification provided for System.paths, used ideas discussed in https://github.com/jorendorff/js-loaders/issues/25 +function applyPaths(loader, name) { + // most specific (most number of slashes in path) match wins + var pathMatch = '', wildcard, maxWildcardPrefixLen = 0; + + var paths = loader.paths; + var pathsCache = loader._loader.paths; + + // check to see if we have a paths entry + for (var p in paths) { + if (paths.hasOwnProperty && !paths.hasOwnProperty(p)) + continue; + + // paths sanitization + var path = paths[p]; + if (path !== pathsCache[p]) + path = paths[p] = pathsCache[p] = urlResolve(paths[p], isRel(paths[p]) ? baseURI : loader.baseURL); + + // exact path match + if (p.indexOf('*') === -1) { + if (name == p) + return paths[p]; + + // support trailing / in paths rules + else if (name.substr(0, p.length - 1) == p.substr(0, p.length - 1) && (name.length < p.length || name[p.length - 1] == p[p.length - 1]) && (paths[p][paths[p].length - 1] == '/' || paths[p] == '')) { + return paths[p].substr(0, paths[p].length - 1) + (name.length > p.length ? (paths[p] && '/' || '') + name.substr(p.length) : ''); + } + } + // wildcard path match + else { + var pathParts = p.split('*'); + if (pathParts.length > 2) + throw new TypeError('Only one wildcard in a path is permitted'); + + var wildcardPrefixLen = pathParts[0].length; + if (wildcardPrefixLen >= maxWildcardPrefixLen && + name.substr(0, pathParts[0].length) == pathParts[0] && + name.substr(name.length - pathParts[1].length) == pathParts[1]) { + maxWildcardPrefixLen = wildcardPrefixLen; + pathMatch = p; + wildcard = name.substr(pathParts[0].length, name.length - pathParts[1].length - pathParts[0].length); + } + } + } + + var outPath = paths[pathMatch]; + if (typeof wildcard == 'string') + outPath = outPath.replace('*', wildcard); + + return outPath; +} + +function dedupe(deps) { + var newDeps = []; + for (var i = 0, l = deps.length; i < l; i++) + if (indexOf.call(newDeps, deps[i]) == -1) + newDeps.push(deps[i]) + return newDeps; +} + +function group(deps) { + var names = []; + var indices = []; + for (var i = 0, l = deps.length; i < l; i++) { + var index = indexOf.call(names, deps[i]); + if (index === -1) { + names.push(deps[i]); + indices.push([i]); + } + else { + indices[index].push(i); + } + } + return { names: names, indices: indices }; +} + +var getOwnPropertyDescriptor = true; +try { + Object.getOwnPropertyDescriptor({ a: 0 }, 'a'); +} +catch(e) { + getOwnPropertyDescriptor = false; +} + +// converts any module.exports object into an object ready for SystemJS.newModule +function getESModule(exports) { + var esModule = {}; + // don't trigger getters/setters in environments that support them + if ((typeof exports == 'object' || typeof exports == 'function') && exports !== __global) { + if (getOwnPropertyDescriptor) { + for (var p in exports) { + // The default property is copied to esModule later on + if (p === 'default') + continue; + defineOrCopyProperty(esModule, exports, p); + } + } + else { + extend(esModule, exports); + } + } + esModule['default'] = exports; + defineProperty(esModule, '__useDefault', { + value: true + }); + return esModule; +} + +function defineOrCopyProperty(targetObj, sourceObj, propName) { + try { + var d; + if (d = Object.getOwnPropertyDescriptor(sourceObj, propName)) + defineProperty(targetObj, propName, d); + } + catch (ex) { + // Object.getOwnPropertyDescriptor threw an exception, fall back to normal set property + // we dont need hasOwnProperty here because getOwnPropertyDescriptor would have returned undefined above + targetObj[propName] = sourceObj[propName]; + return false; + } +} + +function extend(a, b, prepend) { + var hasOwnProperty = b && b.hasOwnProperty; + for (var p in b) { + if (hasOwnProperty && !b.hasOwnProperty(p)) + continue; + if (!prepend || !(p in a)) + a[p] = b[p]; + } + return a; +} + +// meta first-level extends where: +// array + array appends +// object + object extends +// other properties replace +function extendMeta(a, b, prepend) { + var hasOwnProperty = b && b.hasOwnProperty; + for (var p in b) { + if (hasOwnProperty && !b.hasOwnProperty(p)) + continue; + var val = b[p]; + if (!(p in a)) + a[p] = val; + else if (val instanceof Array && a[p] instanceof Array) + a[p] = [].concat(prepend ? val : a[p]).concat(prepend ? a[p] : val); + else if (typeof val == 'object' && val !== null && typeof a[p] == 'object') + a[p] = extend(extend({}, a[p]), val, prepend); + else if (!prepend) + a[p] = val; + } +} + +function extendPkgConfig(pkgCfgA, pkgCfgB, pkgName, loader, warnInvalidProperties) { + for (var prop in pkgCfgB) { + if (indexOf.call(['main', 'format', 'defaultExtension', 'basePath'], prop) != -1) { + pkgCfgA[prop] = pkgCfgB[prop]; + } + else if (prop == 'map') { + extend(pkgCfgA.map = pkgCfgA.map || {}, pkgCfgB.map); + } + else if (prop == 'meta') { + extend(pkgCfgA.meta = pkgCfgA.meta || {}, pkgCfgB.meta); + } + else if (prop == 'depCache') { + for (var d in pkgCfgB.depCache) { + var dNormalized; + + if (d.substr(0, 2) == './') + dNormalized = pkgName + '/' + d.substr(2); + else + dNormalized = coreResolve.call(loader, d); + loader.depCache[dNormalized] = (loader.depCache[dNormalized] || []).concat(pkgCfgB.depCache[d]); + } + } + else if (warnInvalidProperties && indexOf.call(['browserConfig', 'nodeConfig', 'devConfig', 'productionConfig'], prop) == -1 && + (!pkgCfgB.hasOwnProperty || pkgCfgB.hasOwnProperty(prop))) { + warn.call(loader, '"' + prop + '" is not a valid package configuration option in package ' + pkgName); + } + } +} + +// deeply-merge (to first level) config with any existing package config +function setPkgConfig(loader, pkgName, cfg, prependConfig) { + var pkg; + + // first package is config by reference for fast path, cloned after that + if (!loader.packages[pkgName]) { + pkg = loader.packages[pkgName] = cfg; + } + else { + var basePkg = loader.packages[pkgName]; + pkg = loader.packages[pkgName] = {}; + + extendPkgConfig(pkg, prependConfig ? cfg : basePkg, pkgName, loader, prependConfig); + extendPkgConfig(pkg, prependConfig ? basePkg : cfg, pkgName, loader, !prependConfig); + } + + // main object becomes main map + if (typeof pkg.main == 'object') { + pkg.map = pkg.map || {}; + pkg.map['./@main'] = pkg.main; + pkg.main['default'] = pkg.main['default'] || './'; + pkg.main = '@main'; + } + + return pkg; +} + +function warn(msg) { + if (this.warnings && typeof console != 'undefined' && console.warn) + console.warn(msg); +} +// we define a __exec for globally-scoped execution +// used by module format implementations +var __exec; + +(function() { + + var hasBuffer = typeof Buffer != 'undefined'; + try { + if (hasBuffer && new Buffer('a').toString('base64') != 'YQ==') + hasBuffer = false; + } + catch(e) { + hasBuffer = false; + } + + var sourceMapPrefix = '\n//# sourceMappingURL=data:application/json;base64,'; + function inlineSourceMap(sourceMapString) { + if (hasBuffer) + return sourceMapPrefix + new Buffer(sourceMapString).toString('base64'); + else if (typeof btoa != 'undefined') + return sourceMapPrefix + btoa(unescape(encodeURIComponent(sourceMapString))); + else + return ''; + } + + function getSource(load, wrap) { + var lastLineIndex = load.source.lastIndexOf('\n'); + + // wrap ES formats with a System closure for System global encapsulation + if (load.metadata.format == 'global') + wrap = false; + + var sourceMap = load.metadata.sourceMap; + if (sourceMap) { + if (typeof sourceMap != 'object') + throw new TypeError('load.metadata.sourceMap must be set to an object.'); + + sourceMap = JSON.stringify(sourceMap); + } + + return (wrap ? '(function(System, SystemJS) {' : '') + load.source + (wrap ? '\n})(System, System);' : '') + // adds the sourceURL comment if not already present + + (load.source.substr(lastLineIndex, 15) != '\n//# sourceURL=' + ? '\n//# sourceURL=' + load.address + (sourceMap ? '!transpiled' : '') : '') + // add sourceMappingURL if load.metadata.sourceMap is set + + (sourceMap && inlineSourceMap(sourceMap) || ''); + } + + var curLoad; + + // System.register, System.registerDynamic, AMD define pipeline + // if currently evalling code here, immediately reduce the registered entry against the load record + hook('pushRegister_', function() { + return function(register) { + if (!curLoad) + return false; + + this.reduceRegister_(curLoad, register); + return true; + }; + }); + + // System clobbering protection (mostly for Traceur) + var curSystem; + var callCounter = 0; + function preExec(loader, load) { + curLoad = load; + if (callCounter++ == 0) + curSystem = __global.System; + __global.System = __global.SystemJS = loader; + } + function postExec() { + if (--callCounter == 0) + __global.System = __global.SystemJS = curSystem; + curLoad = undefined; + } + + var useVm; + var vm; + __exec = function(load) { + if (!load.source) + return; + if ((load.metadata.integrity || load.metadata.nonce) && supportsScriptExec) + return scriptExec.call(this, load); + try { + preExec(this, load); + curLoad = load; + // global scoped eval for node (avoids require scope leak) + if (!vm && this._nodeRequire) { + vm = this._nodeRequire('vm'); + useVm = vm.runInThisContext("typeof System !== 'undefined' && System") === this; + } + if (useVm) + vm.runInThisContext(getSource(load, true), { filename: load.address + (load.metadata.sourceMap ? '!transpiled' : '') }); + else + (0, eval)(getSource(load, true)); + postExec(); + } + catch(e) { + postExec(); + throw addToError(e, 'Evaluating ' + load.address); + } + }; + + var supportsScriptExec = false; + if (isBrowser && typeof document != 'undefined' && document.getElementsByTagName) { + var scripts = document.getElementsByTagName('script'); + $__curScript = scripts[scripts.length - 1]; + + if (!(window.chrome && window.chrome.extension || navigator.userAgent.match(/^Node\.js/))) + supportsScriptExec = true; + } + + // script execution via injecting a script tag into the page + // this allows CSP integrity and nonce to be set for CSP environments + var head; + function scriptExec(load) { + if (!head) + head = document.head || document.body || document.documentElement; + + var script = document.createElement('script'); + script.text = getSource(load, false); + var onerror = window.onerror; + var e; + window.onerror = function(_e) { + e = addToError(_e, 'Evaluating ' + load.address); + if (onerror) + onerror.apply(this, arguments); + } + preExec(this, load); + + if (load.metadata.integrity) + script.setAttribute('integrity', load.metadata.integrity); + if (load.metadata.nonce) + script.setAttribute('nonce', load.metadata.nonce); + + head.appendChild(script); + head.removeChild(script); + postExec(); + window.onerror = onerror; + if (e) + throw e; + } + +})(); +function readMemberExpression(p, value) { + var pParts = p.split('.'); + while (pParts.length) + value = value[pParts.shift()]; + return value; +} + +function getMapMatch(map, name) { + var bestMatch, bestMatchLength = 0; + + for (var p in map) { + if (name.substr(0, p.length) == p && (name.length == p.length || name[p.length] == '/')) { + var curMatchLength = p.split('/').length; + if (curMatchLength <= bestMatchLength) + continue; + bestMatch = p; + bestMatchLength = curMatchLength; + } + } + + return bestMatch; +} + +function prepareBaseURL(loader) { + // ensure baseURl is fully normalized + if (this._loader.baseURL !== this.baseURL) { + if (this.baseURL[this.baseURL.length - 1] != '/') + this.baseURL += '/'; + + this._loader.baseURL = this.baseURL = new URL(this.baseURL, baseURIObj).href; + } +} + +var envModule; +function setProduction(isProduction, isBuilder) { + this.set('@system-env', envModule = this.newModule({ + browser: isBrowser, + node: !!this._nodeRequire, + production: !isBuilder && isProduction, + dev: isBuilder || !isProduction, + build: isBuilder, + 'default': true + })); +} + +hookConstructor(function(constructor) { + return function() { + constructor.call(this); + + // support baseURL + this.baseURL = baseURI; + + // support map and paths + this.map = {}; + + // make the location of the system.js script accessible + if (typeof $__curScript != 'undefined') + this.scriptSrc = $__curScript.src; + + // global behaviour flags + this.warnings = false; + this.defaultJSExtensions = false; + this.pluginFirst = false; + this.loaderErrorStack = false; + + // by default load ".json" files as json + // leading * meta doesn't need normalization + // NB add this in next breaking release + // this.meta['*.json'] = { format: 'json' }; + + // support the empty module, as a concept + this.set('@empty', this.newModule({})); + + setProduction.call(this, false, false); + }; +}); + +// include the node require since we're overriding it +if (typeof require != 'undefined' && typeof process != 'undefined' && !process.browser) + SystemJSLoader.prototype._nodeRequire = require; + +/* + Core SystemJS Normalization + + If a name is relative, we apply URL normalization to the page + If a name is an absolute URL, we leave it as-is + + Plain names (neither of the above) run through the map and paths + normalization phases. + + The paths normalization phase applies last (paths extension), which + defines the `decanonicalize` function and normalizes everything into + a URL. + */ + +var parentModuleContext; +function getNodeModule(name, baseURL) { + if (!isPlain(name)) + throw new Error('Node module ' + name + ' can\'t be loaded as it is not a package require.'); + + if (!parentModuleContext) { + var Module = this._nodeRequire('module'); + var base = baseURL.substr(isWindows ? 8 : 7); + parentModuleContext = new Module(base); + parentModuleContext.paths = Module._nodeModulePaths(base); + } + return parentModuleContext.require(name); +} + +function coreResolve(name, parentName) { + // standard URL resolution + if (isRel(name)) + return urlResolve(name, parentName); + else if (isAbsolute(name)) + return name; + + // plain names not starting with './', '://' and '/' go through custom resolution + var mapMatch = getMapMatch(this.map, name); + + if (mapMatch) { + name = this.map[mapMatch] + name.substr(mapMatch.length); + + if (isRel(name)) + return urlResolve(name); + else if (isAbsolute(name)) + return name; + } + + if (this.has(name)) + return name; + + // dynamically load node-core modules when requiring `@node/fs` for example + if (name.substr(0, 6) == '@node/') { + if (!this._nodeRequire) + throw new TypeError('Error loading ' + name + '. Can only load node core modules in Node.'); + if (this.builder) + this.set(name, this.newModule({})); + else + this.set(name, this.newModule(getESModule(getNodeModule.call(this, name.substr(6), this.baseURL)))); + return name; + } + + // prepare the baseURL to ensure it is normalized + prepareBaseURL.call(this); + + return applyPaths(this, name) || this.baseURL + name; +} + +hook('normalize', function(normalize) { + return function(name, parentName, skipExt) { + var resolved = coreResolve.call(this, name, parentName); + if (this.defaultJSExtensions && !skipExt && resolved.substr(resolved.length - 3, 3) != '.js' && !isPlain(resolved)) + resolved += '.js'; + return resolved; + }; +}); + +// percent encode just '#' in urls if using HTTP requests +var httpRequest = typeof XMLHttpRequest != 'undefined'; +hook('locate', function(locate) { + return function(load) { + return Promise.resolve(locate.call(this, load)) + .then(function(address) { + if (httpRequest) + return address.replace(/#/g, '%23'); + return address; + }); + }; +}); + +/* + * Fetch with authorization + */ +hook('fetch', function() { + return function(load) { + return new Promise(function(resolve, reject) { + fetchTextFromURL(load.address, load.metadata.authorization, resolve, reject); + }); + }; +}); + +/* + __useDefault + + When a module object looks like: + newModule( + __useDefault: true, + default: 'some-module' + }) + + Then importing that module provides the 'some-module' + result directly instead of the full module. + + Useful for eg module.exports = function() {} +*/ +hook('import', function(systemImport) { + return function(name, parentName, parentAddress) { + if (parentName && parentName.name) + warn.call(this, 'SystemJS.import(name, { name: parentName }) is deprecated for SystemJS.import(name, parentName), while importing ' + name + ' from ' + parentName.name); + return systemImport.call(this, name, parentName, parentAddress).then(function(module) { + return module.__useDefault ? module['default'] : module; + }); + }; +}); + +/* + * Allow format: 'detect' meta to enable format detection + */ +hook('translate', function(systemTranslate) { + return function(load) { + if (load.metadata.format == 'detect') + load.metadata.format = undefined; + return systemTranslate.apply(this, arguments); + }; +}); + + +/* + * JSON format support + * + * Supports loading JSON files as a module format itself + * + * Usage: + * + * SystemJS.config({ + * meta: { + * '*.json': { format: 'json' } + * } + * }); + * + * Module is returned as if written: + * + * export default {JSON} + * + * No named exports are provided + * + * Files ending in ".json" are treated as json automatically by SystemJS + */ +hook('instantiate', function(instantiate) { + return function(load) { + if (load.metadata.format == 'json' && !this.builder) { + var entry = load.metadata.entry = createEntry(); + entry.deps = []; + entry.execute = function() { + try { + return JSON.parse(load.source); + } + catch(e) { + throw new Error("Invalid JSON file " + load.name); + } + }; + } + }; +}) + +/* + Extend config merging one deep only + + loader.config({ + some: 'random', + config: 'here', + deep: { + config: { too: 'too' } + } + }); + + <=> + + loader.some = 'random'; + loader.config = 'here' + loader.deep = loader.deep || {}; + loader.deep.config = { too: 'too' }; + + + Normalizes meta and package configs allowing for: + + SystemJS.config({ + meta: { + './index.js': {} + } + }); + + To become + + SystemJS.meta['https://thissite.com/index.js'] = {}; + + For easy normalization canonicalization with latest URL support. + +*/ +function envSet(loader, cfg, envCallback) { + if (envModule.browser && cfg.browserConfig) + envCallback(cfg.browserConfig); + if (envModule.node && cfg.nodeConfig) + envCallback(cfg.nodeConfig); + if (envModule.dev && cfg.devConfig) + envCallback(cfg.devConfig); + if (envModule.build && cfg.buildConfig) + envCallback(cfg.buildConfig); + if (envModule.production && cfg.productionConfig) + envCallback(cfg.productionConfig); +} + +SystemJSLoader.prototype.getConfig = function(name) { + var cfg = {}; + var loader = this; + for (var p in loader) { + if (loader.hasOwnProperty && !loader.hasOwnProperty(p) || p in SystemJSLoader.prototype && p != 'transpiler') + continue; + if (indexOf.call(['_loader', 'amdDefine', 'amdRequire', 'defined', 'failed', 'version', 'loads'], p) == -1) + cfg[p] = loader[p]; + } + cfg.production = envModule.production; + return cfg; +}; + +var curCurScript; +SystemJSLoader.prototype.config = function(cfg, isEnvConfig) { + var loader = this; + + if ('loaderErrorStack' in cfg) { + curCurScript = $__curScript; + if (cfg.loaderErrorStack) + $__curScript = undefined; + else + $__curScript = curCurScript; + } + + if ('warnings' in cfg) + loader.warnings = cfg.warnings; + + // transpiler deprecation path + if (cfg.transpilerRuntime === false) + loader._loader.loadedTranspilerRuntime = true; + + if ('production' in cfg || 'build' in cfg) + setProduction.call(loader, !!cfg.production, !!(cfg.build || envModule && envModule.build)); + + if (!isEnvConfig) { + // if using nodeConfig / browserConfig / productionConfig, take baseURL from there + // these exceptions will be unnecessary when we can properly implement config queuings + var baseURL; + envSet(loader, cfg, function(cfg) { + baseURL = baseURL || cfg.baseURL; + }); + baseURL = baseURL || cfg.baseURL; + + // always configure baseURL first + if (baseURL) { + var hasConfig = false; + function checkHasConfig(obj) { + for (var p in obj) + if (obj.hasOwnProperty(p)) + return true; + } + if (checkHasConfig(loader.packages) || checkHasConfig(loader.meta) || checkHasConfig(loader.depCache) || checkHasConfig(loader.bundles) || checkHasConfig(loader.packageConfigPaths)) + throw new TypeError('Incorrect configuration order. The baseURL must be configured with the first SystemJS.config call.'); + + this.baseURL = baseURL; + prepareBaseURL.call(this); + } + + if (cfg.paths) + extend(loader.paths, cfg.paths); + + envSet(loader, cfg, function(cfg) { + if (cfg.paths) + extend(loader.paths, cfg.paths); + }); + + // warn on wildcard path deprecations + if (this.warnings) { + for (var p in loader.paths) + if (p.indexOf('*') != -1) + warn.call(loader, 'Paths configuration "' + p + '" -> "' + loader.paths[p] + '" uses wildcards which are being deprecated for simpler trailing "/" folder paths.'); + } + } + + if (cfg.defaultJSExtensions) { + loader.defaultJSExtensions = cfg.defaultJSExtensions; + warn.call(loader, 'The defaultJSExtensions configuration option is deprecated, use packages configuration instead.'); + } + + if (cfg.pluginFirst) + loader.pluginFirst = cfg.pluginFirst; + + if (cfg.map) { + var objMaps = ''; + for (var p in cfg.map) { + var v = cfg.map[p]; + + // object map backwards-compat into packages configuration + if (typeof v !== 'string') { + objMaps += (objMaps.length ? ', ' : '') + '"' + p + '"'; + + var defaultJSExtension = loader.defaultJSExtensions && p.substr(p.length - 3, 3) != '.js'; + var prop = loader.decanonicalize(p); + if (defaultJSExtension && prop.substr(prop.length - 3, 3) == '.js') + prop = prop.substr(0, prop.length - 3); + + // if a package main, revert it + var pkgMatch = ''; + for (var pkg in loader.packages) { + if (prop.substr(0, pkg.length) == pkg + && (!prop[pkg.length] || prop[pkg.length] == '/') + && pkgMatch.split('/').length < pkg.split('/').length) + pkgMatch = pkg; + } + if (pkgMatch && loader.packages[pkgMatch].main) + prop = prop.substr(0, prop.length - loader.packages[pkgMatch].main.length - 1); + + var pkg = loader.packages[prop] = loader.packages[prop] || {}; + pkg.map = v; + } + else { + loader.map[p] = v; + } + } + if (objMaps) + warn.call(loader, 'The map configuration for ' + objMaps + ' uses object submaps, which is deprecated in global map.\nUpdate this to use package contextual map with configs like SystemJS.config({ packages: { "' + p + '": { map: {...} } } }).'); + } + + if (cfg.packageConfigPaths) { + var packageConfigPaths = []; + for (var i = 0; i < cfg.packageConfigPaths.length; i++) { + var path = cfg.packageConfigPaths[i]; + var packageLength = Math.max(path.lastIndexOf('*') + 1, path.lastIndexOf('/')); + var normalized = coreResolve.call(loader, path.substr(0, packageLength)); + packageConfigPaths[i] = normalized + path.substr(packageLength); + } + loader.packageConfigPaths = packageConfigPaths; + } + + if (cfg.bundles) { + for (var p in cfg.bundles) { + var bundle = []; + for (var i = 0; i < cfg.bundles[p].length; i++) { + var defaultJSExtension = loader.defaultJSExtensions && cfg.bundles[p][i].substr(cfg.bundles[p][i].length - 3, 3) != '.js'; + var normalizedBundleDep = loader.decanonicalize(cfg.bundles[p][i]); + if (defaultJSExtension && normalizedBundleDep.substr(normalizedBundleDep.length - 3, 3) == '.js') + normalizedBundleDep = normalizedBundleDep.substr(0, normalizedBundleDep.length - 3); + bundle.push(normalizedBundleDep); + } + loader.bundles[p] = bundle; + } + } + + if (cfg.packages) { + for (var p in cfg.packages) { + if (p.match(/^([^\/]+:)?\/\/$/)) + throw new TypeError('"' + p + '" is not a valid package name.'); + + var prop = coreResolve.call(loader, p); + + // allow trailing slash in packages + if (prop[prop.length - 1] == '/') + prop = prop.substr(0, prop.length - 1); + + setPkgConfig(loader, prop, cfg.packages[p], false); + } + } + + for (var c in cfg) { + var v = cfg[c]; + + if (indexOf.call(['baseURL', 'map', 'packages', 'bundles', 'paths', 'warnings', 'packageConfigPaths', + 'loaderErrorStack', 'browserConfig', 'nodeConfig', 'devConfig', 'buildConfig', 'productionConfig'], c) != -1) + continue; + + if (typeof v != 'object' || v instanceof Array) { + loader[c] = v; + } + else { + loader[c] = loader[c] || {}; + + for (var p in v) { + // base-level wildcard meta does not normalize to retain catch-all quality + if (c == 'meta' && p[0] == '*') { + extend(loader[c][p] = loader[c][p] || {}, v[p]); + } + else if (c == 'meta') { + // meta can go through global map, with defaultJSExtensions adding + var resolved = coreResolve.call(loader, p); + if (loader.defaultJSExtensions && resolved.substr(resolved.length - 3, 3) != '.js' && !isPlain(resolved)) + resolved += '.js'; + extend(loader[c][resolved] = loader[c][resolved] || {}, v[p]); + } + else if (c == 'depCache') { + var defaultJSExtension = loader.defaultJSExtensions && p.substr(p.length - 3, 3) != '.js'; + var prop = loader.decanonicalize(p); + if (defaultJSExtension && prop.substr(prop.length - 3, 3) == '.js') + prop = prop.substr(0, prop.length - 3); + loader[c][prop] = [].concat(v[p]); + } + else { + loader[c][p] = v[p]; + } + } + } + } + + envSet(loader, cfg, function(cfg) { + loader.config(cfg, true); + }); +};/* + * Package Configuration Extension + * + * Example: + * + * SystemJS.packages = { + * jquery: { + * main: 'index.js', // when not set, package name is requested directly + * format: 'amd', + * defaultExtension: 'ts', // defaults to 'js', can be set to false + * modules: { + * '*.ts': { + * loader: 'typescript' + * }, + * 'vendor/sizzle.js': { + * format: 'global' + * } + * }, + * map: { + * // map internal require('sizzle') to local require('./vendor/sizzle') + * sizzle: './vendor/sizzle.js', + * // map any internal or external require of 'jquery/vendor/another' to 'another/index.js' + * './vendor/another.js': './another/index.js', + * // test.js / test -> lib/test.js + * './test.js': './lib/test.js', + * + * // environment-specific map configurations + * './index.js': { + * '~browser': './index-node.js', + * './custom-condition.js|~export': './index-custom.js' + * } + * }, + * // allows for setting package-prefixed depCache + * // keys are normalized module names relative to the package itself + * depCache: { + * // import 'package/index.js' loads in parallel package/lib/test.js,package/vendor/sizzle.js + * './index.js': ['./test'], + * './test.js': ['external-dep'], + * 'external-dep/path.js': ['./another.js'] + * } + * } + * }; + * + * Then: + * import 'jquery' -> jquery/index.js + * import 'jquery/submodule' -> jquery/submodule.js + * import 'jquery/submodule.ts' -> jquery/submodule.ts loaded as typescript + * import 'jquery/vendor/another' -> another/index.js + * + * Detailed Behaviours + * - main can have a leading "./" can be added optionally + * - map and defaultExtension are applied to the main + * - defaultExtension adds the extension only if the exact extension is not present + * - defaultJSExtensions applies after map when defaultExtension is not set + * - if a meta value is available for a module, map and defaultExtension are skipped + * - like global map, package map also applies to subpaths (sizzle/x, ./vendor/another/sub) + * - condition module map is '@env' module in package or '@system-env' globally + * - map targets support conditional interpolation ('./x': './x.#{|env}.js') + * - internal package map targets cannot use boolean conditionals + * + * Package Configuration Loading + * + * Not all packages may already have their configuration present in the System config + * For these cases, a list of packageConfigPaths can be provided, which when matched against + * a request, will first request a ".json" file by the package name to derive the package + * configuration from. This allows dynamic loading of non-predetermined code, a key use + * case in SystemJS. + * + * Example: + * + * SystemJS.packageConfigPaths = ['packages/test/package.json', 'packages/*.json']; + * + * // will first request 'packages/new-package/package.json' for the package config + * // before completing the package request to 'packages/new-package/path' + * SystemJS.import('packages/new-package/path'); + * + * // will first request 'packages/test/package.json' before the main + * SystemJS.import('packages/test'); + * + * When a package matches packageConfigPaths, it will always send a config request for + * the package configuration. + * The package name itself is taken to be the match up to and including the last wildcard + * or trailing slash. + * The most specific package config path will be used. + * Any existing package configurations for the package will deeply merge with the + * package config, with the existing package configurations taking preference. + * To opt-out of the package configuration request for a package that matches + * packageConfigPaths, use the { configured: true } package config option. + * + */ +(function() { + + hookConstructor(function(constructor) { + return function() { + constructor.call(this); + this.packages = {}; + this.packageConfigPaths = []; + }; + }); + + function getPackage(loader, normalized) { + // use most specific package + var curPkg, curPkgLen = 0, pkgLen; + for (var p in loader.packages) { + if (normalized.substr(0, p.length) === p && (normalized.length === p.length || normalized[p.length] === '/')) { + pkgLen = p.split('/').length; + if (pkgLen > curPkgLen) { + curPkg = p; + curPkgLen = pkgLen; + } + } + } + return curPkg; + } + + function addDefaultExtension(loader, pkg, pkgName, subPath, skipExtensions) { + // don't apply extensions to folders or if defaultExtension = false + if (!subPath || subPath[subPath.length - 1] == '/' || skipExtensions || pkg.defaultExtension === false) + return subPath; + + var metaMatch = false; + + // exact meta or meta with any content after the last wildcard skips extension + if (pkg.meta) + getMetaMatches(pkg.meta, subPath, function(metaPattern, matchMeta, matchDepth) { + if (matchDepth == 0 || metaPattern.lastIndexOf('*') != metaPattern.length - 1) + return metaMatch = true; + }); + + // exact global meta or meta with any content after the last wildcard skips extension + if (!metaMatch && loader.meta) + getMetaMatches(loader.meta, pkgName + '/' + subPath, function(metaPattern, matchMeta, matchDepth) { + if (matchDepth == 0 || metaPattern.lastIndexOf('*') != metaPattern.length - 1) + return metaMatch = true; + }); + + if (metaMatch) + return subPath; + + // work out what the defaultExtension is and add if not there already + // NB reconsider if default should really be ".js"? + var defaultExtension = '.' + (pkg.defaultExtension || 'js'); + if (subPath.substr(subPath.length - defaultExtension.length) != defaultExtension) + return subPath + defaultExtension; + else + return subPath; + } + + function applyPackageConfigSync(loader, pkg, pkgName, subPath, skipExtensions) { + // main + if (!subPath) { + if (pkg.main) + subPath = pkg.main.substr(0, 2) == './' ? pkg.main.substr(2) : pkg.main; + // also no submap if name is package itself (import 'pkg' -> 'path/to/pkg.js') + else + // NB can add a default package main convention here when defaultJSExtensions is deprecated + // if it becomes internal to the package then it would no longer be an exit path + return pkgName + (loader.defaultJSExtensions ? '.js' : ''); + } + + // map config checking without then with extensions + if (pkg.map) { + var mapPath = './' + subPath; + + var mapMatch = getMapMatch(pkg.map, mapPath); + + // we then check map with the default extension adding + if (!mapMatch) { + mapPath = './' + addDefaultExtension(loader, pkg, pkgName, subPath, skipExtensions); + if (mapPath != './' + subPath) + mapMatch = getMapMatch(pkg.map, mapPath); + } + if (mapMatch) { + var mapped = doMapSync(loader, pkg, pkgName, mapMatch, mapPath, skipExtensions); + if (mapped) + return mapped; + } + } + + // normal package resolution + return pkgName + '/' + addDefaultExtension(loader, pkg, pkgName, subPath, skipExtensions); + } + + function validMapping(mapMatch, mapped, pkgName, path) { + // disallow internal to subpath maps + if (mapMatch == '.') + throw new Error('Package ' + pkgName + ' has a map entry for "." which is not permitted.'); + + // allow internal ./x -> ./x/y or ./x/ -> ./x/y recursive maps + // but only if the path is exactly ./x and not ./x/z + if (mapped.substr(0, mapMatch.length) == mapMatch && path.length > mapMatch.length) + return false; + + return true; + } + + function doMapSync(loader, pkg, pkgName, mapMatch, path, skipExtensions) { + if (path[path.length - 1] == '/') + path = path.substr(0, path.length - 1); + var mapped = pkg.map[mapMatch]; + + if (typeof mapped == 'object') + throw new Error('Synchronous conditional normalization not supported sync normalizing ' + mapMatch + ' in ' + pkgName); + + if (!validMapping(mapMatch, mapped, pkgName, path) || typeof mapped != 'string') + return; + + // package map to main / base-level + if (mapped == '.') + mapped = pkgName; + + // internal package map + else if (mapped.substr(0, 2) == './') + return pkgName + '/' + addDefaultExtension(loader, pkg, pkgName, mapped.substr(2) + path.substr(mapMatch.length), skipExtensions); + + // external map reference + return loader.normalizeSync(mapped + path.substr(mapMatch.length), pkgName + '/'); + } + + function applyPackageConfig(loader, pkg, pkgName, subPath, skipExtensions) { + // main + if (!subPath) { + if (pkg.main) + subPath = pkg.main.substr(0, 2) == './' ? pkg.main.substr(2) : pkg.main; + // also no submap if name is package itself (import 'pkg' -> 'path/to/pkg.js') + else + // NB can add a default package main convention here when defaultJSExtensions is deprecated + // if it becomes internal to the package then it would no longer be an exit path + return Promise.resolve(pkgName + (loader.defaultJSExtensions ? '.js' : '')); + } + + // map config checking without then with extensions + var mapPath, mapMatch; + + if (pkg.map) { + mapPath = './' + subPath; + mapMatch = getMapMatch(pkg.map, mapPath); + + // we then check map with the default extension adding + if (!mapMatch) { + mapPath = './' + addDefaultExtension(loader, pkg, pkgName, subPath, skipExtensions); + if (mapPath != './' + subPath) + mapMatch = getMapMatch(pkg.map, mapPath); + } + } + + return (mapMatch ? doMap(loader, pkg, pkgName, mapMatch, mapPath, skipExtensions) : Promise.resolve()) + .then(function(mapped) { + if (mapped) + return Promise.resolve(mapped); + + // normal package resolution / fallback resolution for no conditional match + return Promise.resolve(pkgName + '/' + addDefaultExtension(loader, pkg, pkgName, subPath, skipExtensions)); + }); + } + + function doStringMap(loader, pkg, pkgName, mapMatch, mapped, path, skipExtensions) { + // NB the interpolation cases should strictly skip subsequent interpolation + // package map to main / base-level + if (mapped == '.') + mapped = pkgName; + + // internal package map + else if (mapped.substr(0, 2) == './') + return Promise.resolve(pkgName + '/' + addDefaultExtension(loader, pkg, pkgName, mapped.substr(2) + path.substr(mapMatch.length), skipExtensions)) + .then(function(name) { + return interpolateConditional.call(loader, name, pkgName + '/'); + }); + + // external map reference + return loader.normalize(mapped + path.substr(mapMatch.length), pkgName + '/'); + } + + function doMap(loader, pkg, pkgName, mapMatch, path, skipExtensions) { + if (path[path.length - 1] == '/') + path = path.substr(0, path.length - 1); + + var mapped = pkg.map[mapMatch]; + + if (typeof mapped == 'string') { + if (!validMapping(mapMatch, mapped, pkgName, path)) + return Promise.resolve(); + return doStringMap(loader, pkg, pkgName, mapMatch, mapped, path, skipExtensions); + } + + // we use a special conditional syntax to allow the builder to handle conditional branch points further + if (loader.builder) + return Promise.resolve(pkgName + '/#:' + path); + + // we load all conditions upfront + var conditionPromises = []; + var conditions = []; + for (var e in mapped) { + var c = parseCondition(e); + conditions.push({ + condition: c, + map: mapped[e] + }); + conditionPromises.push(loader['import'](c.module, pkgName)); + } + + // map object -> conditional map + return Promise.all(conditionPromises) + .then(function(conditionValues) { + // first map condition to match is used + for (var i = 0; i < conditions.length; i++) { + var c = conditions[i].condition; + var value = readMemberExpression(c.prop, conditionValues[i]); + if (!c.negate && value || c.negate && !value) + return conditions[i].map; + } + }) + .then(function(mapped) { + if (mapped) { + if (!validMapping(mapMatch, mapped, pkgName, path)) + return; + return doStringMap(loader, pkg, pkgName, mapMatch, mapped, path, skipExtensions); + } + + // no environment match -> fallback to original subPath by returning undefined + }); + } + + // normalizeSync = decanonicalize + package resolution + SystemJSLoader.prototype.normalizeSync = SystemJSLoader.prototype.decanonicalize = SystemJSLoader.prototype.normalize; + + // decanonicalize must JUST handle package defaultExtension: false case when defaultJSExtensions is set + // to be deprecated! + hook('decanonicalize', function(decanonicalize) { + return function(name, parentName) { + if (this.builder) + return decanonicalize.call(this, name, parentName, true); + + var decanonicalized = decanonicalize.call(this, name, parentName, false); + + if (!this.defaultJSExtensions) + return decanonicalized; + + var pkgName = getPackage(this, decanonicalized); + + var pkg = this.packages[pkgName]; + var defaultExtension = pkg && pkg.defaultExtension; + + if (defaultExtension == undefined && pkg && pkg.meta) + getMetaMatches(pkg.meta, decanonicalized.substr(pkgName), function(metaPattern, matchMeta, matchDepth) { + if (matchDepth == 0 || metaPattern.lastIndexOf('*') != metaPattern.length - 1) { + defaultExtension = false; + return true; + } + }); + + if ((defaultExtension === false || defaultExtension && defaultExtension != '.js') && name.substr(name.length - 3, 3) != '.js' && decanonicalized.substr(decanonicalized.length - 3, 3) == '.js') + decanonicalized = decanonicalized.substr(0, decanonicalized.length - 3); + + return decanonicalized; + }; + }); + + hook('normalizeSync', function(normalizeSync) { + return function(name, parentName, isPlugin) { + var loader = this; + isPlugin = isPlugin === true; + + // apply contextual package map first + // (we assume the parent package config has already been loaded) + if (parentName) + var parentPackageName = getPackage(loader, parentName) || + loader.defaultJSExtensions && parentName.substr(parentName.length - 3, 3) == '.js' && + getPackage(loader, parentName.substr(0, parentName.length - 3)); + + var parentPackage = parentPackageName && loader.packages[parentPackageName]; + + // ignore . since internal maps handled by standard package resolution + if (parentPackage && name[0] != '.') { + var parentMap = parentPackage.map; + var parentMapMatch = parentMap && getMapMatch(parentMap, name); + + if (parentMapMatch && typeof parentMap[parentMapMatch] == 'string') { + var mapped = doMapSync(loader, parentPackage, parentPackageName, parentMapMatch, name, isPlugin); + if (mapped) + return mapped; + } + } + + var defaultJSExtension = loader.defaultJSExtensions && name.substr(name.length - 3, 3) != '.js'; + + // apply map, core, paths, contextual package map + var normalized = normalizeSync.call(loader, name, parentName, false); + + // undo defaultJSExtension + if (defaultJSExtension && normalized.substr(normalized.length - 3, 3) != '.js') + defaultJSExtension = false; + if (defaultJSExtension) + normalized = normalized.substr(0, normalized.length - 3); + + var pkgConfigMatch = getPackageConfigMatch(loader, normalized); + var pkgName = pkgConfigMatch && pkgConfigMatch.packageName || getPackage(loader, normalized); + + if (!pkgName) + return normalized + (defaultJSExtension ? '.js' : ''); + + var subPath = normalized.substr(pkgName.length + 1); + + return applyPackageConfigSync(loader, loader.packages[pkgName] || {}, pkgName, subPath, isPlugin); + }; + }); + + hook('normalize', function(normalize) { + return function(name, parentName, isPlugin) { + var loader = this; + isPlugin = isPlugin === true; + + return Promise.resolve() + .then(function() { + // apply contextual package map first + // (we assume the parent package config has already been loaded) + if (parentName) + var parentPackageName = getPackage(loader, parentName) || + loader.defaultJSExtensions && parentName.substr(parentName.length - 3, 3) == '.js' && + getPackage(loader, parentName.substr(0, parentName.length - 3)); + + var parentPackage = parentPackageName && loader.packages[parentPackageName]; + + // ignore . since internal maps handled by standard package resolution + if (parentPackage && name.substr(0, 2) != './') { + var parentMap = parentPackage.map; + var parentMapMatch = parentMap && getMapMatch(parentMap, name); + + if (parentMapMatch) + return doMap(loader, parentPackage, parentPackageName, parentMapMatch, name, isPlugin); + } + + return Promise.resolve(); + }) + .then(function(mapped) { + if (mapped) + return mapped; + + var defaultJSExtension = loader.defaultJSExtensions && name.substr(name.length - 3, 3) != '.js'; + + // apply map, core, paths, contextual package map + var normalized = normalize.call(loader, name, parentName, false); + + // undo defaultJSExtension + if (defaultJSExtension && normalized.substr(normalized.length - 3, 3) != '.js') + defaultJSExtension = false; + if (defaultJSExtension) + normalized = normalized.substr(0, normalized.length - 3); + + var pkgConfigMatch = getPackageConfigMatch(loader, normalized); + var pkgName = pkgConfigMatch && pkgConfigMatch.packageName || getPackage(loader, normalized); + + if (!pkgName) + return Promise.resolve(normalized + (defaultJSExtension ? '.js' : '')); + + var pkg = loader.packages[pkgName]; + + // if package is already configured or not a dynamic config package, use existing package config + var isConfigured = pkg && (pkg.configured || !pkgConfigMatch); + return (isConfigured ? Promise.resolve(pkg) : loadPackageConfigPath(loader, pkgName, pkgConfigMatch.configPath)) + .then(function(pkg) { + var subPath = normalized.substr(pkgName.length + 1); + + return applyPackageConfig(loader, pkg, pkgName, subPath, isPlugin); + }); + }); + }; + }); + + // check if the given normalized name matches a packageConfigPath + // if so, loads the config + var packageConfigPaths = {}; + + // data object for quick checks against package paths + function createPkgConfigPathObj(path) { + var lastWildcard = path.lastIndexOf('*'); + var length = Math.max(lastWildcard + 1, path.lastIndexOf('/')); + return { + length: length, + regEx: new RegExp('^(' + path.substr(0, length).replace(/[.+?^${}()|[\]\\]/g, '\\$&').replace(/\*/g, '[^\\/]+') + ')(\\/|$)'), + wildcard: lastWildcard != -1 + }; + } + + // most specific match wins + function getPackageConfigMatch(loader, normalized) { + var pkgName, exactMatch = false, configPath; + for (var i = 0; i < loader.packageConfigPaths.length; i++) { + var packageConfigPath = loader.packageConfigPaths[i]; + var p = packageConfigPaths[packageConfigPath] || (packageConfigPaths[packageConfigPath] = createPkgConfigPathObj(packageConfigPath)); + if (normalized.length < p.length) + continue; + var match = normalized.match(p.regEx); + if (match && (!pkgName || (!(exactMatch && p.wildcard) && pkgName.length < match[1].length))) { + pkgName = match[1]; + exactMatch = !p.wildcard; + configPath = pkgName + packageConfigPath.substr(p.length); + } + } + + if (!pkgName) + return; + + return { + packageName: pkgName, + configPath: configPath + }; + } + + function loadPackageConfigPath(loader, pkgName, pkgConfigPath) { + var configLoader = loader.pluginLoader || loader; + + // NB remove this when json is default + (configLoader.meta[pkgConfigPath] = configLoader.meta[pkgConfigPath] || {}).format = 'json'; + configLoader.meta[pkgConfigPath].loader = null; + + return configLoader.load(pkgConfigPath) + .then(function() { + var cfg = configLoader.get(pkgConfigPath)['default']; + + // support "systemjs" prefixing + if (cfg.systemjs) + cfg = cfg.systemjs; + + // modules backwards compatibility + if (cfg.modules) { + cfg.meta = cfg.modules; + warn.call(loader, 'Package config file ' + pkgConfigPath + ' is configured with "modules", which is deprecated as it has been renamed to "meta".'); + } + + return setPkgConfig(loader, pkgName, cfg, true); + }); + } + + function getMetaMatches(pkgMeta, subPath, matchFn) { + // wildcard meta + var meta = {}; + var wildcardIndex; + for (var module in pkgMeta) { + // allow meta to start with ./ for flexibility + var dotRel = module.substr(0, 2) == './' ? './' : ''; + if (dotRel) + module = module.substr(2); + + wildcardIndex = module.indexOf('*'); + if (wildcardIndex === -1) + continue; + + if (module.substr(0, wildcardIndex) == subPath.substr(0, wildcardIndex) + && module.substr(wildcardIndex + 1) == subPath.substr(subPath.length - module.length + wildcardIndex + 1)) { + // alow match function to return true for an exit path + if (matchFn(module, pkgMeta[dotRel + module], module.split('/').length)) + return; + } + } + // exact meta + var exactMeta = pkgMeta[subPath] && pkgMeta.hasOwnProperty && pkgMeta.hasOwnProperty(subPath) ? pkgMeta[subPath] : pkgMeta['./' + subPath]; + if (exactMeta) + matchFn(exactMeta, exactMeta, 0); + } + + hook('locate', function(locate) { + return function(load) { + var loader = this; + return Promise.resolve(locate.call(this, load)) + .then(function(address) { + var pkgName = getPackage(loader, load.name); + if (pkgName) { + var pkg = loader.packages[pkgName]; + var subPath = load.name.substr(pkgName.length + 1); + + var meta = {}; + if (pkg.meta) { + var bestDepth = 0; + + // NB support a main shorthand in meta here? + getMetaMatches(pkg.meta, subPath, function(metaPattern, matchMeta, matchDepth) { + if (matchDepth > bestDepth) + bestDepth = matchDepth; + extendMeta(meta, matchMeta, matchDepth && bestDepth > matchDepth); + }); + + extendMeta(load.metadata, meta); + } + + // format + if (pkg.format && !load.metadata.loader) + load.metadata.format = load.metadata.format || pkg.format; + } + + return address; + }); + }; + }); + +})(); +/* + * Script tag fetch + * + * When load.metadata.scriptLoad is true, we load via script tag injection. + */ +(function() { + + if (typeof document != 'undefined') + var head = document.getElementsByTagName('head')[0]; + + var curSystem; + var curRequire; + + // if doing worker executing, this is set to the load record being executed + var workerLoad = null; + + // interactive mode handling method courtesy RequireJS + var ieEvents = head && (function() { + var s = document.createElement('script'); + var isOpera = typeof opera !== 'undefined' && opera.toString() === '[object Opera]'; + return s.attachEvent && !(s.attachEvent.toString && s.attachEvent.toString().indexOf('[native code') < 0) && !isOpera; + })(); + + // IE interactive-only part + // we store loading scripts array as { script: