diff --git a/lerna.json b/lerna.json index 588948f605d14..379af8c31f1af 100644 --- a/lerna.json +++ b/lerna.json @@ -17,5 +17,5 @@ "registry": "https://registry.npmjs.org/" } }, - "version": "10.0.7-canary.0" + "version": "10.0.7-canary.1" } diff --git a/packages/create-next-app/package.json b/packages/create-next-app/package.json index 7008749f8cb2a..0390b94f2427f 100644 --- a/packages/create-next-app/package.json +++ b/packages/create-next-app/package.json @@ -1,6 +1,6 @@ { "name": "create-next-app", - "version": "10.0.7-canary.0", + "version": "10.0.7-canary.1", "keywords": [ "react", "next", diff --git a/packages/eslint-plugin-next/package.json b/packages/eslint-plugin-next/package.json index b97cf016adfb2..9e24c37a023a9 100644 --- a/packages/eslint-plugin-next/package.json +++ b/packages/eslint-plugin-next/package.json @@ -1,6 +1,6 @@ { "name": "@next/eslint-plugin-next", - "version": "10.0.7-canary.0", + "version": "10.0.7-canary.1", "description": "ESLint plugin for NextJS.", "main": "lib/index.js", "license": "MIT", diff --git a/packages/next-bundle-analyzer/package.json b/packages/next-bundle-analyzer/package.json index 8ea085fa2ebbe..c8832267d2750 100644 --- a/packages/next-bundle-analyzer/package.json +++ b/packages/next-bundle-analyzer/package.json @@ -1,6 +1,6 @@ { "name": "@next/bundle-analyzer", - "version": "10.0.7-canary.0", + "version": "10.0.7-canary.1", "main": "index.js", "license": "MIT", "repository": { diff --git a/packages/next-codemod/package.json b/packages/next-codemod/package.json index 87d41b4ce0d9b..8f3c586d7b73c 100644 --- a/packages/next-codemod/package.json +++ b/packages/next-codemod/package.json @@ -1,6 +1,6 @@ { "name": "@next/codemod", - "version": "10.0.7-canary.0", + "version": "10.0.7-canary.1", "license": "MIT", "dependencies": { "chalk": "4.1.0", diff --git a/packages/next-env/package.json b/packages/next-env/package.json index 737dae319eeb8..4132448a3d95f 100644 --- a/packages/next-env/package.json +++ b/packages/next-env/package.json @@ -1,6 +1,6 @@ { "name": "@next/env", - "version": "10.0.7-canary.0", + "version": "10.0.7-canary.1", "keywords": [ "react", "next", diff --git a/packages/next-mdx/package.json b/packages/next-mdx/package.json index 7494758bc7826..21aa133faab18 100644 --- a/packages/next-mdx/package.json +++ b/packages/next-mdx/package.json @@ -1,6 +1,6 @@ { "name": "@next/mdx", - "version": "10.0.7-canary.0", + "version": "10.0.7-canary.1", "main": "index.js", "license": "MIT", "repository": { diff --git a/packages/next-plugin-google-analytics/package.json b/packages/next-plugin-google-analytics/package.json index fa3bc3b1c9ed3..5cf54a74a740c 100644 --- a/packages/next-plugin-google-analytics/package.json +++ b/packages/next-plugin-google-analytics/package.json @@ -1,6 +1,6 @@ { "name": "@next/plugin-google-analytics", - "version": "10.0.7-canary.0", + "version": "10.0.7-canary.1", "repository": { "url": "vercel/next.js", "directory": "packages/next-plugin-google-analytics" diff --git a/packages/next-plugin-sentry/package.json b/packages/next-plugin-sentry/package.json index fd1e771e5cc62..011c75f77f250 100644 --- a/packages/next-plugin-sentry/package.json +++ b/packages/next-plugin-sentry/package.json @@ -1,6 +1,6 @@ { "name": "@next/plugin-sentry", - "version": "10.0.7-canary.0", + "version": "10.0.7-canary.1", "repository": { "url": "vercel/next.js", "directory": "packages/next-plugin-sentry" diff --git a/packages/next-plugin-storybook/package.json b/packages/next-plugin-storybook/package.json index dca89fd26f502..b0af400f1666f 100644 --- a/packages/next-plugin-storybook/package.json +++ b/packages/next-plugin-storybook/package.json @@ -1,6 +1,6 @@ { "name": "@next/plugin-storybook", - "version": "10.0.7-canary.0", + "version": "10.0.7-canary.1", "repository": { "url": "vercel/next.js", "directory": "packages/next-plugin-storybook" diff --git a/packages/next-polyfill-module/package.json b/packages/next-polyfill-module/package.json index b303ff99464ff..42291b061cf22 100644 --- a/packages/next-polyfill-module/package.json +++ b/packages/next-polyfill-module/package.json @@ -1,6 +1,6 @@ { "name": "@next/polyfill-module", - "version": "10.0.7-canary.0", + "version": "10.0.7-canary.1", "description": "A standard library polyfill for ES Modules supporting browsers (Edge 16+, Firefox 60+, Chrome 61+, Safari 10.1+)", "main": "dist/polyfill-module.js", "license": "MIT", diff --git a/packages/next-polyfill-nomodule/package.json b/packages/next-polyfill-nomodule/package.json index 3a771f1050dbf..716ea97436316 100644 --- a/packages/next-polyfill-nomodule/package.json +++ b/packages/next-polyfill-nomodule/package.json @@ -1,6 +1,6 @@ { "name": "@next/polyfill-nomodule", - "version": "10.0.7-canary.0", + "version": "10.0.7-canary.1", "description": "A polyfill for non-dead, nomodule browsers.", "main": "dist/polyfill-nomodule.js", "license": "MIT", diff --git a/packages/next/build/webpack-config.ts b/packages/next/build/webpack-config.ts index 686ecd3cdde34..568eb149a6f41 100644 --- a/packages/next/build/webpack-config.ts +++ b/packages/next/build/webpack-config.ts @@ -43,6 +43,7 @@ import { build as buildConfiguration } from './webpack/config' import { __overrideCssConfiguration } from './webpack/config/blocks/css/overrideCssConfiguration' import { pluginLoaderOptions } from './webpack/loaders/next-plugin-loader' import BuildManifestPlugin from './webpack/plugins/build-manifest-plugin' +import BuildStatsPlugin from './webpack/plugins/build-stats-plugin' import ChunkNamesPlugin from './webpack/plugins/chunk-names-plugin' import { CssMinimizerPlugin } from './webpack/plugins/css-minimizer-plugin' import { JsConfigPathsPlugin } from './webpack/plugins/jsconfig-paths-plugin' @@ -1109,6 +1110,11 @@ export default async function getBaseWebpackConfig( buildId, rewrites, }), + !isServer && + config.experimental.stats && + new BuildStatsPlugin({ + distDir, + }), new ProfilingPlugin(), config.experimental.optimizeFonts && !dev && diff --git a/packages/next/build/webpack/plugins/build-stats-plugin.ts b/packages/next/build/webpack/plugins/build-stats-plugin.ts new file mode 100644 index 0000000000000..e07125904098b --- /dev/null +++ b/packages/next/build/webpack/plugins/build-stats-plugin.ts @@ -0,0 +1,48 @@ +import fs from 'fs' +import path from 'path' +// @ts-ignore no types package +import bfj from 'next/dist/compiled/bfj' +import { spans } from './profiling-plugin' +import { webpack } from 'next/dist/compiled/webpack/webpack' +import { tracer, traceAsyncFn } from '../../tracer' + +// This plugin creates a stats.json for a build when enabled +export default class BuildStatsPlugin { + private distDir: string + + constructor(options: { distDir: string }) { + this.distDir = options.distDir + } + + apply(compiler: webpack.Compiler) { + compiler.hooks.done.tapAsync( + 'NextJsBuildStats', + async (stats, callback) => { + tracer.withSpan(spans.get(compiler), async () => { + try { + const writeStatsSpan = tracer.startSpan('NextJsBuildStats') + await traceAsyncFn(writeStatsSpan, () => { + return new Promise((resolve, reject) => { + const statsJson = stats.toJson({ + source: false, + }) + const fileStream = fs.createWriteStream( + path.join(this.distDir, 'next-stats.json') + ) + const jsonStream = bfj.streamify(statsJson) + jsonStream.pipe(fileStream) + jsonStream.on('error', reject) + fileStream.on('error', reject) + jsonStream.on('dataError', reject) + fileStream.on('close', resolve) + }) + }) + callback() + } catch (err) { + callback(err) + } + }) + } + ) + } +} diff --git a/packages/next/compiled/bfj/index.js b/packages/next/compiled/bfj/index.js new file mode 100644 index 0000000000000..145f9c93ceb52 --- /dev/null +++ b/packages/next/compiled/bfj/index.js @@ -0,0 +1 @@ +module.exports=(()=>{var __webpack_modules__={2364:(e,t,n)=>{"use strict";const r=n(2950);const i=n(4756);const o=n(1669);o.inherits(DataStream,i);e.exports=DataStream;function DataStream(e,t){if(r.not.instanceStrict(this,DataStream)){return new DataStream(e,t)}return i.call(this,e,{...t,objectMode:true})}},9075:e=>{"use strict";e.exports={create:create};function create(e,t,n,r){const i=new Error("JSON error: encountered `"+e+"` at line "+n+", column "+r+" where `"+t+"` was expected.");i.actual=e;i.expected=t;i.lineNumber=n;i.columnNumber=r;return i}},6682:(e,t,n)=>{"use strict";const r=n(2950);const i=n(8614).EventEmitter;const o=n(6351);const a=n(7358);const s={undefined:true,function:true,symbol:true};e.exports=eventify;function eventify(e,t={}){const n={};const u=new i;const c=a(t);const f=new Map;let l=0;let p=false;let h;let d;let _;let v;u.pause=(()=>{let e;_=new c(t=>e=t);return()=>{_=null;l=0;e()}});parseOptions();setImmediate(begin);return u;function parseOptions(){parseCoercionOption("promises");parseCoercionOption("buffers");parseCoercionOption("maps");parseCoercionOption("iterables");if(Object.keys(n).length===0){p=true}if(t.circular==="ignore"){h=true}r.assert.maybe.positive(t.yieldRate);v=t.yieldRate||16384}function parseCoercionOption(e){if(t[e]!=="ignore"){n[e]=true}}function begin(){return proceed(e).catch(e=>emit(o.error,e)).then(()=>emit(o.end))}function proceed(e){if(++l%v!==0){return coerce(e).then(after)}return new c((t,n)=>{setImmediate(()=>{coerce(e).then(after).then(t).catch(n)})});function after(e){if(isInvalid(e)){return}if(e===false||e===true||e===null){return literal(e)}if(Array.isArray(e)){return array(e)}const t=typeof e;switch(t){case"number":return value(e,t);case"string":return value(escapeString(e),t);default:return object(e)}}}function coerce(e){if(p||r.primitive(e)){return c.resolve(e)}if(r.thenable(e)){return coerceThing(e,"promises",coercePromise).then(coerce)}if(r.instanceStrict(e,Buffer)){return coerceThing(e,"buffers",coerceBuffer)}if(r.instanceStrict(e,Map)){return coerceThing(e,"maps",coerceMap)}if(r.iterable(e)&&r.not.string(e)&&r.not.array(e)){return coerceThing(e,"iterables",coerceIterable)}if(r.function(e.toJSON)){return c.resolve(e.toJSON())}return c.resolve(e)}function coerceThing(e,t,r){if(n[t]){return r(e)}return c.resolve()}function coercePromise(e){return e}function coerceBuffer(e){return c.resolve(e.toString())}function coerceMap(e){const t={};return coerceCollection(e,t,(e,n)=>{t[n]=e})}function coerceCollection(e,t,n){e.forEach(n);return c.resolve(t)}function coerceIterable(e){const t=[];return coerceCollection(e,t,e=>{t.push(e)})}function isInvalid(e){const t=typeof e;return!!s[t]||t==="number"&&!isValidNumber(e)}function isValidNumber(e){return e>Number.NEGATIVE_INFINITY&&eu.emit(e,t)).catch(e=>{try{u.emit(o.error,e)}catch(e){}})}function array(e){return collection(e,e,"array",e=>{if(isInvalid(e)){return proceed(null)}return proceed(e)})}function collection(e,t,n,r){let i;return c.resolve().then(()=>{if(f.has(e)){i=d=true;if(!h){return emit(o.dataError,new Error("Circular reference."))}}else{f.set(e,true)}}).then(()=>emit(o[n])).then(()=>item(0));function item(a){if(a>=t.length){if(i){d=false}if(d){return c.resolve()}return emit(o.endPrefix+o[n]).then(()=>f.delete(e))}if(d){return item(a+1)}return r(t[a]).then(()=>item(a+1))}}function object(e){return collection(e,Object.keys(e),"object",t=>{const n=e[t];if(isInvalid(n)){return c.resolve()}return emit(o.property,escapeString(t)).then(()=>proceed(n))})}function escapeString(e){e=JSON.stringify(e);return e.substring(1,e.length-1)}}},6351:e=>{"use strict";e.exports={array:"arr",object:"obj",property:"pro",string:"str",number:"num",literal:"lit",endPrefix:"end-",end:"end",error:"err"};e.exports.endArray=e.exports.endPrefix+e.exports.array;e.exports.endObject=e.exports.endPrefix+e.exports.object;e.exports.endLine=`${e.exports.endPrefix}line`;e.exports.dataError=`${e.exports.error}-data`},2986:(e,t,n)=>{"use strict";e.exports={walk:n(3312),match:n(3577),parse:n(6619),unpipe:n(6232),read:n(3909),eventify:n(6682),streamify:n(5651),stringify:n(6790),write:n(582),events:n(6351)}},3235:(e,t,n)=>{"use strict";const r=n(2950);const i=n(4756);const o=n(1669);o.inherits(JsonStream,i);e.exports=JsonStream;function JsonStream(e,t){if(r.not.instanceStrict(this,JsonStream)){return new JsonStream(e,t)}return i.call(this,e,{...t,encoding:"utf8"})}},3577:(e,t,n)=>{"use strict";const r=n(2950);const i=n(2364);const o=n(6351);const a=n(7030);const s=n(3312);const u=1024;e.exports=match;function match(e,t,n={}){const c=[];const f=[];const l=s(e,n);const p=new a(n.bufferLength||u);let h;const{highWaterMark:d}=n;if(d){h={highWaterMark:d}}const _=new i(read,h);let v,y,g;let m=false;let b=true;let w=false;let C=0;let E=0;const S=n.minDepth||0;r.assert.greaterOrEqual(S,0);if(r.function(t)){v=t;t=null}else{m=!!n.numbers;if(r.string(t)){r.assert.nonEmptyString(t);y=t;t=null}else{r.assert.instanceStrict(t,RegExp)}}l.on(o.array,array);l.on(o.object,object);l.on(o.property,property);l.on(o.endArray,endScope);l.on(o.endObject,endScope);l.on(o.string,value);l.on(o.number,value);l.on(o.literal,value);l.on(o.end,end);l.on(o.error,error);l.on(o.dataError,dataError);return _;function read(){if(b){b=false;if(w){if(C>0){after()}return endResults()}}if(g){const e=g;g=null;e();after()}}function after(){if(b||g){return}let e;for(e=0;e0){const t=c[c.length-1];if(Array.isArray(t)){n=t.length}else{n=f.pop()}t[n]=e}if(e===null){return}if(v){if(v(n,e,c.length)){push(e)}}else{if(m&&typeof n==="number"){n=n.toString()}if(y&&y===n||t&&t.test(n)){push(e)}}}function push(e){if(C+1===p.length){pause()}p[E+C++]=e;after()}function end(){w=true;endResults()}function error(e){_.emit("error",e)}function dataError(e){_.emit("dataError",e)}}},6619:(e,t,n)=>{"use strict";const r=n(2950);const i=n(6351);const o=n(7358);const a=n(3312);e.exports=parse;const s=new Map;function parse(e,t={}){const n=o(t);try{r.assert.maybe.function(t.reviver,"Invalid reviver option")}catch(e){return n.reject(e)}const u=[];const c=[];const f=t.reviver;const l=!!t.ndjson;let p,h,d,_;if(l&&s.has(e)){const t=s.get(e);s.delete(e);p=t.emitter;setImmediate(t.resume)}else{p=a(e,t)}p.on(i.array,array);p.on(i.object,object);p.on(i.property,property);p.on(i.string,value);p.on(i.number,value);p.on(i.literal,value);p.on(i.endArray,endScope);p.on(i.endObject,endScope);p.on(i.end,end);p.on(i.error,error);p.on(i.dataError,error);if(l){p.on(i.endLine,endLine)}return new n((e,t)=>{h=e;d=t});function array(){if(u.length>0){return}beginScope([])}function beginScope(e){if(u.length>0){return}if(c.length>0){value(e)}c.push(e)}function value(e){if(u.length>0){return}if(c.length===0){return c.push(e)}const t=c[c.length-1];if(_){t[_]=e;_=null}else{t.push(e)}}function object(){if(u.length>0){return}beginScope({})}function property(e){if(u.length>0){return}_=e}function endScope(){if(u.length>0){return}if(c.length>1){c.pop()}}function end(){if(l){const t=p.pause();p.removeAllListeners();s.set(e,{emitter:p,resume:t})}if(u.length>0){return d(u[0])}if(f){c[0]=transform(c[0],"")}h(c[0])}function transform(e,t){if(e&&typeof e==="object"){Object.entries(e).forEach(([t,n])=>{e[t]=transform(n,t)})}return f(t,e)}function error(e){u.push(e)}function endLine(){if(c.length>0){end()}}}},7358:(e,t,n)=>{"use strict";e.exports=((e={})=>e.Promise||n(5229))},3909:(e,t,n)=>{"use strict";const r=n(5747);const i=n(6619);e.exports=read;function read(e,t){return i(r.createReadStream(e,t),{...t,ndjson:false})}},4756:(e,t,n)=>{"use strict";const r=n(1669);const i=n(2413).Readable;const o=n(2950);r.inherits(BfjStream,i);e.exports=BfjStream;function BfjStream(e,t){if(o.not.instanceStrict(this,BfjStream)){return new BfjStream(e)}o.assert.function(e,"Invalid read implementation");this._read=function(){e()};return i.call(this,t)}},5651:(e,t,n)=>{"use strict";const r=n(2950);const i=n(6682);const o=n(6351);const a=n(3235);const s=n(7030);const u=n(7358);const c=n(6638);const f=1024;e.exports=streamify;function streamify(e,t={}){const n=i(e,t);const r=new s(t.bufferLength||f);const l=u(t);const p=normaliseSpace(t);let h;const{highWaterMark:d}=t;if(d){h={highWaterMark:d}}const _=new a(read,h);let v=true;let y=0;let g="";let m;let b=false;let w;let C=0;let E=l.resolve();let S;n.on(o.array,noRacing(array));n.on(o.object,noRacing(object));n.on(o.property,noRacing(property));n.on(o.string,noRacing(string));n.on(o.number,noRacing(value));n.on(o.literal,noRacing(value));n.on(o.endArray,noRacing(endArray));n.on(o.endObject,noRacing(endObject));n.on(o.end,noRacing(end));n.on(o.error,noRacing(error));n.on(o.dataError,noRacing(dataError));return _;function read(){if(v){v=false;if(m){if(C>0){after()}return endStream()}}if(b){after()}}function after(){if(v){return}let e;for(e=0;eE=E.then(()=>e(t))}function array(){return beforeScope().then(()=>addJson("[")).then(()=>afterScope())}function beforeScope(){return before(true)}function before(e){if(w){w=false;if(p){return addJson(" ")}return l.resolve()}return l.resolve().then(()=>{if(S){if(e){S=false}return addJson(",")}if(!e){S=true}}).then(()=>{if(p&&g){return indent()}})}function addJson(e){if(C+1<=r.length){r[y+C++]=e;after();return l.resolve()}b=true;return new l(t=>{const i=n.pause();c({interval:-10,until(){return C+1<=r.length},pass(){b=false;r[y+C++]=e;t();setImmediate(i)}})})}function indent(){return addJson(`\n${g}`)}function afterScope(){S=false;if(p){g+=p}}function object(){return beforeScope().then(()=>addJson("{")).then(()=>afterScope())}function property(e){return before().then(()=>addJson(`"${e}":`)).then(()=>{w=true})}function string(e){return value(`"${e}"`)}function value(e){return before().then(()=>addJson(`${e}`))}function endArray(){return beforeScopeEnd().then(()=>addJson("]")).then(()=>afterScopeEnd())}function beforeScopeEnd(){if(p){g=g.substr(p.length);return indent()}return l.resolve()}function afterScopeEnd(){S=true}function endObject(){return beforeScopeEnd().then(()=>addJson("}")).then(()=>afterScopeEnd())}function end(){after();m=true;endStream()}function error(e){_.emit("error",e)}function dataError(e){_.emit("dataError",e)}}function normaliseSpace(e){if(r.positive(e.space)){return new Array(e.space+1).join(" ")}if(r.nonEmptyString(e.space)){return e.space}}},6790:(e,t,n)=>{"use strict";const r=n(7358);const i=n(5651);e.exports=stringify;function stringify(e,t){const n=[];const o=r(t);const a=i(e,t);let s,u;a.on("data",read);a.on("end",end);a.on("error",error);a.on("dataError",error);return new o((e,t)=>{s=e;u=t});function read(e){n.push(e)}function end(){s(n.join(""))}function error(e){u(e)}}},6232:(e,t,n)=>{"use strict";const r=n(2413);const i=n(2950);const o=n(6619);e.exports=unpipe;function unpipe(e,t){i.assert.function(e,"Invalid callback argument");const n=new r.PassThrough;o(n,{...t,ndjson:false}).then(t=>e(null,t)).catch(t=>e(t));return n}},3312:(e,t,n)=>{"use strict";const r=n(2950);const i=n(9075);const o=n(8614).EventEmitter;const a=n(6351);const s=n(7358);const u={obj:"}",arr:"]"};const c={'"':'"',"\\":"\\","/":"/",b:"\b",f:"\f",n:"\n",r:"\r",t:"\t"};e.exports=initialise;function initialise(e,t={}){r.assert.instanceStrict(e,n(2413).Readable,"Invalid stream argument");const f={line:1,column:1};const l=new o;const p={arr:value,obj:property};const h=[];const d=[];const _={};const v=s(t);const y=[];const g=t.yieldRate||16384;const m=!!t.ndjson;let b=0;let w=false;let C=false;let E=false;let S=false;let P=true;let A=0;let k;let F;let j;e.setEncoding("utf8");e.on("data",readStream);e.on("end",endStream);e.on("error",e=>{l.emit(a.error,e);endStream()});l.pause=(()=>{let e;F=new v(t=>e=t);return()=>{F=null;A=0;if(m&&w&&E){emit(a.end)}else{e()}}});return l;function readStream(e){addChunk(e);if(C){return resume()}C=true;value()}function addChunk(e){h.push(e);const t=e.length;d.push({item:t,aggregate:length()+t})}function length(){const e=d.length;if(e===0){return 0}return d[e-1].aggregate}function value(){if(++A%g!==0){return _do()}return new v(e=>{setImmediate(()=>_do().then(e))});function _do(){return awaitNonWhitespace().then(next).then(handleValue).catch(()=>{})}}function awaitNonWhitespace(){return wait();function wait(){return awaitCharacter().then(step)}function step(){if(isWhitespace(character())){return next().then(wait)}}}function awaitCharacter(){let e,t;if(b{e=n;t=r});function after(){if(bb){return j=h[0][b]}const e=d.length;for(let t=1;tb){return j=h[t][b+n-e]}}}function isWhitespace(e){switch(e){case"\n":if(m&&y.length===0){return false}case" ":case"\t":case"\r":return true}return false}function next(){return awaitCharacter().then(after);function after(){const e=character();j=null;b+=1;_.line=f.line;_.column=f.column;if(e==="\n"){f.line+=1;f.column=1}else{f.column+=1}if(b>d[0].aggregate){h.shift();const e=d.shift().item;b-=e;d.forEach(t=>t.aggregate-=e)}return e}}function handleValue(e){if(m&&y.length===0){if(e==="\n"){P=true;return emit(a.endLine).then(value)}if(!P){return fail(e,"\n",_).then(value)}P=false}switch(e){case"[":return array();case"{":return object();case'"':return string();case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":case"-":case".":return number(e);case"f":return literalFalse();case"n":return literalNull();case"t":return literalTrue();default:return fail(e,"value",_).then(value)}}function array(){return scope(a.array,value)}function scope(e,t){return emit(e).then(()=>{y.push(e);return endScope(e)}).then(t)}function emit(...e){return(F||v.resolve()).then(()=>{try{l.emit(...e)}catch(e){try{l.emit(a.error,e)}catch(e){}}})}function endScope(e){return awaitNonWhitespace().then(()=>{if(character()===u[e]){return emit(a.endPrefix+e).then(()=>{y.pop();return next()}).then(endValue)}}).catch(endWalk)}function endValue(){return awaitNonWhitespace().then(after).catch(endWalk);function after(){if(y.length===0){if(m){return value()}return fail(character(),"EOF",f).then(value)}return checkScope()}function checkScope(){const e=y[y.length-1];const t=p[e];return endScope(e).then(()=>{if(y.length>0){return checkCharacter(character(),",",f)}}).then(e=>{if(e){return next()}}).then(t)}}function fail(e,t,n){return emit(a.dataError,i.create(e,t,n.line,n.column))}function checkCharacter(e,t,n){if(e===t){return v.resolve(true)}return fail(e,t,n).then(false)}function object(){return scope(a.object,property)}function property(){return awaitNonWhitespace().then(next).then(propertyName)}function propertyName(e){return checkCharacter(e,'"',_).then(()=>walkString(a.property)).then(awaitNonWhitespace).then(next).then(propertyValue)}function propertyValue(e){return checkCharacter(e,":",_).then(value)}function walkString(e){let t=false;const n=[];S=true;return next().then(step);function step(r){if(t){t=false;return escape(r).then(e=>{n.push(e);return next().then(step)})}if(r==="\\"){t=true;return next().then(step)}if(r!=='"'){n.push(r);return next().then(step)}S=false;return emit(e,n.join(""))}}function escape(e){if(c[e]){return v.resolve(c[e])}if(e==="u"){return escapeHex()}return fail(e,"escape character",_).then(()=>`\\${e}`)}function escapeHex(){let e=[];return next().then(step.bind(null,0));function step(t,n){if(isHexit(n)){e.push(n)}if(t<3){return next().then(step.bind(null,t+1))}e=e.join("");if(e.length===4){return String.fromCharCode(parseInt(e,16))}return fail(n,"hex digit",_).then(()=>`\\u${e}${n}`)}}function string(){return walkString(a.string).then(endValue)}function number(e){let t=[e];return walkDigits().then(addDigits.bind(null,checkDecimalPlace));function addDigits(e,n){t=t.concat(n.digits);if(n.atEnd){return endNumber()}return e()}function checkDecimalPlace(){if(character()==="."){return next().then(e=>{t.push(e);return walkDigits()}).then(addDigits.bind(null,checkExponent))}return checkExponent()}function checkExponent(){if(character()==="e"||character()==="E"){return next().then(e=>{t.push(e);return awaitCharacter()}).then(checkSign).catch(fail.bind(null,"EOF","exponent",f))}return endNumber()}function checkSign(){if(character()==="+"||character()==="-"){return next().then(e=>{t.push(e);return readExponent()})}return readExponent()}function readExponent(){return walkDigits().then(addDigits.bind(null,endNumber))}function endNumber(){return emit(a.number,parseFloat(t.join(""))).then(endValue)}}function walkDigits(){const e=[];return wait();function wait(){return awaitCharacter().then(step).catch(atEnd)}function step(){if(isDigit(character())){return next().then(t=>{e.push(t);return wait()})}return{digits:e,atEnd:false}}function atEnd(){return{digits:e,atEnd:true}}}function literalFalse(){return literal(["a","l","s","e"],false)}function literal(e,t){let n,r,i;return wait();function wait(){return awaitCharacter().then(step).catch(atEnd)}function step(){if(i||e.length===0){return atEnd()}return next().then(afterNext)}function atEnd(){return v.resolve().then(()=>{if(i){return fail(n,r,_)}if(e.length>0){return fail("EOF",e.shift(),f)}return done()}).then(endValue)}function afterNext(t){n=t;r=e.shift();if(n!==r){i=true}return wait()}function done(){return emit(a.literal,t)}}function literalNull(){return literal(["u","l","l"],null)}function literalTrue(){return literal(["r","u","e"],true)}function endStream(){w=true;if(C){return resume()}endWalk()}function resume(){if(k){k();k=null}}function endWalk(){if(E){return v.resolve()}E=true;return v.resolve().then(()=>{if(S){return fail("EOF",'"',f)}}).then(popScopes).then(()=>emit(a.end))}function popScopes(){if(y.length===0){return v.resolve()}return fail("EOF",u[y.pop()],f).then(popScopes)}}function isHexit(e){return isDigit(e)||isInRange(e,"A","F")||isInRange(e,"a","f")}function isDigit(e){return isInRange(e,"0","9")}function isInRange(e,t,n){const r=e.charCodeAt(0);return r>=t.charCodeAt(0)&&r<=n.charCodeAt(0)}},582:(e,t,n)=>{"use strict";const r=n(5747);const i=n(7358);const o=n(5651);e.exports=write;function write(e,t,n){const a=i(n);return new a((i,a)=>{o(t,n).pipe(r.createWriteStream(e,n)).on("finish",()=>{i()}).on("error",a).on("dataError",a)})}},5801:e=>{"use strict";e.exports=function(e){var t=e._SomePromiseArray;function any(e){var n=new t(e);var r=n.promise();n.setHowMany(1);n.setUnwrap();n.init();return r}e.any=function(e){return any(e)};e.prototype.any=function(){return any(this)}}},9952:(e,t,n)=>{"use strict";var r;try{throw new Error}catch(e){r=e}var i=n(7254);var o=n(3172);function Async(){this._customScheduler=false;this._isTickUsed=false;this._lateQueue=new o(16);this._normalQueue=new o(16);this._haveDrainedQueues=false;var e=this;this.drainQueues=function(){e._drainQueues()};this._schedule=i}Async.prototype.setScheduler=function(e){var t=this._schedule;this._schedule=e;this._customScheduler=true;return t};Async.prototype.hasCustomScheduler=function(){return this._customScheduler};Async.prototype.haveItemsQueued=function(){return this._isTickUsed||this._haveDrainedQueues};Async.prototype.fatalError=function(e,t){if(t){process.stderr.write("Fatal "+(e instanceof Error?e.stack:e)+"\n");process.exit(2)}else{this.throwLater(e)}};Async.prototype.throwLater=function(e,t){if(arguments.length===1){t=e;e=function(){throw t}}if(typeof setTimeout!=="undefined"){setTimeout(function(){e(t)},0)}else try{this._schedule(function(){e(t)})}catch(e){throw new Error("No async scheduler available\n\n See http://goo.gl/MqrFmX\n")}};function AsyncInvokeLater(e,t,n){this._lateQueue.push(e,t,n);this._queueTick()}function AsyncInvoke(e,t,n){this._normalQueue.push(e,t,n);this._queueTick()}function AsyncSettlePromises(e){this._normalQueue._pushOne(e);this._queueTick()}Async.prototype.invokeLater=AsyncInvokeLater;Async.prototype.invoke=AsyncInvoke;Async.prototype.settlePromises=AsyncSettlePromises;function _drainQueue(e){while(e.length()>0){_drainQueueStep(e)}}function _drainQueueStep(e){var t=e.shift();if(typeof t!=="function"){t._settlePromises()}else{var n=e.shift();var r=e.shift();t.call(n,r)}}Async.prototype._drainQueues=function(){_drainQueue(this._normalQueue);this._reset();this._haveDrainedQueues=true;_drainQueue(this._lateQueue)};Async.prototype._queueTick=function(){if(!this._isTickUsed){this._isTickUsed=true;this._schedule(this.drainQueues)}};Async.prototype._reset=function(){this._isTickUsed=false};e.exports=Async;e.exports.firstLineError=r},1273:e=>{"use strict";e.exports=function(e,t,n,r){var i=false;var o=function(e,t){this._reject(t)};var a=function(e,t){t.promiseRejectionQueued=true;t.bindingPromise._then(o,o,null,this,e)};var s=function(e,t){if((this._bitField&50397184)===0){this._resolveCallback(t.target)}};var u=function(e,t){if(!t.promiseRejectionQueued)this._reject(e)};e.prototype.bind=function(o){if(!i){i=true;e.prototype._propagateFrom=r.propagateFromFunction();e.prototype._boundValue=r.boundValueFunction()}var c=n(o);var f=new e(t);f._propagateFrom(this,1);var l=this._target();f._setBoundTo(c);if(c instanceof e){var p={promiseRejectionQueued:false,promise:f,target:l,bindingPromise:c};l._then(t,a,undefined,f,p);c._then(s,u,undefined,f,p);f._setOnCancel(c)}else{f._resolveCallback(l)}return f};e.prototype._setBoundTo=function(e){if(e!==undefined){this._bitField=this._bitField|2097152;this._boundTo=e}else{this._bitField=this._bitField&~2097152}};e.prototype._isBound=function(){return(this._bitField&2097152)===2097152};e.bind=function(t,n){return e.resolve(n).bind(t)}}},5229:(e,t,n)=>{"use strict";var r;if(typeof Promise!=="undefined")r=Promise;function noConflict(){try{if(Promise===i)Promise=r}catch(e){}return i}var i=n(5175)();i.noConflict=noConflict;e.exports=i},8779:(e,t,n)=>{"use strict";var r=Object.create;if(r){var i=r(null);var o=r(null);i[" size"]=o[" size"]=0}e.exports=function(e){var t=n(6587);var r=t.canEvaluate;var a=t.isIdentifier;var s;var u;if(true){var c=function(e){return new Function("ensureMethod"," \n return function(obj) { \n 'use strict' \n var len = this.length; \n ensureMethod(obj, 'methodName'); \n switch(len) { \n case 1: return obj.methodName(this[0]); \n case 2: return obj.methodName(this[0], this[1]); \n case 3: return obj.methodName(this[0], this[1], this[2]); \n case 0: return obj.methodName(); \n default: \n return obj.methodName.apply(obj, this); \n } \n }; \n ".replace(/methodName/g,e))(ensureMethod)};var f=function(e){return new Function("obj"," \n 'use strict'; \n return obj.propertyName; \n ".replace("propertyName",e))};var l=function(e,t,n){var r=n[e];if(typeof r!=="function"){if(!a(e)){return null}r=t(e);n[e]=r;n[" size"]++;if(n[" size"]>512){var i=Object.keys(n);for(var o=0;o<256;++o)delete n[i[o]];n[" size"]=i.length-256}}return r};s=function(e){return l(e,c,i)};u=function(e){return l(e,f,o)}}function ensureMethod(n,r){var i;if(n!=null)i=n[r];if(typeof i!=="function"){var o="Object "+t.classString(n)+" has no method '"+t.toString(r)+"'";throw new e.TypeError(o)}return i}function caller(e){var t=this.pop();var n=ensureMethod(e,t);return n.apply(e,this)}e.prototype.call=function(e){var t=arguments.length;var n=new Array(Math.max(t-1,0));for(var i=1;i{"use strict";e.exports=function(e,t,r,i){var o=n(6587);var a=o.tryCatch;var s=o.errorObj;var u=e._async;e.prototype["break"]=e.prototype.cancel=function(){if(!i.cancellation())return this._warn("cancellation is disabled");var e=this;var t=e;while(e._isCancellable()){if(!e._cancelBy(t)){if(t._isFollowing()){t._followee().cancel()}else{t._cancelBranched()}break}var n=e._cancellationParent;if(n==null||!n._isCancellable()){if(e._isFollowing()){e._followee().cancel()}else{e._cancelBranched()}break}else{if(e._isFollowing())e._followee().cancel();e._setWillBeCancelled();t=e;e=n}}};e.prototype._branchHasCancelled=function(){this._branchesRemainingToCancel--};e.prototype._enoughBranchesHaveCancelled=function(){return this._branchesRemainingToCancel===undefined||this._branchesRemainingToCancel<=0};e.prototype._cancelBy=function(e){if(e===this){this._branchesRemainingToCancel=0;this._invokeOnCancel();return true}else{this._branchHasCancelled();if(this._enoughBranchesHaveCancelled()){this._invokeOnCancel();return true}}return false};e.prototype._cancelBranched=function(){if(this._enoughBranchesHaveCancelled()){this._cancel()}};e.prototype._cancel=function(){if(!this._isCancellable())return;this._setCancelled();u.invoke(this._cancelPromises,this,undefined)};e.prototype._cancelPromises=function(){if(this._length()>0)this._settlePromises()};e.prototype._unsetOnCancel=function(){this._onCancelField=undefined};e.prototype._isCancellable=function(){return this.isPending()&&!this._isCancelled()};e.prototype.isCancellable=function(){return this.isPending()&&!this.isCancelled()};e.prototype._doInvokeOnCancel=function(e,t){if(o.isArray(e)){for(var n=0;n{"use strict";e.exports=function(e){var t=n(6587);var r=n(9048).keys;var i=t.tryCatch;var o=t.errorObj;function catchFilter(n,a,s){return function(u){var c=s._boundValue();e:for(var f=0;f{"use strict";e.exports=function(e){var t=false;var n=[];e.prototype._promiseCreated=function(){};e.prototype._pushContext=function(){};e.prototype._popContext=function(){return null};e._peekContext=e.prototype._peekContext=function(){};function Context(){this._trace=new Context.CapturedTrace(peekContext())}Context.prototype._pushContext=function(){if(this._trace!==undefined){this._trace._promiseCreated=null;n.push(this._trace)}};Context.prototype._popContext=function(){if(this._trace!==undefined){var e=n.pop();var t=e._promiseCreated;e._promiseCreated=null;return t}return null};function createContext(){if(t)return new Context}function peekContext(){var e=n.length-1;if(e>=0){return n[e]}return undefined}Context.CapturedTrace=null;Context.create=createContext;Context.deactivateLongStackTraces=function(){};Context.activateLongStackTraces=function(){var n=e.prototype._pushContext;var r=e.prototype._popContext;var i=e._peekContext;var o=e.prototype._peekContext;var a=e.prototype._promiseCreated;Context.deactivateLongStackTraces=function(){e.prototype._pushContext=n;e.prototype._popContext=r;e._peekContext=i;e.prototype._peekContext=o;e.prototype._promiseCreated=a;t=false};t=true;e.prototype._pushContext=Context.prototype._pushContext;e.prototype._popContext=Context.prototype._popContext;e._peekContext=e.prototype._peekContext=peekContext;e.prototype._promiseCreated=function(){var e=this._peekContext();if(e&&e._promiseCreated==null)e._promiseCreated=this}};return Context}},4776:(e,t,n)=>{"use strict";e.exports=function(e,t,r,i){var o=e._async;var a=n(9640).Warning;var s=n(6587);var u=n(9048);var c=s.canAttachTrace;var f;var l;var p=/[\\\/]bluebird[\\\/]js[\\\/](release|debug|instrumented)/;var h=/\((?:timers\.js):\d+:\d+\)/;var d=/[\/<\(](.+?):(\d+):(\d+)\)?\s*$/;var _=null;var v=null;var y=false;var g;var m=!!(s.env("BLUEBIRD_DEBUG")!=0&&(false||s.env("BLUEBIRD_DEBUG")||s.env("NODE_ENV")==="development"));var b=!!(s.env("BLUEBIRD_WARNINGS")!=0&&(m||s.env("BLUEBIRD_WARNINGS")));var w=!!(s.env("BLUEBIRD_LONG_STACK_TRACES")!=0&&(m||s.env("BLUEBIRD_LONG_STACK_TRACES")));var C=s.env("BLUEBIRD_W_FORGOTTEN_RETURN")!=0&&(b||!!s.env("BLUEBIRD_W_FORGOTTEN_RETURN"));var E;(function(){var t=[];function unhandledRejectionCheck(){for(var e=0;e0};e.prototype._setRejectionIsUnhandled=function(){this._bitField=this._bitField|1048576};e.prototype._unsetRejectionIsUnhandled=function(){this._bitField=this._bitField&~1048576;if(this._isUnhandledRejectionNotified()){this._unsetUnhandledRejectionIsNotified();this._notifyUnhandledRejectionIsHandled()}};e.prototype._isRejectionUnhandled=function(){return(this._bitField&1048576)>0};e.prototype._warn=function(e,t,n){return warn(e,t,n||this)};e.onPossiblyUnhandledRejection=function(t){var n=e._getContext();l=s.contextBind(n,t)};e.onUnhandledRejectionHandled=function(t){var n=e._getContext();f=s.contextBind(n,t)};var S=function(){};e.longStackTraces=function(){if(o.haveItemsQueued()&&!M.longStackTraces){throw new Error("cannot enable long stack traces after promises have been created\n\n See http://goo.gl/MqrFmX\n")}if(!M.longStackTraces&&longStackTracesIsSupported()){var n=e.prototype._captureStackTrace;var r=e.prototype._attachExtraTrace;var i=e.prototype._dereferenceTrace;M.longStackTraces=true;S=function(){if(o.haveItemsQueued()&&!M.longStackTraces){throw new Error("cannot enable long stack traces after promises have been created\n\n See http://goo.gl/MqrFmX\n")}e.prototype._captureStackTrace=n;e.prototype._attachExtraTrace=r;e.prototype._dereferenceTrace=i;t.deactivateLongStackTraces();M.longStackTraces=false};e.prototype._captureStackTrace=longStackTracesCaptureStackTrace;e.prototype._attachExtraTrace=longStackTracesAttachExtraTrace;e.prototype._dereferenceTrace=longStackTracesDereferenceTrace;t.activateLongStackTraces()}};e.hasLongStackTraces=function(){return M.longStackTraces&&longStackTracesIsSupported()};var P={unhandledrejection:{before:function(){var e=s.global.onunhandledrejection;s.global.onunhandledrejection=null;return e},after:function(e){s.global.onunhandledrejection=e}},rejectionhandled:{before:function(){var e=s.global.onrejectionhandled;s.global.onrejectionhandled=null;return e},after:function(e){s.global.onrejectionhandled=e}}};var A=function(){var e=function(e,t){if(e){var n;try{n=e.before();return!s.global.dispatchEvent(t)}finally{e.after(n)}}else{return!s.global.dispatchEvent(t)}};try{if(typeof CustomEvent==="function"){var t=new CustomEvent("CustomEvent");s.global.dispatchEvent(t);return function(t,n){t=t.toLowerCase();var r={detail:n,cancelable:true};var i=new CustomEvent(t,r);u.defineProperty(i,"promise",{value:n.promise});u.defineProperty(i,"reason",{value:n.reason});return e(P[t],i)}}else if(typeof Event==="function"){var t=new Event("CustomEvent");s.global.dispatchEvent(t);return function(t,n){t=t.toLowerCase();var r=new Event(t,{cancelable:true});r.detail=n;u.defineProperty(r,"promise",{value:n.promise});u.defineProperty(r,"reason",{value:n.reason});return e(P[t],r)}}else{var t=document.createEvent("CustomEvent");t.initCustomEvent("testingtheevent",false,true,{});s.global.dispatchEvent(t);return function(t,n){t=t.toLowerCase();var r=document.createEvent("CustomEvent");r.initCustomEvent(t,false,true,n);return e(P[t],r)}}}catch(e){}return function(){return false}}();var k=function(){if(s.isNode){return function(){return process.emit.apply(process,arguments)}}else{if(!s.global){return function(){return false}}return function(e){var t="on"+e.toLowerCase();var n=s.global[t];if(!n)return false;n.apply(s.global,[].slice.call(arguments,1));return true}}}();function generatePromiseLifecycleEventObject(e,t){return{promise:t}}var F={promiseCreated:generatePromiseLifecycleEventObject,promiseFulfilled:generatePromiseLifecycleEventObject,promiseRejected:generatePromiseLifecycleEventObject,promiseResolved:generatePromiseLifecycleEventObject,promiseCancelled:generatePromiseLifecycleEventObject,promiseChained:function(e,t,n){return{promise:t,child:n}},warning:function(e,t){return{warning:t}},unhandledRejection:function(e,t,n){return{reason:t,promise:n}},rejectionHandled:generatePromiseLifecycleEventObject};var j=function(e){var t=false;try{t=k.apply(null,arguments)}catch(e){o.throwLater(e);t=true}var n=false;try{n=A(e,F[e].apply(null,arguments))}catch(e){o.throwLater(e);n=true}return n||t};e.config=function(t){t=Object(t);if("longStackTraces"in t){if(t.longStackTraces){e.longStackTraces()}else if(!t.longStackTraces&&e.hasLongStackTraces()){S()}}if("warnings"in t){var n=t.warnings;M.warnings=!!n;C=M.warnings;if(s.isObject(n)){if("wForgottenReturn"in n){C=!!n.wForgottenReturn}}}if("cancellation"in t&&t.cancellation&&!M.cancellation){if(o.haveItemsQueued()){throw new Error("cannot enable cancellation after promises are in use")}e.prototype._clearCancellationData=cancellationClearCancellationData;e.prototype._propagateFrom=cancellationPropagateFrom;e.prototype._onCancel=cancellationOnCancel;e.prototype._setOnCancel=cancellationSetOnCancel;e.prototype._attachCancellationCallback=cancellationAttachCancellationCallback;e.prototype._execute=cancellationExecute;x=cancellationPropagateFrom;M.cancellation=true}if("monitoring"in t){if(t.monitoring&&!M.monitoring){M.monitoring=true;e.prototype._fireEvent=j}else if(!t.monitoring&&M.monitoring){M.monitoring=false;e.prototype._fireEvent=defaultFireEvent}}if("asyncHooks"in t&&s.nodeSupportsAsyncResource){var a=M.asyncHooks;var u=!!t.asyncHooks;if(a!==u){M.asyncHooks=u;if(u){r()}else{i()}}}return e};function defaultFireEvent(){return false}e.prototype._fireEvent=defaultFireEvent;e.prototype._execute=function(e,t,n){try{e(t,n)}catch(e){return e}};e.prototype._onCancel=function(){};e.prototype._setOnCancel=function(e){};e.prototype._attachCancellationCallback=function(e){};e.prototype._captureStackTrace=function(){};e.prototype._attachExtraTrace=function(){};e.prototype._dereferenceTrace=function(){};e.prototype._clearCancellationData=function(){};e.prototype._propagateFrom=function(e,t){};function cancellationExecute(e,t,n){var r=this;try{e(t,n,function(e){if(typeof e!=="function"){throw new TypeError("onCancel must be a function, got: "+s.toString(e))}r._attachCancellationCallback(e)})}catch(e){return e}}function cancellationAttachCancellationCallback(e){if(!this._isCancellable())return this;var t=this._onCancel();if(t!==undefined){if(s.isArray(t)){t.push(e)}else{this._setOnCancel([t,e])}}else{this._setOnCancel(e)}}function cancellationOnCancel(){return this._onCancelField}function cancellationSetOnCancel(e){this._onCancelField=e}function cancellationClearCancellationData(){this._cancellationParent=undefined;this._onCancelField=undefined}function cancellationPropagateFrom(e,t){if((t&1)!==0){this._cancellationParent=e;var n=e._branchesRemainingToCancel;if(n===undefined){n=0}e._branchesRemainingToCancel=n+1}if((t&2)!==0&&e._isBound()){this._setBoundTo(e._boundTo)}}function bindingPropagateFrom(e,t){if((t&2)!==0&&e._isBound()){this._setBoundTo(e._boundTo)}}var x=bindingPropagateFrom;function boundValueFunction(){var t=this._boundTo;if(t!==undefined){if(t instanceof e){if(t.isFulfilled()){return t.value()}else{return undefined}}}return t}function longStackTracesCaptureStackTrace(){this._trace=new CapturedTrace(this._peekContext())}function longStackTracesAttachExtraTrace(e,t){if(c(e)){var n=this._trace;if(n!==undefined){if(t)n=n._parent}if(n!==undefined){n.attachExtraTrace(e)}else if(!e.__stackCleaned__){var r=parseStackAndMessage(e);s.notEnumerableProp(e,"stack",r.message+"\n"+r.stack.join("\n"));s.notEnumerableProp(e,"__stackCleaned__",true)}}}function longStackTracesDereferenceTrace(){this._trace=undefined}function checkForgottenReturns(e,t,n,r,i){if(e===undefined&&t!==null&&C){if(i!==undefined&&i._returnedNonUndefined())return;if((r._bitField&65535)===0)return;if(n)n=n+" ";var o="";var a="";if(t._trace){var s=t._trace.stack.split("\n");var u=cleanStack(s);for(var c=u.length-1;c>=0;--c){var f=u[c];if(!h.test(f)){var l=f.match(d);if(l){o="at "+l[1]+":"+l[2]+":"+l[3]+" "}break}}if(u.length>0){var p=u[0];for(var c=0;c0){a="\n"+s[c-1]}break}}}}var _="a promise was created in a "+n+"handler "+o+"but was not returned from it, "+"see http://goo.gl/rRqMUw"+a;r._warn(_,true,t)}}function deprecated(e,t){var n=e+" is deprecated and will be removed in a future version.";if(t)n+=" Use "+t+" instead.";return warn(n)}function warn(t,n,r){if(!M.warnings)return;var i=new a(t);var o;if(n){r._attachExtraTrace(i)}else if(M.longStackTraces&&(o=e._peekContext())){o.attachExtraTrace(i)}else{var s=parseStackAndMessage(i);i.stack=s.message+"\n"+s.stack.join("\n")}if(!j("warning",i)){formatAndLogError(i,"",true)}}function reconstructStack(e,t){for(var n=0;n=0;--s){if(r[s]===o){a=s;break}}for(var s=a;s>=0;--s){var u=r[s];if(t[i]===u){t.pop();i--}else{break}}t=r}}function cleanStack(e){var t=[];for(var n=0;n0&&e.name!="SyntaxError"){t=t.slice(n)}return t}function parseStackAndMessage(e){var t=e.stack;var n=e.toString();t=typeof t==="string"&&t.length>0?stackFramesAsArray(e):[" (No stack trace)"];return{message:n,stack:e.name=="SyntaxError"?t:cleanStack(t)}}function formatAndLogError(e,t,n){if(typeof console!=="undefined"){var r;if(s.isObject(e)){var i=e.stack;r=t+v(i,e)}else{r=t+String(e)}if(typeof g==="function"){g(r,n)}else if(typeof console.log==="function"||typeof console.log==="object"){console.log(r)}}}function fireRejectionEvent(e,t,n,r){var i=false;try{if(typeof t==="function"){i=true;if(e==="rejectionHandled"){t(r)}else{t(n,r)}}}catch(e){o.throwLater(e)}if(e==="unhandledRejection"){if(!j(e,n,r)&&!i){formatAndLogError(n,"Unhandled rejection ")}}else{j(e,r)}}function formatNonError(e){var t;if(typeof e==="function"){t="[function "+(e.name||"anonymous")+"]"}else{t=e&&typeof e.toString==="function"?e.toString():s.toString(e);var n=/\[object [a-zA-Z0-9$_]+\]/;if(n.test(t)){try{var r=JSON.stringify(e);t=r}catch(e){}}if(t.length===0){t="(empty array)"}}return"(<"+snip(t)+">, no stack trace)"}function snip(e){var t=41;if(e.length=o){return}T=function(e){if(p.test(e))return true;var t=parseLineInfo(e);if(t){if(t.fileName===a&&(i<=t.line&&t.line<=o)){return true}}return false}}function CapturedTrace(e){this._parent=e;this._promisesCreated=0;var t=this._length=1+(e===undefined?0:e._length);O(this,CapturedTrace);if(t>32)this.uncycle()}s.inherits(CapturedTrace,Error);t.CapturedTrace=CapturedTrace;CapturedTrace.prototype.uncycle=function(){var e=this._length;if(e<2)return;var t=[];var n={};for(var r=0,i=this;i!==undefined;++r){t.push(i);i=i._parent}e=this._length=r;for(var r=e-1;r>=0;--r){var o=t[r].stack;if(n[o]===undefined){n[o]=r}}for(var r=0;r0){t[s-1]._parent=undefined;t[s-1]._length=1}t[r]._parent=undefined;t[r]._length=1;var u=r>0?t[r-1]:this;if(s=0;--f){t[f]._length=c;c++}return}}};CapturedTrace.prototype.attachExtraTrace=function(e){if(e.__stackCleaned__)return;this.uncycle();var t=parseStackAndMessage(e);var n=t.message;var r=[t.stack];var i=this;while(i!==undefined){r.push(cleanStack(i.stack.split("\n")));i=i._parent}removeCommonRoots(r);removeDuplicateOrEmptyJumps(r);s.notEnumerableProp(e,"stack",reconstructStack(n,r));s.notEnumerableProp(e,"__stackCleaned__",true)};var O=function stackDetection(){var e=/^\s*at\s*/;var t=function(e,t){if(typeof e==="string")return e;if(t.name!==undefined&&t.message!==undefined){return t.toString()}return formatNonError(t)};if(typeof Error.stackTraceLimit==="number"&&typeof Error.captureStackTrace==="function"){Error.stackTraceLimit+=6;_=e;v=t;var n=Error.captureStackTrace;T=function(e){return p.test(e)};return function(e,t){Error.stackTraceLimit+=6;n(e,t);Error.stackTraceLimit-=6}}var r=new Error;if(typeof r.stack==="string"&&r.stack.split("\n")[0].indexOf("stackDetection@")>=0){_=/@/;v=t;y=true;return function captureStackTrace(e){e.stack=(new Error).stack}}var i;try{throw new Error}catch(e){i="stack"in e}if(!("stack"in r)&&i&&typeof Error.stackTraceLimit==="number"){_=e;v=t;return function captureStackTrace(e){Error.stackTraceLimit+=6;try{throw new Error}catch(t){e.stack=t.stack}Error.stackTraceLimit-=6}}v=function(e,t){if(typeof e==="string")return e;if((typeof t==="object"||typeof t==="function")&&t.name!==undefined&&t.message!==undefined){return t.toString()}return formatNonError(t)};return null}([]);if(typeof console!=="undefined"&&typeof console.warn!=="undefined"){g=function(e){console.warn(e)};if(s.isNode&&process.stderr.isTTY){g=function(e,t){var n=t?"":"";console.warn(n+e+"\n")}}else if(!s.isNode&&typeof(new Error).stack==="string"){g=function(e,t){console.warn("%c"+e,t?"color: darkorange":"color: red")}}}var M={warnings:b,longStackTraces:false,cancellation:false,monitoring:false,asyncHooks:false};if(w)e.longStackTraces();return{asyncHooks:function(){return M.asyncHooks},longStackTraces:function(){return M.longStackTraces},warnings:function(){return M.warnings},cancellation:function(){return M.cancellation},monitoring:function(){return M.monitoring},propagateFromFunction:function(){return x},boundValueFunction:function(){return boundValueFunction},checkForgottenReturns:checkForgottenReturns,setBounds:setBounds,warn:warn,deprecated:deprecated,CapturedTrace:CapturedTrace,fireDomEvent:A,fireGlobalEvent:k}}},8925:e=>{"use strict";e.exports=function(e){function returner(){return this.value}function thrower(){throw this.reason}e.prototype["return"]=e.prototype.thenReturn=function(t){if(t instanceof e)t.suppressUnhandledRejections();return this._then(returner,undefined,undefined,{value:t},undefined)};e.prototype["throw"]=e.prototype.thenThrow=function(e){return this._then(thrower,undefined,undefined,{reason:e},undefined)};e.prototype.catchThrow=function(e){if(arguments.length<=1){return this._then(undefined,thrower,undefined,{reason:e},undefined)}else{var t=arguments[1];var n=function(){throw t};return this.caught(e,n)}};e.prototype.catchReturn=function(t){if(arguments.length<=1){if(t instanceof e)t.suppressUnhandledRejections();return this._then(undefined,returner,undefined,{value:t},undefined)}else{var n=arguments[1];if(n instanceof e)n.suppressUnhandledRejections();var r=function(){return n};return this.caught(t,r)}}}},5708:e=>{"use strict";e.exports=function(e,t){var n=e.reduce;var r=e.all;function promiseAllThis(){return r(this)}function PromiseMapSeries(e,r){return n(e,r,t,t)}e.prototype.each=function(e){return n(this,e,t,0)._then(promiseAllThis,undefined,undefined,this,undefined)};e.prototype.mapSeries=function(e){return n(this,e,t,t)};e.each=function(e,r){return n(e,r,t,0)._then(promiseAllThis,undefined,undefined,e,undefined)};e.mapSeries=PromiseMapSeries}},9640:(e,t,n)=>{"use strict";var r=n(9048);var i=r.freeze;var o=n(6587);var a=o.inherits;var s=o.notEnumerableProp;function subError(e,t){function SubError(n){if(!(this instanceof SubError))return new SubError(n);s(this,"message",typeof n==="string"?n:t);s(this,"name",e);if(Error.captureStackTrace){Error.captureStackTrace(this,this.constructor)}else{Error.call(this)}}a(SubError,Error);return SubError}var u,c;var f=subError("Warning","warning");var l=subError("CancellationError","cancellation error");var p=subError("TimeoutError","timeout error");var h=subError("AggregateError","aggregate error");try{u=TypeError;c=RangeError}catch(e){u=subError("TypeError","type error");c=subError("RangeError","range error")}var d=("join pop push shift unshift slice filter forEach some "+"every map indexOf lastIndexOf reduce reduceRight sort reverse").split(" ");for(var _=0;_{var t=function(){"use strict";return this===undefined}();if(t){e.exports={freeze:Object.freeze,defineProperty:Object.defineProperty,getDescriptor:Object.getOwnPropertyDescriptor,keys:Object.keys,names:Object.getOwnPropertyNames,getPrototypeOf:Object.getPrototypeOf,isArray:Array.isArray,isES5:t,propertyIsWritable:function(e,t){var n=Object.getOwnPropertyDescriptor(e,t);return!!(!n||n.writable||n.set)}}}else{var n={}.hasOwnProperty;var r={}.toString;var i={}.constructor.prototype;var o=function(e){var t=[];for(var r in e){if(n.call(e,r)){t.push(r)}}return t};var a=function(e,t){return{value:e[t]}};var s=function(e,t,n){e[t]=n.value;return e};var u=function(e){return e};var c=function(e){try{return Object(e).constructor.prototype}catch(e){return i}};var f=function(e){try{return r.call(e)==="[object Array]"}catch(e){return false}};e.exports={isArray:f,keys:o,names:o,defineProperty:s,getDescriptor:a,freeze:u,getPrototypeOf:c,isES5:t,propertyIsWritable:function(){return true}}}},3359:e=>{"use strict";e.exports=function(e,t){var n=e.map;e.prototype.filter=function(e,r){return n(this,e,r,t)};e.filter=function(e,r,i){return n(e,r,i,t)}}},1371:(e,t,n)=>{"use strict";e.exports=function(e,t,r){var i=n(6587);var o=e.CancellationError;var a=i.errorObj;var s=n(691)(r);function PassThroughHandlerContext(e,t,n){this.promise=e;this.type=t;this.handler=n;this.called=false;this.cancelPromise=null}PassThroughHandlerContext.prototype.isFinallyHandler=function(){return this.type===0};function FinallyHandlerCancelReaction(e){this.finallyHandler=e}FinallyHandlerCancelReaction.prototype._resultCancelled=function(){checkCancel(this.finallyHandler)};function checkCancel(e,t){if(e.cancelPromise!=null){if(arguments.length>1){e.cancelPromise._reject(t)}else{e.cancelPromise._cancel()}e.cancelPromise=null;return true}return false}function succeed(){return finallyHandler.call(this,this.promise._target()._settledValue())}function fail(e){if(checkCancel(this,e))return;a.e=e;return a}function finallyHandler(n){var i=this.promise;var s=this.handler;if(!this.called){this.called=true;var u=this.isFinallyHandler()?s.call(i._boundValue()):s.call(i._boundValue(),n);if(u===r){return u}else if(u!==undefined){i._setReturnedNonUndefined();var c=t(u,i);if(c instanceof e){if(this.cancelPromise!=null){if(c._isCancelled()){var f=new o("late cancellation observer");i._attachExtraTrace(f);a.e=f;return a}else if(c.isPending()){c._attachCancellationCallback(new FinallyHandlerCancelReaction(this))}}return c._then(succeed,fail,undefined,this,undefined)}}}if(i.isRejected()){checkCancel(this);a.e=n;return a}else{checkCancel(this);return n}}e.prototype._passThrough=function(e,t,n,r){if(typeof e!=="function")return this.then();return this._then(n,r,undefined,new PassThroughHandlerContext(this,t,e),undefined)};e.prototype.lastly=e.prototype["finally"]=function(e){return this._passThrough(e,0,finallyHandler,finallyHandler)};e.prototype.tap=function(e){return this._passThrough(e,1,finallyHandler)};e.prototype.tapCatch=function(t){var n=arguments.length;if(n===1){return this._passThrough(t,1,undefined,finallyHandler)}else{var r=new Array(n-1),o=0,a;for(a=0;a{"use strict";e.exports=function(e,t,r,i,o,a){var s=n(9640);var u=s.TypeError;var c=n(6587);var f=c.errorObj;var l=c.tryCatch;var p=[];function promiseFromYieldHandler(t,n,r){for(var o=0;o{"use strict";e.exports=function(e,t,r,i,o){var a=n(6587);var s=a.canEvaluate;var u=a.tryCatch;var c=a.errorObj;var f;if(true){if(s){var l=function(e){return new Function("value","holder"," \n 'use strict'; \n holder.pIndex = value; \n holder.checkFulfillment(this); \n ".replace(/Index/g,e))};var p=function(e){return new Function("promise","holder"," \n 'use strict'; \n holder.pIndex = promise; \n ".replace(/Index/g,e))};var h=function(t){var n=new Array(t);for(var r=0;r0&&typeof arguments[n]==="function"){o=arguments[n];if(true){if(n<=8&&s){var u=new e(i);u._captureStackTrace();var c=d[n-1];var l=new c(o);var p=_;for(var h=0;h{"use strict";e.exports=function(e,t,r,i,o,a){var s=n(6587);var u=s.tryCatch;var c=s.errorObj;var f=e._async;function MappingPromiseArray(t,n,r,i){this.constructor$(t);this._promise._captureStackTrace();var a=e._getContext();this._callback=s.contextBind(a,n);this._preservedValues=i===o?new Array(this.length()):null;this._limit=r;this._inFlight=0;this._queue=[];f.invoke(this._asyncInit,this,undefined);if(s.isArray(t)){for(var u=0;u=1){this._inFlight--;this._drainQueue();if(this._isResolved())return true}}else{if(f>=1&&this._inFlight>=f){r[n]=t;this._queue.push(n);return false}if(s!==null)s[n]=t;var l=this._promise;var p=this._callback;var h=l._boundValue();l._pushContext();var d=u(p).call(h,t,n,o);var _=l._popContext();a.checkForgottenReturns(d,_,s!==null?"Promise.filter":"Promise.map",l);if(d===c){this._reject(d.e);return true}var v=i(d,this._promise);if(v instanceof e){v=v._target();var y=v._bitField;if((y&50397184)===0){if(f>=1)this._inFlight++;r[n]=v;v._proxy(this,(n+1)*-1);return false}else if((y&33554432)!==0){d=v._value()}else if((y&16777216)!==0){this._reject(v._reason());return true}else{this._cancel();return true}}r[n]=d}var g=++this._totalResolved;if(g>=o){if(s!==null){this._filter(r,s)}else{this._resolve(r)}return true}return false};MappingPromiseArray.prototype._drainQueue=function(){var e=this._queue;var t=this._limit;var n=this._values;while(e.length>0&&this._inFlight=1?a:0;return new MappingPromiseArray(t,n,a,o).promise()}e.prototype.map=function(e,t){return map(this,e,t,null)};e.map=function(e,t,n,r){return map(e,t,n,r)}}},3303:(e,t,n)=>{"use strict";e.exports=function(e,t,r,i,o){var a=n(6587);var s=a.tryCatch;e.method=function(n){if(typeof n!=="function"){throw new e.TypeError("expecting a function but got "+a.classString(n))}return function(){var r=new e(t);r._captureStackTrace();r._pushContext();var i=s(n).apply(this,arguments);var a=r._popContext();o.checkForgottenReturns(i,a,"Promise.method",r);r._resolveFromSyncValue(i);return r}};e.attempt=e["try"]=function(n){if(typeof n!=="function"){return i("expecting a function but got "+a.classString(n))}var r=new e(t);r._captureStackTrace();r._pushContext();var u;if(arguments.length>1){o.deprecated("calling Promise.try with more than 1 argument");var c=arguments[1];var f=arguments[2];u=a.isArray(c)?s(n).apply(f,c):s(n).call(f,c)}else{u=s(n)()}var l=r._popContext();o.checkForgottenReturns(u,l,"Promise.try",r);r._resolveFromSyncValue(u);return r};e.prototype._resolveFromSyncValue=function(e){if(e===a.errorObj){this._rejectCallback(e.e,false)}else{this._resolveCallback(e,true)}}}},938:(e,t,n)=>{"use strict";var r=n(6587);var i=r.maybeWrapAsError;var o=n(9640);var a=o.OperationalError;var s=n(9048);function isUntypedError(e){return e instanceof Error&&s.getPrototypeOf(e)===Error.prototype}var u=/^(?:name|message|stack|cause)$/;function wrapAsOperationalError(e){var t;if(isUntypedError(e)){t=new a(e);t.name=e.name;t.message=e.message;t.stack=e.stack;var n=s.keys(e);for(var i=0;i{"use strict";e.exports=function(e){var t=n(6587);var r=e._async;var i=t.tryCatch;var o=t.errorObj;function spreadAdapter(e,n){var a=this;if(!t.isArray(e))return successAdapter.call(a,e,n);var s=i(n).apply(a._boundValue(),[null].concat(e));if(s===o){r.throwLater(s.e)}}function successAdapter(e,t){var n=this;var a=n._boundValue();var s=e===undefined?i(t).call(a,null):i(t).call(a,null,e);if(s===o){r.throwLater(s.e)}}function errorAdapter(e,t){var n=this;if(!e){var a=new Error(e+"");a.cause=e;e=a}var s=i(t).call(n._boundValue(),e);if(s===o){r.throwLater(s.e)}}e.prototype.asCallback=e.prototype.nodeify=function(e,t){if(typeof e=="function"){var n=successAdapter;if(t!==undefined&&Object(t).spread){n=spreadAdapter}this._then(n,errorAdapter,undefined,this,e)}return this}}},5175:(e,t,n)=>{"use strict";e.exports=function(){var t=function(){return new m("circular promise resolution chain\n\n See http://goo.gl/MqrFmX\n")};var r=function(){return new Promise.PromiseInspection(this._target())};var i=function(e){return Promise.reject(new m(e))};function Proxyable(){}var o={};var a=n(6587);a.setReflectHandler(r);var s=function(){var e=process.domain;if(e===undefined){return null}return e};var u=function(){return null};var c=function(){return{domain:s(),async:null}};var f=a.isNode&&a.nodeSupportsAsyncResource?n(7303).AsyncResource:null;var l=function(){return{domain:s(),async:new f("Bluebird::Promise")}};var p=a.isNode?c:u;a.notEnumerableProp(Promise,"_getContext",p);var h=function(){p=l;a.notEnumerableProp(Promise,"_getContext",l)};var d=function(){p=c;a.notEnumerableProp(Promise,"_getContext",c)};var _=n(9048);var v=n(9952);var y=new v;_.defineProperty(Promise,"_async",{value:y});var g=n(9640);var m=Promise.TypeError=g.TypeError;Promise.RangeError=g.RangeError;var b=Promise.CancellationError=g.CancellationError;Promise.TimeoutError=g.TimeoutError;Promise.OperationalError=g.OperationalError;Promise.RejectionError=g.OperationalError;Promise.AggregateError=g.AggregateError;var w=function(){};var C={};var E={};var S=n(3938)(Promise,w);var P=n(3003)(Promise,w,S,i,Proxyable);var A=n(1030)(Promise);var k=A.create;var F=n(4776)(Promise,A,h,d);var j=F.CapturedTrace;var x=n(1371)(Promise,S,E);var T=n(691)(E);var R=n(938);var O=a.errorObj;var M=a.tryCatch;function check(e,t){if(e==null||e.constructor!==Promise){throw new m("the promise constructor cannot be invoked directly\n\n See http://goo.gl/MqrFmX\n")}if(typeof t!=="function"){throw new m("expecting a function but got "+a.classString(t))}}function Promise(e){if(e!==w){check(this,e)}this._bitField=0;this._fulfillmentHandler0=undefined;this._rejectionHandler0=undefined;this._promise0=undefined;this._receiver0=undefined;this._resolveFromExecutor(e);this._promiseCreated();this._fireEvent("promiseCreated",this)}Promise.prototype.toString=function(){return"[object Promise]"};Promise.prototype.caught=Promise.prototype["catch"]=function(e){var t=arguments.length;if(t>1){var n=new Array(t-1),r=0,o;for(o=0;o0&&typeof e!=="function"&&typeof t!=="function"){var n=".then() only accepts functions but was passed: "+a.classString(e);if(arguments.length>1){n+=", "+a.classString(t)}this._warn(n)}return this._then(e,t,undefined,undefined,undefined)};Promise.prototype.done=function(e,t){var n=this._then(e,t,undefined,undefined,undefined);n._setIsFinal()};Promise.prototype.spread=function(e){if(typeof e!=="function"){return i("expecting a function but got "+a.classString(e))}return this.all()._then(e,undefined,undefined,C,undefined)};Promise.prototype.toJSON=function(){var e={isFulfilled:false,isRejected:false,fulfillmentValue:undefined,rejectionReason:undefined};if(this.isFulfilled()){e.fulfillmentValue=this.value();e.isFulfilled=true}else if(this.isRejected()){e.rejectionReason=this.reason();e.isRejected=true}return e};Promise.prototype.all=function(){if(arguments.length>0){this._warn(".all() was passed arguments but it does not take any")}return new P(this).promise()};Promise.prototype.error=function(e){return this.caught(a.originatesFromRejection,e)};Promise.getNewLibraryCopy=e.exports;Promise.is=function(e){return e instanceof Promise};Promise.fromNode=Promise.fromCallback=function(e){var t=new Promise(w);t._captureStackTrace();var n=arguments.length>1?!!Object(arguments[1]).multiArgs:false;var r=M(e)(R(t,n));if(r===O){t._rejectCallback(r.e,true)}if(!t._isFateSealed())t._setAsyncGuaranteed();return t};Promise.all=function(e){return new P(e).promise()};Promise.cast=function(e){var t=S(e);if(!(t instanceof Promise)){t=new Promise(w);t._captureStackTrace();t._setFulfilled();t._rejectionHandler0=e}return t};Promise.resolve=Promise.fulfilled=Promise.cast;Promise.reject=Promise.rejected=function(e){var t=new Promise(w);t._captureStackTrace();t._rejectCallback(e,true);return t};Promise.setScheduler=function(e){if(typeof e!=="function"){throw new m("expecting a function but got "+a.classString(e))}return y.setScheduler(e)};Promise.prototype._then=function(e,t,n,r,i){var o=i!==undefined;var s=o?i:new Promise(w);var u=this._target();var c=u._bitField;if(!o){s._propagateFrom(this,3);s._captureStackTrace();if(r===undefined&&(this._bitField&2097152)!==0){if(!((c&50397184)===0)){r=this._boundValue()}else{r=u===this?undefined:this._boundTo}}this._fireEvent("promiseChained",this,s)}var f=p();if(!((c&50397184)===0)){var l,h,d=u._settlePromiseCtx;if((c&33554432)!==0){h=u._rejectionHandler0;l=e}else if((c&16777216)!==0){h=u._fulfillmentHandler0;l=t;u._unsetRejectionIsUnhandled()}else{d=u._settlePromiseLateCancellationObserver;h=new b("late cancellation observer");u._attachExtraTrace(h);l=t}y.invoke(d,u,{handler:a.contextBind(f,l),promise:s,receiver:r,value:h})}else{u._addCallbacks(e,t,s,r,f)}return s};Promise.prototype._length=function(){return this._bitField&65535};Promise.prototype._isFateSealed=function(){return(this._bitField&117506048)!==0};Promise.prototype._isFollowing=function(){return(this._bitField&67108864)===67108864};Promise.prototype._setLength=function(e){this._bitField=this._bitField&-65536|e&65535};Promise.prototype._setFulfilled=function(){this._bitField=this._bitField|33554432;this._fireEvent("promiseFulfilled",this)};Promise.prototype._setRejected=function(){this._bitField=this._bitField|16777216;this._fireEvent("promiseRejected",this)};Promise.prototype._setFollowing=function(){this._bitField=this._bitField|67108864;this._fireEvent("promiseResolved",this)};Promise.prototype._setIsFinal=function(){this._bitField=this._bitField|4194304};Promise.prototype._isFinal=function(){return(this._bitField&4194304)>0};Promise.prototype._unsetCancelled=function(){this._bitField=this._bitField&~65536};Promise.prototype._setCancelled=function(){this._bitField=this._bitField|65536;this._fireEvent("promiseCancelled",this)};Promise.prototype._setWillBeCancelled=function(){this._bitField=this._bitField|8388608};Promise.prototype._setAsyncGuaranteed=function(){if(y.hasCustomScheduler())return;var e=this._bitField;this._bitField=e|(e&536870912)>>2^134217728};Promise.prototype._setNoAsyncGuarantee=function(){this._bitField=(this._bitField|536870912)&~134217728};Promise.prototype._receiverAt=function(e){var t=e===0?this._receiver0:this[e*4-4+3];if(t===o){return undefined}else if(t===undefined&&this._isBound()){return this._boundValue()}return t};Promise.prototype._promiseAt=function(e){return this[e*4-4+2]};Promise.prototype._fulfillmentHandlerAt=function(e){return this[e*4-4+0]};Promise.prototype._rejectionHandlerAt=function(e){return this[e*4-4+1]};Promise.prototype._boundValue=function(){};Promise.prototype._migrateCallback0=function(e){var t=e._bitField;var n=e._fulfillmentHandler0;var r=e._rejectionHandler0;var i=e._promise0;var a=e._receiverAt(0);if(a===undefined)a=o;this._addCallbacks(n,r,i,a,null)};Promise.prototype._migrateCallbackAt=function(e,t){var n=e._fulfillmentHandlerAt(t);var r=e._rejectionHandlerAt(t);var i=e._promiseAt(t);var a=e._receiverAt(t);if(a===undefined)a=o;this._addCallbacks(n,r,i,a,null)};Promise.prototype._addCallbacks=function(e,t,n,r,i){var o=this._length();if(o>=65535-4){o=0;this._setLength(0)}if(o===0){this._promise0=n;this._receiver0=r;if(typeof e==="function"){this._fulfillmentHandler0=a.contextBind(i,e)}if(typeof t==="function"){this._rejectionHandler0=a.contextBind(i,t)}}else{var s=o*4-4;this[s+2]=n;this[s+3]=r;if(typeof e==="function"){this[s+0]=a.contextBind(i,e)}if(typeof t==="function"){this[s+1]=a.contextBind(i,t)}}this._setLength(o+1);return o};Promise.prototype._proxy=function(e,t){this._addCallbacks(undefined,undefined,t,e,null)};Promise.prototype._resolveCallback=function(e,n){if((this._bitField&117506048)!==0)return;if(e===this)return this._rejectCallback(t(),false);var r=S(e,this);if(!(r instanceof Promise))return this._fulfill(e);if(n)this._propagateFrom(r,2);var i=r._target();if(i===this){this._reject(t());return}var o=i._bitField;if((o&50397184)===0){var a=this._length();if(a>0)i._migrateCallback0(this);for(var s=1;s>>16)return;if(e===this){var r=t();this._attachExtraTrace(r);return this._reject(r)}this._setFulfilled();this._rejectionHandler0=e;if((n&65535)>0){if((n&134217728)!==0){this._settlePromises()}else{y.settlePromises(this)}this._dereferenceTrace()}};Promise.prototype._reject=function(e){var t=this._bitField;if((t&117506048)>>>16)return;this._setRejected();this._fulfillmentHandler0=e;if(this._isFinal()){return y.fatalError(e,a.isNode)}if((t&65535)>0){y.settlePromises(this)}else{this._ensurePossibleRejectionHandled()}};Promise.prototype._fulfillPromises=function(e,t){for(var n=1;n0){if((e&16842752)!==0){var n=this._fulfillmentHandler0;this._settlePromise0(this._rejectionHandler0,n,e);this._rejectPromises(t,n)}else{var r=this._rejectionHandler0;this._settlePromise0(this._fulfillmentHandler0,r,e);this._fulfillPromises(t,r)}this._setLength(0)}this._clearCancellationData()};Promise.prototype._settledValue=function(){var e=this._bitField;if((e&33554432)!==0){return this._rejectionHandler0}else if((e&16777216)!==0){return this._fulfillmentHandler0}};if(typeof Symbol!=="undefined"&&Symbol.toStringTag){_.defineProperty(Promise.prototype,Symbol.toStringTag,{get:function(){return"Object"}})}function deferResolve(e){this.promise._resolveCallback(e)}function deferReject(e){this.promise._rejectCallback(e,false)}Promise.defer=Promise.pending=function(){F.deprecated("Promise.defer","new Promise");var e=new Promise(w);return{promise:e,resolve:deferResolve,reject:deferReject}};a.notEnumerableProp(Promise,"_makeSelfResolutionError",t);n(3303)(Promise,w,S,i,F);n(1273)(Promise,w,S,F);n(7386)(Promise,P,i,F);n(8925)(Promise);n(7659)(Promise);n(9255)(Promise,P,S,w,y);Promise.Promise=Promise;Promise.version="3.7.2";n(8779)(Promise);n(2225)(Promise,i,w,S,Proxyable,F);n(2757)(Promise,P,i,S,w,F);n(733)(Promise);n(7632)(Promise,w);n(4519)(Promise,P,S,i);n(3741)(Promise,w,S,i);n(8773)(Promise,P,i,S,w,F);n(8741)(Promise,P,F);n(5566)(Promise,P,i);n(8329)(Promise,w,F);n(1904)(Promise,i,S,k,w,F);n(5801)(Promise);n(5708)(Promise,w);n(3359)(Promise,w);a.toFastProperties(Promise);a.toFastProperties(Promise.prototype);function fillTypes(e){var t=new Promise(w);t._fulfillmentHandler0=e;t._rejectionHandler0=e;t._promise0=e;t._receiver0=e}fillTypes({a:1});fillTypes({b:2});fillTypes({c:3});fillTypes(1);fillTypes(function(){});fillTypes(undefined);fillTypes(false);fillTypes(new Promise(w));F.setBounds(v.firstLineError,a.lastLineError);return Promise}},3003:(e,t,n)=>{"use strict";e.exports=function(e,t,r,i,o){var a=n(6587);var s=a.isArray;function toResolutionValue(e){switch(e){case-2:return[];case-3:return{};case-6:return new Map}}function PromiseArray(n){var r=this._promise=new e(t);if(n instanceof e){r._propagateFrom(n,3);n.suppressUnhandledRejections()}r._setOnCancel(this);this._values=n;this._length=0;this._totalResolved=0;this._init(undefined,-2)}a.inherits(PromiseArray,o);PromiseArray.prototype.length=function(){return this._length};PromiseArray.prototype.promise=function(){return this._promise};PromiseArray.prototype._init=function init(t,n){var o=r(this._values,this._promise);if(o instanceof e){o=o._target();var s=o._bitField;this._values=o;if((s&50397184)===0){this._promise._setAsyncGuaranteed();return o._then(init,this._reject,undefined,this,n)}else if((s&33554432)!==0){o=o._value()}else if((s&16777216)!==0){return this._reject(o._reason())}else{return this._cancel()}}o=a.asArray(o);if(o===null){var u=i("expecting an array or an iterable object but got "+a.classString(o)).reason();this._promise._rejectCallback(u,false);return}if(o.length===0){if(n===-5){this._resolveEmptyArray()}else{this._resolve(toResolutionValue(n))}return}this._iterate(o)};PromiseArray.prototype._iterate=function(t){var n=this.getActualLength(t.length);this._length=n;this._values=this.shouldCopyValues()?new Array(n):this._values;var i=this._promise;var o=false;var a=null;for(var s=0;s=this._length){this._resolve(this._values);return true}return false};PromiseArray.prototype._promiseCancelled=function(){this._cancel();return true};PromiseArray.prototype._promiseRejected=function(e){this._totalResolved++;this._reject(e);return true};PromiseArray.prototype._resultCancelled=function(){if(this._isResolved())return;var t=this._values;this._cancel();if(t instanceof e){t.cancel()}else{for(var n=0;n{"use strict";e.exports=function(e,t){var r={};var i=n(6587);var o=n(938);var a=i.withAppended;var s=i.maybeWrapAsError;var u=i.canEvaluate;var c=n(9640).TypeError;var f="Async";var l={__isPromisified__:true};var p=["arity","length","name","arguments","caller","callee","prototype","__isPromisified__"];var h=new RegExp("^(?:"+p.join("|")+")$");var d=function(e){return i.isIdentifier(e)&&e.charAt(0)!=="_"&&e!=="constructor"};function propsFilter(e){return!h.test(e)}function isPromisified(e){try{return e.__isPromisified__===true}catch(e){return false}}function hasPromisified(e,t,n){var r=i.getDataPropertyOrDefault(e,t+n,l);return r?isPromisified(r):false}function checkValid(e,t,n){for(var r=0;r=n;--r){t.push(r)}for(var r=e+1;r<=3;++r){t.push(r)}return t};var g=function(e){return i.filledRange(e,"_arg","")};var m=function(e){return i.filledRange(Math.max(e,3),"_arg","")};var b=function(e){if(typeof e.length==="number"){return Math.max(Math.min(e.length,1023+1),0)}return 0};v=function(n,u,c,f,l,p){var h=Math.max(0,b(f)-1);var d=y(h);var _=typeof n==="string"||u===r;function generateCallForArgumentCount(e){var t=g(e).join(", ");var n=e>0?", ":"";var r;if(_){r="ret = callback.call(this, {{args}}, nodeback); break;\n"}else{r=u===undefined?"ret = callback({{args}}, nodeback); break;\n":"ret = callback.call(receiver, {{args}}, nodeback); break;\n"}return r.replace("{{args}}",t).replace(", ",n)}function generateArgumentSwitchCase(){var e="";for(var t=0;t{"use strict";e.exports=function(e,t,r,i){var o=n(6587);var a=o.isObject;var s=n(9048);var u;if(typeof Map==="function")u=Map;var c=function(){var e=0;var t=0;function extractEntry(n,r){this[e]=n;this[e+t]=r;e++}return function mapToEntries(n){t=n.size;e=0;var r=new Array(n.size*2);n.forEach(extractEntry,r);return r}}();var f=function(e){var t=new u;var n=e.length/2|0;for(var r=0;r=this._length){var r;if(this._isMap){r=f(this._values)}else{r={};var i=this.length();for(var o=0,a=this.length();o>1};function props(t){var n;var o=r(t);if(!a(o)){return i("cannot await properties of a non-object\n\n See http://goo.gl/MqrFmX\n")}else if(o instanceof e){n=o._then(e.props,undefined,undefined,undefined,undefined)}else{n=new PropertiesPromiseArray(o).promise()}if(o instanceof e){n._propagateFrom(o,2)}return n}e.prototype.props=function(){return props(this)};e.props=function(e){return props(e)}}},3172:e=>{"use strict";function arrayMove(e,t,n,r,i){for(var o=0;o{"use strict";e.exports=function(e,t,r,i){var o=n(6587);var a=function(e){return e.then(function(t){return race(t,e)})};function race(n,s){var u=r(n);if(u instanceof e){return a(u)}else{n=o.asArray(n);if(n===null)return i("expecting an array or an iterable object but got "+o.classString(n))}var c=new e(t);if(s!==undefined){c._propagateFrom(s,3)}var f=c._fulfill;var l=c._reject;for(var p=0,h=n.length;p{"use strict";e.exports=function(e,t,r,i,o,a){var s=n(6587);var u=s.tryCatch;function ReductionPromiseArray(t,n,r,i){this.constructor$(t);var a=e._getContext();this._fn=s.contextBind(a,n);if(r!==undefined){r=e.resolve(r);r._attachCancellationCallback(this)}this._initialValue=r;this._currentCancellable=null;if(i===o){this._eachValues=Array(this._length)}else if(i===0){this._eachValues=null}else{this._eachValues=undefined}this._promise._captureStackTrace();this._init$(undefined,-5)}s.inherits(ReductionPromiseArray,t);ReductionPromiseArray.prototype._gotAccum=function(e){if(this._eachValues!==undefined&&this._eachValues!==null&&e!==o){this._eachValues.push(e)}};ReductionPromiseArray.prototype._eachComplete=function(e){if(this._eachValues!==null){this._eachValues.push(e)}return this._eachValues};ReductionPromiseArray.prototype._init=function(){};ReductionPromiseArray.prototype._resolveEmptyArray=function(){this._resolve(this._eachValues!==undefined?this._eachValues:this._initialValue)};ReductionPromiseArray.prototype.shouldCopyValues=function(){return false};ReductionPromiseArray.prototype._resolve=function(e){this._promise._resolveCallback(e);this._values=null};ReductionPromiseArray.prototype._resultCancelled=function(t){if(t===this._initialValue)return this._cancel();if(this._isResolved())return;this._resultCancelled$();if(this._currentCancellable instanceof e){this._currentCancellable.cancel()}if(this._initialValue instanceof e){this._initialValue.cancel()}};ReductionPromiseArray.prototype._iterate=function(t){this._values=t;var n;var r;var i=t.length;if(this._initialValue!==undefined){n=this._initialValue;r=0}else{n=e.resolve(t[0]);r=1}this._currentCancellable=n;for(var o=r;o{"use strict";var r=n(6587);var i;var o=function(){throw new Error("No async scheduler available\n\n See http://goo.gl/MqrFmX\n")};var a=r.getNativePromise();if(r.isNode&&typeof MutationObserver==="undefined"){var s=global.setImmediate;var u=process.nextTick;i=r.isRecentNode?function(e){s.call(global,e)}:function(e){u.call(process,e)}}else if(typeof a==="function"&&typeof a.resolve==="function"){var c=a.resolve();i=function(e){c.then(e)}}else if(typeof MutationObserver!=="undefined"&&!(typeof window!=="undefined"&&window.navigator&&(window.navigator.standalone||window.cordova))&&"classList"in document.documentElement){i=function(){var e=document.createElement("div");var t={attributes:true};var n=false;var r=document.createElement("div");var i=new MutationObserver(function(){e.classList.toggle("foo");n=false});i.observe(r,t);var o=function(){if(n)return;n=true;r.classList.toggle("foo")};return function schedule(n){var r=new MutationObserver(function(){r.disconnect();n()});r.observe(e,t);o()}}()}else if(typeof setImmediate!=="undefined"){i=function(e){setImmediate(e)}}else if(typeof setTimeout!=="undefined"){i=function(e){setTimeout(e,0)}}else{i=o}e.exports=i},8741:(e,t,n)=>{"use strict";e.exports=function(e,t,r){var i=e.PromiseInspection;var o=n(6587);function SettledPromiseArray(e){this.constructor$(e)}o.inherits(SettledPromiseArray,t);SettledPromiseArray.prototype._promiseResolved=function(e,t){this._values[e]=t;var n=++this._totalResolved;if(n>=this._length){this._resolve(this._values);return true}return false};SettledPromiseArray.prototype._promiseFulfilled=function(e,t){var n=new i;n._bitField=33554432;n._settledValueField=e;return this._promiseResolved(t,n)};SettledPromiseArray.prototype._promiseRejected=function(e,t){var n=new i;n._bitField=16777216;n._settledValueField=e;return this._promiseResolved(t,n)};e.settle=function(e){r.deprecated(".settle()",".reflect()");return new SettledPromiseArray(e).promise()};e.allSettled=function(e){return new SettledPromiseArray(e).promise()};e.prototype.settle=function(){return e.settle(this)}}},5566:(e,t,n)=>{"use strict";e.exports=function(e,t,r){var i=n(6587);var o=n(9640).RangeError;var a=n(9640).AggregateError;var s=i.isArray;var u={};function SomePromiseArray(e){this.constructor$(e);this._howMany=0;this._unwrap=false;this._initialized=false}i.inherits(SomePromiseArray,t);SomePromiseArray.prototype._init=function(){if(!this._initialized){return}if(this._howMany===0){this._resolve([]);return}this._init$(undefined,-5);var e=s(this._values);if(!this._isResolved()&&e&&this._howMany>this._canPossiblyFulfill()){this._reject(this._getRangeError(this.length()))}};SomePromiseArray.prototype.init=function(){this._initialized=true;this._init()};SomePromiseArray.prototype.setUnwrap=function(){this._unwrap=true};SomePromiseArray.prototype.howMany=function(){return this._howMany};SomePromiseArray.prototype.setHowMany=function(e){this._howMany=e};SomePromiseArray.prototype._promiseFulfilled=function(e){this._addFulfilled(e);if(this._fulfilled()===this.howMany()){this._values.length=this.howMany();if(this.howMany()===1&&this._unwrap){this._resolve(this._values[0])}else{this._resolve(this._values)}return true}return false};SomePromiseArray.prototype._promiseRejected=function(e){this._addRejected(e);return this._checkOutcome()};SomePromiseArray.prototype._promiseCancelled=function(){if(this._values instanceof e||this._values==null){return this._cancel()}this._addRejected(u);return this._checkOutcome()};SomePromiseArray.prototype._checkOutcome=function(){if(this.howMany()>this._canPossiblyFulfill()){var e=new a;for(var t=this.length();t0){this._reject(e)}else{this._cancel()}return true}return false};SomePromiseArray.prototype._fulfilled=function(){return this._totalResolved};SomePromiseArray.prototype._rejected=function(){return this._values.length-this.length()};SomePromiseArray.prototype._addRejected=function(e){this._values.push(e)};SomePromiseArray.prototype._addFulfilled=function(e){this._values[this._totalResolved++]=e};SomePromiseArray.prototype._canPossiblyFulfill=function(){return this.length()-this._rejected()};SomePromiseArray.prototype._getRangeError=function(e){var t="Input array must contain at least "+this._howMany+" items but contains only "+e+" items";return new o(t)};SomePromiseArray.prototype._resolveEmptyArray=function(){this._reject(this._getRangeError(0))};function some(e,t){if((t|0)!==t||t<0){return r("expecting a positive integer\n\n See http://goo.gl/MqrFmX\n")}var n=new SomePromiseArray(e);var i=n.promise();n.setHowMany(t);n.init();return i}e.some=function(e,t){return some(e,t)};e.prototype.some=function(e){return some(this,e)};e._SomePromiseArray=SomePromiseArray}},7659:e=>{"use strict";e.exports=function(e){function PromiseInspection(e){if(e!==undefined){e=e._target();this._bitField=e._bitField;this._settledValueField=e._isFateSealed()?e._settledValue():undefined}else{this._bitField=0;this._settledValueField=undefined}}PromiseInspection.prototype._settledValue=function(){return this._settledValueField};var t=PromiseInspection.prototype.value=function(){if(!this.isFulfilled()){throw new TypeError("cannot get fulfillment value of a non-fulfilled promise\n\n See http://goo.gl/MqrFmX\n")}return this._settledValue()};var n=PromiseInspection.prototype.error=PromiseInspection.prototype.reason=function(){if(!this.isRejected()){throw new TypeError("cannot get rejection reason of a non-rejected promise\n\n See http://goo.gl/MqrFmX\n")}return this._settledValue()};var r=PromiseInspection.prototype.isFulfilled=function(){return(this._bitField&33554432)!==0};var i=PromiseInspection.prototype.isRejected=function(){return(this._bitField&16777216)!==0};var o=PromiseInspection.prototype.isPending=function(){return(this._bitField&50397184)===0};var a=PromiseInspection.prototype.isResolved=function(){return(this._bitField&50331648)!==0};PromiseInspection.prototype.isCancelled=function(){return(this._bitField&8454144)!==0};e.prototype.__isCancelled=function(){return(this._bitField&65536)===65536};e.prototype._isCancelled=function(){return this._target().__isCancelled()};e.prototype.isCancelled=function(){return(this._target()._bitField&8454144)!==0};e.prototype.isPending=function(){return o.call(this._target())};e.prototype.isRejected=function(){return i.call(this._target())};e.prototype.isFulfilled=function(){return r.call(this._target())};e.prototype.isResolved=function(){return a.call(this._target())};e.prototype.value=function(){return t.call(this._target())};e.prototype.reason=function(){var e=this._target();e._unsetRejectionIsUnhandled();return n.call(e)};e.prototype._value=function(){return this._settledValue()};e.prototype._reason=function(){this._unsetRejectionIsUnhandled();return this._settledValue()};e.PromiseInspection=PromiseInspection}},3938:(e,t,n)=>{"use strict";e.exports=function(e,t){var r=n(6587);var i=r.errorObj;var o=r.isObject;function tryConvertToPromise(n,r){if(o(n)){if(n instanceof e)return n;var a=getThen(n);if(a===i){if(r)r._pushContext();var s=e.reject(a.e);if(r)r._popContext();return s}else if(typeof a==="function"){if(isAnyBluebirdPromise(n)){var s=new e(t);n._then(s._fulfill,s._reject,undefined,s,null);return s}return doThenable(n,a,r)}}return n}function doGetThen(e){return e.then}function getThen(e){try{return doGetThen(e)}catch(e){i.e=e;return i}}var a={}.hasOwnProperty;function isAnyBluebirdPromise(e){try{return a.call(e,"_promise0")}catch(e){return false}}function doThenable(n,o,a){var s=new e(t);var u=s;if(a)a._pushContext();s._captureStackTrace();if(a)a._popContext();var c=true;var f=r.tryCatch(o).call(n,resolve,reject);c=false;if(s&&f===i){s._rejectCallback(f.e,true,true);s=null}function resolve(e){if(!s)return;s._resolveCallback(e);s=null}function reject(e){if(!s)return;s._rejectCallback(e,c,true);s=null}return u}return tryConvertToPromise}},8329:(e,t,n)=>{"use strict";e.exports=function(e,t,r){var i=n(6587);var o=e.TimeoutError;function HandleWrapper(e){this.handle=e}HandleWrapper.prototype._resultCancelled=function(){clearTimeout(this.handle)};var a=function(e){return s(+this).thenReturn(e)};var s=e.delay=function(n,i){var o;var s;if(i!==undefined){o=e.resolve(i)._then(a,null,null,n,undefined);if(r.cancellation()&&i instanceof e){o._setOnCancel(i)}}else{o=new e(t);s=setTimeout(function(){o._fulfill()},+n);if(r.cancellation()){o._setOnCancel(new HandleWrapper(s))}o._captureStackTrace()}o._setAsyncGuaranteed();return o};e.prototype.delay=function(e){return s(e,this)};var u=function(e,t,n){var r;if(typeof t!=="string"){if(t instanceof Error){r=t}else{r=new o("operation timed out")}}else{r=new o(t)}i.markAsOriginatingFromRejection(r);e._attachExtraTrace(r);e._reject(r);if(n!=null){n.cancel()}};function successClear(e){clearTimeout(this.handle);return e}function failureClear(e){clearTimeout(this.handle);throw e}e.prototype.timeout=function(e,t){e=+e;var n,i;var o=new HandleWrapper(setTimeout(function timeoutTimeout(){if(n.isPending()){u(n,t,i)}},e));if(r.cancellation()){i=this.then();n=i._then(successClear,failureClear,undefined,o,undefined);n._setOnCancel(o)}else{n=this._then(successClear,failureClear,undefined,o,undefined)}return n}}},1904:(e,t,n)=>{"use strict";e.exports=function(e,t,r,i,o,a){var s=n(6587);var u=n(9640).TypeError;var c=n(6587).inherits;var f=s.errorObj;var l=s.tryCatch;var p={};function thrower(e){setTimeout(function(){throw e},0)}function castPreservingDisposable(e){var t=r(e);if(t!==e&&typeof e._isDisposable==="function"&&typeof e._getDisposer==="function"&&e._isDisposable()){t._setDisposable(e._getDisposer())}return t}function dispose(t,n){var i=0;var a=t.length;var s=new e(o);function iterator(){if(i>=a)return s._fulfill();var o=castPreservingDisposable(t[i++]);if(o instanceof e&&o._isDisposable()){try{o=r(o._getDisposer().tryDispose(n),t.promise)}catch(e){return thrower(e)}if(o instanceof e){return o._then(iterator,thrower,null,null,null)}}iterator()}iterator();return s}function Disposer(e,t,n){this._data=e;this._promise=t;this._context=n}Disposer.prototype.data=function(){return this._data};Disposer.prototype.promise=function(){return this._promise};Disposer.prototype.resource=function(){if(this.promise().isFulfilled()){return this.promise().value()}return p};Disposer.prototype.tryDispose=function(e){var t=this.resource();var n=this._context;if(n!==undefined)n._pushContext();var r=t!==p?this.doDispose(t,e):null;if(n!==undefined)n._popContext();this._promise._unsetDisposable();this._data=null;return r};Disposer.isDisposer=function(e){return e!=null&&typeof e.resource==="function"&&typeof e.tryDispose==="function"};function FunctionDisposer(e,t,n){this.constructor$(e,t,n)}c(FunctionDisposer,Disposer);FunctionDisposer.prototype.doDispose=function(e,t){var n=this.data();return n.call(e,e,t)};function maybeUnwrapDisposer(e){if(Disposer.isDisposer(e)){this.resources[this.index]._setDisposable(e);return e.promise()}return e}function ResourceList(e){this.length=e;this.promise=null;this[e-1]=null}ResourceList.prototype._resultCancelled=function(){var t=this.length;for(var n=0;n0};e.prototype._getDisposer=function(){return this._disposer};e.prototype._unsetDisposable=function(){this._bitField=this._bitField&~131072;this._disposer=undefined};e.prototype.disposer=function(e){if(typeof e==="function"){return new FunctionDisposer(e,this,i())}throw new u}}},6587:function(module,__unused_webpack_exports,__nccwpck_require__){"use strict";var es5=__nccwpck_require__(9048);var canEvaluate=typeof navigator=="undefined";var errorObj={e:{}};var tryCatchTarget;var globalObject=typeof self!=="undefined"?self:typeof window!=="undefined"?window:typeof global!=="undefined"?global:this!==undefined?this:null;function tryCatcher(){try{var e=tryCatchTarget;tryCatchTarget=null;return e.apply(this,arguments)}catch(e){errorObj.e=e;return errorObj}}function tryCatch(e){tryCatchTarget=e;return tryCatcher}var inherits=function(e,t){var n={}.hasOwnProperty;function T(){this.constructor=e;this.constructor$=t;for(var r in t.prototype){if(n.call(t.prototype,r)&&r.charAt(r.length-1)!=="$"){this[r+"$"]=t.prototype[r]}}}T.prototype=t.prototype;e.prototype=new T;return e.prototype};function isPrimitive(e){return e==null||e===true||e===false||typeof e==="string"||typeof e==="number"}function isObject(e){return typeof e==="function"||typeof e==="object"&&e!==null}function maybeWrapAsError(e){if(!isPrimitive(e))return e;return new Error(safeToString(e))}function withAppended(e,t){var n=e.length;var r=new Array(n+1);var i;for(i=0;i1;var r=t.length>0&&!(t.length===1&&t[0]==="constructor");var i=thisAssignmentPattern.test(e+"")&&es5.names(e).length>0;if(n||r||i){return true}}return false}catch(e){return false}}function toFastProperties(obj){function FakeConstructor(){}FakeConstructor.prototype=obj;var receiver=new FakeConstructor;function ic(){return typeof receiver.foo}ic();ic();return obj;eval(obj)}var rident=/^[a-z$_][a-z$_0-9]*$/i;function isIdentifier(e){return rident.test(e)}function filledRange(e,t,n){var r=new Array(e);for(var i=0;i10||e[0]>0}();ret.nodeSupportsAsyncResource=ret.isNode&&function(){var e=false;try{var t=__nccwpck_require__(7303).AsyncResource;e=typeof t.prototype.runInAsyncScope==="function"}catch(t){e=false}return e}();if(ret.isNode)ret.toFastProperties(process);try{throw new Error}catch(e){ret.lastLineError=e}module.exports=ret},2950:function(e,t,n){e=n.nmd(e);(function(t){"use strict";var n,r,i,o,a,s,u,c,f,l,p,h,d,_,v,y,g;n={};r={};[{n:"equal",f:equal,s:"equal {e}"},{n:"undefined",f:isUndefined,s:"be undefined"},{n:"null",f:isNull,s:"be null"},{n:"assigned",f:assigned,s:"be assigned"},{n:"primitive",f:primitive,s:"be primitive type"},{n:"contains",f:contains,s:"contain {e}"},{n:"in",f:isIn,s:"be in {e}"},{n:"containsKey",f:containsKey,s:"contain key {e}"},{n:"keyIn",f:keyIn,s:"be key in {e}"},{n:"zero",f:zero,s:"be 0"},{n:"one",f:one,s:"be 1"},{n:"infinity",f:infinity,s:"be infinity"},{n:"number",f:number,s:"be Number"},{n:"integer",f:integer,s:"be integer"},{n:"float",f:float,s:"be non-integer number"},{n:"even",f:even,s:"be even number"},{n:"odd",f:odd,s:"be odd number"},{n:"greater",f:greater,s:"be greater than {e}"},{n:"less",f:less,s:"be less than {e}"},{n:"between",f:between,s:"be between {e} and {e2}"},{n:"greaterOrEqual",f:greaterOrEqual,s:"be greater than or equal to {e}"},{n:"lessOrEqual",f:lessOrEqual,s:"be less than or equal to {e}"},{n:"inRange",f:inRange,s:"be in the range {e} to {e2}"},{n:"positive",f:positive,s:"be positive number"},{n:"negative",f:negative,s:"be negative number"},{n:"string",f:string,s:"be String"},{n:"emptyString",f:emptyString,s:"be empty string"},{n:"nonEmptyString",f:nonEmptyString,s:"be non-empty string"},{n:"match",f:match,s:"match {e}"},{n:"boolean",f:boolean,s:"be Boolean"},{n:"object",f:object,s:"be Object"},{n:"emptyObject",f:emptyObject,s:"be empty object"},{n:"nonEmptyObject",f:nonEmptyObject,s:"be non-empty object"},{n:"instanceStrict",f:instanceStrict,s:"be instanceof {t}"},{n:"thenable",f:thenable,s:"be promise-like"},{n:"instance",f:instance,s:"be {t}"},{n:"like",f:like,s:"be like {e}"},{n:"array",f:array,s:"be Array"},{n:"emptyArray",f:emptyArray,s:"be empty array"},{n:"nonEmptyArray",f:nonEmptyArray,s:"be non-empty array"},{n:"arrayLike",f:arrayLike,s:"be array-like"},{n:"iterable",f:iterable,s:"be iterable"},{n:"date",f:date,s:"be valid Date"},{n:"function",f:isFunction,s:"be Function"},{n:"hasLength",f:hasLength,s:"have length {e}"},{n:"throws",f:throws,s:"throw"}].map(function(e){var t=e.n;n[t]="assert failed: expected {a} to "+e.s;r[t]=e.f});i={map:map,all:all,any:any};u=["array","arrayLike","iterable","object"];c=Object.prototype.hasOwnProperty;f=Object.prototype.toString;l=Object.keys;p=Array.prototype.slice;h=Array.isArray;d=Number.NEGATIVE_INFINITY;_=Number.POSITIVE_INFINITY;v=typeof Symbol==="function";y=typeof Map==="function";g=typeof Set==="function";i=mixin(i,r);o=createModifiedPredicates(assertModifier,assertImpl);a=createModifiedPredicates(notModifier,notImpl);s=createModifiedPredicates(maybeModifier,maybeImpl);o.not=createModifiedModifier(assertModifier,a,"not ");o.maybe=createModifiedModifier(assertModifier,s,"maybe ");u.forEach(createOfPredicates);createOfModifiers(o,assertModifier);createOfModifiers(a,notModifier);u.forEach(createMaybeOfModifiers);exportFunctions(mixin(i,{assert:o,not:a,maybe:s}));function equal(e,t){return e===t}function isUndefined(e){return e===undefined}function isNull(e){return e===null}function assigned(e){return e!==undefined&&e!==null}function primitive(e){var t;switch(e){case null:case undefined:case false:case true:return true}t=typeof e;return t==="string"||t==="number"||v&&t==="symbol"}function zero(e){return e===0}function one(e){return e===1}function infinity(e){return e===d||e===_}function number(e){return typeof e==="number"&&e>d&&e<_}function integer(e){return typeof e==="number"&&e%1===0}function float(e){return number(e)&&e%1!==0}function even(e){return typeof e==="number"&&e%2===0}function odd(e){return integer(e)&&e%2!==0}function greater(e,t){return number(e)&&e>t}function less(e,t){return number(e)&&en}function greaterOrEqual(e,t){return number(e)&&e>=t}function lessOrEqual(e,t){return number(e)&&e<=t}function inRange(e,t,n){if(t=n}function positive(e){return greater(e,0)}function negative(e){return less(e,0)}function string(e){return typeof e==="string"}function emptyString(e){return e===""}function nonEmptyString(e){return string(e)&&e!==""}function match(e,t){return string(e)&&!!e.match(t)}function boolean(e){return e===false||e===true}function object(e){return f.call(e)==="[object Object]"}function emptyObject(e){return object(e)&&!some(e,function(){return true})}function some(e,t){for(var n in e){if(c.call(e,n)){if(t(n,e[n])){return true}}}return false}function nonEmptyObject(e){return object(e)&&some(e,function(){return true})}function thenable(e){return assigned(e)&&isFunction(e.then)}function instanceStrict(e,t){try{return e instanceof t}catch(e){return false}}function instance(e,t){try{return instanceStrict(e,t)||e.constructor.name===t.name||f.call(e)==="[object "+t.name+"]"}catch(e){return false}}function like(e,t){var n;for(n in t){if(c.call(t,n)){if(c.call(e,n)===false||typeof e[n]!==typeof t[n]){return false}if(object(e[n])&&like(e[n],t[n])===false){return false}}}return true}function array(e){return h(e)}function emptyArray(e){return h(e)&&e.length===0}function nonEmptyArray(e){return h(e)&&e.length>0}function arrayLike(e){return assigned(e)&&e.length>=0}function iterable(e){if(!v){return arrayLike(e)}return assigned(e)&&isFunction(e[Symbol.iterator])}function contains(e,t){var n,r;if(!assigned(e)){return false}if(g&&instanceStrict(e,Set)){return e.has(t)}if(string(e)){return e.indexOf(t)!==-1}if(v&&e[Symbol.iterator]&&isFunction(e.values)){n=e.values();do{r=n.next();if(r.value===t){return true}}while(!r.done);return false}return some(e,function(e,n){return n===t})}function isIn(e,t){return contains(t,e)}function containsKey(e,t){if(!assigned(e)){return false}if(y&&instanceStrict(e,Map)){return e.has(t)}if(iterable(e)&&!number(+t)){return false}return!!e[t]}function keyIn(e,t){return containsKey(t,e)}function hasLength(e,t){return assigned(e)&&e.length===t}function date(e){return instanceStrict(e,Date)&&integer(e.getTime())}function isFunction(e){return typeof e==="function"}function throws(e){if(!isFunction(e)){return false}try{e()}catch(e){return true}return false}function map(e,t){var n;if(h(e)){n=[]}else{n={}}if(isFunction(t)){forEach(e,function(e,r){n[e]=t(r)})}else{if(!h(t)){o.object(t)}var r=l(e||{});forEach(t,function(t,i){r.some(function(e,n){if(e===t){r.splice(n,1);return true}return false});if(isFunction(i)){if(a.assigned(e)){n[t]=!!i.m}else{n[t]=i(e[t])}}else{n[t]=map(e[t],i)}})}return n}function forEach(e,t){for(var n in e){if(c.call(e,n)){t(n,e[n])}}}function all(e){if(h(e)){return testArray(e,false)}o.object(e);return testObject(e,false)}function testArray(e,t){var n;for(n=0;n{"use strict";class Hoopy extends Array{constructor(e){let t,n;if(!isPositiveInteger(e)){throw new TypeError("Argument `size` must be a positive integer.")}super(e);this.grow=(r=>{if(!isPositiveInteger(r)){throw new TypeError("Argument `by` must be a positive integer.")}let i;const o=e+r;for(i=e;i=o){t%=o}this[t]=this[i];this[i]=undefined}}e=o});return new Proxy(this,{get(t,n){if(isInteger(n)){return t[getIndex(n,e)]}return t[n]},set(r,i,o){if(isInteger(i)){t=getIndex(i,e);r[t]=o;if(Math.abs(i)>=e){n=true}else{n=false}}else{r[i]=o}return true}})}}function isPositiveInteger(e){return isInteger(e)&&e>0}function isInteger(e){try{return+e%1===0}catch(e){}return false}function getIndex(e,t){if(e===0){return 0}if(e<0){return(t-Math.abs(e))%t}return e%t}function nop(){throw new Error("Not implemented")}Hoopy.prototype.push=nop;Hoopy.prototype.pop=nop;Hoopy.prototype.shift=nop;Hoopy.prototype.unshift=nop;e.exports=Hoopy},6638:function(e,t,n){e=n.nmd(e);(function(t){"use strict";if(typeof define==="function"&&define.amd){define(function(){return tryer})}else if(true&&e!==null){e.exports=tryer}else{t.tryer=tryer}function tryer(e){e=normaliseOptions(e);iterateWhen();function iterateWhen(){if(preRecur()){iterateUntil()}}function preRecur(){return conditionallyRecur("when",iterateWhen)}function conditionallyRecur(t,n){if(!e[t]()){incrementCount(e);if(shouldFail(e)){e.fail()}else{recur(n,postIncrementInterval(e))}return false}return true}function iterateUntil(){var t;if(isActionSynchronous(e)){t=e.action();if(t&&isFunction(t.then)){return t.then(postRecur,postRecur)}return postRecur()}e.action(postRecur)}function postRecur(){if(conditionallyRecur("until",iterateUntil)){e.pass()}}}function normaliseOptions(e){e=e||{};return{count:0,when:normalisePredicate(e.when),until:normalisePredicate(e.until),action:normaliseFunction(e.action),fail:normaliseFunction(e.fail),pass:normaliseFunction(e.pass),interval:normaliseNumber(e.interval,-1e3),limit:normaliseNumber(e.limit,-1)}}function normalisePredicate(e){return normalise(e,isFunction,yes)}function isFunction(e){return typeof e==="function"}function yes(){return true}function normaliseFunction(e){return normalise(e,isFunction,nop)}function nop(){}function normalise(e,t,n){if(t(e)){return e}return n}function normaliseNumber(e,t){return normalise(e,isNumber,t)}function isNumber(e){return typeof e==="number"&&e===e}function isActionSynchronous(e){return e.action.length===0}function incrementCount(e){e.count+=1}function shouldFail(e){return e.limit>=0&&e.count>=e.limit}function postIncrementInterval(e){var t=e.interval;if(e.interval<0){e.interval*=2}return t}function recur(e,t){setTimeout(e,Math.abs(t))}})(this)},7303:e=>{"use strict";e.exports=require("async_hooks")},8614:e=>{"use strict";e.exports=require("events")},5747:e=>{"use strict";e.exports=require("fs")},2413:e=>{"use strict";e.exports=require("stream")},1669:e=>{"use strict";e.exports=require("util")}};var __webpack_module_cache__={};function __nccwpck_require__(e){if(__webpack_module_cache__[e]){return __webpack_module_cache__[e].exports}var t=__webpack_module_cache__[e]={id:e,loaded:false,exports:{}};var n=true;try{__webpack_modules__[e].call(t.exports,t,t.exports,__nccwpck_require__);n=false}finally{if(n)delete __webpack_module_cache__[e]}t.loaded=true;return t.exports}(()=>{__nccwpck_require__.nmd=(e=>{e.paths=[];if(!e.children)e.children=[];return e})})();__nccwpck_require__.ab=__dirname+"/";return __nccwpck_require__(2986)})(); \ No newline at end of file diff --git a/packages/next/compiled/bfj/package.json b/packages/next/compiled/bfj/package.json new file mode 100644 index 0000000000000..5d1da0d089b6f --- /dev/null +++ b/packages/next/compiled/bfj/package.json @@ -0,0 +1 @@ +{"name":"bfj","main":"index.js","author":"Phil Booth (https://gitlab.com/philbooth)","license":"MIT"} diff --git a/packages/next/next-server/server/config.ts b/packages/next/next-server/server/config.ts index 2408b923a7800..e4cce3badc26c 100644 --- a/packages/next/next-server/server/config.ts +++ b/packages/next/next-server/server/config.ts @@ -87,6 +87,7 @@ const defaultConfig: NextConfig = { optimizeCss: false, scrollRestoration: false, scriptLoader: false, + stats: !!process.env.VERCEL_ANALYTICS_ID, }, future: { strictPostcssConfiguration: false, diff --git a/packages/next/package.json b/packages/next/package.json index ee11e0f167c72..964e872432733 100644 --- a/packages/next/package.json +++ b/packages/next/package.json @@ -1,6 +1,6 @@ { "name": "next", - "version": "10.0.7-canary.0", + "version": "10.0.7-canary.1", "description": "The React Framework", "main": "./dist/server/next.js", "license": "MIT", @@ -63,10 +63,10 @@ "@ampproject/toolbox-optimizer": "2.7.1-alpha.0", "@babel/runtime": "7.12.5", "@hapi/accept": "5.0.1", - "@next/env": "10.0.7-canary.0", - "@next/polyfill-module": "10.0.7-canary.0", - "@next/react-dev-overlay": "10.0.7-canary.0", - "@next/react-refresh-utils": "10.0.7-canary.0", + "@next/env": "10.0.7-canary.1", + "@next/polyfill-module": "10.0.7-canary.1", + "@next/react-dev-overlay": "10.0.7-canary.1", + "@next/react-refresh-utils": "10.0.7-canary.1", "@opentelemetry/api": "0.14.0", "ast-types": "0.13.2", "browserslist": "4.16.1", @@ -135,7 +135,7 @@ "@babel/preset-react": "7.12.10", "@babel/preset-typescript": "7.12.7", "@babel/types": "7.12.12", - "@next/polyfill-nomodule": "10.0.7-canary.0", + "@next/polyfill-nomodule": "10.0.7-canary.1", "@taskr/clear": "1.1.0", "@taskr/esnext": "1.1.0", "@taskr/watch": "1.1.0", @@ -178,6 +178,7 @@ "babel-plugin-dynamic-import-node": "2.3.3", "babel-plugin-transform-define": "2.0.0", "babel-plugin-transform-react-remove-prop-types": "0.4.24", + "bfj": "7.0.2", "cacache": "15.0.5", "cache-loader": "4.1.0", "ci-info": "watson/ci-info#f43f6a1cefff47fb361c88cf4b943fdbcaafe540", diff --git a/packages/next/taskfile.js b/packages/next/taskfile.js index b3eafbfb1f0f2..a93b7a1bee6f6 100644 --- a/packages/next/taskfile.js +++ b/packages/next/taskfile.js @@ -143,6 +143,14 @@ export async function ncc_babel_bundle_packages(task, opts) { .target('compiled/babel/') } +// eslint-disable-next-line camelcase +externals['bfj'] = 'next/dist/compiled/bfj' +export async function ncc_bfj(task, opts) { + await task + .source(opts.src || relative(__dirname, require.resolve('bfj'))) + .ncc({ packageName: 'bfj' }) + .target('compiled/bfj') +} // eslint-disable-next-line camelcase externals['cacache'] = 'next/dist/compiled/cacache' export async function ncc_cacache(task, opts) { @@ -672,6 +680,7 @@ export async function ncc(task) { 'ncc_async_sema', 'ncc_babel_bundle', 'ncc_babel_bundle_packages', + 'ncc_bfj', 'ncc_cacache', 'ncc_cache_loader', 'ncc_ci_info', diff --git a/packages/react-dev-overlay/package.json b/packages/react-dev-overlay/package.json index 029d4a07febbc..77996d45c75d9 100644 --- a/packages/react-dev-overlay/package.json +++ b/packages/react-dev-overlay/package.json @@ -1,6 +1,6 @@ { "name": "@next/react-dev-overlay", - "version": "10.0.7-canary.0", + "version": "10.0.7-canary.1", "description": "A development-only overlay for developing React applications.", "repository": { "url": "vercel/next.js", diff --git a/packages/react-refresh-utils/package.json b/packages/react-refresh-utils/package.json index 6df527395cf95..a869ac34ed9b0 100644 --- a/packages/react-refresh-utils/package.json +++ b/packages/react-refresh-utils/package.json @@ -1,6 +1,6 @@ { "name": "@next/react-refresh-utils", - "version": "10.0.7-canary.0", + "version": "10.0.7-canary.1", "description": "An experimental package providing utilities for React Refresh.", "repository": { "url": "vercel/next.js", diff --git a/test/integration/build-stats/next.config.js b/test/integration/build-stats/next.config.js new file mode 100644 index 0000000000000..2a9c4a5aa5a23 --- /dev/null +++ b/test/integration/build-stats/next.config.js @@ -0,0 +1,5 @@ +module.exports = { + experimental: { + stats: true, + }, +} diff --git a/test/integration/build-stats/pages/index.js b/test/integration/build-stats/pages/index.js new file mode 100644 index 0000000000000..166a8aecea1bb --- /dev/null +++ b/test/integration/build-stats/pages/index.js @@ -0,0 +1,3 @@ +export default function Index(props) { + return

Hello world

+} diff --git a/test/integration/build-stats/test/index.test.js b/test/integration/build-stats/test/index.test.js new file mode 100644 index 0000000000000..df521207f1d59 --- /dev/null +++ b/test/integration/build-stats/test/index.test.js @@ -0,0 +1,20 @@ +/* eslint-env jest */ + +import fs from 'fs-extra' +import { join } from 'path' +import { nextBuild } from 'next-test-utils' + +jest.setTimeout(1000 * 60 * 1) + +const appDir = join(__dirname, '../') +const statsPath = join(appDir, '.next/next-stats.json') + +describe('Build Stats', () => { + it('outputs next-stats.json when enabled', async () => { + await nextBuild(appDir) + expect(await fs.pathExists(statsPath)).toBe(true) + + const statsData = await fs.readFile(statsPath, 'utf8') + JSON.parse(statsData) + }) +}) diff --git a/test/integration/production/test/index.test.js b/test/integration/production/test/index.test.js index 7acfcb58908c2..186e478c3fbb4 100644 --- a/test/integration/production/test/index.test.js +++ b/test/integration/production/test/index.test.js @@ -782,6 +782,10 @@ describe('Production Usage', () => { expect(existsSync(join(appDir, '.next', 'profile-events.json'))).toBe(false) }) + it('should not emit stats', async () => { + expect(existsSync(join(appDir, '.next', 'next-stats.json'))).toBe(false) + }) + it('should contain the Next.js version in window export', async () => { let browser try { diff --git a/yarn.lock b/yarn.lock index 16eec2963c95d..1f8e90fe3fd08 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4016,6 +4016,16 @@ before-after-hook@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/before-after-hook/-/before-after-hook-2.1.0.tgz#b6c03487f44e24200dd30ca5e6a1979c5d2fb635" +bfj@7.0.2: + version "7.0.2" + resolved "https://registry.yarnpkg.com/bfj/-/bfj-7.0.2.tgz#1988ce76f3add9ac2913fd8ba47aad9e651bfbb2" + integrity sha512-+e/UqUzwmzJamNF50tBV6tZPTORow7gQ96iFow+8b562OdMpEK0BcJEq2OSPEDmAbSMBQ7PKZ87ubFkgxpYWgw== + dependencies: + bluebird "^3.5.5" + check-types "^11.1.1" + hoopy "^0.1.4" + tryer "^1.0.1" + big.js@^5.2.2: version "5.2.2" resolved "https://registry.yarnpkg.com/big.js/-/big.js-5.2.2.tgz#65f0af382f578bcdc742bd9c281e9cb2d7768328" @@ -4619,6 +4629,11 @@ chardet@^0.7.0: version "0.7.0" resolved "https://registry.yarnpkg.com/chardet/-/chardet-0.7.0.tgz#90094849f0937f2eedc2425d0d28a9e5f0cbad9e" +check-types@^11.1.1: + version "11.1.2" + resolved "https://registry.yarnpkg.com/check-types/-/check-types-11.1.2.tgz#86a7c12bf5539f6324eb0e70ca8896c0e38f3e2f" + integrity sha512-tzWzvgePgLORb9/3a0YenggReLKAIb2owL03H2Xdoe5pKcUyWRSEQ8xfCar8t2SIAuEDwtmx2da1YB52YuHQMQ== + cheerio@0.22.0: version "0.22.0" resolved "https://registry.yarnpkg.com/cheerio/-/cheerio-0.22.0.tgz#a9baa860a3f9b595a6b81b1a86873121ed3a269e" @@ -7877,6 +7892,11 @@ homedir-polyfill@^1.0.0: dependencies: parse-passwd "^1.0.0" +hoopy@^0.1.4: + version "0.1.4" + resolved "https://registry.yarnpkg.com/hoopy/-/hoopy-0.1.4.tgz#609207d661100033a9a9402ad3dea677381c1b1d" + integrity sha512-HRcs+2mr52W0K+x8RzcLzuPPmVIKMSv97RGHy0Ea9y/mpcaK+xTrjICA04KAHi4GRzxliNqNJEFYWHghy3rSfQ== + hosted-git-info@^2.1.4, hosted-git-info@^2.7.1: version "2.8.5" resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.8.5.tgz#759cfcf2c4d156ade59b0b2dfabddc42a6b9c70c" @@ -15507,6 +15527,11 @@ trough@^1.0.0: dependencies: glob "^7.1.2" +tryer@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/tryer/-/tryer-1.0.1.tgz#f2c85406800b9b0f74c9f7465b81eaad241252f8" + integrity sha512-c3zayb8/kWWpycWYg87P71E1S1ZL6b6IJxfb5fvsUgsf0S2MVGaDhDXXjDMpdCpfWXqptc+4mXwmiy1ypXqRAA== + ts-pnp@^1.1.6: version "1.2.0" resolved "https://registry.yarnpkg.com/ts-pnp/-/ts-pnp-1.2.0.tgz#a500ad084b0798f1c3071af391e65912c86bca92"