Server render the main page
Also, add hashes to asset file names and use the "entry manifest" plugin in dev to get auto-reloading.
This commit is contained in:
116
public/systemjs@2.0.0/dist/extras/amd.js
vendored
Normal file
116
public/systemjs@2.0.0/dist/extras/amd.js
vendored
Normal file
@ -0,0 +1,116 @@
|
||||
/*
|
||||
* Support for AMD loading
|
||||
*/
|
||||
(function (global) {
|
||||
const systemPrototype = System.constructor.prototype;
|
||||
|
||||
const emptyInstantiation = [[], function () { return {} }];
|
||||
|
||||
function unsupportedRequire () {
|
||||
throw new Error('AMD require not supported.');
|
||||
}
|
||||
|
||||
function unsupportedNamed () {
|
||||
throw new Error('Named AMD not supported.');
|
||||
}
|
||||
|
||||
const requireExportsModule = ['require', 'exports', 'module'];
|
||||
|
||||
// hook System.register to know the last declaration binding
|
||||
let lastRegisterDeclare;
|
||||
const systemRegister = systemPrototype.register;
|
||||
systemPrototype.register = function (deps, declare) {
|
||||
lastRegisterDeclare = declare;
|
||||
systemRegister.call(this, deps, declare);
|
||||
};
|
||||
|
||||
const getRegister = systemPrototype.getRegister;
|
||||
systemPrototype.getRegister = function () {
|
||||
const register = getRegister.call(this);
|
||||
// if its an actual System.register leave it
|
||||
if (register && register[1] === lastRegisterDeclare)
|
||||
return register;
|
||||
|
||||
// otherwise AMD takes priority
|
||||
// no registration -> attempt AMD detection
|
||||
if (!amdDefineDeps)
|
||||
return register || emptyInstantiation;
|
||||
|
||||
const exports = {};
|
||||
const module = { exports: exports };
|
||||
const depModules = [];
|
||||
const setters = [];
|
||||
let splice = 0;
|
||||
for (let i = 0; i < amdDefineDeps.length; i++) {
|
||||
const id = amdDefineDeps[i];
|
||||
const index = setters.length;
|
||||
if (id === 'require') {
|
||||
depModules[i] = unsupportedRequire;
|
||||
splice++;
|
||||
}
|
||||
else if (id === 'module') {
|
||||
depModules[i] = module;
|
||||
splice++;
|
||||
}
|
||||
else if (id === 'exports') {
|
||||
depModules[i] = exports;
|
||||
splice++;
|
||||
}
|
||||
else {
|
||||
// needed for ie11 lack of iteration scope
|
||||
const idx = i;
|
||||
setters.push(function (ns) {
|
||||
depModules[idx] = ns.default;
|
||||
});
|
||||
}
|
||||
if (splice)
|
||||
amdDefineDeps[index] = id;
|
||||
}
|
||||
if (splice)
|
||||
amdDefineDeps.length -= splice;
|
||||
const amdExec = amdDefineExec;
|
||||
const registration = [amdDefineDeps, function (_export) {
|
||||
_export('default', exports);
|
||||
return {
|
||||
setters: setters,
|
||||
execute: function () {
|
||||
_export('default', amdExec.apply(exports, depModules) || module.exports);
|
||||
}
|
||||
};
|
||||
}];
|
||||
amdDefineDeps = null;
|
||||
return registration;
|
||||
};
|
||||
let amdDefineDeps;
|
||||
let amdDefineExec;
|
||||
global.define = function (name, deps, execute) {
|
||||
// define('', [], function () {})
|
||||
if (typeof name === 'string') {
|
||||
if (amdDefineDeps) {
|
||||
amdDefineDeps = [];
|
||||
amdDefineExec = unsupportedNamed;
|
||||
return;
|
||||
}
|
||||
else {
|
||||
name = deps;
|
||||
deps = execute;
|
||||
}
|
||||
}
|
||||
// define([], function () {})
|
||||
if (name instanceof Array) {
|
||||
amdDefineDeps = name;
|
||||
amdDefineExec = deps;
|
||||
}
|
||||
// define({})
|
||||
else if (typeof name === 'object') {
|
||||
amdDefineDeps = [];
|
||||
amdDefineExec = function () { return name };
|
||||
}
|
||||
// define(function () {})
|
||||
else if (typeof name === 'function') {
|
||||
amdDefineDeps = requireExportsModule;
|
||||
amdDefineExec = name;
|
||||
}
|
||||
};
|
||||
global.define.amd = {};
|
||||
})(typeof self !== 'undefined' ? self : global);
|
1
public/systemjs@2.0.0/dist/extras/amd.min.js
vendored
Normal file
1
public/systemjs@2.0.0/dist/extras/amd.min.js
vendored
Normal file
@ -0,0 +1 @@
|
||||
!function(e){const t=System.constructor.prototype,n=[[],function(){return{}}];function o(){throw new Error("AMD require not supported.")}function r(){throw new Error("Named AMD not supported.")}const i=["require","exports","module"];let u;const f=t.register;t.register=function(e,t){u=t,f.call(this,e,t)};const s=t.getRegister;let c,l;t.getRegister=function(){const e=s.call(this);if(e&&e[1]===u)return e;if(!c)return e||n;const t={},r={exports:t},i=[],f=[];let p=0;for(let e=0;e<c.length;e++){const n=c[e],u=f.length;if("require"===n)i[e]=o,p++;else if("module"===n)i[e]=r,p++;else if("exports"===n)i[e]=t,p++;else{const t=e;f.push(function(e){i[t]=e.default})}p&&(c[u]=n)}p&&(c.length-=p);const d=l,a=[c,function(e){return e("default",t),{setters:f,execute:function(){e("default",d.apply(t,i)||r.exports)}}}];return c=null,a},e.define=function(e,t,n){if("string"==typeof e){if(c)return c=[],void(l=r);e=t,t=n}e instanceof Array?(c=e,l=t):"object"==typeof e?(c=[],l=function(){return e}):"function"==typeof e&&(c=i,l=e)},e.define.amd={}}("undefined"!=typeof self?self:global);
|
1
public/systemjs@2.0.0/dist/extras/amd.min.js.map
vendored
Normal file
1
public/systemjs@2.0.0/dist/extras/amd.min.js.map
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"sources":["amd.js"],"names":["global","systemPrototype","System","constructor","prototype","emptyInstantiation","unsupportedRequire","Error","unsupportedNamed","requireExportsModule","lastRegisterDeclare","systemRegister","register","deps","declare","call","this","getRegister","amdDefineDeps","amdDefineExec","exports","module","depModules","setters","splice","i","length","id","index","idx","push","ns","default","amdExec","registration","_export","execute","apply","define","name","Array","amd","self"],"mappings":"CAGA,SAAWA,GACT,MAAMC,EAAkBC,OAAOC,YAAYC,UAErCC,EAAqB,CAAC,GAAI,WAAc,MAAO,KAErD,SAASC,IACP,MAAM,IAAIC,MAAM,8BAGlB,SAASC,IACP,MAAM,IAAID,MAAM,4BAGlB,MAAME,EAAuB,CAAC,UAAW,UAAW,UAGpD,IAAIC,EACJ,MAAMC,EAAiBV,EAAgBW,SACvCX,EAAgBW,SAAW,SAAUC,EAAMC,GACzCJ,EAAsBI,EACtBH,EAAeI,KAAKC,KAAMH,EAAMC,IAGlC,MAAMG,EAAchB,EAAgBgB,YAyDpC,IAAIC,EACAC,EAzDJlB,EAAgBgB,YAAc,WAC5B,MAAML,EAAWK,EAAYF,KAAKC,MAElC,GAAIJ,GAAYA,EAAS,KAAOF,EAC9B,OAAOE,EAIT,IAAKM,EACH,OAAON,GAAYP,EAErB,MAAMe,EAAU,GACVC,EAAS,CAAED,QAASA,GACpBE,EAAa,GACbC,EAAU,GAChB,IAAIC,EAAS,EACb,IAAK,IAAIC,EAAI,EAAGA,EAAIP,EAAcQ,OAAQD,IAAK,CAC7C,MAAME,EAAKT,EAAcO,GACnBG,EAAQL,EAAQG,OACtB,GAAW,YAAPC,EACFL,EAAWG,GAAKnB,EAChBkB,SAEG,GAAW,WAAPG,EACPL,EAAWG,GAAKJ,EAChBG,SAEG,GAAW,YAAPG,EACPL,EAAWG,GAAKL,EAChBI,QAEG,CAEH,MAAMK,EAAMJ,EACZF,EAAQO,KAAK,SAAUC,GACrBT,EAAWO,GAAOE,EAAGC,UAGrBR,IACFN,EAAcU,GAASD,GAEvBH,IACFN,EAAcQ,QAAUF,GAC1B,MAAMS,EAAUd,EACVe,EAAe,CAAChB,EAAe,SAAUiB,GAE7C,OADAA,EAAQ,UAAWf,GACZ,CACLG,QAASA,EACTa,QAAS,WACPD,EAAQ,UAAWF,EAAQI,MAAMjB,EAASE,IAAeD,EAAOD,aAKtE,OADAF,EAAgB,KACTgB,GAITlC,EAAOsC,OAAS,SAAUC,EAAM1B,EAAMuB,GAEpC,GAAoB,iBAATG,EAAmB,CAC5B,GAAIrB,EAGF,OAFAA,EAAgB,QAChBC,EAAgBX,GAIhB+B,EAAO1B,EACPA,EAAOuB,EAIPG,aAAgBC,OAClBtB,EAAgBqB,EAChBpB,EAAgBN,GAGO,iBAAT0B,GACdrB,EAAgB,GAChBC,EAAgB,WAAc,OAAOoB,IAGd,mBAATA,IACdrB,EAAgBT,EAChBU,EAAgBoB,IAGpBvC,EAAOsC,OAAOG,IAAM,GA/GtB,CAgHmB,oBAATC,KAAuBA,KAAO1C"}
|
57
public/systemjs@2.0.0/dist/extras/global.js
vendored
Normal file
57
public/systemjs@2.0.0/dist/extras/global.js
vendored
Normal file
@ -0,0 +1,57 @@
|
||||
/*
|
||||
* SystemJS global script loading support
|
||||
* Extra for the s.js build only
|
||||
* (Included by default in system.js build)
|
||||
*/
|
||||
(function (global) {
|
||||
|
||||
const systemJSPrototype = System.constructor.prototype;
|
||||
|
||||
function getLastGlobalProp () {
|
||||
// alternatively Object.keys(global).pop()
|
||||
// but this may be faster (pending benchmarks)
|
||||
let lastProp;
|
||||
for (let p in global)
|
||||
if (global.hasOwnProperty(p))
|
||||
lastProp = p;
|
||||
return lastProp;
|
||||
}
|
||||
|
||||
let lastGlobalProp;
|
||||
const impt = systemJSPrototype.import;
|
||||
systemJSPrototype.import = function (id, parentUrl) {
|
||||
lastGlobalProp = getLastGlobalProp();
|
||||
return impt.call(this, id, parentUrl);
|
||||
};
|
||||
|
||||
const emptyInstantiation = [[], function () { return {} }];
|
||||
|
||||
const getRegister = systemJSPrototype.getRegister;
|
||||
systemJSPrototype.getRegister = function () {
|
||||
const lastRegister = getRegister.call(this);
|
||||
if (lastRegister)
|
||||
return lastRegister;
|
||||
|
||||
// no registration -> attempt a global detection as difference from snapshot
|
||||
// when multiple globals, we take the global value to be the last defined new global object property
|
||||
// for performance, this will not support multi-version / global collisions as previous SystemJS versions did
|
||||
// note in Edge, deleting and re-adding a global does not change its ordering
|
||||
const globalProp = getLastGlobalProp();
|
||||
if (lastGlobalProp === globalProp)
|
||||
return emptyInstantiation;
|
||||
|
||||
lastGlobalProp = globalProp;
|
||||
let globalExport;
|
||||
try {
|
||||
globalExport = global[globalProp];
|
||||
}
|
||||
catch (e) {
|
||||
return emptyInstantiation;
|
||||
}
|
||||
|
||||
return [[], function (_export) {
|
||||
return { execute: function () { _export('default', globalExport) } };
|
||||
}];
|
||||
};
|
||||
|
||||
})(typeof self !== 'undefined' ? self : global);
|
1
public/systemjs@2.0.0/dist/extras/global.min.js
vendored
Normal file
1
public/systemjs@2.0.0/dist/extras/global.min.js
vendored
Normal file
@ -0,0 +1 @@
|
||||
!function(t){const n=System.constructor.prototype;function e(){let n;for(let e in t)t.hasOwnProperty(e)&&(n=e);return n}let r;const o=n.import;n.import=function(t,n){return r=e(),o.call(this,t,n)};const c=[[],function(){return{}}],u=n.getRegister;n.getRegister=function(){const n=u.call(this);if(n)return n;const o=e();if(r===o)return c;let i;r=o;try{i=t[o]}catch(t){return c}return[[],function(t){return{execute:function(){t("default",i)}}}]}}("undefined"!=typeof self?self:global);
|
1
public/systemjs@2.0.0/dist/extras/global.min.js.map
vendored
Normal file
1
public/systemjs@2.0.0/dist/extras/global.min.js.map
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"sources":["global.js"],"names":["global","systemJSPrototype","System","constructor","prototype","getLastGlobalProp","lastProp","p","hasOwnProperty","lastGlobalProp","impt","import","id","parentUrl","call","this","emptyInstantiation","getRegister","lastRegister","globalProp","globalExport","e","_export","execute","self"],"mappings":"CAKA,SAAWA,GAEX,MAAMC,EAAoBC,OAAOC,YAAYC,UAE7C,SAASC,IAGP,IAAIC,EACJ,IAAK,IAAIC,KAAKP,EACRA,EAAOQ,eAAeD,KACxBD,EAAWC,GACf,OAAOD,EAGT,IAAIG,EACJ,MAAMC,EAAOT,EAAkBU,OAC/BV,EAAkBU,OAAS,SAAUC,EAAIC,GAEvC,OADAJ,EAAiBJ,IACVK,EAAKI,KAAKC,KAAMH,EAAIC,IAG7B,MAAMG,EAAqB,CAAC,GAAI,WAAc,MAAO,KAE/CC,EAAchB,EAAkBgB,YACtChB,EAAkBgB,YAAc,WAC9B,MAAMC,EAAeD,EAAYH,KAAKC,MACtC,GAAIG,EACF,OAAOA,EAMT,MAAMC,EAAad,IACnB,GAAII,IAAmBU,EACrB,OAAOH,EAGT,IAAII,EADJX,EAAiBU,EAEjB,IACEC,EAAepB,EAAOmB,GAExB,MAAOE,GACL,OAAOL,EAGT,MAAO,CAAC,GAAI,SAAUM,GACpB,MAAO,CAAEC,QAAS,WAAcD,EAAQ,UAAWF,QA/CvD,CAmDmB,oBAATI,KAAuBA,KAAOxB"}
|
48
public/systemjs@2.0.0/dist/extras/named-exports.js
vendored
Normal file
48
public/systemjs@2.0.0/dist/extras/named-exports.js
vendored
Normal file
@ -0,0 +1,48 @@
|
||||
/*
|
||||
* Named exports support for legacy module formats in SystemJS 2.0
|
||||
*/
|
||||
(function () {
|
||||
const systemPrototype = System.constructor.prototype;
|
||||
|
||||
// hook System.register to know the last declaration binding
|
||||
let lastRegisterDeclare;
|
||||
const systemRegister = systemPrototype.register;
|
||||
systemPrototype.register = function (deps, declare) {
|
||||
lastRegisterDeclare = declare;
|
||||
systemRegister.call(this, deps, declare);
|
||||
};
|
||||
|
||||
const getRegister = systemPrototype.getRegister;
|
||||
systemPrototype.getRegister = function () {
|
||||
const register = getRegister.call(this);
|
||||
// if it is an actual System.register call, then its ESM
|
||||
// -> dont add named exports
|
||||
if (!register || register[1] === lastRegisterDeclare || register[1].length === 0)
|
||||
return register;
|
||||
|
||||
// otherwise it was provided by a custom instantiator
|
||||
// -> extend the registration with named exports support
|
||||
const registerDeclare = register[1];
|
||||
register[1] = function (_export, _context) {
|
||||
// hook the _export function to note the default export
|
||||
let defaultExport;
|
||||
const declaration = registerDeclare.call(this, function (name, value) {
|
||||
if (name === 'default')
|
||||
defaultExport = value;
|
||||
_export(name, value);
|
||||
}, _context);
|
||||
// hook the execute function
|
||||
const execute = declaration.execute;
|
||||
if (execute)
|
||||
declaration.execute = function () {
|
||||
execute.call(this);
|
||||
// do a bulk export of the default export object
|
||||
// to export all its names as named exports
|
||||
if (typeof defaultExport === 'object')
|
||||
_export(defaultExport);
|
||||
};
|
||||
return declaration;
|
||||
};
|
||||
return register;
|
||||
};
|
||||
})();
|
1
public/systemjs@2.0.0/dist/extras/named-exports.min.js
vendored
Normal file
1
public/systemjs@2.0.0/dist/extras/named-exports.min.js
vendored
Normal file
@ -0,0 +1 @@
|
||||
!function(){const t=System.constructor.prototype;let e;const n=t.register;t.register=function(t,c){e=c,n.call(this,t,c)};const c=t.getRegister;t.getRegister=function(){const t=c.call(this);if(!t||t[1]===e||0===t[1].length)return t;const n=t[1];return t[1]=function(t,e){let c;const o=n.call(this,function(e,n){"default"===e&&(c=n),t(e,n)},e),s=o.execute;return s&&(o.execute=function(){s.call(this),"object"==typeof c&&t(c)}),o},t}}();
|
1
public/systemjs@2.0.0/dist/extras/named-exports.min.js.map
vendored
Normal file
1
public/systemjs@2.0.0/dist/extras/named-exports.min.js.map
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"sources":["named-exports.js"],"names":["systemPrototype","System","constructor","prototype","lastRegisterDeclare","systemRegister","register","deps","declare","call","this","getRegister","length","registerDeclare","_export","_context","defaultExport","declaration","name","value","execute"],"mappings":"CAGA,WACE,MAAMA,EAAkBC,OAAOC,YAAYC,UAG3C,IAAIC,EACJ,MAAMC,EAAiBL,EAAgBM,SACvCN,EAAgBM,SAAW,SAAUC,EAAMC,GACzCJ,EAAsBI,EACtBH,EAAeI,KAAKC,KAAMH,EAAMC,IAGlC,MAAMG,EAAcX,EAAgBW,YACpCX,EAAgBW,YAAc,WAC5B,MAAML,EAAWK,EAAYF,KAAKC,MAGlC,IAAKJ,GAAYA,EAAS,KAAOF,GAA8C,IAAvBE,EAAS,GAAGM,OAClE,OAAON,EAIT,MAAMO,EAAkBP,EAAS,GAqBjC,OApBAA,EAAS,GAAK,SAAUQ,EAASC,GAE/B,IAAIC,EACJ,MAAMC,EAAcJ,EAAgBJ,KAAKC,KAAM,SAAUQ,EAAMC,GAChD,YAATD,IACFF,EAAgBG,GAClBL,EAAQI,EAAMC,IACbJ,GAEGK,EAAUH,EAAYG,QAS5B,OARIA,IACFH,EAAYG,QAAU,WACpBA,EAAQX,KAAKC,MAGgB,iBAAlBM,GACTF,EAAQE,KAEPC,GAEFX,GA1CX"}
|
32
public/systemjs@2.0.0/dist/extras/transform.js
vendored
Normal file
32
public/systemjs@2.0.0/dist/extras/transform.js
vendored
Normal file
@ -0,0 +1,32 @@
|
||||
/*
|
||||
* Support for a "transform" loader interface
|
||||
*/
|
||||
(function () {
|
||||
const systemJSPrototype = System.constructor.prototype;
|
||||
|
||||
const instantiate = systemJSPrototype.instantiate;
|
||||
systemJSPrototype.instantiate = function (url, parent) {
|
||||
if (url.slice(-5) === '.wasm')
|
||||
return instantiate.call(this, url, parent);
|
||||
|
||||
const loader = this;
|
||||
return fetch(url)
|
||||
.then(function (res) {
|
||||
if (!res.ok)
|
||||
throw new Error('Fetch error: ' + res.status + ' ' + res.statusText + (parent ? ' loading from ' + parent : ''));
|
||||
return res.text();
|
||||
})
|
||||
.then(function (source) {
|
||||
return loader.transform.call(this, url, source);
|
||||
})
|
||||
.then(function (source) {
|
||||
(0, eval)(source + '\n//# sourceURL=' + url);
|
||||
return loader.getRegister();
|
||||
});
|
||||
};
|
||||
|
||||
// Hookable transform function!
|
||||
systemJSPrototype.transform = function (_id, source) {
|
||||
return source;
|
||||
};
|
||||
})();
|
1
public/systemjs@2.0.0/dist/extras/transform.min.js
vendored
Normal file
1
public/systemjs@2.0.0/dist/extras/transform.min.js
vendored
Normal file
@ -0,0 +1 @@
|
||||
!function(){const t=System.constructor.prototype,n=t.instantiate;t.instantiate=function(t,r){if(".wasm"===t.slice(-5))return n.call(this,t,r);const e=this;return fetch(t).then(function(t){if(!t.ok)throw new Error("Fetch error: "+t.status+" "+t.statusText+(r?" loading from "+r:""));return t.text()}).then(function(n){return e.transform.call(this,t,n)}).then(function(n){return(0,eval)(n+"\n//# sourceURL="+t),e.getRegister()})},t.transform=function(t,n){return n}}();
|
1
public/systemjs@2.0.0/dist/extras/transform.min.js.map
vendored
Normal file
1
public/systemjs@2.0.0/dist/extras/transform.min.js.map
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"sources":["transform.js"],"names":["systemJSPrototype","System","constructor","prototype","instantiate","url","parent","slice","call","this","loader","fetch","then","res","ok","Error","status","statusText","text","source","transform","eval","getRegister","_id"],"mappings":"CAGA,WACE,MAAMA,EAAoBC,OAAOC,YAAYC,UAEvCC,EAAcJ,EAAkBI,YACtCJ,EAAkBI,YAAc,SAAUC,EAAKC,GAC7C,GAAsB,UAAlBD,EAAIE,OAAO,GACb,OAAOH,EAAYI,KAAKC,KAAMJ,EAAKC,GAErC,MAAMI,EAASD,KACf,OAAOE,MAAMN,GACZO,KAAK,SAAUC,GACd,IAAKA,EAAIC,GACP,MAAM,IAAIC,MAAM,gBAAkBF,EAAIG,OAAS,IAAMH,EAAII,YAAcX,EAAS,kBAAoBA,EAAS,KAC/G,OAAOO,EAAIK,SAEZN,KAAK,SAAUO,GACd,OAAOT,EAAOU,UAAUZ,KAAKC,KAAMJ,EAAKc,KAEzCP,KAAK,SAAUO,GAEd,OADA,EAAIE,MAAMF,EAAS,mBAAqBd,GACjCK,EAAOY,iBAKlBtB,EAAkBoB,UAAY,SAAUG,EAAKJ,GAC3C,OAAOA,GA1BX"}
|
403
public/systemjs@2.0.0/dist/s.js
vendored
Normal file
403
public/systemjs@2.0.0/dist/s.js
vendored
Normal file
@ -0,0 +1,403 @@
|
||||
/*
|
||||
* SJS 2.0.0
|
||||
* Minimal SystemJS Build
|
||||
*/
|
||||
(function () {
|
||||
const hasSelf = typeof self !== 'undefined';
|
||||
|
||||
const envGlobal = hasSelf ? self : global;
|
||||
|
||||
let baseUrl;
|
||||
if (typeof location !== 'undefined') {
|
||||
baseUrl = location.href.split('#')[0].split('?')[0];
|
||||
const lastSepIndex = baseUrl.lastIndexOf('/');
|
||||
if (lastSepIndex !== -1)
|
||||
baseUrl = baseUrl.slice(0, lastSepIndex + 1);
|
||||
}
|
||||
|
||||
const backslashRegEx = /\\/g;
|
||||
function resolveIfNotPlainOrUrl (relUrl, parentUrl) {
|
||||
if (relUrl.indexOf('\\') !== -1)
|
||||
relUrl = relUrl.replace(backslashRegEx, '/');
|
||||
// protocol-relative
|
||||
if (relUrl[0] === '/' && relUrl[1] === '/') {
|
||||
return parentUrl.slice(0, parentUrl.indexOf(':') + 1) + relUrl;
|
||||
}
|
||||
// relative-url
|
||||
else if (relUrl[0] === '.' && (relUrl[1] === '/' || relUrl[1] === '.' && (relUrl[2] === '/' || relUrl.length === 2 && (relUrl += '/')) ||
|
||||
relUrl.length === 1 && (relUrl += '/')) ||
|
||||
relUrl[0] === '/') {
|
||||
const parentProtocol = parentUrl.slice(0, parentUrl.indexOf(':') + 1);
|
||||
// Disabled, but these cases will give inconsistent results for deep backtracking
|
||||
//if (parentUrl[parentProtocol.length] !== '/')
|
||||
// throw new Error('Cannot resolve');
|
||||
// read pathname from parent URL
|
||||
// pathname taken to be part after leading "/"
|
||||
let pathname;
|
||||
if (parentUrl[parentProtocol.length + 1] === '/') {
|
||||
// resolving to a :// so we need to read out the auth and host
|
||||
if (parentProtocol !== 'file:') {
|
||||
pathname = parentUrl.slice(parentProtocol.length + 2);
|
||||
pathname = pathname.slice(pathname.indexOf('/') + 1);
|
||||
}
|
||||
else {
|
||||
pathname = parentUrl.slice(8);
|
||||
}
|
||||
}
|
||||
else {
|
||||
// resolving to :/ so pathname is the /... part
|
||||
pathname = parentUrl.slice(parentProtocol.length + 1);
|
||||
}
|
||||
|
||||
if (relUrl[0] === '/')
|
||||
return parentUrl.slice(0, parentUrl.length - pathname.length - 1) + relUrl;
|
||||
|
||||
// join together and split for removal of .. and . segments
|
||||
// looping the string instead of anything fancy for perf reasons
|
||||
// '../../../../../z' resolved to 'x/y' is just 'z'
|
||||
const segmented = pathname.slice(0, pathname.lastIndexOf('/') + 1) + relUrl;
|
||||
|
||||
const output = [];
|
||||
let segmentIndex = -1;
|
||||
for (let i = 0; i < segmented.length; i++) {
|
||||
// busy reading a segment - only terminate on '/'
|
||||
if (segmentIndex !== -1) {
|
||||
if (segmented[i] === '/') {
|
||||
output.push(segmented.slice(segmentIndex, i + 1));
|
||||
segmentIndex = -1;
|
||||
}
|
||||
}
|
||||
|
||||
// new segment - check if it is relative
|
||||
else if (segmented[i] === '.') {
|
||||
// ../ segment
|
||||
if (segmented[i + 1] === '.' && (segmented[i + 2] === '/' || i + 2 === segmented.length)) {
|
||||
output.pop();
|
||||
i += 2;
|
||||
}
|
||||
// ./ segment
|
||||
else if (segmented[i + 1] === '/' || i + 1 === segmented.length) {
|
||||
i += 1;
|
||||
}
|
||||
else {
|
||||
// the start of a new segment as below
|
||||
segmentIndex = i;
|
||||
}
|
||||
}
|
||||
// it is the start of a new segment
|
||||
else {
|
||||
segmentIndex = i;
|
||||
}
|
||||
}
|
||||
// finish reading out the last segment
|
||||
if (segmentIndex !== -1)
|
||||
output.push(segmented.slice(segmentIndex));
|
||||
return parentUrl.slice(0, parentUrl.length - pathname.length) + output.join('');
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* SystemJS Core
|
||||
*
|
||||
* Provides
|
||||
* - System.import
|
||||
* - System.register support for
|
||||
* live bindings, function hoisting through circular references,
|
||||
* reexports, dynamic import, import.meta.url, top-level await
|
||||
* - System.getRegister to get the registration
|
||||
* - Symbol.toStringTag support in Module objects
|
||||
* - Hookable System.createContext to customize import.meta
|
||||
* - System.onload(id, err?) handler for tracing / hot-reloading
|
||||
*
|
||||
* Core comes with no System.prototype.resolve or
|
||||
* System.prototype.instantiate implementations
|
||||
*/
|
||||
|
||||
const hasSymbol = typeof Symbol !== 'undefined';
|
||||
const toStringTag = hasSymbol && Symbol.toStringTag;
|
||||
const REGISTRY = hasSymbol ? Symbol() : '@';
|
||||
|
||||
function SystemJS () {
|
||||
this[REGISTRY] = {};
|
||||
}
|
||||
|
||||
const systemJSPrototype = SystemJS.prototype;
|
||||
systemJSPrototype.import = function (id, parentUrl) {
|
||||
const loader = this;
|
||||
return Promise.resolve(loader.resolve(id, parentUrl))
|
||||
.then(function (id) {
|
||||
const load = getOrCreateLoad(loader, id);
|
||||
return load.C || topLevelLoad(loader, load);
|
||||
});
|
||||
};
|
||||
|
||||
// Hookable createContext function -> allowing eg custom import meta
|
||||
systemJSPrototype.createContext = function (parentId) {
|
||||
return {
|
||||
url: parentId
|
||||
};
|
||||
};
|
||||
|
||||
let lastRegister;
|
||||
systemJSPrototype.register = function (deps, declare) {
|
||||
lastRegister = [deps, declare];
|
||||
};
|
||||
|
||||
/*
|
||||
* getRegister provides the last anonymous System.register call
|
||||
*/
|
||||
systemJSPrototype.getRegister = function () {
|
||||
const _lastRegister = lastRegister;
|
||||
lastRegister = undefined;
|
||||
return _lastRegister;
|
||||
};
|
||||
|
||||
function getOrCreateLoad (loader, id, firstParentUrl) {
|
||||
let load = loader[REGISTRY][id];
|
||||
if (load)
|
||||
return load;
|
||||
|
||||
const importerSetters = [];
|
||||
const ns = Object.create(null);
|
||||
if (toStringTag)
|
||||
Object.defineProperty(ns, toStringTag, { value: 'Module' });
|
||||
|
||||
let instantiatePromise = Promise.resolve()
|
||||
.then(function () {
|
||||
return loader.instantiate(id, firstParentUrl);
|
||||
})
|
||||
.then(function (registration) {
|
||||
if (!registration)
|
||||
throw new Error('Module ' + id + ' did not instantiate');
|
||||
function _export (name, value) {
|
||||
// note if we have hoisted exports (including reexports)
|
||||
load.h = true;
|
||||
let changed = false;
|
||||
if (typeof name !== 'object') {
|
||||
if (!(name in ns) || ns[name] !== value) {
|
||||
ns[name] = value;
|
||||
changed = true;
|
||||
}
|
||||
}
|
||||
else {
|
||||
for (let p in name) {
|
||||
let value = name[p];
|
||||
if (!(p in ns) || ns[p] !== value) {
|
||||
ns[p] = value;
|
||||
changed = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (changed)
|
||||
for (let i = 0; i < importerSetters.length; i++)
|
||||
importerSetters[i](ns);
|
||||
return value;
|
||||
}
|
||||
const declared = registration[1](_export, registration[1].length === 2 ? {
|
||||
import: function (importId) {
|
||||
return loader.import(importId, id);
|
||||
},
|
||||
meta: loader.createContext(id)
|
||||
} : undefined);
|
||||
load.e = declared.execute || function () {};
|
||||
return [registration[0], declared.setters || []];
|
||||
});
|
||||
|
||||
const linkPromise = instantiatePromise
|
||||
.then(function (instantiation) {
|
||||
return Promise.all(instantiation[0].map(function (dep, i) {
|
||||
const setter = instantiation[1][i];
|
||||
return Promise.resolve(loader.resolve(dep, id))
|
||||
.then(function (depId) {
|
||||
const depLoad = getOrCreateLoad(loader, depId, id);
|
||||
// depLoad.I may be undefined for already-evaluated
|
||||
return Promise.resolve(depLoad.I)
|
||||
.then(function () {
|
||||
if (setter) {
|
||||
depLoad.i.push(setter);
|
||||
// only run early setters when there are hoisted exports of that module
|
||||
// the timing works here as pending hoisted export calls will trigger through importerSetters
|
||||
if (depLoad.h || !depLoad.I)
|
||||
setter(depLoad.n);
|
||||
}
|
||||
return depLoad;
|
||||
});
|
||||
})
|
||||
}))
|
||||
.then(function (depLoads) {
|
||||
load.d = depLoads;
|
||||
});
|
||||
});
|
||||
|
||||
// disable unhandled rejections
|
||||
linkPromise.catch(function () {});
|
||||
|
||||
// Captial letter = a promise function
|
||||
return load = loader[REGISTRY][id] = {
|
||||
id: id,
|
||||
// importerSetters, the setters functions registered to this dependency
|
||||
// we retain this to add more later
|
||||
i: importerSetters,
|
||||
// module namespace object
|
||||
n: ns,
|
||||
|
||||
// instantiate
|
||||
I: instantiatePromise,
|
||||
// link
|
||||
L: linkPromise,
|
||||
// whether it has hoisted exports
|
||||
h: false,
|
||||
|
||||
// On instantiate completion we have populated:
|
||||
// dependency load records
|
||||
d: undefined,
|
||||
// execution function
|
||||
// set to NULL immediately after execution (or on any failure) to indicate execution has happened
|
||||
// in such a case, pC should be used, and pLo, pLi will be emptied
|
||||
e: undefined,
|
||||
|
||||
// On execution we have populated:
|
||||
// the execution error if any
|
||||
eE: undefined,
|
||||
// in the case of TLA, the execution promise
|
||||
E: undefined,
|
||||
|
||||
// On execution, pLi, pLo, e cleared
|
||||
|
||||
// Promise for top-level completion
|
||||
C: undefined
|
||||
};
|
||||
}
|
||||
|
||||
function instantiateAll (loader, load, loaded) {
|
||||
if (!loaded[load.id]) {
|
||||
loaded[load.id] = true;
|
||||
// load.L may be undefined for already-instantiated
|
||||
return Promise.resolve(load.L)
|
||||
.then(function () {
|
||||
return Promise.all(load.d.map(function (dep) {
|
||||
return instantiateAll(loader, dep, loaded);
|
||||
}));
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
function topLevelLoad (loader, load) {
|
||||
return load.C = instantiateAll(loader, load, {})
|
||||
.then(function () {
|
||||
return postOrderExec(loader, load, {});
|
||||
})
|
||||
.then(function () {
|
||||
return load.n;
|
||||
});
|
||||
}
|
||||
|
||||
// the closest we can get to call(undefined)
|
||||
const nullContext = Object.freeze(Object.create(null));
|
||||
|
||||
// returns a promise if and only if a top-level await subgraph
|
||||
// throws on sync errors
|
||||
function postOrderExec (loader, load, seen) {
|
||||
if (seen[load.id])
|
||||
return;
|
||||
seen[load.id] = true;
|
||||
|
||||
if (!load.e) {
|
||||
if (load.eE)
|
||||
throw load.eE;
|
||||
if (load.E)
|
||||
return load.E;
|
||||
return;
|
||||
}
|
||||
|
||||
// deps execute first, unless circular
|
||||
let depLoadPromises;
|
||||
load.d.forEach(function (depLoad) {
|
||||
{
|
||||
const depLoadPromise = postOrderExec(loader, depLoad, seen);
|
||||
if (depLoadPromise)
|
||||
(depLoadPromises = depLoadPromises || []).push(depLoadPromise);
|
||||
}
|
||||
});
|
||||
if (depLoadPromises) {
|
||||
return load.E = Promise.all(depLoadPromises).then(doExec);
|
||||
}
|
||||
|
||||
return doExec();
|
||||
|
||||
function doExec () {
|
||||
try {
|
||||
let execPromise = load.e.call(nullContext);
|
||||
if (execPromise) {
|
||||
execPromise.then(function () {
|
||||
load.C = load.n;
|
||||
load.E = null;
|
||||
});
|
||||
execPromise.catch(function () {});
|
||||
return load.E = load.E || execPromise;
|
||||
}
|
||||
// (should be a promise, but a minify optimization to leave out Promise.resolve)
|
||||
load.C = load.n;
|
||||
}
|
||||
catch (err) {
|
||||
load.eE = err;
|
||||
throw err;
|
||||
}
|
||||
finally {
|
||||
load.L = load.I = undefined;
|
||||
load.e = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
envGlobal.System = new SystemJS();
|
||||
|
||||
/*
|
||||
* Supports loading System.register via script tag injection
|
||||
*/
|
||||
|
||||
let err$1;
|
||||
if (typeof window !== 'undefined')
|
||||
window.addEventListener('error', function (e) {
|
||||
err$1 = e.error;
|
||||
});
|
||||
|
||||
const systemRegister = systemJSPrototype.register;
|
||||
systemJSPrototype.register = function (deps, declare) {
|
||||
err$1 = undefined;
|
||||
systemRegister.call(this, deps, declare);
|
||||
};
|
||||
|
||||
systemJSPrototype.instantiate = function (url, firstParentUrl) {
|
||||
const loader = this;
|
||||
return new Promise(function (resolve, reject) {
|
||||
const script = document.createElement('script');
|
||||
script.charset = 'utf-8';
|
||||
script.async = true;
|
||||
script.addEventListener('error', function () {
|
||||
reject(new Error('Error loading ' + url + (firstParentUrl ? ' from ' + firstParentUrl : '')));
|
||||
});
|
||||
script.addEventListener('load', function () {
|
||||
document.head.removeChild(script);
|
||||
// Note URL normalization issues are going to be a careful concern here
|
||||
if (err$1)
|
||||
return reject(err$1);
|
||||
else
|
||||
resolve(loader.getRegister());
|
||||
});
|
||||
script.src = url;
|
||||
document.head.appendChild(script);
|
||||
});
|
||||
};
|
||||
|
||||
systemJSPrototype.resolve = function (id, parentUrl) {
|
||||
const resolved = resolveIfNotPlainOrUrl(id, parentUrl || baseUrl);
|
||||
if (!resolved) {
|
||||
if (id.indexOf(':') !== -1)
|
||||
return id;
|
||||
throw new Error('Cannot resolve "' + id + (parentUrl ? '" from ' + parentUrl : '"'));
|
||||
}
|
||||
return resolved;
|
||||
};
|
||||
|
||||
}());
|
1
public/systemjs@2.0.0/dist/s.min.js
vendored
Normal file
1
public/systemjs@2.0.0/dist/s.min.js
vendored
Normal file
@ -0,0 +1 @@
|
||||
!function(){const e="undefined"!=typeof self?self:global;let n;if("undefined"!=typeof location){const e=(n=location.href.split("#")[0].split("?")[0]).lastIndexOf("/");-1!==e&&(n=n.slice(0,e+1))}const t=/\\/g,r="undefined"!=typeof Symbol,i=r&&Symbol.toStringTag,o=r?Symbol():"@";function c(){this[o]={}}const l=c.prototype;let u;l.import=function(e,n){const t=this;return Promise.resolve(t.resolve(e,n)).then(function(e){const n=function e(n,t,r){let c=n[o][t];if(c)return c;const l=[],u=Object.create(null);i&&Object.defineProperty(u,i,{value:"Module"});let f=Promise.resolve().then(function(){return n.instantiate(t,r)}).then(function(e){if(!e)throw new Error("Module "+t+" did not instantiate");const r=e[1](function(e,n){c.h=!0;let t=!1;if("object"!=typeof e)e in u&&u[e]===n||(u[e]=n,t=!0);else for(let n in e){let r=e[n];n in u&&u[n]===r||(u[n]=r,t=!0)}if(t)for(let e=0;e<l.length;e++)l[e](u);return n},2===e[1].length?{import:function(e){return n.import(e,t)},meta:n.createContext(t)}:void 0);return c.e=r.execute||function(){},[e[0],r.setters||[]]});const s=f.then(function(r){return Promise.all(r[0].map(function(i,o){const c=r[1][o];return Promise.resolve(n.resolve(i,t)).then(function(r){const i=e(n,r,t);return Promise.resolve(i.I).then(function(){return c&&(i.i.push(c),!i.h&&i.I||c(i.n)),i})})})).then(function(e){c.d=e})});return s.catch(function(){}),c=n[o][t]={id:t,i:l,n:u,I:f,L:s,h:!1,d:void 0,e:void 0,eE:void 0,E:void 0,C:void 0}}(t,e);return n.C||function(e,n){return n.C=function e(n,t,r){if(!r[t.id])return r[t.id]=!0,Promise.resolve(t.L).then(function(){return Promise.all(t.d.map(function(t){return e(n,t,r)}))})}(e,n,{}).then(function(){return function e(n,t,r){if(r[t.id])return;if(r[t.id]=!0,!t.e){if(t.eE)throw t.eE;return t.E?t.E:void 0}let i;return t.d.forEach(function(t){{const o=e(n,t,r);o&&(i=i||[]).push(o)}}),i?t.E=Promise.all(i).then(o):o();function o(){try{let e=t.e.call(f);if(e)return e.then(function(){t.C=t.n,t.E=null}),e.catch(function(){}),t.E=t.E||e;t.C=t.n}catch(e){throw t.eE=e,e}finally{t.L=t.I=void 0,t.e=null}}}(e,n,{})}).then(function(){return n.n})}(t,n)})},l.createContext=function(e){return{url:e}},l.register=function(e,n){u=[e,n]},l.getRegister=function(){const e=u;return u=void 0,e};const f=Object.freeze(Object.create(null));let s;e.System=new c,"undefined"!=typeof window&&window.addEventListener("error",function(e){s=e.error});const d=l.register;l.register=function(e,n){s=void 0,d.call(this,e,n)},l.instantiate=function(e,n){const t=this;return new Promise(function(r,i){const o=document.createElement("script");o.charset="utf-8",o.async=!0,o.addEventListener("error",function(){i(new Error("Error loading "+e+(n?" from "+n:"")))}),o.addEventListener("load",function(){if(document.head.removeChild(o),s)return i(s);r(t.getRegister())}),o.src=e,document.head.appendChild(o)})},l.resolve=function(e,r){const i=function(e,n){if(-1!==e.indexOf("\\")&&(e=e.replace(t,"/")),"/"===e[0]&&"/"===e[1])return n.slice(0,n.indexOf(":")+1)+e;if("."===e[0]&&("/"===e[1]||"."===e[1]&&("/"===e[2]||2===e.length&&(e+="/"))||1===e.length&&(e+="/"))||"/"===e[0]){const t=n.slice(0,n.indexOf(":")+1);let r;if(r="/"===n[t.length+1]?"file:"!==t?(r=n.slice(t.length+2)).slice(r.indexOf("/")+1):n.slice(8):n.slice(t.length+1),"/"===e[0])return n.slice(0,n.length-r.length-1)+e;const i=r.slice(0,r.lastIndexOf("/")+1)+e,o=[];let c=-1;for(let e=0;e<i.length;e++)-1!==c?"/"===i[e]&&(o.push(i.slice(c,e+1)),c=-1):"."===i[e]?"."!==i[e+1]||"/"!==i[e+2]&&e+2!==i.length?"/"===i[e+1]||e+1===i.length?e+=1:c=e:(o.pop(),e+=2):c=e;return-1!==c&&o.push(i.slice(c)),n.slice(0,n.length-r.length)+o.join("")}}(e,r||n);if(!i){if(-1!==e.indexOf(":"))return e;throw new Error('Cannot resolve "'+e+(r?'" from '+r:'"'))}return i}}();
|
1
public/systemjs@2.0.0/dist/s.min.js.map
vendored
Normal file
1
public/systemjs@2.0.0/dist/s.min.js.map
vendored
Normal file
File diff suppressed because one or more lines are too long
712
public/systemjs@2.0.0/dist/system.js
vendored
Normal file
712
public/systemjs@2.0.0/dist/system.js
vendored
Normal file
@ -0,0 +1,712 @@
|
||||
/*
|
||||
* SystemJS 2.0.0
|
||||
*/
|
||||
(function () {
|
||||
const hasSelf = typeof self !== 'undefined';
|
||||
|
||||
const envGlobal = hasSelf ? self : global;
|
||||
|
||||
let baseUrl;
|
||||
if (typeof location !== 'undefined') {
|
||||
baseUrl = location.href.split('#')[0].split('?')[0];
|
||||
const lastSepIndex = baseUrl.lastIndexOf('/');
|
||||
if (lastSepIndex !== -1)
|
||||
baseUrl = baseUrl.slice(0, lastSepIndex + 1);
|
||||
}
|
||||
|
||||
const backslashRegEx = /\\/g;
|
||||
function resolveIfNotPlainOrUrl (relUrl, parentUrl) {
|
||||
if (relUrl.indexOf('\\') !== -1)
|
||||
relUrl = relUrl.replace(backslashRegEx, '/');
|
||||
// protocol-relative
|
||||
if (relUrl[0] === '/' && relUrl[1] === '/') {
|
||||
return parentUrl.slice(0, parentUrl.indexOf(':') + 1) + relUrl;
|
||||
}
|
||||
// relative-url
|
||||
else if (relUrl[0] === '.' && (relUrl[1] === '/' || relUrl[1] === '.' && (relUrl[2] === '/' || relUrl.length === 2 && (relUrl += '/')) ||
|
||||
relUrl.length === 1 && (relUrl += '/')) ||
|
||||
relUrl[0] === '/') {
|
||||
const parentProtocol = parentUrl.slice(0, parentUrl.indexOf(':') + 1);
|
||||
// Disabled, but these cases will give inconsistent results for deep backtracking
|
||||
//if (parentUrl[parentProtocol.length] !== '/')
|
||||
// throw new Error('Cannot resolve');
|
||||
// read pathname from parent URL
|
||||
// pathname taken to be part after leading "/"
|
||||
let pathname;
|
||||
if (parentUrl[parentProtocol.length + 1] === '/') {
|
||||
// resolving to a :// so we need to read out the auth and host
|
||||
if (parentProtocol !== 'file:') {
|
||||
pathname = parentUrl.slice(parentProtocol.length + 2);
|
||||
pathname = pathname.slice(pathname.indexOf('/') + 1);
|
||||
}
|
||||
else {
|
||||
pathname = parentUrl.slice(8);
|
||||
}
|
||||
}
|
||||
else {
|
||||
// resolving to :/ so pathname is the /... part
|
||||
pathname = parentUrl.slice(parentProtocol.length + 1);
|
||||
}
|
||||
|
||||
if (relUrl[0] === '/')
|
||||
return parentUrl.slice(0, parentUrl.length - pathname.length - 1) + relUrl;
|
||||
|
||||
// join together and split for removal of .. and . segments
|
||||
// looping the string instead of anything fancy for perf reasons
|
||||
// '../../../../../z' resolved to 'x/y' is just 'z'
|
||||
const segmented = pathname.slice(0, pathname.lastIndexOf('/') + 1) + relUrl;
|
||||
|
||||
const output = [];
|
||||
let segmentIndex = -1;
|
||||
for (let i = 0; i < segmented.length; i++) {
|
||||
// busy reading a segment - only terminate on '/'
|
||||
if (segmentIndex !== -1) {
|
||||
if (segmented[i] === '/') {
|
||||
output.push(segmented.slice(segmentIndex, i + 1));
|
||||
segmentIndex = -1;
|
||||
}
|
||||
}
|
||||
|
||||
// new segment - check if it is relative
|
||||
else if (segmented[i] === '.') {
|
||||
// ../ segment
|
||||
if (segmented[i + 1] === '.' && (segmented[i + 2] === '/' || i + 2 === segmented.length)) {
|
||||
output.pop();
|
||||
i += 2;
|
||||
}
|
||||
// ./ segment
|
||||
else if (segmented[i + 1] === '/' || i + 1 === segmented.length) {
|
||||
i += 1;
|
||||
}
|
||||
else {
|
||||
// the start of a new segment as below
|
||||
segmentIndex = i;
|
||||
}
|
||||
}
|
||||
// it is the start of a new segment
|
||||
else {
|
||||
segmentIndex = i;
|
||||
}
|
||||
}
|
||||
// finish reading out the last segment
|
||||
if (segmentIndex !== -1)
|
||||
output.push(segmented.slice(segmentIndex));
|
||||
return parentUrl.slice(0, parentUrl.length - pathname.length) + output.join('');
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Package name maps implementation
|
||||
*
|
||||
* Reduced implementation - only a single scope level is supported
|
||||
*
|
||||
* To make lookups fast we pre-resolve the entire package name map
|
||||
* and then match based on backtracked hash lookups
|
||||
*
|
||||
* path_prefix in scopes not supported
|
||||
* nested scopes not supported
|
||||
*/
|
||||
|
||||
function resolveUrl (relUrl, parentUrl) {
|
||||
return resolveIfNotPlainOrUrl(relUrl, parentUrl) ||
|
||||
relUrl.indexOf(':') !== -1 && relUrl ||
|
||||
resolveIfNotPlainOrUrl('./' + relUrl, parentUrl);
|
||||
}
|
||||
|
||||
function createPackageMap (json, baseUrl) {
|
||||
if (json.path_prefix) {
|
||||
baseUrl = resolveUrl(json.path_prefix, baseUrl);
|
||||
if (baseUrl[baseUrl.length - 1] !== '/')
|
||||
baseUrl += '/';
|
||||
}
|
||||
|
||||
const basePackages = json.packages || {};
|
||||
const scopes = {};
|
||||
if (json.scopes) {
|
||||
for (let scopeName in json.scopes) {
|
||||
const scope = json.scopes[scopeName];
|
||||
if (scope.path_prefix)
|
||||
throw new Error('Scope path_prefix not currently supported');
|
||||
if (scope.scopes)
|
||||
throw new Error('Nested scopes not currently supported');
|
||||
let resolvedScopeName = resolveUrl(scopeName, baseUrl);
|
||||
if (resolvedScopeName[resolvedScopeName.length - 1] === '/')
|
||||
resolvedScopeName = resolvedScopeName.substr(0, resolvedScopeName.length - 1);
|
||||
scopes[resolvedScopeName] = scope.packages || {};
|
||||
}
|
||||
}
|
||||
|
||||
function getMatch (path, matchObj) {
|
||||
let sepIndex = path.length;
|
||||
do {
|
||||
const segment = path.slice(0, sepIndex);
|
||||
if (segment in matchObj)
|
||||
return segment;
|
||||
} while ((sepIndex = path.lastIndexOf('/', sepIndex - 1)) !== -1)
|
||||
}
|
||||
|
||||
function applyPackages (id, packages, baseUrl) {
|
||||
const pkgName = getMatch(id, packages);
|
||||
if (pkgName) {
|
||||
const pkg = packages[pkgName];
|
||||
if (pkgName === id) {
|
||||
if (typeof pkg === 'string')
|
||||
return resolveUrl(pkg, baseUrl + pkgName + '/');
|
||||
if (!pkg.main)
|
||||
throw new Error('Package ' + pkgName + ' has no main');
|
||||
return resolveUrl(
|
||||
(pkg.path ? pkg.path + (pkg.path[pkg.path.length - 1] === '/' ? '' : '/') : pkgName + '/') + pkg.main,
|
||||
baseUrl
|
||||
);
|
||||
}
|
||||
else {
|
||||
return resolveUrl(
|
||||
(typeof pkg === 'string' || !pkg.path
|
||||
? pkgName + '/'
|
||||
: pkg.path + (pkg.path[pkg.path.length - 1] === '/' ? '' : '/')
|
||||
) + id.slice(pkgName.length + 1)
|
||||
, baseUrl);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return function (id, parentUrl) {
|
||||
const scopeName = getMatch(parentUrl, scopes);
|
||||
if (scopeName) {
|
||||
const scopePackages = scopes[scopeName];
|
||||
const packageResolution = applyPackages(id, scopePackages, scopeName + '/');
|
||||
if (packageResolution)
|
||||
return packageResolution;
|
||||
}
|
||||
return applyPackages(id, basePackages, baseUrl) || throwBare(id, parentUrl);
|
||||
};
|
||||
}
|
||||
|
||||
function throwBare (id, parentUrl) {
|
||||
throw new Error('Unable to resolve bare specifier "' + id + (parentUrl ? '" from ' + parentUrl : '"'));
|
||||
}
|
||||
|
||||
/*
|
||||
* SystemJS Core
|
||||
*
|
||||
* Provides
|
||||
* - System.import
|
||||
* - System.register support for
|
||||
* live bindings, function hoisting through circular references,
|
||||
* reexports, dynamic import, import.meta.url, top-level await
|
||||
* - System.getRegister to get the registration
|
||||
* - Symbol.toStringTag support in Module objects
|
||||
* - Hookable System.createContext to customize import.meta
|
||||
* - System.onload(id, err?) handler for tracing / hot-reloading
|
||||
*
|
||||
* Core comes with no System.prototype.resolve or
|
||||
* System.prototype.instantiate implementations
|
||||
*/
|
||||
|
||||
const hasSymbol = typeof Symbol !== 'undefined';
|
||||
const toStringTag = hasSymbol && Symbol.toStringTag;
|
||||
const REGISTRY = hasSymbol ? Symbol() : '@';
|
||||
|
||||
function SystemJS () {
|
||||
this[REGISTRY] = {};
|
||||
}
|
||||
|
||||
const systemJSPrototype = SystemJS.prototype;
|
||||
systemJSPrototype.import = function (id, parentUrl) {
|
||||
const loader = this;
|
||||
return Promise.resolve(loader.resolve(id, parentUrl))
|
||||
.then(function (id) {
|
||||
const load = getOrCreateLoad(loader, id);
|
||||
return load.C || topLevelLoad(loader, load);
|
||||
});
|
||||
};
|
||||
|
||||
// Hookable createContext function -> allowing eg custom import meta
|
||||
systemJSPrototype.createContext = function (parentId) {
|
||||
return {
|
||||
url: parentId
|
||||
};
|
||||
};
|
||||
|
||||
// onLoad(id, err) provided for tracing / hot-reloading
|
||||
systemJSPrototype.onload = function () {};
|
||||
|
||||
let lastRegister;
|
||||
systemJSPrototype.register = function (deps, declare) {
|
||||
lastRegister = [deps, declare];
|
||||
};
|
||||
|
||||
/*
|
||||
* getRegister provides the last anonymous System.register call
|
||||
*/
|
||||
systemJSPrototype.getRegister = function () {
|
||||
const _lastRegister = lastRegister;
|
||||
lastRegister = undefined;
|
||||
return _lastRegister;
|
||||
};
|
||||
|
||||
function getOrCreateLoad (loader, id, firstParentUrl) {
|
||||
let load = loader[REGISTRY][id];
|
||||
if (load)
|
||||
return load;
|
||||
|
||||
const importerSetters = [];
|
||||
const ns = Object.create(null);
|
||||
if (toStringTag)
|
||||
Object.defineProperty(ns, toStringTag, { value: 'Module' });
|
||||
|
||||
let instantiatePromise = Promise.resolve()
|
||||
.then(function () {
|
||||
return loader.instantiate(id, firstParentUrl);
|
||||
})
|
||||
.then(function (registration) {
|
||||
if (!registration)
|
||||
throw new Error('Module ' + id + ' did not instantiate');
|
||||
function _export (name, value) {
|
||||
// note if we have hoisted exports (including reexports)
|
||||
load.h = true;
|
||||
let changed = false;
|
||||
if (typeof name !== 'object') {
|
||||
if (!(name in ns) || ns[name] !== value) {
|
||||
ns[name] = value;
|
||||
changed = true;
|
||||
}
|
||||
}
|
||||
else {
|
||||
for (let p in name) {
|
||||
let value = name[p];
|
||||
if (!(p in ns) || ns[p] !== value) {
|
||||
ns[p] = value;
|
||||
changed = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (changed)
|
||||
for (let i = 0; i < importerSetters.length; i++)
|
||||
importerSetters[i](ns);
|
||||
return value;
|
||||
}
|
||||
const declared = registration[1](_export, registration[1].length === 2 ? {
|
||||
import: function (importId) {
|
||||
return loader.import(importId, id);
|
||||
},
|
||||
meta: loader.createContext(id)
|
||||
} : undefined);
|
||||
load.e = declared.execute || function () {};
|
||||
return [registration[0], declared.setters || []];
|
||||
});
|
||||
|
||||
instantiatePromise = instantiatePromise.catch(function (err) {
|
||||
loader.onload(load.id, err);
|
||||
throw err;
|
||||
});
|
||||
|
||||
const linkPromise = instantiatePromise
|
||||
.then(function (instantiation) {
|
||||
return Promise.all(instantiation[0].map(function (dep, i) {
|
||||
const setter = instantiation[1][i];
|
||||
return Promise.resolve(loader.resolve(dep, id))
|
||||
.then(function (depId) {
|
||||
const depLoad = getOrCreateLoad(loader, depId, id);
|
||||
// depLoad.I may be undefined for already-evaluated
|
||||
return Promise.resolve(depLoad.I)
|
||||
.then(function () {
|
||||
if (setter) {
|
||||
depLoad.i.push(setter);
|
||||
// only run early setters when there are hoisted exports of that module
|
||||
// the timing works here as pending hoisted export calls will trigger through importerSetters
|
||||
if (depLoad.h || !depLoad.I)
|
||||
setter(depLoad.n);
|
||||
}
|
||||
return depLoad;
|
||||
});
|
||||
})
|
||||
}))
|
||||
.then(function (depLoads) {
|
||||
load.d = depLoads;
|
||||
});
|
||||
});
|
||||
|
||||
// disable unhandled rejections
|
||||
linkPromise.catch(function () {});
|
||||
|
||||
// Captial letter = a promise function
|
||||
return load = loader[REGISTRY][id] = {
|
||||
id: id,
|
||||
// importerSetters, the setters functions registered to this dependency
|
||||
// we retain this to add more later
|
||||
i: importerSetters,
|
||||
// module namespace object
|
||||
n: ns,
|
||||
|
||||
// instantiate
|
||||
I: instantiatePromise,
|
||||
// link
|
||||
L: linkPromise,
|
||||
// whether it has hoisted exports
|
||||
h: false,
|
||||
|
||||
// On instantiate completion we have populated:
|
||||
// dependency load records
|
||||
d: undefined,
|
||||
// execution function
|
||||
// set to NULL immediately after execution (or on any failure) to indicate execution has happened
|
||||
// in such a case, pC should be used, and pLo, pLi will be emptied
|
||||
e: undefined,
|
||||
|
||||
// On execution we have populated:
|
||||
// the execution error if any
|
||||
eE: undefined,
|
||||
// in the case of TLA, the execution promise
|
||||
E: undefined,
|
||||
|
||||
// On execution, pLi, pLo, e cleared
|
||||
|
||||
// Promise for top-level completion
|
||||
C: undefined
|
||||
};
|
||||
}
|
||||
|
||||
function instantiateAll (loader, load, loaded) {
|
||||
if (!loaded[load.id]) {
|
||||
loaded[load.id] = true;
|
||||
// load.L may be undefined for already-instantiated
|
||||
return Promise.resolve(load.L)
|
||||
.then(function () {
|
||||
return Promise.all(load.d.map(function (dep) {
|
||||
return instantiateAll(loader, dep, loaded);
|
||||
}));
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
function topLevelLoad (loader, load) {
|
||||
return load.C = instantiateAll(loader, load, {})
|
||||
.then(function () {
|
||||
return postOrderExec(loader, load, {});
|
||||
})
|
||||
.then(function () {
|
||||
return load.n;
|
||||
});
|
||||
}
|
||||
|
||||
// the closest we can get to call(undefined)
|
||||
const nullContext = Object.freeze(Object.create(null));
|
||||
|
||||
// returns a promise if and only if a top-level await subgraph
|
||||
// throws on sync errors
|
||||
function postOrderExec (loader, load, seen) {
|
||||
if (seen[load.id])
|
||||
return;
|
||||
seen[load.id] = true;
|
||||
|
||||
if (!load.e) {
|
||||
if (load.eE)
|
||||
throw load.eE;
|
||||
if (load.E)
|
||||
return load.E;
|
||||
return;
|
||||
}
|
||||
|
||||
// deps execute first, unless circular
|
||||
let depLoadPromises;
|
||||
load.d.forEach(function (depLoad) {
|
||||
{
|
||||
try {
|
||||
const depLoadPromise = postOrderExec(loader, depLoad, seen);
|
||||
if (depLoadPromise)
|
||||
(depLoadPromises = depLoadPromises || []).push(depLoadPromise);
|
||||
}
|
||||
catch (err) {
|
||||
loader.onload(load.id, err);
|
||||
throw err;
|
||||
}
|
||||
}
|
||||
});
|
||||
if (depLoadPromises) {
|
||||
return Promise.all(depLoadPromises)
|
||||
.then(doExec)
|
||||
.catch(function (err) {
|
||||
loader.onload(load.id, err);
|
||||
throw err;
|
||||
});
|
||||
}
|
||||
|
||||
return doExec();
|
||||
|
||||
function doExec () {
|
||||
try {
|
||||
let execPromise = load.e.call(nullContext);
|
||||
if (execPromise) {
|
||||
execPromise = execPromise.then(function () {
|
||||
load.C = load.n;
|
||||
load.E = null; // indicates completion
|
||||
loader.onload(load.id, null);
|
||||
}, function () {
|
||||
loader.onload(load.id, err);
|
||||
throw err;
|
||||
});
|
||||
execPromise.catch(function () {});
|
||||
return load.E = load.E || execPromise;
|
||||
}
|
||||
// (should be a promise, but a minify optimization to leave out Promise.resolve)
|
||||
load.C = load.n;
|
||||
loader.onload(load.id, null);
|
||||
}
|
||||
catch (err) {
|
||||
loader.onload(load.id, err);
|
||||
load.eE = err;
|
||||
throw err;
|
||||
}
|
||||
finally {
|
||||
load.L = load.I = undefined;
|
||||
load.e = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
envGlobal.System = new SystemJS();
|
||||
|
||||
/*
|
||||
* Supports loading System.register via script tag injection
|
||||
*/
|
||||
|
||||
let err$1;
|
||||
if (typeof window !== 'undefined')
|
||||
window.addEventListener('error', function (e) {
|
||||
err$1 = e.error;
|
||||
});
|
||||
|
||||
const systemRegister = systemJSPrototype.register;
|
||||
systemJSPrototype.register = function (deps, declare) {
|
||||
err$1 = undefined;
|
||||
systemRegister.call(this, deps, declare);
|
||||
};
|
||||
|
||||
systemJSPrototype.instantiate = function (url, firstParentUrl) {
|
||||
const loader = this;
|
||||
return new Promise(function (resolve, reject) {
|
||||
const script = document.createElement('script');
|
||||
script.charset = 'utf-8';
|
||||
script.async = true;
|
||||
script.addEventListener('error', function () {
|
||||
reject(new Error('Error loading ' + url + (firstParentUrl ? ' from ' + firstParentUrl : '')));
|
||||
});
|
||||
script.addEventListener('load', function () {
|
||||
document.head.removeChild(script);
|
||||
// Note URL normalization issues are going to be a careful concern here
|
||||
if (err$1)
|
||||
return reject(err$1);
|
||||
else
|
||||
resolve(loader.getRegister());
|
||||
});
|
||||
script.src = url;
|
||||
document.head.appendChild(script);
|
||||
});
|
||||
};
|
||||
|
||||
/*
|
||||
* Supports loading System.register in workers
|
||||
*/
|
||||
|
||||
if (hasSelf && typeof importScripts === 'function')
|
||||
systemJSPrototype.instantiate = function (url) {
|
||||
const loader = this;
|
||||
return new Promise(function (resolve, reject) {
|
||||
try {
|
||||
importScripts(url);
|
||||
}
|
||||
catch (e) {
|
||||
reject(e);
|
||||
}
|
||||
resolve(loader.getRegister());
|
||||
});
|
||||
};
|
||||
|
||||
/*
|
||||
* SystemJS global script loading support
|
||||
* Extra for the s.js build only
|
||||
* (Included by default in system.js build)
|
||||
*/
|
||||
(function (global) {
|
||||
|
||||
const systemJSPrototype = System.constructor.prototype;
|
||||
|
||||
function getLastGlobalProp () {
|
||||
// alternatively Object.keys(global).pop()
|
||||
// but this may be faster (pending benchmarks)
|
||||
let lastProp;
|
||||
for (let p in global)
|
||||
if (global.hasOwnProperty(p))
|
||||
lastProp = p;
|
||||
return lastProp;
|
||||
}
|
||||
|
||||
let lastGlobalProp;
|
||||
const impt = systemJSPrototype.import;
|
||||
systemJSPrototype.import = function (id, parentUrl) {
|
||||
lastGlobalProp = getLastGlobalProp();
|
||||
return impt.call(this, id, parentUrl);
|
||||
};
|
||||
|
||||
const emptyInstantiation = [[], function () { return {} }];
|
||||
|
||||
const getRegister = systemJSPrototype.getRegister;
|
||||
systemJSPrototype.getRegister = function () {
|
||||
const lastRegister = getRegister.call(this);
|
||||
if (lastRegister)
|
||||
return lastRegister;
|
||||
|
||||
// no registration -> attempt a global detection as difference from snapshot
|
||||
// when multiple globals, we take the global value to be the last defined new global object property
|
||||
// for performance, this will not support multi-version / global collisions as previous SystemJS versions did
|
||||
// note in Edge, deleting and re-adding a global does not change its ordering
|
||||
const globalProp = getLastGlobalProp();
|
||||
if (lastGlobalProp === globalProp)
|
||||
return emptyInstantiation;
|
||||
|
||||
lastGlobalProp = globalProp;
|
||||
let globalExport;
|
||||
try {
|
||||
globalExport = global[globalProp];
|
||||
}
|
||||
catch (e) {
|
||||
return emptyInstantiation;
|
||||
}
|
||||
|
||||
return [[], function (_export) {
|
||||
return { execute: function () { _export('default', globalExport); } };
|
||||
}];
|
||||
};
|
||||
|
||||
})(typeof self !== 'undefined' ? self : global);
|
||||
|
||||
/*
|
||||
* Loads WASM based on file extension detection
|
||||
* Assumes successive instantiate will handle other files
|
||||
*/
|
||||
const instantiate = systemJSPrototype.instantiate;
|
||||
systemJSPrototype.instantiate = function (url, parent) {
|
||||
if (url.slice(-5) !== '.wasm')
|
||||
return instantiate.call(this, url, parent);
|
||||
|
||||
return fetch(url)
|
||||
.then(function (res) {
|
||||
if (!res.ok)
|
||||
throw new Error(res.status + ' ' + res.statusText + ' ' + res.url + (parent ? ' loading from ' + parent : ''));
|
||||
return WebAssembly.compileStreaming(res);
|
||||
})
|
||||
.then(function (module) {
|
||||
const deps = [];
|
||||
const setters = [];
|
||||
const importObj = {};
|
||||
|
||||
// we can only set imports if supported (eg early Safari doesnt support)
|
||||
if (WebAssembly.Module.imports)
|
||||
WebAssembly.Module.imports(module).forEach(function (impt) {
|
||||
const key = impt.module;
|
||||
setters.push(function (m) {
|
||||
importObj[key] = m;
|
||||
});
|
||||
if (deps.indexOf(key) === -1)
|
||||
deps.push(key);
|
||||
});
|
||||
|
||||
return [deps, function (_export) {
|
||||
return {
|
||||
setters: setters,
|
||||
execute: function () {
|
||||
_export(new WebAssembly.Instance(module, importObj).exports);
|
||||
}
|
||||
};
|
||||
}];
|
||||
});
|
||||
};
|
||||
|
||||
/*
|
||||
* Package name map support for SystemJS
|
||||
*
|
||||
* <script type="systemjs-packagemap">{}</script>
|
||||
* OR
|
||||
* <script type="systemjs-packagemap" src=package.json></script>
|
||||
*
|
||||
* Only supports loading the first package map
|
||||
*/
|
||||
|
||||
let packageMapPromise, packageMapResolve;
|
||||
if (typeof document !== 'undefined') {
|
||||
const scripts = document.getElementsByTagName('script');
|
||||
for (let i = 0; i < scripts.length; i++) {
|
||||
const script = scripts[i];
|
||||
if (script.type !== 'systemjs-packagemap')
|
||||
continue;
|
||||
|
||||
if (!script.src) {
|
||||
packageMapResolve = createPackageMap(JSON.parse(script.innerHTML), baseUrl);
|
||||
packageMapPromise = Promise.resolve();
|
||||
}
|
||||
else {
|
||||
packageMapPromise = fetch(script.src)
|
||||
.then(function (res) {
|
||||
return res.json();
|
||||
})
|
||||
.then(function (json) {
|
||||
packageMapResolve = createPackageMap(json, script.src);
|
||||
packageMapPromise = undefined;
|
||||
}, function () {
|
||||
packageMapResolve = throwBare;
|
||||
packageMapPromise = undefined;
|
||||
});
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!packageMapPromise)
|
||||
packageMapResolve = throwBare;
|
||||
|
||||
systemJSPrototype.resolve = function (id, parentUrl) {
|
||||
parentUrl = parentUrl || baseUrl;
|
||||
|
||||
const resolvedIfNotPlainOrUrl = resolveIfNotPlainOrUrl(id, parentUrl);
|
||||
if (resolvedIfNotPlainOrUrl)
|
||||
return resolvedIfNotPlainOrUrl;
|
||||
if (id.indexOf(':') !== -1)
|
||||
return id;
|
||||
|
||||
// now just left with plain
|
||||
// (if not package map, packageMapResolve just throws)
|
||||
if (packageMapPromise)
|
||||
return packageMapPromise
|
||||
.then(function () {
|
||||
return packageMapResolve(id, parentUrl);
|
||||
});
|
||||
|
||||
return packageMapResolve(id, parentUrl);
|
||||
};
|
||||
|
||||
systemJSPrototype.get = function (id) {
|
||||
const load = this[REGISTRY][id];
|
||||
if (load && load.e === null && !load.E) {
|
||||
if (load.eE)
|
||||
return null;
|
||||
return load.n;
|
||||
}
|
||||
};
|
||||
|
||||
// Delete function provided for hot-reloading use cases
|
||||
systemJSPrototype.delete = function (id) {
|
||||
const load = this.get(id);
|
||||
if (load === undefined)
|
||||
return false;
|
||||
// remove from importerSetters
|
||||
// (release for gc)
|
||||
if (load && load.d)
|
||||
load.d.forEach(function (depLoad) {
|
||||
const importerIndex = depLoad.i.indexOf(load);
|
||||
if (importerIndex !== -1)
|
||||
depLoad.i.splice(importerIndex, 1);
|
||||
});
|
||||
return delete this[REGISTRY][id];
|
||||
};
|
||||
|
||||
}());
|
4
public/systemjs@2.0.0/dist/system.min.js
vendored
Normal file
4
public/systemjs@2.0.0/dist/system.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
1
public/systemjs@2.0.0/dist/system.min.js.map
vendored
Normal file
1
public/systemjs@2.0.0/dist/system.min.js.map
vendored
Normal file
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user